@everylanguage/shared-types 1.0.14 → 1.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/types/database.d.ts +284 -190
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everylanguage/shared-types",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
4
4
  "type": "module",
5
5
  "main": "types/database.js",
6
6
  "types": "types/database.d.ts",
@@ -34,7 +34,6 @@ export type Database = {
34
34
  Tables: {
35
35
  app_downloads: {
36
36
  Row: {
37
- anon_user_id: string | null;
38
37
  app_version: string;
39
38
  created_at: string | null;
40
39
  device_id: string;
@@ -45,9 +44,9 @@ export type Database = {
45
44
  os_version: string | null;
46
45
  platform: Database["public"]["Enums"]["platform_type"];
47
46
  source_share_id: string | null;
47
+ user_id: string | null;
48
48
  };
49
49
  Insert: {
50
- anon_user_id?: string | null;
51
50
  app_version: string;
52
51
  created_at?: string | null;
53
52
  device_id: string;
@@ -58,9 +57,9 @@ export type Database = {
58
57
  os_version?: string | null;
59
58
  platform: Database["public"]["Enums"]["platform_type"];
60
59
  source_share_id?: string | null;
60
+ user_id?: string | null;
61
61
  };
62
62
  Update: {
63
- anon_user_id?: string | null;
64
63
  app_version?: string;
65
64
  created_at?: string | null;
66
65
  device_id?: string;
@@ -71,20 +70,21 @@ export type Database = {
71
70
  os_version?: string | null;
72
71
  platform?: Database["public"]["Enums"]["platform_type"];
73
72
  source_share_id?: string | null;
73
+ user_id?: string | null;
74
74
  };
75
75
  Relationships: [
76
76
  {
77
- foreignKeyName: "app_downloads_anon_user_id_fkey";
78
- columns: ["anon_user_id"];
77
+ foreignKeyName: "app_downloads_source_share_id_fkey";
78
+ columns: ["source_share_id"];
79
79
  isOneToOne: false;
80
- referencedRelation: "users_anon";
80
+ referencedRelation: "shares";
81
81
  referencedColumns: ["id"];
82
82
  },
83
83
  {
84
- foreignKeyName: "app_downloads_source_share_id_fkey";
85
- columns: ["source_share_id"];
84
+ foreignKeyName: "app_downloads_user_id_fkey";
85
+ columns: ["user_id"];
86
86
  isOneToOne: false;
87
- referencedRelation: "shares";
87
+ referencedRelation: "users";
88
88
  referencedColumns: ["id"];
89
89
  }
90
90
  ];
@@ -297,7 +297,6 @@ export type Database = {
297
297
  };
298
298
  chapter_listens: {
299
299
  Row: {
300
- anon_user_id: string;
301
300
  chapter_id: string;
302
301
  connectivity: Database["public"]["Enums"]["connectivity_type"] | null;
303
302
  created_at: string | null;
@@ -307,9 +306,9 @@ export type Database = {
307
306
  listened_at: string | null;
308
307
  location: unknown | null;
309
308
  session_id: string;
309
+ user_id: string | null;
310
310
  };
311
311
  Insert: {
312
- anon_user_id: string;
313
312
  chapter_id: string;
314
313
  connectivity?: Database["public"]["Enums"]["connectivity_type"] | null;
315
314
  created_at?: string | null;
@@ -319,9 +318,9 @@ export type Database = {
319
318
  listened_at?: string | null;
320
319
  location?: unknown | null;
321
320
  session_id: string;
321
+ user_id?: string | null;
322
322
  };
323
323
  Update: {
324
- anon_user_id?: string;
325
324
  chapter_id?: string;
326
325
  connectivity?: Database["public"]["Enums"]["connectivity_type"] | null;
327
326
  created_at?: string | null;
@@ -331,15 +330,9 @@ export type Database = {
331
330
  listened_at?: string | null;
332
331
  location?: unknown | null;
333
332
  session_id?: string;
333
+ user_id?: string | null;
334
334
  };
335
335
  Relationships: [
336
- {
337
- foreignKeyName: "chapter_listens_anon_user_id_fkey";
338
- columns: ["anon_user_id"];
339
- isOneToOne: false;
340
- referencedRelation: "users_anon";
341
- referencedColumns: ["id"];
342
- },
343
336
  {
344
337
  foreignKeyName: "chapter_listens_chapter_id_fkey";
345
338
  columns: ["chapter_id"];
@@ -360,6 +353,13 @@ export type Database = {
360
353
  isOneToOne: false;
361
354
  referencedRelation: "sessions";
362
355
  referencedColumns: ["id"];
356
+ },
357
+ {
358
+ foreignKeyName: "chapter_listens_user_id_fkey";
359
+ columns: ["user_id"];
360
+ isOneToOne: false;
361
+ referencedRelation: "users";
362
+ referencedColumns: ["id"];
363
363
  }
364
364
  ];
365
365
  };
@@ -760,7 +760,6 @@ export type Database = {
760
760
  };
761
761
  media_file_listens: {
762
762
  Row: {
763
- anon_user_id: string;
764
763
  connectivity: Database["public"]["Enums"]["connectivity_type"] | null;
765
764
  created_at: string | null;
766
765
  device_id: string;
@@ -772,9 +771,9 @@ export type Database = {
772
771
  media_file_id: string;
773
772
  position_seconds: number;
774
773
  session_id: string;
774
+ user_id: string;
775
775
  };
776
776
  Insert: {
777
- anon_user_id: string;
778
777
  connectivity?: Database["public"]["Enums"]["connectivity_type"] | null;
779
778
  created_at?: string | null;
780
779
  device_id: string;
@@ -786,9 +785,9 @@ export type Database = {
786
785
  media_file_id: string;
787
786
  position_seconds: number;
788
787
  session_id: string;
788
+ user_id: string;
789
789
  };
790
790
  Update: {
791
- anon_user_id?: string;
792
791
  connectivity?: Database["public"]["Enums"]["connectivity_type"] | null;
793
792
  created_at?: string | null;
794
793
  device_id?: string;
@@ -800,15 +799,9 @@ export type Database = {
800
799
  media_file_id?: string;
801
800
  position_seconds?: number;
802
801
  session_id?: string;
802
+ user_id?: string;
803
803
  };
804
804
  Relationships: [
805
- {
806
- foreignKeyName: "media_file_listens_anon_user_id_fkey";
807
- columns: ["anon_user_id"];
808
- isOneToOne: false;
809
- referencedRelation: "users_anon";
810
- referencedColumns: ["id"];
811
- },
812
805
  {
813
806
  foreignKeyName: "media_file_listens_language_entity_id_fkey";
814
807
  columns: ["language_entity_id"];
@@ -829,6 +822,13 @@ export type Database = {
829
822
  isOneToOne: false;
830
823
  referencedRelation: "sessions";
831
824
  referencedColumns: ["id"];
825
+ },
826
+ {
827
+ foreignKeyName: "media_file_listens_user_id_fkey";
828
+ columns: ["user_id"];
829
+ isOneToOne: false;
830
+ referencedRelation: "users";
831
+ referencedColumns: ["id"];
832
832
  }
833
833
  ];
834
834
  };
@@ -1043,6 +1043,7 @@ export type Database = {
1043
1043
  created_at: string | null;
1044
1044
  created_by: string | null;
1045
1045
  deleted_at: string | null;
1046
+ denormalized_audio_version_id: string | null;
1046
1047
  duration_seconds: number;
1047
1048
  id: string;
1048
1049
  media_file_id: string;
@@ -1054,6 +1055,7 @@ export type Database = {
1054
1055
  created_at?: string | null;
1055
1056
  created_by?: string | null;
1056
1057
  deleted_at?: string | null;
1058
+ denormalized_audio_version_id?: string | null;
1057
1059
  duration_seconds: number;
1058
1060
  id?: string;
1059
1061
  media_file_id: string;
@@ -1065,6 +1067,7 @@ export type Database = {
1065
1067
  created_at?: string | null;
1066
1068
  created_by?: string | null;
1067
1069
  deleted_at?: string | null;
1070
+ denormalized_audio_version_id?: string | null;
1068
1071
  duration_seconds?: number;
1069
1072
  id?: string;
1070
1073
  media_file_id?: string;
@@ -1080,6 +1083,13 @@ export type Database = {
1080
1083
  referencedRelation: "users";
1081
1084
  referencedColumns: ["id"];
1082
1085
  },
1086
+ {
1087
+ foreignKeyName: "media_files_verses_denormalized_audio_version_id_fkey";
1088
+ columns: ["denormalized_audio_version_id"];
1089
+ isOneToOne: false;
1090
+ referencedRelation: "audio_versions";
1091
+ referencedColumns: ["id"];
1092
+ },
1083
1093
  {
1084
1094
  foreignKeyName: "media_files_verses_media_file_id_fkey";
1085
1095
  columns: ["media_file_id"];
@@ -1937,7 +1947,6 @@ export type Database = {
1937
1947
  };
1938
1948
  sessions: {
1939
1949
  Row: {
1940
- anon_user_id: string;
1941
1950
  app_version: string;
1942
1951
  connectivity: Database["public"]["Enums"]["connectivity_type"] | null;
1943
1952
  created_at: string | null;
@@ -1949,9 +1958,9 @@ export type Database = {
1949
1958
  os_version: string | null;
1950
1959
  platform: Database["public"]["Enums"]["platform_type"];
1951
1960
  started_at: string | null;
1961
+ user_id: string;
1952
1962
  };
1953
1963
  Insert: {
1954
- anon_user_id: string;
1955
1964
  app_version: string;
1956
1965
  connectivity?: Database["public"]["Enums"]["connectivity_type"] | null;
1957
1966
  created_at?: string | null;
@@ -1963,9 +1972,9 @@ export type Database = {
1963
1972
  os_version?: string | null;
1964
1973
  platform: Database["public"]["Enums"]["platform_type"];
1965
1974
  started_at?: string | null;
1975
+ user_id: string;
1966
1976
  };
1967
1977
  Update: {
1968
- anon_user_id?: string;
1969
1978
  app_version?: string;
1970
1979
  connectivity?: Database["public"]["Enums"]["connectivity_type"] | null;
1971
1980
  created_at?: string | null;
@@ -1977,13 +1986,14 @@ export type Database = {
1977
1986
  os_version?: string | null;
1978
1987
  platform?: Database["public"]["Enums"]["platform_type"];
1979
1988
  started_at?: string | null;
1989
+ user_id?: string;
1980
1990
  };
1981
1991
  Relationships: [
1982
1992
  {
1983
- foreignKeyName: "sessions_anon_user_id_fkey";
1984
- columns: ["anon_user_id"];
1993
+ foreignKeyName: "sessions_user_id_fkey";
1994
+ columns: ["user_id"];
1985
1995
  isOneToOne: false;
1986
- referencedRelation: "users_anon";
1996
+ referencedRelation: "users";
1987
1997
  referencedColumns: ["id"];
1988
1998
  }
1989
1999
  ];
@@ -1996,10 +2006,10 @@ export type Database = {
1996
2006
  language_entity_id: string;
1997
2007
  location: unknown | null;
1998
2008
  opened_at: string | null;
1999
- opened_by_anon_user_id: string | null;
2000
2009
  origin_share_id: string | null;
2001
2010
  session_id: string | null;
2002
2011
  share_id: string;
2012
+ user_id: string | null;
2003
2013
  };
2004
2014
  Insert: {
2005
2015
  created_at?: string | null;
@@ -2008,10 +2018,10 @@ export type Database = {
2008
2018
  language_entity_id: string;
2009
2019
  location?: unknown | null;
2010
2020
  opened_at?: string | null;
2011
- opened_by_anon_user_id?: string | null;
2012
2021
  origin_share_id?: string | null;
2013
2022
  session_id?: string | null;
2014
2023
  share_id: string;
2024
+ user_id?: string | null;
2015
2025
  };
2016
2026
  Update: {
2017
2027
  created_at?: string | null;
@@ -2020,10 +2030,10 @@ export type Database = {
2020
2030
  language_entity_id?: string;
2021
2031
  location?: unknown | null;
2022
2032
  opened_at?: string | null;
2023
- opened_by_anon_user_id?: string | null;
2024
2033
  origin_share_id?: string | null;
2025
2034
  session_id?: string | null;
2026
2035
  share_id?: string;
2036
+ user_id?: string | null;
2027
2037
  };
2028
2038
  Relationships: [
2029
2039
  {
@@ -2033,13 +2043,6 @@ export type Database = {
2033
2043
  referencedRelation: "language_entities";
2034
2044
  referencedColumns: ["id"];
2035
2045
  },
2036
- {
2037
- foreignKeyName: "share_opens_opened_by_anon_user_id_fkey";
2038
- columns: ["opened_by_anon_user_id"];
2039
- isOneToOne: false;
2040
- referencedRelation: "users_anon";
2041
- referencedColumns: ["id"];
2042
- },
2043
2046
  {
2044
2047
  foreignKeyName: "share_opens_origin_share_id_fkey";
2045
2048
  columns: ["origin_share_id"];
@@ -2060,12 +2063,18 @@ export type Database = {
2060
2063
  isOneToOne: false;
2061
2064
  referencedRelation: "shares";
2062
2065
  referencedColumns: ["id"];
2066
+ },
2067
+ {
2068
+ foreignKeyName: "share_opens_user_id_fkey";
2069
+ columns: ["user_id"];
2070
+ isOneToOne: false;
2071
+ referencedRelation: "users";
2072
+ referencedColumns: ["id"];
2063
2073
  }
2064
2074
  ];
2065
2075
  };
2066
2076
  shares: {
2067
2077
  Row: {
2068
- anon_user_id: string;
2069
2078
  created_at: string | null;
2070
2079
  device_id: string;
2071
2080
  id: string;
@@ -2076,9 +2085,9 @@ export type Database = {
2076
2085
  share_entity_id: string;
2077
2086
  share_entity_type: Database["public"]["Enums"]["share_entity_type"];
2078
2087
  shared_at: string | null;
2088
+ user_id: string;
2079
2089
  };
2080
2090
  Insert: {
2081
- anon_user_id: string;
2082
2091
  created_at?: string | null;
2083
2092
  device_id: string;
2084
2093
  id?: string;
@@ -2089,9 +2098,9 @@ export type Database = {
2089
2098
  share_entity_id: string;
2090
2099
  share_entity_type: Database["public"]["Enums"]["share_entity_type"];
2091
2100
  shared_at?: string | null;
2101
+ user_id: string;
2092
2102
  };
2093
2103
  Update: {
2094
- anon_user_id?: string;
2095
2104
  created_at?: string | null;
2096
2105
  device_id?: string;
2097
2106
  id?: string;
@@ -2102,15 +2111,9 @@ export type Database = {
2102
2111
  share_entity_id?: string;
2103
2112
  share_entity_type?: Database["public"]["Enums"]["share_entity_type"];
2104
2113
  shared_at?: string | null;
2114
+ user_id?: string;
2105
2115
  };
2106
2116
  Relationships: [
2107
- {
2108
- foreignKeyName: "shares_anon_user_id_fkey";
2109
- columns: ["anon_user_id"];
2110
- isOneToOne: false;
2111
- referencedRelation: "users_anon";
2112
- referencedColumns: ["id"];
2113
- },
2114
2117
  {
2115
2118
  foreignKeyName: "shares_language_entity_id_fkey";
2116
2119
  columns: ["language_entity_id"];
@@ -2131,6 +2134,13 @@ export type Database = {
2131
2134
  isOneToOne: false;
2132
2135
  referencedRelation: "sessions";
2133
2136
  referencedColumns: ["id"];
2137
+ },
2138
+ {
2139
+ foreignKeyName: "shares_user_id_fkey";
2140
+ columns: ["user_id"];
2141
+ isOneToOne: false;
2142
+ referencedRelation: "users";
2143
+ referencedColumns: ["id"];
2134
2144
  }
2135
2145
  ];
2136
2146
  };
@@ -2287,43 +2297,33 @@ export type Database = {
2287
2297
  };
2288
2298
  user_bookmark_folders: {
2289
2299
  Row: {
2290
- anon_user_id: string | null;
2291
2300
  color: string | null;
2292
2301
  created_at: string | null;
2293
2302
  id: string;
2294
2303
  name: string;
2295
2304
  parent_folder_id: string | null;
2296
2305
  updated_at: string | null;
2297
- user_id: string | null;
2306
+ user_id: string;
2298
2307
  };
2299
2308
  Insert: {
2300
- anon_user_id?: string | null;
2301
2309
  color?: string | null;
2302
2310
  created_at?: string | null;
2303
2311
  id?: string;
2304
2312
  name: string;
2305
2313
  parent_folder_id?: string | null;
2306
2314
  updated_at?: string | null;
2307
- user_id?: string | null;
2315
+ user_id: string;
2308
2316
  };
2309
2317
  Update: {
2310
- anon_user_id?: string | null;
2311
2318
  color?: string | null;
2312
2319
  created_at?: string | null;
2313
2320
  id?: string;
2314
2321
  name?: string;
2315
2322
  parent_folder_id?: string | null;
2316
2323
  updated_at?: string | null;
2317
- user_id?: string | null;
2324
+ user_id?: string;
2318
2325
  };
2319
2326
  Relationships: [
2320
- {
2321
- foreignKeyName: "user_bookmark_folders_anon_user_id_fkey";
2322
- columns: ["anon_user_id"];
2323
- isOneToOne: false;
2324
- referencedRelation: "users_anon";
2325
- referencedColumns: ["id"];
2326
- },
2327
2327
  {
2328
2328
  foreignKeyName: "user_bookmark_folders_parent_folder_id_fkey";
2329
2329
  columns: ["parent_folder_id"];
@@ -2342,7 +2342,6 @@ export type Database = {
2342
2342
  };
2343
2343
  user_bookmarks: {
2344
2344
  Row: {
2345
- anon_user_id: string | null;
2346
2345
  bookmark_folder_id: string | null;
2347
2346
  color: string | null;
2348
2347
  created_at: string | null;
@@ -2351,10 +2350,9 @@ export type Database = {
2351
2350
  target_id: string;
2352
2351
  target_type: Database["public"]["Enums"]["target_type"];
2353
2352
  updated_at: string | null;
2354
- user_id: string | null;
2353
+ user_id: string;
2355
2354
  };
2356
2355
  Insert: {
2357
- anon_user_id?: string | null;
2358
2356
  bookmark_folder_id?: string | null;
2359
2357
  color?: string | null;
2360
2358
  created_at?: string | null;
@@ -2363,10 +2361,9 @@ export type Database = {
2363
2361
  target_id: string;
2364
2362
  target_type: Database["public"]["Enums"]["target_type"];
2365
2363
  updated_at?: string | null;
2366
- user_id?: string | null;
2364
+ user_id: string;
2367
2365
  };
2368
2366
  Update: {
2369
- anon_user_id?: string | null;
2370
2367
  bookmark_folder_id?: string | null;
2371
2368
  color?: string | null;
2372
2369
  created_at?: string | null;
@@ -2375,16 +2372,9 @@ export type Database = {
2375
2372
  target_id?: string;
2376
2373
  target_type?: Database["public"]["Enums"]["target_type"];
2377
2374
  updated_at?: string | null;
2378
- user_id?: string | null;
2375
+ user_id?: string;
2379
2376
  };
2380
2377
  Relationships: [
2381
- {
2382
- foreignKeyName: "user_bookmarks_anon_user_id_fkey";
2383
- columns: ["anon_user_id"];
2384
- isOneToOne: false;
2385
- referencedRelation: "users_anon";
2386
- referencedColumns: ["id"];
2387
- },
2388
2378
  {
2389
2379
  foreignKeyName: "user_bookmarks_bookmark_folder_id_fkey";
2390
2380
  columns: ["bookmark_folder_id"];
@@ -2455,6 +2445,55 @@ export type Database = {
2455
2445
  }
2456
2446
  ];
2457
2447
  };
2448
+ user_current_selections: {
2449
+ Row: {
2450
+ created_at: string;
2451
+ id: string;
2452
+ selected_audio_version: string | null;
2453
+ selected_text_version: string | null;
2454
+ updated_at: string;
2455
+ user_id: string;
2456
+ };
2457
+ Insert: {
2458
+ created_at?: string;
2459
+ id?: string;
2460
+ selected_audio_version?: string | null;
2461
+ selected_text_version?: string | null;
2462
+ updated_at?: string;
2463
+ user_id: string;
2464
+ };
2465
+ Update: {
2466
+ created_at?: string;
2467
+ id?: string;
2468
+ selected_audio_version?: string | null;
2469
+ selected_text_version?: string | null;
2470
+ updated_at?: string;
2471
+ user_id?: string;
2472
+ };
2473
+ Relationships: [
2474
+ {
2475
+ foreignKeyName: "user_current_selections_selected_audio_version_fkey";
2476
+ columns: ["selected_audio_version"];
2477
+ isOneToOne: false;
2478
+ referencedRelation: "audio_versions";
2479
+ referencedColumns: ["id"];
2480
+ },
2481
+ {
2482
+ foreignKeyName: "user_current_selections_selected_text_version_fkey";
2483
+ columns: ["selected_text_version"];
2484
+ isOneToOne: false;
2485
+ referencedRelation: "text_versions";
2486
+ referencedColumns: ["id"];
2487
+ },
2488
+ {
2489
+ foreignKeyName: "user_current_selections_user_id_fkey";
2490
+ columns: ["user_id"];
2491
+ isOneToOne: true;
2492
+ referencedRelation: "users";
2493
+ referencedColumns: ["id"];
2494
+ }
2495
+ ];
2496
+ };
2458
2497
  user_custom_texts: {
2459
2498
  Row: {
2460
2499
  created_at: string | null;
@@ -2492,40 +2531,30 @@ export type Database = {
2492
2531
  };
2493
2532
  user_playlist_groups: {
2494
2533
  Row: {
2495
- anon_user_id: string | null;
2496
2534
  created_at: string | null;
2497
2535
  description: string | null;
2498
2536
  id: string;
2499
2537
  name: string;
2500
2538
  updated_at: string | null;
2501
- user_id: string | null;
2539
+ user_id: string;
2502
2540
  };
2503
2541
  Insert: {
2504
- anon_user_id?: string | null;
2505
2542
  created_at?: string | null;
2506
2543
  description?: string | null;
2507
2544
  id?: string;
2508
2545
  name: string;
2509
2546
  updated_at?: string | null;
2510
- user_id?: string | null;
2547
+ user_id: string;
2511
2548
  };
2512
2549
  Update: {
2513
- anon_user_id?: string | null;
2514
2550
  created_at?: string | null;
2515
2551
  description?: string | null;
2516
2552
  id?: string;
2517
2553
  name?: string;
2518
2554
  updated_at?: string | null;
2519
- user_id?: string | null;
2555
+ user_id?: string;
2520
2556
  };
2521
2557
  Relationships: [
2522
- {
2523
- foreignKeyName: "user_playlist_groups_anon_user_id_fkey";
2524
- columns: ["anon_user_id"];
2525
- isOneToOne: false;
2526
- referencedRelation: "users_anon";
2527
- referencedColumns: ["id"];
2528
- },
2529
2558
  {
2530
2559
  foreignKeyName: "user_playlist_groups_user_id_fkey";
2531
2560
  columns: ["user_id"];
@@ -2537,46 +2566,36 @@ export type Database = {
2537
2566
  };
2538
2567
  user_playlists: {
2539
2568
  Row: {
2540
- anon_user_id: string | null;
2541
2569
  created_at: string | null;
2542
2570
  id: string;
2543
2571
  image_id: string | null;
2544
2572
  name: string;
2545
2573
  playlist_id: string;
2546
2574
  updated_at: string | null;
2547
- user_id: string | null;
2575
+ user_id: string;
2548
2576
  user_playlist_group_id: string | null;
2549
2577
  };
2550
2578
  Insert: {
2551
- anon_user_id?: string | null;
2552
2579
  created_at?: string | null;
2553
2580
  id?: string;
2554
2581
  image_id?: string | null;
2555
2582
  name: string;
2556
2583
  playlist_id: string;
2557
2584
  updated_at?: string | null;
2558
- user_id?: string | null;
2585
+ user_id: string;
2559
2586
  user_playlist_group_id?: string | null;
2560
2587
  };
2561
2588
  Update: {
2562
- anon_user_id?: string | null;
2563
2589
  created_at?: string | null;
2564
2590
  id?: string;
2565
2591
  image_id?: string | null;
2566
2592
  name?: string;
2567
2593
  playlist_id?: string;
2568
2594
  updated_at?: string | null;
2569
- user_id?: string | null;
2595
+ user_id?: string;
2570
2596
  user_playlist_group_id?: string | null;
2571
2597
  };
2572
2598
  Relationships: [
2573
- {
2574
- foreignKeyName: "user_playlists_anon_user_id_fkey";
2575
- columns: ["anon_user_id"];
2576
- isOneToOne: false;
2577
- referencedRelation: "users_anon";
2578
- referencedColumns: ["id"];
2579
- },
2580
2599
  {
2581
2600
  foreignKeyName: "user_playlists_image_id_fkey";
2582
2601
  columns: ["image_id"];
@@ -2652,39 +2671,68 @@ export type Database = {
2652
2671
  }
2653
2672
  ];
2654
2673
  };
2655
- user_saved_image_sets: {
2674
+ user_saved_audio_versions: {
2656
2675
  Row: {
2657
- anon_user_id: string | null;
2676
+ audio_version_id: string;
2658
2677
  created_at: string | null;
2659
2678
  id: string;
2660
- set_id: string;
2661
2679
  updated_at: string | null;
2662
- user_id: string | null;
2680
+ user_id: string;
2663
2681
  };
2664
2682
  Insert: {
2665
- anon_user_id?: string | null;
2683
+ audio_version_id: string;
2666
2684
  created_at?: string | null;
2667
2685
  id?: string;
2668
- set_id: string;
2669
2686
  updated_at?: string | null;
2670
- user_id?: string | null;
2687
+ user_id: string;
2671
2688
  };
2672
2689
  Update: {
2673
- anon_user_id?: string | null;
2690
+ audio_version_id?: string;
2674
2691
  created_at?: string | null;
2675
2692
  id?: string;
2676
- set_id?: string;
2677
2693
  updated_at?: string | null;
2678
- user_id?: string | null;
2694
+ user_id?: string;
2679
2695
  };
2680
2696
  Relationships: [
2681
2697
  {
2682
- foreignKeyName: "user_saved_image_sets_anon_user_id_fkey";
2683
- columns: ["anon_user_id"];
2698
+ foreignKeyName: "user_saved_audio_versions_audio_version_id_fkey";
2699
+ columns: ["audio_version_id"];
2684
2700
  isOneToOne: false;
2685
- referencedRelation: "users_anon";
2701
+ referencedRelation: "audio_versions";
2686
2702
  referencedColumns: ["id"];
2687
2703
  },
2704
+ {
2705
+ foreignKeyName: "user_saved_audio_versions_user_id_fkey";
2706
+ columns: ["user_id"];
2707
+ isOneToOne: false;
2708
+ referencedRelation: "users";
2709
+ referencedColumns: ["id"];
2710
+ }
2711
+ ];
2712
+ };
2713
+ user_saved_image_sets: {
2714
+ Row: {
2715
+ created_at: string | null;
2716
+ id: string;
2717
+ set_id: string;
2718
+ updated_at: string | null;
2719
+ user_id: string;
2720
+ };
2721
+ Insert: {
2722
+ created_at?: string | null;
2723
+ id?: string;
2724
+ set_id: string;
2725
+ updated_at?: string | null;
2726
+ user_id: string;
2727
+ };
2728
+ Update: {
2729
+ created_at?: string | null;
2730
+ id?: string;
2731
+ set_id?: string;
2732
+ updated_at?: string | null;
2733
+ user_id?: string;
2734
+ };
2735
+ Relationships: [
2688
2736
  {
2689
2737
  foreignKeyName: "user_saved_image_sets_set_id_fkey";
2690
2738
  columns: ["set_id"];
@@ -2701,60 +2749,89 @@ export type Database = {
2701
2749
  }
2702
2750
  ];
2703
2751
  };
2704
- user_saved_versions: {
2752
+ user_saved_text_versions: {
2705
2753
  Row: {
2706
- anon_user_id: string | null;
2707
- audio_version_id: string | null;
2708
2754
  created_at: string | null;
2709
2755
  id: string;
2710
- text_version_id: string | null;
2756
+ text_version_id: string;
2711
2757
  updated_at: string | null;
2712
- user_id: string | null;
2758
+ user_id: string;
2713
2759
  };
2714
2760
  Insert: {
2715
- anon_user_id?: string | null;
2716
- audio_version_id?: string | null;
2717
2761
  created_at?: string | null;
2718
2762
  id?: string;
2719
- text_version_id?: string | null;
2763
+ text_version_id: string;
2720
2764
  updated_at?: string | null;
2721
- user_id?: string | null;
2765
+ user_id: string;
2722
2766
  };
2723
2767
  Update: {
2724
- anon_user_id?: string | null;
2725
- audio_version_id?: string | null;
2726
2768
  created_at?: string | null;
2727
2769
  id?: string;
2728
- text_version_id?: string | null;
2770
+ text_version_id?: string;
2729
2771
  updated_at?: string | null;
2730
- user_id?: string | null;
2772
+ user_id?: string;
2731
2773
  };
2732
2774
  Relationships: [
2733
2775
  {
2734
- foreignKeyName: "user_saved_versions_anon_user_id_fkey";
2735
- columns: ["anon_user_id"];
2776
+ foreignKeyName: "user_saved_text_versions_text_version_id_fkey";
2777
+ columns: ["text_version_id"];
2736
2778
  isOneToOne: false;
2737
- referencedRelation: "users_anon";
2779
+ referencedRelation: "text_versions";
2738
2780
  referencedColumns: ["id"];
2739
2781
  },
2740
2782
  {
2741
- foreignKeyName: "user_saved_versions_audio_version_id_fkey";
2742
- columns: ["audio_version_id"];
2783
+ foreignKeyName: "user_saved_text_versions_user_id_fkey";
2784
+ columns: ["user_id"];
2785
+ isOneToOne: false;
2786
+ referencedRelation: "users";
2787
+ referencedColumns: ["id"];
2788
+ }
2789
+ ];
2790
+ };
2791
+ user_version_selections: {
2792
+ Row: {
2793
+ created_at: string | null;
2794
+ current_audio_version_id: string | null;
2795
+ current_text_version_id: string | null;
2796
+ id: string;
2797
+ updated_at: string | null;
2798
+ user_id: string;
2799
+ };
2800
+ Insert: {
2801
+ created_at?: string | null;
2802
+ current_audio_version_id?: string | null;
2803
+ current_text_version_id?: string | null;
2804
+ id?: string;
2805
+ updated_at?: string | null;
2806
+ user_id: string;
2807
+ };
2808
+ Update: {
2809
+ created_at?: string | null;
2810
+ current_audio_version_id?: string | null;
2811
+ current_text_version_id?: string | null;
2812
+ id?: string;
2813
+ updated_at?: string | null;
2814
+ user_id?: string;
2815
+ };
2816
+ Relationships: [
2817
+ {
2818
+ foreignKeyName: "user_version_selections_current_audio_version_id_fkey";
2819
+ columns: ["current_audio_version_id"];
2743
2820
  isOneToOne: false;
2744
2821
  referencedRelation: "audio_versions";
2745
2822
  referencedColumns: ["id"];
2746
2823
  },
2747
2824
  {
2748
- foreignKeyName: "user_saved_versions_text_version_id_fkey";
2749
- columns: ["text_version_id"];
2825
+ foreignKeyName: "user_version_selections_current_text_version_id_fkey";
2826
+ columns: ["current_text_version_id"];
2750
2827
  isOneToOne: false;
2751
2828
  referencedRelation: "text_versions";
2752
2829
  referencedColumns: ["id"];
2753
2830
  },
2754
2831
  {
2755
- foreignKeyName: "user_saved_versions_user_id_fkey";
2832
+ foreignKeyName: "user_version_selections_user_id_fkey";
2756
2833
  columns: ["user_id"];
2757
- isOneToOne: false;
2834
+ isOneToOne: true;
2758
2835
  referencedRelation: "users";
2759
2836
  referencedColumns: ["id"];
2760
2837
  }
@@ -2762,69 +2839,37 @@ export type Database = {
2762
2839
  };
2763
2840
  users: {
2764
2841
  Row: {
2765
- auth_uid: string;
2766
2842
  created_at: string | null;
2767
- email: string;
2843
+ email: string | null;
2768
2844
  first_name: string | null;
2769
2845
  id: string;
2846
+ is_anonymous: boolean;
2770
2847
  last_name: string | null;
2771
2848
  phone_number: string | null;
2772
2849
  updated_at: string | null;
2773
2850
  };
2774
2851
  Insert: {
2775
- auth_uid: string;
2776
2852
  created_at?: string | null;
2777
- email: string;
2853
+ email?: string | null;
2778
2854
  first_name?: string | null;
2779
2855
  id?: string;
2856
+ is_anonymous?: boolean;
2780
2857
  last_name?: string | null;
2781
2858
  phone_number?: string | null;
2782
2859
  updated_at?: string | null;
2783
2860
  };
2784
2861
  Update: {
2785
- auth_uid?: string;
2786
2862
  created_at?: string | null;
2787
- email?: string;
2863
+ email?: string | null;
2788
2864
  first_name?: string | null;
2789
2865
  id?: string;
2866
+ is_anonymous?: boolean;
2790
2867
  last_name?: string | null;
2791
2868
  phone_number?: string | null;
2792
2869
  updated_at?: string | null;
2793
2870
  };
2794
2871
  Relationships: [];
2795
2872
  };
2796
- users_anon: {
2797
- Row: {
2798
- created_at: string | null;
2799
- device_id: string;
2800
- id: string;
2801
- updated_at: string | null;
2802
- user_id: string | null;
2803
- };
2804
- Insert: {
2805
- created_at?: string | null;
2806
- device_id: string;
2807
- id?: string;
2808
- updated_at?: string | null;
2809
- user_id?: string | null;
2810
- };
2811
- Update: {
2812
- created_at?: string | null;
2813
- device_id?: string;
2814
- id?: string;
2815
- updated_at?: string | null;
2816
- user_id?: string | null;
2817
- };
2818
- Relationships: [
2819
- {
2820
- foreignKeyName: "users_anon_user_id_fkey";
2821
- columns: ["user_id"];
2822
- isOneToOne: false;
2823
- referencedRelation: "users";
2824
- referencedColumns: ["id"];
2825
- }
2826
- ];
2827
- };
2828
2873
  verse_feedback: {
2829
2874
  Row: {
2830
2875
  actioned: Database["public"]["Enums"]["feedback_actioned"];
@@ -2898,7 +2943,6 @@ export type Database = {
2898
2943
  };
2899
2944
  verse_listens: {
2900
2945
  Row: {
2901
- anon_user_id: string;
2902
2946
  connectivity: Database["public"]["Enums"]["connectivity_type"] | null;
2903
2947
  created_at: string | null;
2904
2948
  device_id: string;
@@ -2907,10 +2951,10 @@ export type Database = {
2907
2951
  listened_at: string | null;
2908
2952
  location: unknown | null;
2909
2953
  session_id: string;
2954
+ user_id: string;
2910
2955
  verse_id: string;
2911
2956
  };
2912
2957
  Insert: {
2913
- anon_user_id: string;
2914
2958
  connectivity?: Database["public"]["Enums"]["connectivity_type"] | null;
2915
2959
  created_at?: string | null;
2916
2960
  device_id: string;
@@ -2919,10 +2963,10 @@ export type Database = {
2919
2963
  listened_at?: string | null;
2920
2964
  location?: unknown | null;
2921
2965
  session_id: string;
2966
+ user_id: string;
2922
2967
  verse_id: string;
2923
2968
  };
2924
2969
  Update: {
2925
- anon_user_id?: string;
2926
2970
  connectivity?: Database["public"]["Enums"]["connectivity_type"] | null;
2927
2971
  created_at?: string | null;
2928
2972
  device_id?: string;
@@ -2931,16 +2975,10 @@ export type Database = {
2931
2975
  listened_at?: string | null;
2932
2976
  location?: unknown | null;
2933
2977
  session_id?: string;
2978
+ user_id?: string;
2934
2979
  verse_id?: string;
2935
2980
  };
2936
2981
  Relationships: [
2937
- {
2938
- foreignKeyName: "verse_listens_anon_user_id_fkey";
2939
- columns: ["anon_user_id"];
2940
- isOneToOne: false;
2941
- referencedRelation: "users_anon";
2942
- referencedColumns: ["id"];
2943
- },
2944
2982
  {
2945
2983
  foreignKeyName: "verse_listens_language_entity_id_fkey";
2946
2984
  columns: ["language_entity_id"];
@@ -2955,6 +2993,13 @@ export type Database = {
2955
2993
  referencedRelation: "sessions";
2956
2994
  referencedColumns: ["id"];
2957
2995
  },
2996
+ {
2997
+ foreignKeyName: "verse_listens_user_id_fkey";
2998
+ columns: ["user_id"];
2999
+ isOneToOne: false;
3000
+ referencedRelation: "users";
3001
+ referencedColumns: ["id"];
3002
+ },
2958
3003
  {
2959
3004
  foreignKeyName: "verse_listens_verse_id_fkey";
2960
3005
  columns: ["verse_id"];
@@ -3104,6 +3149,55 @@ export type Database = {
3104
3149
  };
3105
3150
  Relationships: [];
3106
3151
  };
3152
+ passages_with_playlist_id: {
3153
+ Row: {
3154
+ book_id: string | null;
3155
+ created_at: string | null;
3156
+ created_by: string | null;
3157
+ end_verse_id: string | null;
3158
+ id: string | null;
3159
+ playlist_id: string | null;
3160
+ start_verse_id: string | null;
3161
+ updated_at: string | null;
3162
+ };
3163
+ Relationships: [
3164
+ {
3165
+ foreignKeyName: "passages_book_id_fkey";
3166
+ columns: ["book_id"];
3167
+ isOneToOne: false;
3168
+ referencedRelation: "books";
3169
+ referencedColumns: ["id"];
3170
+ },
3171
+ {
3172
+ foreignKeyName: "passages_created_by_fkey";
3173
+ columns: ["created_by"];
3174
+ isOneToOne: false;
3175
+ referencedRelation: "users";
3176
+ referencedColumns: ["id"];
3177
+ },
3178
+ {
3179
+ foreignKeyName: "passages_end_verse_id_fkey";
3180
+ columns: ["end_verse_id"];
3181
+ isOneToOne: false;
3182
+ referencedRelation: "verses";
3183
+ referencedColumns: ["id"];
3184
+ },
3185
+ {
3186
+ foreignKeyName: "passages_start_verse_id_fkey";
3187
+ columns: ["start_verse_id"];
3188
+ isOneToOne: false;
3189
+ referencedRelation: "verses";
3190
+ referencedColumns: ["id"];
3191
+ },
3192
+ {
3193
+ foreignKeyName: "playlist_items_playlist_id_fkey";
3194
+ columns: ["playlist_id"];
3195
+ isOneToOne: false;
3196
+ referencedRelation: "playlists";
3197
+ referencedColumns: ["id"];
3198
+ }
3199
+ ];
3200
+ };
3107
3201
  };
3108
3202
  Functions: {
3109
3203
  _postgis_deprecate: {