types.ts 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. export type Json =
  2. | string
  3. | number
  4. | boolean
  5. | null
  6. | { [key: string]: Json | undefined }
  7. | Json[]
  8. export type Database = {
  9. // Allows to automatically instantiate createClient with right options
  10. // instead of createClient<Database, { PostgrestVersion: 'XX' }>(URL, KEY)
  11. __InternalSupabase: {
  12. PostgrestVersion: "12.2.3 (519615d)"
  13. }
  14. public: {
  15. Tables: {
  16. articles: {
  17. Row: {
  18. content: string | null
  19. created_at: string
  20. description: string | null
  21. feed_id: string
  22. guid: string | null
  23. id: string
  24. image_url: string | null
  25. last_seen_at: string | null
  26. published_at: string
  27. read_time: number | null
  28. title: string
  29. updated_at: string
  30. url: string | null
  31. }
  32. Insert: {
  33. content?: string | null
  34. created_at?: string
  35. description?: string | null
  36. feed_id: string
  37. guid?: string | null
  38. id?: string
  39. image_url?: string | null
  40. last_seen_at?: string | null
  41. published_at: string
  42. read_time?: number | null
  43. title: string
  44. updated_at?: string
  45. url?: string | null
  46. }
  47. Update: {
  48. content?: string | null
  49. created_at?: string
  50. description?: string | null
  51. feed_id?: string
  52. guid?: string | null
  53. id?: string
  54. image_url?: string | null
  55. last_seen_at?: string | null
  56. published_at?: string
  57. read_time?: number | null
  58. title?: string
  59. updated_at?: string
  60. url?: string | null
  61. }
  62. Relationships: [
  63. {
  64. foreignKeyName: "articles_feed_id_fkey"
  65. columns: ["feed_id"]
  66. isOneToOne: false
  67. referencedRelation: "feeds"
  68. referencedColumns: ["id"]
  69. },
  70. ]
  71. }
  72. feeds: {
  73. Row: {
  74. article_count: number | null
  75. category: string
  76. created_at: string
  77. description: string | null
  78. id: string
  79. last_fetched_at: string | null
  80. last_updated: string | null
  81. name: string
  82. status: string
  83. type: string
  84. updated_at: string
  85. url: string
  86. }
  87. Insert: {
  88. article_count?: number | null
  89. category: string
  90. created_at?: string
  91. description?: string | null
  92. id?: string
  93. last_fetched_at?: string | null
  94. last_updated?: string | null
  95. name: string
  96. status?: string
  97. type: string
  98. updated_at?: string
  99. url: string
  100. }
  101. Update: {
  102. article_count?: number | null
  103. category?: string
  104. created_at?: string
  105. description?: string | null
  106. id?: string
  107. last_fetched_at?: string | null
  108. last_updated?: string | null
  109. name?: string
  110. status?: string
  111. type?: string
  112. updated_at?: string
  113. url?: string
  114. }
  115. Relationships: []
  116. }
  117. super_users: {
  118. Row: {
  119. created_at: string
  120. email: string
  121. id: string
  122. user_id: string
  123. }
  124. Insert: {
  125. created_at?: string
  126. email: string
  127. id?: string
  128. user_id: string
  129. }
  130. Update: {
  131. created_at?: string
  132. email?: string
  133. id?: string
  134. user_id?: string
  135. }
  136. Relationships: []
  137. }
  138. user_articles: {
  139. Row: {
  140. article_id: string
  141. created_at: string
  142. id: string
  143. is_pinned: boolean
  144. is_read: boolean
  145. read_at: string | null
  146. read_count: number
  147. user_id: string
  148. }
  149. Insert: {
  150. article_id: string
  151. created_at?: string
  152. id?: string
  153. is_pinned?: boolean
  154. is_read?: boolean
  155. read_at?: string | null
  156. read_count?: number
  157. user_id: string
  158. }
  159. Update: {
  160. article_id?: string
  161. created_at?: string
  162. id?: string
  163. is_pinned?: boolean
  164. is_read?: boolean
  165. read_at?: string | null
  166. read_count?: number
  167. user_id?: string
  168. }
  169. Relationships: [
  170. {
  171. foreignKeyName: "user_articles_article_id_fkey"
  172. columns: ["article_id"]
  173. isOneToOne: false
  174. referencedRelation: "articles"
  175. referencedColumns: ["id"]
  176. },
  177. ]
  178. }
  179. user_feeds: {
  180. Row: {
  181. created_at: string
  182. feed_id: string
  183. id: string
  184. is_followed: boolean
  185. user_id: string
  186. }
  187. Insert: {
  188. created_at?: string
  189. feed_id: string
  190. id?: string
  191. is_followed?: boolean
  192. user_id: string
  193. }
  194. Update: {
  195. created_at?: string
  196. feed_id?: string
  197. id?: string
  198. is_followed?: boolean
  199. user_id?: string
  200. }
  201. Relationships: [
  202. {
  203. foreignKeyName: "user_feeds_feed_id_fkey"
  204. columns: ["feed_id"]
  205. isOneToOne: false
  206. referencedRelation: "feeds"
  207. referencedColumns: ["id"]
  208. },
  209. ]
  210. }
  211. }
  212. Views: {
  213. [_ in never]: never
  214. }
  215. Functions: {
  216. is_super_user: { Args: { user_email?: string }; Returns: boolean }
  217. purge_old_articles: {
  218. Args: never
  219. Returns: {
  220. admin_emails: string[]
  221. deleted_count: number
  222. }[]
  223. }
  224. test_purge_articles: {
  225. Args: never
  226. Returns: {
  227. articles_to_delete: number
  228. newest_article_date: string
  229. oldest_article_date: string
  230. sample_titles: string[]
  231. }[]
  232. }
  233. trigger_fetch_all_feeds: { Args: never; Returns: undefined }
  234. trigger_purge_articles: { Args: never; Returns: undefined }
  235. }
  236. Enums: {
  237. [_ in never]: never
  238. }
  239. CompositeTypes: {
  240. [_ in never]: never
  241. }
  242. }
  243. }
  244. type DatabaseWithoutInternals = Omit<Database, "__InternalSupabase">
  245. type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database, "public">]
  246. export type Tables<
  247. DefaultSchemaTableNameOrOptions extends
  248. | keyof (DefaultSchema["Tables"] & DefaultSchema["Views"])
  249. | { schema: keyof DatabaseWithoutInternals },
  250. TableName extends DefaultSchemaTableNameOrOptions extends {
  251. schema: keyof DatabaseWithoutInternals
  252. }
  253. ? keyof (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] &
  254. DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])
  255. : never = never,
  256. > = DefaultSchemaTableNameOrOptions extends {
  257. schema: keyof DatabaseWithoutInternals
  258. }
  259. ? (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] &
  260. DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])[TableName] extends {
  261. Row: infer R
  262. }
  263. ? R
  264. : never
  265. : DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] &
  266. DefaultSchema["Views"])
  267. ? (DefaultSchema["Tables"] &
  268. DefaultSchema["Views"])[DefaultSchemaTableNameOrOptions] extends {
  269. Row: infer R
  270. }
  271. ? R
  272. : never
  273. : never
  274. export type TablesInsert<
  275. DefaultSchemaTableNameOrOptions extends
  276. | keyof DefaultSchema["Tables"]
  277. | { schema: keyof DatabaseWithoutInternals },
  278. TableName extends DefaultSchemaTableNameOrOptions extends {
  279. schema: keyof DatabaseWithoutInternals
  280. }
  281. ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"]
  282. : never = never,
  283. > = DefaultSchemaTableNameOrOptions extends {
  284. schema: keyof DatabaseWithoutInternals
  285. }
  286. ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
  287. Insert: infer I
  288. }
  289. ? I
  290. : never
  291. : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"]
  292. ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
  293. Insert: infer I
  294. }
  295. ? I
  296. : never
  297. : never
  298. export type TablesUpdate<
  299. DefaultSchemaTableNameOrOptions extends
  300. | keyof DefaultSchema["Tables"]
  301. | { schema: keyof DatabaseWithoutInternals },
  302. TableName extends DefaultSchemaTableNameOrOptions extends {
  303. schema: keyof DatabaseWithoutInternals
  304. }
  305. ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"]
  306. : never = never,
  307. > = DefaultSchemaTableNameOrOptions extends {
  308. schema: keyof DatabaseWithoutInternals
  309. }
  310. ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
  311. Update: infer U
  312. }
  313. ? U
  314. : never
  315. : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"]
  316. ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
  317. Update: infer U
  318. }
  319. ? U
  320. : never
  321. : never
  322. export type Enums<
  323. DefaultSchemaEnumNameOrOptions extends
  324. | keyof DefaultSchema["Enums"]
  325. | { schema: keyof DatabaseWithoutInternals },
  326. EnumName extends DefaultSchemaEnumNameOrOptions extends {
  327. schema: keyof DatabaseWithoutInternals
  328. }
  329. ? keyof DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"]
  330. : never = never,
  331. > = DefaultSchemaEnumNameOrOptions extends {
  332. schema: keyof DatabaseWithoutInternals
  333. }
  334. ? DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"][EnumName]
  335. : DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema["Enums"]
  336. ? DefaultSchema["Enums"][DefaultSchemaEnumNameOrOptions]
  337. : never
  338. export type CompositeTypes<
  339. PublicCompositeTypeNameOrOptions extends
  340. | keyof DefaultSchema["CompositeTypes"]
  341. | { schema: keyof DatabaseWithoutInternals },
  342. CompositeTypeName extends PublicCompositeTypeNameOrOptions extends {
  343. schema: keyof DatabaseWithoutInternals
  344. }
  345. ? keyof DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"]
  346. : never = never,
  347. > = PublicCompositeTypeNameOrOptions extends {
  348. schema: keyof DatabaseWithoutInternals
  349. }
  350. ? DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"][CompositeTypeName]
  351. : PublicCompositeTypeNameOrOptions extends keyof DefaultSchema["CompositeTypes"]
  352. ? DefaultSchema["CompositeTypes"][PublicCompositeTypeNameOrOptions]
  353. : never
  354. export const Constants = {
  355. public: {
  356. Enums: {},
  357. },
  358. } as const