zod.ts 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  1. // Code generated by tools/openapigen. DO NOT EDIT.
  2. import { z } from 'zod';
  3. export const LoginStatusSchema = z.number().int();
  4. export type LoginStatus = z.infer<typeof LoginStatusSchema>;
  5. export const ProcessStateSchema = z.string();
  6. export type ProcessState = z.infer<typeof ProcessStateSchema>;
  7. export const ProtocolSchema = z.string();
  8. export type Protocol = z.infer<typeof ProtocolSchema>;
  9. export const SubLinkProviderSchema = z.unknown();
  10. export type SubLinkProvider = z.infer<typeof SubLinkProviderSchema>;
  11. export const transportBitsSchema = z.number().int();
  12. export type transportBits = z.infer<typeof transportBitsSchema>;
  13. export const AllSettingSchema = z.object({
  14. datepicker: z.string(),
  15. expireDiff: z.number().int().min(0),
  16. externalTrafficInformEnable: z.boolean(),
  17. externalTrafficInformURI: z.string(),
  18. ldapAutoCreate: z.boolean(),
  19. ldapAutoDelete: z.boolean(),
  20. ldapBaseDN: z.string(),
  21. ldapBindDN: z.string(),
  22. ldapDefaultExpiryDays: z.number().int().min(0),
  23. ldapDefaultLimitIP: z.number().int().min(0),
  24. ldapDefaultTotalGB: z.number().int().min(0),
  25. ldapEnable: z.boolean(),
  26. ldapFlagField: z.string(),
  27. ldapHost: z.string(),
  28. ldapInboundTags: z.string(),
  29. ldapInvertFlag: z.boolean(),
  30. ldapPassword: z.string(),
  31. ldapPort: z.number().int().min(0).max(65535),
  32. ldapSyncCron: z.string(),
  33. ldapTruthyValues: z.string(),
  34. ldapUseTLS: z.boolean(),
  35. ldapUserAttr: z.string(),
  36. ldapUserFilter: z.string(),
  37. ldapVlessField: z.string(),
  38. pageSize: z.number().int().min(0).max(1000),
  39. panelProxy: z.string(),
  40. remarkModel: z.string(),
  41. restartXrayOnClientDisable: z.boolean(),
  42. sessionMaxAge: z.number().int().min(1).max(525600),
  43. subAnnounce: z.string(),
  44. subCertFile: z.string(),
  45. subClashEnable: z.boolean(),
  46. subClashEnableRouting: z.boolean(),
  47. subClashPath: z.string(),
  48. subClashRules: z.string(),
  49. subClashURI: z.string(),
  50. subDomain: z.string(),
  51. subEmailInRemark: z.boolean(),
  52. subEnable: z.boolean(),
  53. subEnableRouting: z.boolean(),
  54. subEncrypt: z.boolean(),
  55. subJsonEnable: z.boolean(),
  56. subJsonFinalMask: z.string(),
  57. subJsonMux: z.string(),
  58. subJsonPath: z.string(),
  59. subJsonRules: z.string(),
  60. subJsonURI: z.string(),
  61. subKeyFile: z.string(),
  62. subListen: z.string(),
  63. subPath: z.string(),
  64. subPort: z.number().int().min(1).max(65535),
  65. subProfileUrl: z.string(),
  66. subRoutingRules: z.string(),
  67. subShowInfo: z.boolean(),
  68. subSupportUrl: z.string(),
  69. subTitle: z.string(),
  70. subURI: z.string(),
  71. subUpdates: z.number().int().min(0).max(525600),
  72. tgBotAPIServer: z.string(),
  73. tgBotBackup: z.boolean(),
  74. tgBotChatId: z.string(),
  75. tgBotEnable: z.boolean(),
  76. tgBotLoginNotify: z.boolean(),
  77. tgBotProxy: z.string(),
  78. tgBotToken: z.string(),
  79. tgCpu: z.number().int().min(0).max(100),
  80. tgLang: z.string(),
  81. tgRunTime: z.string(),
  82. timeLocation: z.string(),
  83. trafficDiff: z.number().int().min(0).max(100),
  84. trustedProxyCIDRs: z.string(),
  85. twoFactorEnable: z.boolean(),
  86. twoFactorToken: z.string(),
  87. webBasePath: z.string(),
  88. webCertFile: z.string(),
  89. webDomain: z.string(),
  90. webKeyFile: z.string(),
  91. webListen: z.string(),
  92. webPort: z.number().int().min(1).max(65535),
  93. });
  94. export type AllSetting = z.infer<typeof AllSettingSchema>;
  95. export const AllSettingViewSchema = z.object({
  96. datepicker: z.string(),
  97. expireDiff: z.number().int().min(0),
  98. externalTrafficInformEnable: z.boolean(),
  99. externalTrafficInformURI: z.string(),
  100. hasApiToken: z.boolean(),
  101. hasLdapPassword: z.boolean(),
  102. hasNordSecret: z.boolean(),
  103. hasTgBotToken: z.boolean(),
  104. hasTwoFactorToken: z.boolean(),
  105. hasWarpSecret: z.boolean(),
  106. ldapAutoCreate: z.boolean(),
  107. ldapAutoDelete: z.boolean(),
  108. ldapBaseDN: z.string(),
  109. ldapBindDN: z.string(),
  110. ldapDefaultExpiryDays: z.number().int().min(0),
  111. ldapDefaultLimitIP: z.number().int().min(0),
  112. ldapDefaultTotalGB: z.number().int().min(0),
  113. ldapEnable: z.boolean(),
  114. ldapFlagField: z.string(),
  115. ldapHost: z.string(),
  116. ldapInboundTags: z.string(),
  117. ldapInvertFlag: z.boolean(),
  118. ldapPassword: z.string(),
  119. ldapPort: z.number().int().min(0).max(65535),
  120. ldapSyncCron: z.string(),
  121. ldapTruthyValues: z.string(),
  122. ldapUseTLS: z.boolean(),
  123. ldapUserAttr: z.string(),
  124. ldapUserFilter: z.string(),
  125. ldapVlessField: z.string(),
  126. pageSize: z.number().int().min(0).max(1000),
  127. panelProxy: z.string(),
  128. remarkModel: z.string(),
  129. restartXrayOnClientDisable: z.boolean(),
  130. sessionMaxAge: z.number().int().min(1).max(525600),
  131. subAnnounce: z.string(),
  132. subCertFile: z.string(),
  133. subClashEnable: z.boolean(),
  134. subClashEnableRouting: z.boolean(),
  135. subClashPath: z.string(),
  136. subClashRules: z.string(),
  137. subClashURI: z.string(),
  138. subDomain: z.string(),
  139. subEmailInRemark: z.boolean(),
  140. subEnable: z.boolean(),
  141. subEnableRouting: z.boolean(),
  142. subEncrypt: z.boolean(),
  143. subJsonEnable: z.boolean(),
  144. subJsonFinalMask: z.string(),
  145. subJsonMux: z.string(),
  146. subJsonPath: z.string(),
  147. subJsonRules: z.string(),
  148. subJsonURI: z.string(),
  149. subKeyFile: z.string(),
  150. subListen: z.string(),
  151. subPath: z.string(),
  152. subPort: z.number().int().min(1).max(65535),
  153. subProfileUrl: z.string(),
  154. subRoutingRules: z.string(),
  155. subShowInfo: z.boolean(),
  156. subSupportUrl: z.string(),
  157. subTitle: z.string(),
  158. subURI: z.string(),
  159. subUpdates: z.number().int().min(0).max(525600),
  160. tgBotAPIServer: z.string(),
  161. tgBotBackup: z.boolean(),
  162. tgBotChatId: z.string(),
  163. tgBotEnable: z.boolean(),
  164. tgBotLoginNotify: z.boolean(),
  165. tgBotProxy: z.string(),
  166. tgBotToken: z.string(),
  167. tgCpu: z.number().int().min(0).max(100),
  168. tgLang: z.string(),
  169. tgRunTime: z.string(),
  170. timeLocation: z.string(),
  171. trafficDiff: z.number().int().min(0).max(100),
  172. trustedProxyCIDRs: z.string(),
  173. twoFactorEnable: z.boolean(),
  174. twoFactorToken: z.string(),
  175. webBasePath: z.string(),
  176. webCertFile: z.string(),
  177. webDomain: z.string(),
  178. webKeyFile: z.string(),
  179. webListen: z.string(),
  180. webPort: z.number().int().min(1).max(65535),
  181. });
  182. export type AllSettingView = z.infer<typeof AllSettingViewSchema>;
  183. export const ApiTokenSchema = z.object({
  184. createdAt: z.number().int(),
  185. enabled: z.boolean(),
  186. id: z.number().int(),
  187. name: z.string(),
  188. token: z.string(),
  189. });
  190. export type ApiToken = z.infer<typeof ApiTokenSchema>;
  191. export const ApiTokenViewSchema = z.object({
  192. createdAt: z.number().int(),
  193. enabled: z.boolean(),
  194. id: z.number().int(),
  195. name: z.string(),
  196. token: z.string().optional(),
  197. });
  198. export type ApiTokenView = z.infer<typeof ApiTokenViewSchema>;
  199. export const ClientSchema = z.object({
  200. auth: z.string().optional(),
  201. comment: z.string(),
  202. created_at: z.number().int().optional(),
  203. email: z.string(),
  204. enable: z.boolean(),
  205. expiryTime: z.number().int(),
  206. flow: z.string().optional(),
  207. group: z.string().optional(),
  208. id: z.string().optional(),
  209. limitIp: z.number().int(),
  210. password: z.string().optional(),
  211. reset: z.number().int(),
  212. reverse: z.lazy(() => ClientReverseSchema).nullable().optional(),
  213. security: z.string(),
  214. subId: z.string(),
  215. tgId: z.number().int(),
  216. totalGB: z.number().int(),
  217. updated_at: z.number().int().optional(),
  218. });
  219. export type Client = z.infer<typeof ClientSchema>;
  220. export const ClientInboundSchema = z.object({
  221. clientId: z.number().int(),
  222. createdAt: z.number().int(),
  223. flowOverride: z.string(),
  224. inboundId: z.number().int(),
  225. });
  226. export type ClientInbound = z.infer<typeof ClientInboundSchema>;
  227. export const ClientRecordSchema = z.object({
  228. auth: z.string(),
  229. comment: z.string(),
  230. createdAt: z.number().int(),
  231. email: z.string(),
  232. enable: z.boolean(),
  233. expiryTime: z.number().int(),
  234. flow: z.string(),
  235. group: z.string(),
  236. id: z.number().int(),
  237. limitIp: z.number().int(),
  238. password: z.string(),
  239. reset: z.number().int(),
  240. reverse: z.unknown(),
  241. security: z.string(),
  242. subId: z.string(),
  243. tgId: z.number().int(),
  244. totalGB: z.number().int(),
  245. updatedAt: z.number().int(),
  246. uuid: z.string(),
  247. });
  248. export type ClientRecord = z.infer<typeof ClientRecordSchema>;
  249. export const ClientReverseSchema = z.object({
  250. tag: z.string(),
  251. });
  252. export type ClientReverse = z.infer<typeof ClientReverseSchema>;
  253. export const ClientTrafficSchema = z.object({
  254. down: z.number().int(),
  255. email: z.string(),
  256. enable: z.boolean(),
  257. expiryTime: z.number().int(),
  258. id: z.number().int(),
  259. inboundId: z.number().int(),
  260. lastOnline: z.number().int(),
  261. reset: z.number().int(),
  262. subId: z.string(),
  263. total: z.number().int(),
  264. up: z.number().int(),
  265. uuid: z.string(),
  266. });
  267. export type ClientTraffic = z.infer<typeof ClientTrafficSchema>;
  268. export const CustomGeoResourceSchema = z.object({
  269. alias: z.string(),
  270. createdAt: z.number().int(),
  271. id: z.number().int(),
  272. lastModified: z.string(),
  273. lastUpdatedAt: z.number().int(),
  274. localPath: z.string(),
  275. type: z.string(),
  276. updatedAt: z.number().int(),
  277. url: z.string(),
  278. });
  279. export type CustomGeoResource = z.infer<typeof CustomGeoResourceSchema>;
  280. export const FallbackParentInfoSchema = z.object({
  281. masterId: z.number().int(),
  282. path: z.string().optional(),
  283. });
  284. export type FallbackParentInfo = z.infer<typeof FallbackParentInfoSchema>;
  285. export const HistoryOfSeedersSchema = z.object({
  286. id: z.number().int(),
  287. seederName: z.string(),
  288. });
  289. export type HistoryOfSeeders = z.infer<typeof HistoryOfSeedersSchema>;
  290. export const InboundSchema = z.object({
  291. clientStats: z.array(z.lazy(() => ClientTrafficSchema)),
  292. down: z.number().int(),
  293. enable: z.boolean(),
  294. expiryTime: z.number().int(),
  295. fallbackParent: z.lazy(() => FallbackParentInfoSchema).nullable().optional(),
  296. id: z.number().int(),
  297. lastTrafficResetTime: z.number().int(),
  298. listen: z.string(),
  299. nodeId: z.number().int().nullable().optional(),
  300. originNodeGuid: z.string().optional(),
  301. port: z.number().int().min(0).max(65535),
  302. protocol: z.enum(['vmess', 'vless', 'trojan', 'shadowsocks', 'wireguard', 'hysteria', 'http', 'mixed', 'tunnel', 'tun', 'mtproto']),
  303. remark: z.string(),
  304. settings: z.unknown(),
  305. sniffing: z.unknown(),
  306. streamSettings: z.unknown(),
  307. tag: z.string(),
  308. total: z.number().int(),
  309. trafficReset: z.enum(['never', 'hourly', 'daily', 'weekly', 'monthly']),
  310. up: z.number().int(),
  311. });
  312. export type Inbound = z.infer<typeof InboundSchema>;
  313. export const InboundClientIpsSchema = z.object({
  314. clientEmail: z.string(),
  315. id: z.number().int(),
  316. ips: z.unknown(),
  317. });
  318. export type InboundClientIps = z.infer<typeof InboundClientIpsSchema>;
  319. export const InboundFallbackSchema = z.object({
  320. alpn: z.string(),
  321. childId: z.number().int(),
  322. dest: z.string(),
  323. id: z.number().int(),
  324. masterId: z.number().int(),
  325. name: z.string(),
  326. path: z.string(),
  327. sortOrder: z.number().int(),
  328. xver: z.number().int(),
  329. });
  330. export type InboundFallback = z.infer<typeof InboundFallbackSchema>;
  331. export const InboundOptionSchema = z.object({
  332. id: z.number().int(),
  333. port: z.number().int(),
  334. protocol: z.string(),
  335. remark: z.string(),
  336. ssMethod: z.string(),
  337. tag: z.string(),
  338. tlsFlowCapable: z.boolean(),
  339. });
  340. export type InboundOption = z.infer<typeof InboundOptionSchema>;
  341. export const MsgSchema = z.object({
  342. msg: z.string(),
  343. obj: z.unknown(),
  344. success: z.boolean(),
  345. });
  346. export type Msg = z.infer<typeof MsgSchema>;
  347. export const NodeSchema = z.object({
  348. address: z.string(),
  349. allowPrivateAddress: z.boolean(),
  350. apiToken: z.string(),
  351. basePath: z.string(),
  352. clientCount: z.number().int(),
  353. configDirty: z.boolean(),
  354. configDirtyAt: z.number().int(),
  355. cpuPct: z.number(),
  356. createdAt: z.number().int(),
  357. depletedCount: z.number().int(),
  358. enable: z.boolean(),
  359. guid: z.string(),
  360. id: z.number().int(),
  361. inboundCount: z.number().int(),
  362. lastError: z.string(),
  363. lastHeartbeat: z.number().int(),
  364. latencyMs: z.number().int(),
  365. memPct: z.number(),
  366. name: z.string(),
  367. onlineCount: z.number().int(),
  368. panelVersion: z.string(),
  369. parentGuid: z.string().optional(),
  370. pinnedCertSha256: z.string(),
  371. port: z.number().int().min(1).max(65535),
  372. remark: z.string(),
  373. scheme: z.enum(['http', 'https']),
  374. status: z.string(),
  375. tlsVerifyMode: z.enum(['verify', 'skip', 'pin']),
  376. transitive: z.boolean().optional(),
  377. updatedAt: z.number().int(),
  378. uptimeSecs: z.number().int(),
  379. xrayVersion: z.string(),
  380. });
  381. export type Node = z.infer<typeof NodeSchema>;
  382. export const OutboundTrafficsSchema = z.object({
  383. down: z.number().int(),
  384. id: z.number().int(),
  385. tag: z.string(),
  386. total: z.number().int(),
  387. up: z.number().int(),
  388. });
  389. export type OutboundTraffics = z.infer<typeof OutboundTrafficsSchema>;
  390. export const ProbeResultUISchema = z.object({
  391. cpuPct: z.number(),
  392. error: z.string(),
  393. latencyMs: z.number().int(),
  394. memPct: z.number(),
  395. panelVersion: z.string(),
  396. status: z.string(),
  397. uptimeSecs: z.number().int(),
  398. xrayVersion: z.string(),
  399. });
  400. export type ProbeResultUI = z.infer<typeof ProbeResultUISchema>;
  401. export const SettingSchema = z.object({
  402. id: z.number().int(),
  403. key: z.string(),
  404. value: z.string(),
  405. });
  406. export type Setting = z.infer<typeof SettingSchema>;
  407. export const UserSchema = z.object({
  408. id: z.number().int(),
  409. password: z.string(),
  410. username: z.string(),
  411. });
  412. export type User = z.infer<typeof UserSchema>;