zod.ts 11 KB

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