zod.ts 13 KB

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