Klip: Kutt like it's perfect. An easy to use self-hosted URL shortener. https://uwu.ryukyu/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

151 lines
2.7 KiB

  1. type Raw = import("knex").Raw;
  2. type Match<T> = {
  3. [K in keyof T]?: T[K] | [">" | ">=" | "<=" | "<", T[K]];
  4. };
  5. interface User {
  6. id: number;
  7. apikey?: string;
  8. banned: boolean;
  9. banned_by_id?: number;
  10. cooldowns?: string[];
  11. created_at: string;
  12. email: string;
  13. password: string;
  14. reset_password_expires?: string;
  15. reset_password_token?: string;
  16. updated_at: string;
  17. verification_expires?: string;
  18. verification_token?: string;
  19. verified?: boolean;
  20. }
  21. interface UserJoined extends User {
  22. admin?: boolean;
  23. homepage?: string;
  24. domain?: string;
  25. domain_id?: number;
  26. }
  27. interface Domain {
  28. id: number;
  29. uuid: string;
  30. address: string;
  31. banned: boolean;
  32. banned_by_id?: number;
  33. created_at: string;
  34. homepage?: string;
  35. updated_at: string;
  36. user_id?: number;
  37. }
  38. interface DomainSanitized {
  39. id: string;
  40. uuid: undefined;
  41. address: string;
  42. banned: boolean;
  43. banned_by_id?: undefined;
  44. created_at: string;
  45. homepage?: string;
  46. updated_at: string;
  47. user_id?: undefined;
  48. }
  49. interface Host {
  50. id: number;
  51. address: string;
  52. banned: boolean;
  53. banned_by_id?: number;
  54. created_at: string;
  55. updated_at: string;
  56. }
  57. interface IP {
  58. id: number;
  59. created_at: string;
  60. updated_at: string;
  61. ip: string;
  62. }
  63. interface Link {
  64. id: number;
  65. address: string;
  66. banned: boolean;
  67. banned_by_id?: number;
  68. created_at: string;
  69. domain_id?: number;
  70. password?: string;
  71. target: string;
  72. updated_at: string;
  73. user_id?: number;
  74. uuid: string;
  75. visit_count: number;
  76. }
  77. interface LinkSanitized {
  78. address: string;
  79. banned_by_id?: undefined;
  80. banned: boolean;
  81. created_at: string;
  82. domain_id?: undefined;
  83. id: string;
  84. link: string;
  85. password: boolean;
  86. target: string;
  87. updated_at: string;
  88. user_id?: undefined;
  89. uuid?: undefined;
  90. visit_count: number;
  91. }
  92. interface LinkJoinedDomain extends Link {
  93. domain?: string;
  94. }
  95. interface Visit {
  96. id: number;
  97. countries: Record<string, number>;
  98. created_at: string;
  99. link_id: number;
  100. referrers: Record<string, number>;
  101. total: number;
  102. br_chrome: number;
  103. br_edge: number;
  104. br_firefox: number;
  105. br_ie: number;
  106. br_opera: number;
  107. br_other: number;
  108. br_safari: number;
  109. os_android: number;
  110. os_ios: number;
  111. os_linux: number;
  112. os_macos: number;
  113. os_other: number;
  114. os_windows: number;
  115. }
  116. interface Stats {
  117. browser: Record<
  118. "chrome" | "edge" | "firefox" | "ie" | "opera" | "other" | "safari",
  119. number
  120. >;
  121. os: Record<
  122. "android" | "ios" | "linux" | "macos" | "other" | "windows",
  123. number
  124. >;
  125. country: Record<string, number>;
  126. referrer: Record<string, number>;
  127. }
  128. declare namespace Express {
  129. export interface Request {
  130. realIP?: string;
  131. pageType?: string;
  132. linkTarget?: string;
  133. protectedLink?: string;
  134. token?: string;
  135. user: UserJoined;
  136. }
  137. }