Files
CDNManager/packages/shared/dist/index.d.ts
T
Denozordec 8700dc2957
quality / commitlint (push) Skipped
quality / changes (push) Successful in 5s
quality / docker-check (push) Skipped
CD / update-wiki (push) Successful in 6s
quality / web (push) Successful in 53s
quality / api (push) Successful in 49s
CD / quality (push) Successful in 1m57s
CD / publish (push) Successful in 27s
Enhance CDN Manager: Add Cloudflare API token support, update documentation, and introduce new routes for managing nodes, aliases, and topology. Improve UI components and status badges for better user experience.
2026-09-04 12:49:51 +07:00

500 lines
16 KiB
TypeScript

import { z } from 'zod';
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";
}>>;
enabled: z.ZodOptional<z.ZodBoolean>;
sort: z.ZodOptional<z.ZodNumber>;
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";
}>>;
enabled: z.ZodOptional<z.ZodBoolean>;
sort: z.ZodOptional<z.ZodNumber>;
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 loginSchema: z.ZodObject<{
username: z.ZodString;
password: z.ZodString;
}, z.core.$strip>;
type LoginInput = z.infer<typeof loginSchema>;
type LoginRequest = LoginInput;
type JwtClaims = {
sub: string;
exp: number;
email?: string;
name?: string;
apps?: string[];
permissions?: string[];
is_admin?: boolean;
};
type LoginResponse = {
token: string;
expires_at: string;
};
declare const appSettingsPatchSchema: z.ZodObject<{
showQuickActions: z.ZodOptional<z.ZodBoolean>;
defaultTtl: z.ZodOptional<z.ZodNumber>;
namingTemplate: z.ZodOptional<z.ZodString>;
proxiedLock: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>;
type AppSettingsPatch = z.infer<typeof appSettingsPatchSchema>;
declare const appSettingsSchema: z.ZodObject<{
id: z.ZodString;
showQuickActions: z.ZodBoolean;
defaultTtl: z.ZodNumber;
namingTemplate: z.ZodString;
proxiedLock: z.ZodBoolean;
cloudflareConfigured: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>;
type AppSettings = z.infer<typeof appSettingsSchema>;
declare const nodeRoleSchema: z.ZodEnum<{
hub: "hub";
gw: "gw";
edge: "edge";
ix: "ix";
}>;
type NodeRole = z.infer<typeof nodeRoleSchema>;
declare const aliasPurposeSchema: z.ZodEnum<{
custom: "custom";
ix: "ix";
geo: "geo";
backup: "backup";
admin: "admin";
}>;
type AliasPurpose = z.infer<typeof aliasPurposeSchema>;
declare const aliasModeSchema: z.ZodEnum<{
primary: "primary";
pair: "pair";
}>;
type AliasMode = z.infer<typeof aliasModeSchema>;
declare const syncStatusSchema: z.ZodEnum<{
error: "error";
pending: "pending";
ok: "ok";
drift: "drift";
missing: "missing";
}>;
type SyncStatus = z.infer<typeof syncStatusSchema>;
declare const addressFamilySchema: z.ZodEnum<{
v4: "v4";
v6: "v6";
}>;
declare const cfZoneSchema: z.ZodObject<{
id: z.ZodString;
name: z.ZodString;
status: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
type CfZone = z.infer<typeof cfZoneSchema>;
declare const cfDnsRecordSchema: z.ZodObject<{
id: z.ZodOptional<z.ZodString>;
type: z.ZodString;
name: z.ZodString;
content: z.ZodString;
ttl: z.ZodNumber;
proxied: z.ZodOptional<z.ZodBoolean>;
priority: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
type CfDnsRecord = z.infer<typeof cfDnsRecordSchema>;
declare const createDnsRecordPayloadSchema: z.ZodObject<{
type: z.ZodString;
name: z.ZodString;
content: z.ZodString;
ttl: z.ZodNumber;
proxied: z.ZodOptional<z.ZodBoolean>;
priority: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
type CreateDnsRecordPayload = z.infer<typeof createDnsRecordPayloadSchema>;
declare const patchDnsRecordPayloadSchema: z.ZodObject<{
type: z.ZodOptional<z.ZodString>;
name: z.ZodOptional<z.ZodString>;
content: z.ZodOptional<z.ZodString>;
ttl: z.ZodOptional<z.ZodNumber>;
proxied: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
priority: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
}, z.core.$strip>;
type PatchDnsRecordPayload = z.infer<typeof patchDnsRecordPayloadSchema>;
declare const locationSchema: z.ZodObject<{
id: z.ZodString;
code: z.ZodString;
name: z.ZodString;
country: z.ZodNullable<z.ZodString>;
sortOrder: z.ZodNumber;
}, z.core.$strip>;
type Location = z.infer<typeof locationSchema>;
declare const zoneSchema: z.ZodObject<{
id: z.ZodString;
cfZoneId: z.ZodNullable<z.ZodString>;
name: z.ZodString;
role: z.ZodString;
namingTemplate: z.ZodString;
defaultTtl: z.ZodNumber;
lastSyncAt: z.ZodNullable<z.ZodString>;
createdAt: z.ZodString;
updatedAt: z.ZodString;
}, z.core.$strip>;
type Zone = z.infer<typeof zoneSchema>;
declare const zoneCreateSchema: z.ZodObject<{
name: z.ZodString;
cfZoneId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
role: z.ZodDefault<z.ZodString>;
namingTemplate: z.ZodOptional<z.ZodString>;
defaultTtl: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
type ZoneCreate = z.infer<typeof zoneCreateSchema>;
declare const zonePatchSchema: z.ZodObject<{
name: z.ZodOptional<z.ZodString>;
cfZoneId: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
role: z.ZodOptional<z.ZodDefault<z.ZodString>>;
namingTemplate: z.ZodOptional<z.ZodOptional<z.ZodString>>;
defaultTtl: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
}, z.core.$strip>;
type ZonePatch = z.infer<typeof zonePatchSchema>;
declare const nodeAddressSchema: z.ZodObject<{
id: z.ZodString;
family: z.ZodEnum<{
v4: "v4";
v6: "v6";
}>;
ip: z.ZodString;
}, z.core.$strip>;
type NodeAddress = z.infer<typeof nodeAddressSchema>;
declare const nodeSchema: z.ZodObject<{
id: z.ZodString;
zoneId: z.ZodString;
locationId: z.ZodString;
locationCode: z.ZodOptional<z.ZodString>;
locationName: z.ZodOptional<z.ZodString>;
hostname: z.ZodString;
role: z.ZodEnum<{
hub: "hub";
gw: "gw";
edge: "edge";
ix: "ix";
}>;
indexNum: z.ZodNumber;
providerTag: z.ZodNullable<z.ZodString>;
notes: z.ZodNullable<z.ZodString>;
syncStatus: z.ZodEnum<{
error: "error";
pending: "pending";
ok: "ok";
drift: "drift";
missing: "missing";
}>;
cfARecordId: z.ZodNullable<z.ZodString>;
cfAaaaRecordId: z.ZodNullable<z.ZodString>;
lastError: z.ZodNullable<z.ZodString>;
addresses: z.ZodDefault<z.ZodArray<z.ZodObject<{
id: z.ZodString;
family: z.ZodEnum<{
v4: "v4";
v6: "v6";
}>;
ip: z.ZodString;
}, z.core.$strip>>>;
aliasCount: z.ZodOptional<z.ZodNumber>;
createdAt: z.ZodString;
updatedAt: z.ZodString;
}, z.core.$strip>;
type Node = z.infer<typeof nodeSchema>;
declare const nodeCreateSchema: z.ZodObject<{
zoneId: z.ZodString;
locationId: z.ZodString;
role: z.ZodEnum<{
hub: "hub";
gw: "gw";
edge: "edge";
ix: "ix";
}>;
indexNum: z.ZodDefault<z.ZodNumber>;
hostname: z.ZodOptional<z.ZodString>;
providerTag: z.ZodNullable<z.ZodOptional<z.ZodString>>;
notes: z.ZodNullable<z.ZodOptional<z.ZodString>>;
ipv4: z.ZodString;
ipv6: z.ZodNullable<z.ZodOptional<z.ZodString>>;
}, z.core.$strip>;
type NodeCreate = z.infer<typeof nodeCreateSchema>;
declare const nodePatchSchema: z.ZodObject<{
locationId: z.ZodOptional<z.ZodString>;
role: z.ZodOptional<z.ZodEnum<{
hub: "hub";
gw: "gw";
edge: "edge";
ix: "ix";
}>>;
indexNum: z.ZodOptional<z.ZodNumber>;
hostname: z.ZodOptional<z.ZodString>;
providerTag: z.ZodNullable<z.ZodOptional<z.ZodString>>;
notes: z.ZodNullable<z.ZodOptional<z.ZodString>>;
ipv4: z.ZodOptional<z.ZodString>;
ipv6: z.ZodNullable<z.ZodOptional<z.ZodString>>;
}, z.core.$strip>;
type NodePatch = z.infer<typeof nodePatchSchema>;
declare const aliasSchema: z.ZodObject<{
id: z.ZodString;
zoneId: z.ZodString;
name: z.ZodString;
purpose: z.ZodEnum<{
custom: "custom";
ix: "ix";
geo: "geo";
backup: "backup";
admin: "admin";
}>;
mode: z.ZodEnum<{
primary: "primary";
pair: "pair";
}>;
targetNodeId: z.ZodString;
targetHostname: z.ZodOptional<z.ZodString>;
syncStatus: z.ZodEnum<{
error: "error";
pending: "pending";
ok: "ok";
drift: "drift";
missing: "missing";
}>;
cfRecordId: z.ZodNullable<z.ZodString>;
lastError: z.ZodNullable<z.ZodString>;
createdAt: z.ZodString;
updatedAt: z.ZodString;
}, z.core.$strip>;
type Alias = z.infer<typeof aliasSchema>;
declare const aliasCreateSchema: z.ZodObject<{
zoneId: z.ZodString;
name: z.ZodString;
purpose: z.ZodDefault<z.ZodEnum<{
custom: "custom";
ix: "ix";
geo: "geo";
backup: "backup";
admin: "admin";
}>>;
mode: z.ZodDefault<z.ZodEnum<{
primary: "primary";
pair: "pair";
}>>;
targetNodeId: z.ZodString;
}, z.core.$strip>;
type AliasCreate = z.infer<typeof aliasCreateSchema>;
declare const aliasPatchSchema: z.ZodObject<{
name: z.ZodOptional<z.ZodString>;
purpose: z.ZodOptional<z.ZodEnum<{
custom: "custom";
ix: "ix";
geo: "geo";
backup: "backup";
admin: "admin";
}>>;
mode: z.ZodOptional<z.ZodEnum<{
primary: "primary";
pair: "pair";
}>>;
targetNodeId: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
type AliasPatch = z.infer<typeof aliasPatchSchema>;
declare const aliasRetargetSchema: z.ZodObject<{
targetNodeId: z.ZodString;
}, z.core.$strip>;
type AliasRetarget = z.infer<typeof aliasRetargetSchema>;
declare const syncDiffOpSchema: z.ZodObject<{
id: z.ZodString;
kind: z.ZodEnum<{
create: "create";
update: "update";
delete: "delete";
orphan: "orphan";
proxy_violation: "proxy_violation";
noop: "noop";
}>;
entityType: z.ZodEnum<{
orphan: "orphan";
node_a: "node_a";
node_aaaa: "node_aaaa";
alias: "alias";
}>;
entityId: z.ZodNullable<z.ZodString>;
recordName: z.ZodString;
recordType: z.ZodString;
desired: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
observed: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
detail: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
type SyncDiffOp = z.infer<typeof syncDiffOpSchema>;
declare const syncJobSchema: z.ZodObject<{
id: z.ZodString;
zoneId: z.ZodString;
status: z.ZodEnum<{
pending: "pending";
running: "running";
done: "done";
failed: "failed";
}>;
diff: z.ZodOptional<z.ZodArray<z.ZodObject<{
id: z.ZodString;
kind: z.ZodEnum<{
create: "create";
update: "update";
delete: "delete";
orphan: "orphan";
proxy_violation: "proxy_violation";
noop: "noop";
}>;
entityType: z.ZodEnum<{
orphan: "orphan";
node_a: "node_a";
node_aaaa: "node_aaaa";
alias: "alias";
}>;
entityId: z.ZodNullable<z.ZodString>;
recordName: z.ZodString;
recordType: z.ZodString;
desired: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
observed: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
detail: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>>;
error: z.ZodNullable<z.ZodString>;
createdAt: z.ZodString;
finishedAt: z.ZodNullable<z.ZodString>;
}, z.core.$strip>;
type SyncJob = z.infer<typeof syncJobSchema>;
declare const syncApplySchema: z.ZodObject<{
opIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
}, z.core.$strip>;
type SyncApply = z.infer<typeof syncApplySchema>;
declare const dashboardStatsSchema: z.ZodObject<{
nodes: z.ZodNumber;
aliases: z.ZodNumber;
syncOk: z.ZodNumber;
drift: z.ZodNumber;
proxyViolations: z.ZodNumber;
orphans: z.ZodNumber;
lastSyncAt: z.ZodNullable<z.ZodString>;
nodesWithoutIp: z.ZodNumber;
brokenAliases: z.ZodNumber;
}, z.core.$strip>;
type DashboardStats = z.infer<typeof dashboardStatsSchema>;
declare const topologyNodeSchema: z.ZodObject<{
id: z.ZodString;
hostname: z.ZodString;
role: z.ZodEnum<{
hub: "hub";
gw: "gw";
edge: "edge";
ix: "ix";
}>;
locationCode: z.ZodString;
ipv4: z.ZodNullable<z.ZodString>;
syncStatus: z.ZodEnum<{
error: "error";
pending: "pending";
ok: "ok";
drift: "drift";
missing: "missing";
}>;
}, z.core.$strip>;
declare const topologyEdgeSchema: z.ZodObject<{
id: z.ZodString;
aliasName: z.ZodString;
purpose: z.ZodEnum<{
custom: "custom";
ix: "ix";
geo: "geo";
backup: "backup";
admin: "admin";
}>;
fromNodeId: z.ZodString;
toHostname: z.ZodString;
}, z.core.$strip>;
declare const topologySchema: z.ZodObject<{
nodes: z.ZodArray<z.ZodObject<{
id: z.ZodString;
hostname: z.ZodString;
role: z.ZodEnum<{
hub: "hub";
gw: "gw";
edge: "edge";
ix: "ix";
}>;
locationCode: z.ZodString;
ipv4: z.ZodNullable<z.ZodString>;
syncStatus: z.ZodEnum<{
error: "error";
pending: "pending";
ok: "ok";
drift: "drift";
missing: "missing";
}>;
}, z.core.$strip>>;
edges: z.ZodArray<z.ZodObject<{
id: z.ZodString;
aliasName: z.ZodString;
purpose: z.ZodEnum<{
custom: "custom";
ix: "ix";
geo: "geo";
backup: "backup";
admin: "admin";
}>;
fromNodeId: z.ZodString;
toHostname: z.ZodString;
}, z.core.$strip>>;
locations: z.ZodArray<z.ZodObject<{
id: z.ZodString;
code: z.ZodString;
name: z.ZodString;
country: z.ZodNullable<z.ZodString>;
sortOrder: z.ZodNumber;
}, z.core.$strip>>;
}, z.core.$strip>;
type Topology = z.infer<typeof topologySchema>;
declare const bindExportSchema: z.ZodObject<{
zoneName: z.ZodString;
content: z.ZodString;
}, z.core.$strip>;
type BindExport = z.infer<typeof bindExportSchema>;
declare const orphanIgnoreSchema: z.ZodObject<{
recordName: z.ZodString;
recordType: z.ZodString;
}, z.core.$strip>;
declare class ValidationError extends Error {
constructor(message: string);
}
export { type Alias, type AliasCreate, type AliasMode, type AliasPatch, type AliasPurpose, type AliasRetarget, type AppSettings, type AppSettingsPatch, type AppSwitcherConfig, type AppSwitcherEntry, type BindExport, type CfDnsRecord, type CfZone, type CreateDnsRecordPayload, type DashboardStats, type JwtClaims, type Location, type LoginInput, type LoginRequest, type LoginResponse, type Node, type NodeAddress, type NodeCreate, type NodePatch, type NodeRole, type PatchDnsRecordPayload, type SyncApply, type SyncDiffOp, type SyncJob, type SyncStatus, type Topology, ValidationError, type Zone, type ZoneCreate, type ZonePatch, addressFamilySchema, aliasCreateSchema, aliasModeSchema, aliasPatchSchema, aliasPurposeSchema, aliasRetargetSchema, aliasSchema, appSettingsPatchSchema, appSettingsSchema, appSwitcherConfigSchema, appSwitcherEntrySchema, appSwitcherIconSchema, bindExportSchema, cfDnsRecordSchema, cfZoneSchema, createDnsRecordPayloadSchema, dashboardStatsSchema, locationSchema, loginSchema, nodeAddressSchema, nodeCreateSchema, nodePatchSchema, nodeRoleSchema, nodeSchema, orphanIgnoreSchema, patchDnsRecordPayloadSchema, syncApplySchema, syncDiffOpSchema, syncJobSchema, syncStatusSchema, topologyEdgeSchema, topologyNodeSchema, topologySchema, zoneCreateSchema, zonePatchSchema, zoneSchema };