zod.ts 11 KB

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