1
0

zod.ts 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  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. subSortIndex: z.number().int().min(1),
  302. tag: z.string(),
  303. total: z.number().int(),
  304. trafficReset: z.enum(['never', 'hourly', 'daily', 'weekly', 'monthly']),
  305. up: z.number().int(),
  306. });
  307. export type Inbound = z.infer<typeof InboundSchema>;
  308. export const InboundClientIpsSchema = z.object({
  309. clientEmail: z.string(),
  310. id: z.number().int(),
  311. ips: z.unknown(),
  312. });
  313. export type InboundClientIps = z.infer<typeof InboundClientIpsSchema>;
  314. export const InboundFallbackSchema = z.object({
  315. alpn: z.string(),
  316. childId: z.number().int(),
  317. dest: z.string(),
  318. id: z.number().int(),
  319. masterId: z.number().int(),
  320. name: z.string(),
  321. path: z.string(),
  322. sortOrder: z.number().int(),
  323. xver: z.number().int(),
  324. });
  325. export type InboundFallback = z.infer<typeof InboundFallbackSchema>;
  326. export const InboundOptionSchema = z.object({
  327. id: z.number().int(),
  328. nodeId: z.number().int().nullable().optional(),
  329. port: z.number().int(),
  330. protocol: z.string(),
  331. remark: z.string(),
  332. ssMethod: z.string(),
  333. tag: z.string(),
  334. tlsFlowCapable: z.boolean(),
  335. });
  336. export type InboundOption = z.infer<typeof InboundOptionSchema>;
  337. export const MsgSchema = z.object({
  338. msg: z.string(),
  339. obj: z.unknown(),
  340. success: z.boolean(),
  341. });
  342. export type Msg = z.infer<typeof MsgSchema>;
  343. export const NodeSchema = z.object({
  344. address: z.string(),
  345. allowPrivateAddress: z.boolean(),
  346. apiToken: z.string(),
  347. basePath: z.string(),
  348. clientCount: z.number().int(),
  349. configDirty: z.boolean(),
  350. configDirtyAt: z.number().int(),
  351. cpuPct: z.number(),
  352. createdAt: z.number().int(),
  353. depletedCount: z.number().int(),
  354. enable: z.boolean(),
  355. guid: z.string(),
  356. id: z.number().int(),
  357. inboundCount: z.number().int(),
  358. inboundSyncMode: z.enum(['all', 'selected']),
  359. inboundTags: z.array(z.string()),
  360. lastError: z.string(),
  361. lastHeartbeat: z.number().int(),
  362. latencyMs: z.number().int(),
  363. memPct: z.number(),
  364. name: z.string(),
  365. onlineCount: z.number().int(),
  366. outboundTag: z.string(),
  367. panelVersion: z.string(),
  368. parentGuid: z.string().optional(),
  369. pinnedCertSha256: z.string(),
  370. port: z.number().int().min(1).max(65535),
  371. remark: z.string(),
  372. scheme: z.enum(['http', 'https']),
  373. status: z.string(),
  374. tlsVerifyMode: z.enum(['verify', 'skip', 'pin']),
  375. transitive: z.boolean().optional(),
  376. updatedAt: z.number().int(),
  377. uptimeSecs: z.number().int(),
  378. xrayError: z.string(),
  379. xrayState: z.string(),
  380. xrayVersion: z.string(),
  381. });
  382. export type Node = z.infer<typeof NodeSchema>;
  383. export const OutboundTrafficsSchema = z.object({
  384. down: z.number().int(),
  385. id: z.number().int(),
  386. tag: z.string(),
  387. total: z.number().int(),
  388. up: z.number().int(),
  389. });
  390. export type OutboundTraffics = z.infer<typeof OutboundTrafficsSchema>;
  391. export const ProbeResultUISchema = z.object({
  392. cpuPct: z.number(),
  393. error: z.string(),
  394. latencyMs: z.number().int(),
  395. memPct: z.number(),
  396. panelVersion: z.string(),
  397. status: z.string(),
  398. uptimeSecs: z.number().int(),
  399. xrayError: z.string(),
  400. xrayState: z.string(),
  401. xrayVersion: z.string(),
  402. });
  403. export type ProbeResultUI = z.infer<typeof ProbeResultUISchema>;
  404. export const SettingSchema = z.object({
  405. id: z.number().int(),
  406. key: z.string(),
  407. value: z.string(),
  408. });
  409. export type Setting = z.infer<typeof SettingSchema>;
  410. export const UserSchema = z.object({
  411. id: z.number().int(),
  412. password: z.string(),
  413. username: z.string(),
  414. });
  415. export type User = z.infer<typeof UserSchema>;