@capgo/cli 5.0.0-alpha.7 → 5.0.0

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 (59) hide show
  1. package/README.md +197 -41
  2. package/dist/index.js +329 -95820
  3. package/dist/package.json +83 -0
  4. package/package.json +48 -62
  5. package/.eslintignore +0 -4
  6. package/.github/FUNDING.yml +0 -1
  7. package/.github/workflows/build.yml +0 -46
  8. package/.github/workflows/bump_version.yml +0 -56
  9. package/.github/workflows/test.yml +0 -30
  10. package/.prettierignore +0 -6
  11. package/.vscode/launch.json +0 -23
  12. package/.vscode/settings.json +0 -5
  13. package/.vscode/tasks.json +0 -42
  14. package/CHANGELOG.md +0 -2861
  15. package/build.mjs +0 -23
  16. package/bun.lockb +0 -0
  17. package/capacitor.config.ts +0 -33
  18. package/crypto_explained.png +0 -0
  19. package/eslint.config.js +0 -3
  20. package/renovate.json +0 -23
  21. package/src/api/app.ts +0 -75
  22. package/src/api/channels.ts +0 -140
  23. package/src/api/crypto.ts +0 -121
  24. package/src/api/devices_override.ts +0 -41
  25. package/src/api/update.ts +0 -12
  26. package/src/api/versions.ts +0 -101
  27. package/src/app/add.ts +0 -191
  28. package/src/app/debug.ts +0 -220
  29. package/src/app/delete.ts +0 -106
  30. package/src/app/info.ts +0 -87
  31. package/src/app/list.ts +0 -67
  32. package/src/app/set.ts +0 -94
  33. package/src/bundle/check.ts +0 -42
  34. package/src/bundle/cleanup.ts +0 -127
  35. package/src/bundle/compatibility.ts +0 -70
  36. package/src/bundle/decrypt.ts +0 -65
  37. package/src/bundle/delete.ts +0 -53
  38. package/src/bundle/encrypt.ts +0 -69
  39. package/src/bundle/list.ts +0 -43
  40. package/src/bundle/unlink.ts +0 -86
  41. package/src/bundle/upload.ts +0 -516
  42. package/src/bundle/zip.ts +0 -139
  43. package/src/channel/add.ts +0 -73
  44. package/src/channel/currentBundle.ts +0 -72
  45. package/src/channel/delete.ts +0 -51
  46. package/src/channel/list.ts +0 -49
  47. package/src/channel/set.ts +0 -174
  48. package/src/index.ts +0 -290
  49. package/src/init.ts +0 -301
  50. package/src/key.ts +0 -158
  51. package/src/login.ts +0 -66
  52. package/src/types/capacitor__cli.d.ts +0 -6
  53. package/src/types/supabase.types.ts +0 -2471
  54. package/src/utils.ts +0 -738
  55. package/test/chunk_convert.ts +0 -28
  56. package/test/data.ts +0 -18769
  57. package/test/test_headers_rls.ts +0 -24
  58. package/test/test_semver.ts +0 -13
  59. package/tsconfig.json +0 -39
@@ -1,2471 +0,0 @@
1
- export type Json =
2
- | string
3
- | number
4
- | boolean
5
- | null
6
- | { [key: string]: Json | undefined }
7
- | Json[]
8
-
9
- export interface Database {
10
- public: {
11
- Tables: {
12
- apikeys: {
13
- Row: {
14
- created_at: string | null
15
- id: number
16
- key: string
17
- mode: Database['public']['Enums']['key_mode']
18
- updated_at: string | null
19
- user_id: string
20
- }
21
- Insert: {
22
- created_at?: string | null
23
- id?: number
24
- key: string
25
- mode: Database['public']['Enums']['key_mode']
26
- updated_at?: string | null
27
- user_id: string
28
- }
29
- Update: {
30
- created_at?: string | null
31
- id?: number
32
- key?: string
33
- mode?: Database['public']['Enums']['key_mode']
34
- updated_at?: string | null
35
- user_id?: string
36
- }
37
- Relationships: [
38
- {
39
- foreignKeyName: 'apikeys_user_id_fkey'
40
- columns: ['user_id']
41
- isOneToOne: false
42
- referencedRelation: 'users'
43
- referencedColumns: ['id']
44
- },
45
- ]
46
- }
47
- app_stats: {
48
- Row: {
49
- app_id: string
50
- bandwidth: number
51
- channels: number
52
- created_at: string | null
53
- date_id: string
54
- devices: number
55
- devices_real: number
56
- mlu: number
57
- mlu_real: number
58
- shared: number
59
- updated_at: string | null
60
- user_id: string
61
- version_size: number
62
- versions: number
63
- }
64
- Insert: {
65
- app_id: string
66
- bandwidth?: number
67
- channels?: number
68
- created_at?: string | null
69
- date_id?: string
70
- devices?: number
71
- devices_real?: number
72
- mlu?: number
73
- mlu_real?: number
74
- shared?: number
75
- updated_at?: string | null
76
- user_id: string
77
- version_size?: number
78
- versions?: number
79
- }
80
- Update: {
81
- app_id?: string
82
- bandwidth?: number
83
- channels?: number
84
- created_at?: string | null
85
- date_id?: string
86
- devices?: number
87
- devices_real?: number
88
- mlu?: number
89
- mlu_real?: number
90
- shared?: number
91
- updated_at?: string | null
92
- user_id?: string
93
- version_size?: number
94
- versions?: number
95
- }
96
- Relationships: [
97
- {
98
- foreignKeyName: 'app_stats_app_id_fkey'
99
- columns: ['app_id']
100
- isOneToOne: false
101
- referencedRelation: 'apps'
102
- referencedColumns: ['app_id']
103
- },
104
- {
105
- foreignKeyName: 'app_stats_user_id_fkey'
106
- columns: ['user_id']
107
- isOneToOne: false
108
- referencedRelation: 'users'
109
- referencedColumns: ['id']
110
- },
111
- ]
112
- }
113
- app_usage: {
114
- Row: {
115
- app_id: string
116
- bandwidth: number
117
- date: string | null
118
- fails: number
119
- get: number
120
- id: string
121
- install: number
122
- mau: number
123
- storage_added: number
124
- storage_deleted: number
125
- uninstall: number
126
- }
127
- Insert: {
128
- app_id: string
129
- bandwidth?: number
130
- date?: string | null
131
- fails?: number
132
- get?: number
133
- id?: string
134
- install?: number
135
- mau?: number
136
- storage_added?: number
137
- storage_deleted?: number
138
- uninstall?: number
139
- }
140
- Update: {
141
- app_id?: string
142
- bandwidth?: number
143
- date?: string | null
144
- fails?: number
145
- get?: number
146
- id?: string
147
- install?: number
148
- mau?: number
149
- storage_added?: number
150
- storage_deleted?: number
151
- uninstall?: number
152
- }
153
- Relationships: []
154
- }
155
- app_versions: {
156
- Row: {
157
- app_id: string
158
- bucket_id: string | null
159
- checksum: string | null
160
- created_at: string | null
161
- deleted: boolean
162
- external_url: string | null
163
- id: number
164
- minUpdateVersion: string | null
165
- name: string
166
- native_packages: Json[] | null
167
- owner_org: string
168
- r2_path: string | null
169
- session_key: string | null
170
- storage_provider: string
171
- updated_at: string | null
172
- user_id: string | null
173
- }
174
- Insert: {
175
- app_id: string
176
- bucket_id?: string | null
177
- checksum?: string | null
178
- created_at?: string | null
179
- deleted?: boolean
180
- external_url?: string | null
181
- id?: number
182
- minUpdateVersion?: string | null
183
- name: string
184
- native_packages?: Json[] | null
185
- owner_org: string
186
- r2_path?: string | null
187
- session_key?: string | null
188
- storage_provider?: string
189
- updated_at?: string | null
190
- user_id?: string | null
191
- }
192
- Update: {
193
- app_id?: string
194
- bucket_id?: string | null
195
- checksum?: string | null
196
- created_at?: string | null
197
- deleted?: boolean
198
- external_url?: string | null
199
- id?: number
200
- minUpdateVersion?: string | null
201
- name?: string
202
- native_packages?: Json[] | null
203
- owner_org?: string
204
- r2_path?: string | null
205
- session_key?: string | null
206
- storage_provider?: string
207
- updated_at?: string | null
208
- user_id?: string | null
209
- }
210
- Relationships: [
211
- {
212
- foreignKeyName: 'app_versions_app_id_fkey'
213
- columns: ['app_id']
214
- isOneToOne: false
215
- referencedRelation: 'apps'
216
- referencedColumns: ['app_id']
217
- },
218
- {
219
- foreignKeyName: 'owner_org_id_fkey'
220
- columns: ['owner_org']
221
- isOneToOne: false
222
- referencedRelation: 'orgs'
223
- referencedColumns: ['id']
224
- },
225
- ]
226
- }
227
- app_versions_meta: {
228
- Row: {
229
- app_id: string
230
- checksum: string
231
- created_at: string | null
232
- devices: number | null
233
- fails: number | null
234
- id: number
235
- installs: number | null
236
- owner_org: string
237
- size: number
238
- uninstalls: number | null
239
- updated_at: string | null
240
- }
241
- Insert: {
242
- app_id: string
243
- checksum: string
244
- created_at?: string | null
245
- devices?: number | null
246
- fails?: number | null
247
- id?: number
248
- installs?: number | null
249
- owner_org: string
250
- size: number
251
- uninstalls?: number | null
252
- updated_at?: string | null
253
- }
254
- Update: {
255
- app_id?: string
256
- checksum?: string
257
- created_at?: string | null
258
- devices?: number | null
259
- fails?: number | null
260
- id?: number
261
- installs?: number | null
262
- owner_org?: string
263
- size?: number
264
- uninstalls?: number | null
265
- updated_at?: string | null
266
- }
267
- Relationships: [
268
- {
269
- foreignKeyName: 'app_versions_meta_app_id_fkey'
270
- columns: ['app_id']
271
- isOneToOne: false
272
- referencedRelation: 'apps'
273
- referencedColumns: ['app_id']
274
- },
275
- {
276
- foreignKeyName: 'app_versions_meta_id_fkey'
277
- columns: ['id']
278
- isOneToOne: true
279
- referencedRelation: 'app_versions'
280
- referencedColumns: ['id']
281
- },
282
- {
283
- foreignKeyName: 'owner_org_id_fkey'
284
- columns: ['owner_org']
285
- isOneToOne: false
286
- referencedRelation: 'orgs'
287
- referencedColumns: ['id']
288
- },
289
- ]
290
- }
291
- apps: {
292
- Row: {
293
- app_id: string
294
- created_at: string | null
295
- icon_url: string
296
- id: string | null
297
- last_version: string | null
298
- name: string | null
299
- owner_org: string
300
- retention: number
301
- updated_at: string | null
302
- user_id: string | null
303
- }
304
- Insert: {
305
- app_id: string
306
- created_at?: string | null
307
- icon_url: string
308
- id?: string | null
309
- last_version?: string | null
310
- name?: string | null
311
- owner_org: string
312
- retention?: number
313
- updated_at?: string | null
314
- user_id?: string | null
315
- }
316
- Update: {
317
- app_id?: string
318
- created_at?: string | null
319
- icon_url?: string
320
- id?: string | null
321
- last_version?: string | null
322
- name?: string | null
323
- owner_org?: string
324
- retention?: number
325
- updated_at?: string | null
326
- user_id?: string | null
327
- }
328
- Relationships: [
329
- {
330
- foreignKeyName: 'apps_user_id_fkey'
331
- columns: ['user_id']
332
- isOneToOne: false
333
- referencedRelation: 'users'
334
- referencedColumns: ['id']
335
- },
336
- {
337
- foreignKeyName: 'owner_org_id_fkey'
338
- columns: ['owner_org']
339
- isOneToOne: false
340
- referencedRelation: 'orgs'
341
- referencedColumns: ['id']
342
- },
343
- ]
344
- }
345
- auth_uid: {
346
- Row: {
347
- uid: string | null
348
- }
349
- Insert: {
350
- uid?: string | null
351
- }
352
- Update: {
353
- uid?: string | null
354
- }
355
- Relationships: []
356
- }
357
- bandwidth_usage: {
358
- Row: {
359
- app_id: string
360
- device_id: string
361
- file_size: number
362
- id: number
363
- timestamp: string
364
- }
365
- Insert: {
366
- app_id: string
367
- device_id: string
368
- file_size: number
369
- id?: number
370
- timestamp?: string
371
- }
372
- Update: {
373
- app_id?: string
374
- device_id?: string
375
- file_size?: number
376
- id?: number
377
- timestamp?: string
378
- }
379
- Relationships: []
380
- }
381
- channel_devices: {
382
- Row: {
383
- app_id: string
384
- channel_id: number
385
- created_at: string | null
386
- device_id: string
387
- id: number
388
- owner_org: string
389
- updated_at: string
390
- }
391
- Insert: {
392
- app_id: string
393
- channel_id: number
394
- created_at?: string | null
395
- device_id: string
396
- id?: number
397
- owner_org: string
398
- updated_at?: string
399
- }
400
- Update: {
401
- app_id?: string
402
- channel_id?: number
403
- created_at?: string | null
404
- device_id?: string
405
- id?: number
406
- owner_org?: string
407
- updated_at?: string
408
- }
409
- Relationships: [
410
- {
411
- foreignKeyName: 'channel_devices_app_id_fkey'
412
- columns: ['app_id']
413
- isOneToOne: false
414
- referencedRelation: 'apps'
415
- referencedColumns: ['app_id']
416
- },
417
- {
418
- foreignKeyName: 'channel_devices_channel_id_fkey'
419
- columns: ['channel_id']
420
- isOneToOne: false
421
- referencedRelation: 'channels'
422
- referencedColumns: ['id']
423
- },
424
- {
425
- foreignKeyName: 'owner_org_id_fkey'
426
- columns: ['owner_org']
427
- isOneToOne: false
428
- referencedRelation: 'orgs'
429
- referencedColumns: ['id']
430
- },
431
- ]
432
- }
433
- channels: {
434
- Row: {
435
- allow_dev: boolean
436
- allow_device_self_set: boolean
437
- allow_emulator: boolean
438
- android: boolean
439
- app_id: string
440
- beta: boolean
441
- created_at: string
442
- created_by: string | null
443
- disableAutoUpdate: Database['public']['Enums']['disable_update']
444
- disableAutoUpdateUnderNative: boolean
445
- enable_progressive_deploy: boolean
446
- enableAbTesting: boolean
447
- id: number
448
- ios: boolean
449
- name: string
450
- owner_org: string
451
- public: boolean
452
- secondaryVersionPercentage: number
453
- secondVersion: number | null
454
- updated_at: string
455
- version: number
456
- }
457
- Insert: {
458
- allow_dev?: boolean
459
- allow_device_self_set?: boolean
460
- allow_emulator?: boolean
461
- android?: boolean
462
- app_id: string
463
- beta?: boolean
464
- created_at?: string
465
- created_by?: string | null
466
- disableAutoUpdate?: Database['public']['Enums']['disable_update']
467
- disableAutoUpdateUnderNative?: boolean
468
- enable_progressive_deploy?: boolean
469
- enableAbTesting?: boolean
470
- id?: number
471
- ios?: boolean
472
- name: string
473
- owner_org: string
474
- public?: boolean
475
- secondaryVersionPercentage?: number
476
- secondVersion?: number | null
477
- updated_at?: string
478
- version: number
479
- }
480
- Update: {
481
- allow_dev?: boolean
482
- allow_device_self_set?: boolean
483
- allow_emulator?: boolean
484
- android?: boolean
485
- app_id?: string
486
- beta?: boolean
487
- created_at?: string
488
- created_by?: string | null
489
- disableAutoUpdate?: Database['public']['Enums']['disable_update']
490
- disableAutoUpdateUnderNative?: boolean
491
- enable_progressive_deploy?: boolean
492
- enableAbTesting?: boolean
493
- id?: number
494
- ios?: boolean
495
- name?: string
496
- owner_org?: string
497
- public?: boolean
498
- secondaryVersionPercentage?: number
499
- secondVersion?: number | null
500
- updated_at?: string
501
- version?: number
502
- }
503
- Relationships: [
504
- {
505
- foreignKeyName: 'channels_app_id_fkey'
506
- columns: ['app_id']
507
- isOneToOne: false
508
- referencedRelation: 'apps'
509
- referencedColumns: ['app_id']
510
- },
511
- {
512
- foreignKeyName: 'channels_secondVersion_fkey'
513
- columns: ['secondVersion']
514
- isOneToOne: false
515
- referencedRelation: 'app_versions'
516
- referencedColumns: ['id']
517
- },
518
- {
519
- foreignKeyName: 'channels_version_fkey'
520
- columns: ['version']
521
- isOneToOne: false
522
- referencedRelation: 'app_versions'
523
- referencedColumns: ['id']
524
- },
525
- {
526
- foreignKeyName: 'owner_org_id_fkey'
527
- columns: ['owner_org']
528
- isOneToOne: false
529
- referencedRelation: 'orgs'
530
- referencedColumns: ['id']
531
- },
532
- ]
533
- }
534
- clickhouse_app_usage: {
535
- Row: {
536
- app_id: string | null
537
- bandwidth: number | null
538
- date: string | null
539
- fail: number | null
540
- get: number | null
541
- install: number | null
542
- mau: number | null
543
- storage_added: number | null
544
- storage_deleted: number | null
545
- uninstall: number | null
546
- }
547
- Insert: {
548
- app_id?: string | null
549
- bandwidth?: number | null
550
- date?: string | null
551
- fail?: number | null
552
- get?: number | null
553
- install?: number | null
554
- mau?: number | null
555
- storage_added?: number | null
556
- storage_deleted?: number | null
557
- uninstall?: number | null
558
- }
559
- Update: {
560
- app_id?: string | null
561
- bandwidth?: number | null
562
- date?: string | null
563
- fail?: number | null
564
- get?: number | null
565
- install?: number | null
566
- mau?: number | null
567
- storage_added?: number | null
568
- storage_deleted?: number | null
569
- uninstall?: number | null
570
- }
571
- Relationships: []
572
- }
573
- clickhouse_app_usage_parm: {
574
- Row: {
575
- _app_list: string | null
576
- _end_date: string | null
577
- _start_date: string | null
578
- app_id: string | null
579
- bandwidth: number | null
580
- date: string | null
581
- fail: number | null
582
- get: number | null
583
- install: number | null
584
- mau: number | null
585
- storage_added: number | null
586
- storage_deleted: number | null
587
- uninstall: number | null
588
- }
589
- Insert: {
590
- _app_list?: string | null
591
- _end_date?: string | null
592
- _start_date?: string | null
593
- app_id?: string | null
594
- bandwidth?: number | null
595
- date?: string | null
596
- fail?: number | null
597
- get?: number | null
598
- install?: number | null
599
- mau?: number | null
600
- storage_added?: number | null
601
- storage_deleted?: number | null
602
- uninstall?: number | null
603
- }
604
- Update: {
605
- _app_list?: string | null
606
- _end_date?: string | null
607
- _start_date?: string | null
608
- app_id?: string | null
609
- bandwidth?: number | null
610
- date?: string | null
611
- fail?: number | null
612
- get?: number | null
613
- install?: number | null
614
- mau?: number | null
615
- storage_added?: number | null
616
- storage_deleted?: number | null
617
- uninstall?: number | null
618
- }
619
- Relationships: []
620
- }
621
- clickhouse_devices: {
622
- Row: {
623
- app_id: string | null
624
- created_at: string | null
625
- custom_id: string | null
626
- device_id: string | null
627
- is_emulator: boolean | null
628
- is_prod: boolean | null
629
- os_version: string | null
630
- platform: string | null
631
- plugin_version: string | null
632
- updated_at: string | null
633
- version: number | null
634
- version_build: string | null
635
- }
636
- Insert: {
637
- app_id?: string | null
638
- created_at?: string | null
639
- custom_id?: string | null
640
- device_id?: string | null
641
- is_emulator?: boolean | null
642
- is_prod?: boolean | null
643
- os_version?: string | null
644
- platform?: string | null
645
- plugin_version?: string | null
646
- updated_at?: string | null
647
- version?: number | null
648
- version_build?: string | null
649
- }
650
- Update: {
651
- app_id?: string | null
652
- created_at?: string | null
653
- custom_id?: string | null
654
- device_id?: string | null
655
- is_emulator?: boolean | null
656
- is_prod?: boolean | null
657
- os_version?: string | null
658
- platform?: string | null
659
- plugin_version?: string | null
660
- updated_at?: string | null
661
- version?: number | null
662
- version_build?: string | null
663
- }
664
- Relationships: []
665
- }
666
- clickhouse_logs: {
667
- Row: {
668
- action: string | null
669
- app_id: string | null
670
- created_at: string | null
671
- device_id: string | null
672
- platform: string | null
673
- version: number | null
674
- version_build: string | null
675
- }
676
- Insert: {
677
- action?: string | null
678
- app_id?: string | null
679
- created_at?: string | null
680
- device_id?: string | null
681
- platform?: string | null
682
- version?: number | null
683
- version_build?: string | null
684
- }
685
- Update: {
686
- action?: string | null
687
- app_id?: string | null
688
- created_at?: string | null
689
- device_id?: string | null
690
- platform?: string | null
691
- version?: number | null
692
- version_build?: string | null
693
- }
694
- Relationships: []
695
- }
696
- cycle_info: {
697
- Row: {
698
- subscription_anchor_end: string | null
699
- subscription_anchor_start: string | null
700
- }
701
- Insert: {
702
- subscription_anchor_end?: string | null
703
- subscription_anchor_start?: string | null
704
- }
705
- Update: {
706
- subscription_anchor_end?: string | null
707
- subscription_anchor_start?: string | null
708
- }
709
- Relationships: []
710
- }
711
- daily_bandwidth: {
712
- Row: {
713
- app_id: string
714
- bandwidth: number
715
- date: string
716
- id: number
717
- }
718
- Insert: {
719
- app_id: string
720
- bandwidth: number
721
- date: string
722
- id?: number
723
- }
724
- Update: {
725
- app_id?: string
726
- bandwidth?: number
727
- date?: string
728
- id?: number
729
- }
730
- Relationships: []
731
- }
732
- daily_mau: {
733
- Row: {
734
- app_id: string
735
- date: string
736
- id: number
737
- mau: number
738
- }
739
- Insert: {
740
- app_id: string
741
- date: string
742
- id?: number
743
- mau: number
744
- }
745
- Update: {
746
- app_id?: string
747
- date?: string
748
- id?: number
749
- mau?: number
750
- }
751
- Relationships: []
752
- }
753
- daily_storage: {
754
- Row: {
755
- app_id: string
756
- date: string
757
- id: number
758
- storage: number
759
- }
760
- Insert: {
761
- app_id: string
762
- date: string
763
- id?: number
764
- storage: number
765
- }
766
- Update: {
767
- app_id?: string
768
- date?: string
769
- id?: number
770
- storage?: number
771
- }
772
- Relationships: []
773
- }
774
- daily_version: {
775
- Row: {
776
- app_id: string
777
- date: string
778
- fail: number | null
779
- get: number | null
780
- install: number | null
781
- uninstall: number | null
782
- version: number
783
- }
784
- Insert: {
785
- app_id: string
786
- date: string
787
- fail?: number | null
788
- get?: number | null
789
- install?: number | null
790
- uninstall?: number | null
791
- version: number
792
- }
793
- Update: {
794
- app_id?: string
795
- date?: string
796
- fail?: number | null
797
- get?: number | null
798
- install?: number | null
799
- uninstall?: number | null
800
- version?: number
801
- }
802
- Relationships: []
803
- }
804
- deleted_account: {
805
- Row: {
806
- created_at: string | null
807
- email: string
808
- id: string
809
- }
810
- Insert: {
811
- created_at?: string | null
812
- email?: string
813
- id?: string
814
- }
815
- Update: {
816
- created_at?: string | null
817
- email?: string
818
- id?: string
819
- }
820
- Relationships: []
821
- }
822
- device_usage: {
823
- Row: {
824
- app_id: string
825
- device_id: string
826
- id: number
827
- timestamp: string
828
- }
829
- Insert: {
830
- app_id: string
831
- device_id: string
832
- id?: number
833
- timestamp?: string
834
- }
835
- Update: {
836
- app_id?: string
837
- device_id?: string
838
- id?: number
839
- timestamp?: string
840
- }
841
- Relationships: []
842
- }
843
- devices: {
844
- Row: {
845
- app_id: string
846
- created_at: string
847
- custom_id: string
848
- device_id: string
849
- is_emulator: boolean | null
850
- is_prod: boolean | null
851
- os_version: string | null
852
- platform: Database['public']['Enums']['platform_os'] | null
853
- plugin_version: string
854
- updated_at: string
855
- version: number
856
- version_build: string | null
857
- }
858
- Insert: {
859
- app_id: string
860
- created_at: string
861
- custom_id?: string
862
- device_id: string
863
- is_emulator?: boolean | null
864
- is_prod?: boolean | null
865
- os_version?: string | null
866
- platform?: Database['public']['Enums']['platform_os'] | null
867
- plugin_version?: string
868
- updated_at: string
869
- version: number
870
- version_build?: string | null
871
- }
872
- Update: {
873
- app_id?: string
874
- created_at?: string
875
- custom_id?: string
876
- device_id?: string
877
- is_emulator?: boolean | null
878
- is_prod?: boolean | null
879
- os_version?: string | null
880
- platform?: Database['public']['Enums']['platform_os'] | null
881
- plugin_version?: string
882
- updated_at?: string
883
- version?: number
884
- version_build?: string | null
885
- }
886
- Relationships: []
887
- }
888
- devices_override: {
889
- Row: {
890
- app_id: string
891
- created_at: string | null
892
- device_id: string
893
- id: number
894
- owner_org: string
895
- updated_at: string | null
896
- version: number
897
- }
898
- Insert: {
899
- app_id: string
900
- created_at?: string | null
901
- device_id: string
902
- id?: number
903
- owner_org: string
904
- updated_at?: string | null
905
- version: number
906
- }
907
- Update: {
908
- app_id?: string
909
- created_at?: string | null
910
- device_id?: string
911
- id?: number
912
- owner_org?: string
913
- updated_at?: string | null
914
- version?: number
915
- }
916
- Relationships: [
917
- {
918
- foreignKeyName: 'devices_override_app_id_fkey'
919
- columns: ['app_id']
920
- isOneToOne: false
921
- referencedRelation: 'apps'
922
- referencedColumns: ['app_id']
923
- },
924
- {
925
- foreignKeyName: 'devices_override_version_fkey'
926
- columns: ['version']
927
- isOneToOne: false
928
- referencedRelation: 'app_versions'
929
- referencedColumns: ['id']
930
- },
931
- {
932
- foreignKeyName: 'owner_org_id_fkey'
933
- columns: ['owner_org']
934
- isOneToOne: false
935
- referencedRelation: 'orgs'
936
- referencedColumns: ['id']
937
- },
938
- ]
939
- }
940
- global_stats: {
941
- Row: {
942
- apps: number
943
- apps_active: number | null
944
- created_at: string | null
945
- date_id: string
946
- need_upgrade: number | null
947
- not_paying: number | null
948
- onboarded: number | null
949
- paying: number | null
950
- paying_monthly: number | null
951
- paying_yearly: number | null
952
- stars: number
953
- trial: number | null
954
- updates: number
955
- users: number | null
956
- users_active: number | null
957
- }
958
- Insert: {
959
- apps: number
960
- apps_active?: number | null
961
- created_at?: string | null
962
- date_id: string
963
- need_upgrade?: number | null
964
- not_paying?: number | null
965
- onboarded?: number | null
966
- paying?: number | null
967
- paying_monthly?: number | null
968
- paying_yearly?: number | null
969
- stars: number
970
- trial?: number | null
971
- updates: number
972
- users?: number | null
973
- users_active?: number | null
974
- }
975
- Update: {
976
- apps?: number
977
- apps_active?: number | null
978
- created_at?: string | null
979
- date_id?: string
980
- need_upgrade?: number | null
981
- not_paying?: number | null
982
- onboarded?: number | null
983
- paying?: number | null
984
- paying_monthly?: number | null
985
- paying_yearly?: number | null
986
- stars?: number
987
- trial?: number | null
988
- updates?: number
989
- users?: number | null
990
- users_active?: number | null
991
- }
992
- Relationships: []
993
- }
994
- job_queue: {
995
- Row: {
996
- created_at: string | null
997
- extra_info: Json
998
- function_name: string | null
999
- function_type: string | null
1000
- job_id: number
1001
- job_type: string
1002
- payload: string
1003
- request_id: number | null
1004
- status: Database['public']['Enums']['queue_job_status']
1005
- }
1006
- Insert: {
1007
- created_at?: string | null
1008
- extra_info?: Json
1009
- function_name?: string | null
1010
- function_type?: string | null
1011
- job_id?: number
1012
- job_type: string
1013
- payload: string
1014
- request_id?: number | null
1015
- status?: Database['public']['Enums']['queue_job_status']
1016
- }
1017
- Update: {
1018
- created_at?: string | null
1019
- extra_info?: Json
1020
- function_name?: string | null
1021
- function_type?: string | null
1022
- job_id?: number
1023
- job_type?: string
1024
- payload?: string
1025
- request_id?: number | null
1026
- status?: Database['public']['Enums']['queue_job_status']
1027
- }
1028
- Relationships: []
1029
- }
1030
- notifications: {
1031
- Row: {
1032
- created_at: string | null
1033
- id: string
1034
- last_send_at: string
1035
- owner_org: string
1036
- total_send: number
1037
- updated_at: string | null
1038
- }
1039
- Insert: {
1040
- created_at?: string | null
1041
- id: string
1042
- last_send_at?: string
1043
- owner_org: string
1044
- total_send?: number
1045
- updated_at?: string | null
1046
- }
1047
- Update: {
1048
- created_at?: string | null
1049
- id?: string
1050
- last_send_at?: string
1051
- owner_org?: string
1052
- total_send?: number
1053
- updated_at?: string | null
1054
- }
1055
- Relationships: [
1056
- {
1057
- foreignKeyName: 'owner_org_id_fkey'
1058
- columns: ['owner_org']
1059
- isOneToOne: false
1060
- referencedRelation: 'orgs'
1061
- referencedColumns: ['id']
1062
- },
1063
- ]
1064
- }
1065
- org_users: {
1066
- Row: {
1067
- app_id: string | null
1068
- channel_id: number | null
1069
- created_at: string | null
1070
- id: number
1071
- org_id: string
1072
- updated_at: string | null
1073
- user_id: string
1074
- user_right: Database['public']['Enums']['user_min_right'] | null
1075
- }
1076
- Insert: {
1077
- app_id?: string | null
1078
- channel_id?: number | null
1079
- created_at?: string | null
1080
- id?: number
1081
- org_id: string
1082
- updated_at?: string | null
1083
- user_id: string
1084
- user_right?: Database['public']['Enums']['user_min_right'] | null
1085
- }
1086
- Update: {
1087
- app_id?: string | null
1088
- channel_id?: number | null
1089
- created_at?: string | null
1090
- id?: number
1091
- org_id?: string
1092
- updated_at?: string | null
1093
- user_id?: string
1094
- user_right?: Database['public']['Enums']['user_min_right'] | null
1095
- }
1096
- Relationships: [
1097
- {
1098
- foreignKeyName: 'org_users_app_id_fkey'
1099
- columns: ['app_id']
1100
- isOneToOne: false
1101
- referencedRelation: 'apps'
1102
- referencedColumns: ['app_id']
1103
- },
1104
- {
1105
- foreignKeyName: 'org_users_channel_id_fkey'
1106
- columns: ['channel_id']
1107
- isOneToOne: false
1108
- referencedRelation: 'channels'
1109
- referencedColumns: ['id']
1110
- },
1111
- {
1112
- foreignKeyName: 'org_users_org_id_fkey'
1113
- columns: ['org_id']
1114
- isOneToOne: false
1115
- referencedRelation: 'orgs'
1116
- referencedColumns: ['id']
1117
- },
1118
- {
1119
- foreignKeyName: 'org_users_user_id_fkey'
1120
- columns: ['user_id']
1121
- isOneToOne: false
1122
- referencedRelation: 'users'
1123
- referencedColumns: ['id']
1124
- },
1125
- ]
1126
- }
1127
- orgs: {
1128
- Row: {
1129
- created_at: string | null
1130
- created_by: string
1131
- customer_id: string | null
1132
- id: string
1133
- logo: string | null
1134
- management_email: string
1135
- name: string
1136
- updated_at: string | null
1137
- }
1138
- Insert: {
1139
- created_at?: string | null
1140
- created_by: string
1141
- customer_id?: string | null
1142
- id?: string
1143
- logo?: string | null
1144
- management_email: string
1145
- name: string
1146
- updated_at?: string | null
1147
- }
1148
- Update: {
1149
- created_at?: string | null
1150
- created_by?: string
1151
- customer_id?: string | null
1152
- id?: string
1153
- logo?: string | null
1154
- management_email?: string
1155
- name?: string
1156
- updated_at?: string | null
1157
- }
1158
- Relationships: [
1159
- {
1160
- foreignKeyName: 'orgs_created_by_fkey'
1161
- columns: ['created_by']
1162
- isOneToOne: false
1163
- referencedRelation: 'users'
1164
- referencedColumns: ['id']
1165
- },
1166
- {
1167
- foreignKeyName: 'orgs_customer_id_fkey'
1168
- columns: ['customer_id']
1169
- isOneToOne: true
1170
- referencedRelation: 'stripe_info'
1171
- referencedColumns: ['customer_id']
1172
- },
1173
- ]
1174
- }
1175
- plans: {
1176
- Row: {
1177
- bandwidth: number
1178
- bandwidth_unit: number | null
1179
- created_at: string
1180
- description: string
1181
- id: string
1182
- market_desc: string | null
1183
- mau: number
1184
- mau_unit: number | null
1185
- name: string
1186
- price_m: number
1187
- price_m_bandwidth_id: string | null
1188
- price_m_id: string
1189
- price_m_mau_id: string | null
1190
- price_m_storage_id: string | null
1191
- price_y: number
1192
- price_y_id: string
1193
- storage: number
1194
- storage_unit: number | null
1195
- stripe_id: string
1196
- updated_at: string
1197
- }
1198
- Insert: {
1199
- bandwidth: number
1200
- bandwidth_unit?: number | null
1201
- created_at?: string
1202
- description?: string
1203
- id?: string
1204
- market_desc?: string | null
1205
- mau?: number
1206
- mau_unit?: number | null
1207
- name?: string
1208
- price_m?: number
1209
- price_m_bandwidth_id?: string | null
1210
- price_m_id: string
1211
- price_m_mau_id?: string | null
1212
- price_m_storage_id?: string | null
1213
- price_y?: number
1214
- price_y_id: string
1215
- storage: number
1216
- storage_unit?: number | null
1217
- stripe_id?: string
1218
- updated_at?: string
1219
- }
1220
- Update: {
1221
- bandwidth?: number
1222
- bandwidth_unit?: number | null
1223
- created_at?: string
1224
- description?: string
1225
- id?: string
1226
- market_desc?: string | null
1227
- mau?: number
1228
- mau_unit?: number | null
1229
- name?: string
1230
- price_m?: number
1231
- price_m_bandwidth_id?: string | null
1232
- price_m_id?: string
1233
- price_m_mau_id?: string | null
1234
- price_m_storage_id?: string | null
1235
- price_y?: number
1236
- price_y_id?: string
1237
- storage?: number
1238
- storage_unit?: number | null
1239
- stripe_id?: string
1240
- updated_at?: string
1241
- }
1242
- Relationships: []
1243
- }
1244
- stats: {
1245
- Row: {
1246
- action: string
1247
- app_id: string
1248
- created_at: string
1249
- device_id: string
1250
- platform: Database['public']['Enums']['platform_os']
1251
- version: number
1252
- version_build: string
1253
- }
1254
- Insert: {
1255
- action: string
1256
- app_id: string
1257
- created_at: string
1258
- device_id: string
1259
- platform: Database['public']['Enums']['platform_os']
1260
- version: number
1261
- version_build: string
1262
- }
1263
- Update: {
1264
- action?: string
1265
- app_id?: string
1266
- created_at?: string
1267
- device_id?: string
1268
- platform?: Database['public']['Enums']['platform_os']
1269
- version?: number
1270
- version_build?: string
1271
- }
1272
- Relationships: []
1273
- }
1274
- storage_usage: {
1275
- Row: {
1276
- app_id: string
1277
- device_id: string
1278
- file_size: number
1279
- id: number
1280
- timestamp: string
1281
- }
1282
- Insert: {
1283
- app_id: string
1284
- device_id: string
1285
- file_size: number
1286
- id?: number
1287
- timestamp?: string
1288
- }
1289
- Update: {
1290
- app_id?: string
1291
- device_id?: string
1292
- file_size?: number
1293
- id?: number
1294
- timestamp?: string
1295
- }
1296
- Relationships: []
1297
- }
1298
- stripe_info: {
1299
- Row: {
1300
- created_at: string
1301
- customer_id: string
1302
- is_good_plan: boolean | null
1303
- plan_usage: number | null
1304
- price_id: string | null
1305
- product_id: string
1306
- status: Database['public']['Enums']['stripe_status'] | null
1307
- subscription_anchor_end: string
1308
- subscription_anchor_start: string
1309
- subscription_id: string | null
1310
- subscription_metered: Json
1311
- trial_at: string
1312
- updated_at: string
1313
- }
1314
- Insert: {
1315
- created_at?: string
1316
- customer_id: string
1317
- is_good_plan?: boolean | null
1318
- plan_usage?: number | null
1319
- price_id?: string | null
1320
- product_id?: string
1321
- status?: Database['public']['Enums']['stripe_status'] | null
1322
- subscription_anchor_end?: string
1323
- subscription_anchor_start?: string
1324
- subscription_id?: string | null
1325
- subscription_metered?: Json
1326
- trial_at?: string
1327
- updated_at?: string
1328
- }
1329
- Update: {
1330
- created_at?: string
1331
- customer_id?: string
1332
- is_good_plan?: boolean | null
1333
- plan_usage?: number | null
1334
- price_id?: string | null
1335
- product_id?: string
1336
- status?: Database['public']['Enums']['stripe_status'] | null
1337
- subscription_anchor_end?: string
1338
- subscription_anchor_start?: string
1339
- subscription_id?: string | null
1340
- subscription_metered?: Json
1341
- trial_at?: string
1342
- updated_at?: string
1343
- }
1344
- Relationships: [
1345
- {
1346
- foreignKeyName: 'stripe_info_product_id_fkey'
1347
- columns: ['product_id']
1348
- isOneToOne: false
1349
- referencedRelation: 'plans'
1350
- referencedColumns: ['stripe_id']
1351
- },
1352
- ]
1353
- }
1354
- users: {
1355
- Row: {
1356
- billing_email: string | null
1357
- country: string | null
1358
- created_at: string | null
1359
- customer_id: string | null
1360
- email: string
1361
- enableNotifications: boolean
1362
- first_name: string | null
1363
- id: string
1364
- image_url: string | null
1365
- last_name: string | null
1366
- legalAccepted: boolean
1367
- optForNewsletters: boolean
1368
- updated_at: string | null
1369
- }
1370
- Insert: {
1371
- billing_email?: string | null
1372
- country?: string | null
1373
- created_at?: string | null
1374
- customer_id?: string | null
1375
- email: string
1376
- enableNotifications?: boolean
1377
- first_name?: string | null
1378
- id: string
1379
- image_url?: string | null
1380
- last_name?: string | null
1381
- legalAccepted?: boolean
1382
- optForNewsletters?: boolean
1383
- updated_at?: string | null
1384
- }
1385
- Update: {
1386
- billing_email?: string | null
1387
- country?: string | null
1388
- created_at?: string | null
1389
- customer_id?: string | null
1390
- email?: string
1391
- enableNotifications?: boolean
1392
- first_name?: string | null
1393
- id?: string
1394
- image_url?: string | null
1395
- last_name?: string | null
1396
- legalAccepted?: boolean
1397
- optForNewsletters?: boolean
1398
- updated_at?: string | null
1399
- }
1400
- Relationships: [
1401
- {
1402
- foreignKeyName: 'users_customer_id_fkey'
1403
- columns: ['customer_id']
1404
- isOneToOne: true
1405
- referencedRelation: 'stripe_info'
1406
- referencedColumns: ['customer_id']
1407
- },
1408
- {
1409
- foreignKeyName: 'users_id_fkey'
1410
- columns: ['id']
1411
- isOneToOne: true
1412
- referencedRelation: 'users'
1413
- referencedColumns: ['id']
1414
- },
1415
- ]
1416
- }
1417
- version_usage: {
1418
- Row: {
1419
- action: string
1420
- app_id: string
1421
- timestamp: string
1422
- version: number
1423
- }
1424
- Insert: {
1425
- action: string
1426
- app_id: string
1427
- timestamp: string
1428
- version: number
1429
- }
1430
- Update: {
1431
- action?: string
1432
- app_id?: string
1433
- timestamp?: string
1434
- version?: number
1435
- }
1436
- Relationships: []
1437
- }
1438
- workers: {
1439
- Row: {
1440
- id: number
1441
- locked: boolean
1442
- }
1443
- Insert: {
1444
- id?: number
1445
- locked?: boolean
1446
- }
1447
- Update: {
1448
- id?: number
1449
- locked?: boolean
1450
- }
1451
- Relationships: []
1452
- }
1453
- }
1454
- Views: {
1455
- [_ in never]: never
1456
- }
1457
- Functions: {
1458
- accept_invitation_to_org: {
1459
- Args: {
1460
- org_id: string
1461
- }
1462
- Returns: string
1463
- }
1464
- calculate_cycle_usage: {
1465
- Args: Record<PropertyKey, never>
1466
- Returns: undefined
1467
- }
1468
- calculate_daily_app_usage: {
1469
- Args: Record<PropertyKey, never>
1470
- Returns: undefined
1471
- }
1472
- check_min_rights:
1473
- | {
1474
- Args: {
1475
- min_right: Database['public']['Enums']['user_min_right']
1476
- org_id: string
1477
- app_id: string
1478
- channel_id: number
1479
- }
1480
- Returns: boolean
1481
- }
1482
- | {
1483
- Args: {
1484
- min_right: Database['public']['Enums']['user_min_right']
1485
- user_id: string
1486
- org_id: string
1487
- app_id: string
1488
- channel_id: number
1489
- }
1490
- Returns: boolean
1491
- }
1492
- convert_bytes_to_gb: {
1493
- Args: {
1494
- byt: number
1495
- }
1496
- Returns: number
1497
- }
1498
- convert_bytes_to_mb: {
1499
- Args: {
1500
- byt: number
1501
- }
1502
- Returns: number
1503
- }
1504
- convert_gb_to_bytes: {
1505
- Args: {
1506
- gb: number
1507
- }
1508
- Returns: number
1509
- }
1510
- convert_mb_to_bytes: {
1511
- Args: {
1512
- gb: number
1513
- }
1514
- Returns: number
1515
- }
1516
- convert_number_to_percent: {
1517
- Args: {
1518
- val: number
1519
- max_val: number
1520
- }
1521
- Returns: number
1522
- }
1523
- count_active_users: {
1524
- Args: {
1525
- app_ids: string[]
1526
- }
1527
- Returns: number
1528
- }
1529
- count_all_need_upgrade: {
1530
- Args: Record<PropertyKey, never>
1531
- Returns: number
1532
- }
1533
- count_all_onboarded: {
1534
- Args: Record<PropertyKey, never>
1535
- Returns: number
1536
- }
1537
- count_all_paying: {
1538
- Args: Record<PropertyKey, never>
1539
- Returns: number
1540
- }
1541
- count_all_plans: {
1542
- Args: Record<PropertyKey, never>
1543
- Returns: {
1544
- product_id: string
1545
- count: number
1546
- }[]
1547
- }
1548
- count_all_plans_v2: {
1549
- Args: Record<PropertyKey, never>
1550
- Returns: {
1551
- plan_name: string
1552
- count: number
1553
- }[]
1554
- }
1555
- count_all_trial: {
1556
- Args: Record<PropertyKey, never>
1557
- Returns: number
1558
- }
1559
- create_partitions: {
1560
- Args: {
1561
- start_date: string
1562
- num_years: number
1563
- }
1564
- Returns: undefined
1565
- }
1566
- delete_user: {
1567
- Args: Record<PropertyKey, never>
1568
- Returns: undefined
1569
- }
1570
- exist_app_v2: {
1571
- Args: {
1572
- appid: string
1573
- }
1574
- Returns: boolean
1575
- }
1576
- exist_app_versions: {
1577
- Args: {
1578
- appid: string
1579
- name_version: string
1580
- apikey: string
1581
- }
1582
- Returns: boolean
1583
- }
1584
- exist_user: {
1585
- Args: {
1586
- e_mail: string
1587
- }
1588
- Returns: string
1589
- }
1590
- find_best_plan_v3: {
1591
- Args: {
1592
- mau: number
1593
- bandwidth: number
1594
- storage: number
1595
- }
1596
- Returns: string
1597
- }
1598
- find_fit_plan_v3: {
1599
- Args: {
1600
- mau: number
1601
- bandwidth: number
1602
- storage: number
1603
- }
1604
- Returns: {
1605
- name: string
1606
- }[]
1607
- }
1608
- get_apikey: {
1609
- Args: Record<PropertyKey, never>
1610
- Returns: string
1611
- }
1612
- get_app_versions: {
1613
- Args: {
1614
- appid: string
1615
- name_version: string
1616
- apikey: string
1617
- }
1618
- Returns: number
1619
- }
1620
- get_current_plan_max:
1621
- | {
1622
- Args: Record<PropertyKey, never>
1623
- Returns: string
1624
- }
1625
- | {
1626
- Args: {
1627
- userid: string
1628
- }
1629
- Returns: {
1630
- mau: number
1631
- bandwidth: number
1632
- storage: number
1633
- }[]
1634
- }
1635
- get_current_plan_max_org: {
1636
- Args: {
1637
- orgid: string
1638
- }
1639
- Returns: {
1640
- mau: number
1641
- bandwidth: number
1642
- storage: number
1643
- }[]
1644
- }
1645
- get_current_plan_name:
1646
- | {
1647
- Args: Record<PropertyKey, never>
1648
- Returns: string
1649
- }
1650
- | {
1651
- Args: {
1652
- userid: string
1653
- }
1654
- Returns: string
1655
- }
1656
- get_current_plan_name_org: {
1657
- Args: {
1658
- orgid: string
1659
- }
1660
- Returns: string
1661
- }
1662
- get_customer_counts: {
1663
- Args: Record<PropertyKey, never>
1664
- Returns: {
1665
- yearly: number
1666
- monthly: number
1667
- total: number
1668
- }[]
1669
- }
1670
- get_cycle_info: {
1671
- Args: {
1672
- userid: string
1673
- }
1674
- Returns: {
1675
- subscription_anchor_start: string
1676
- subscription_anchor_end: string
1677
- }[]
1678
- }
1679
- get_cycle_info_org: {
1680
- Args: {
1681
- orgid: string
1682
- }
1683
- Returns: {
1684
- subscription_anchor_start: string
1685
- subscription_anchor_end: string
1686
- }[]
1687
- }
1688
- get_db_url: {
1689
- Args: Record<PropertyKey, never>
1690
- Returns: string
1691
- }
1692
- get_devices_version: {
1693
- Args: {
1694
- app_id: string
1695
- version_id: number
1696
- }
1697
- Returns: number
1698
- }
1699
- get_external_function_url: {
1700
- Args: Record<PropertyKey, never>
1701
- Returns: string
1702
- }
1703
- get_identity:
1704
- | {
1705
- Args: Record<PropertyKey, never>
1706
- Returns: string
1707
- }
1708
- | {
1709
- Args: {
1710
- keymode: Database['public']['Enums']['key_mode'][]
1711
- }
1712
- Returns: string
1713
- }
1714
- get_identity_apikey_only: {
1715
- Args: {
1716
- keymode: Database['public']['Enums']['key_mode'][]
1717
- }
1718
- Returns: string
1719
- }
1720
- get_infos: {
1721
- Args: {
1722
- appid: string
1723
- deviceid: string
1724
- versionname: string
1725
- }
1726
- Returns: {
1727
- current_version_id: number
1728
- versiondata: Json
1729
- channel: Json
1730
- }[]
1731
- }
1732
- get_max_plan:
1733
- | {
1734
- Args: Record<PropertyKey, never>
1735
- Returns: {
1736
- mau: number
1737
- bandwidth: number
1738
- storage: number
1739
- }[]
1740
- }
1741
- | {
1742
- Args: {
1743
- userid: string
1744
- }
1745
- Returns: {
1746
- mau: number
1747
- storage: number
1748
- bandwidth: number
1749
- }[]
1750
- }
1751
- get_metered_usage:
1752
- | {
1753
- Args: Record<PropertyKey, never>
1754
- Returns: number
1755
- }
1756
- | {
1757
- Args: {
1758
- userid: string
1759
- }
1760
- Returns: Database['public']['CompositeTypes']['stats_table']
1761
- }
1762
- get_org_members: {
1763
- Args: {
1764
- guild_id: string
1765
- }
1766
- Returns: {
1767
- aid: number
1768
- uid: string
1769
- email: string
1770
- image_url: string
1771
- role: Database['public']['Enums']['user_min_right']
1772
- }[]
1773
- }
1774
- get_org_perm_for_apikey: {
1775
- Args: {
1776
- apikey: string
1777
- app_id: string
1778
- }
1779
- Returns: string
1780
- }
1781
- get_orgs_v3: {
1782
- Args: {
1783
- userid: string
1784
- }
1785
- Returns: {
1786
- gid: string
1787
- created_by: string
1788
- logo: string
1789
- name: string
1790
- role: string
1791
- paying: boolean
1792
- trial_left: number
1793
- can_use_more: boolean
1794
- is_canceled: boolean
1795
- }[]
1796
- }
1797
- get_orgs_v4:
1798
- | {
1799
- Args: Record<PropertyKey, never>
1800
- Returns: {
1801
- gid: string
1802
- created_by: string
1803
- logo: string
1804
- name: string
1805
- role: string
1806
- paying: boolean
1807
- trial_left: number
1808
- can_use_more: boolean
1809
- is_canceled: boolean
1810
- app_count: number
1811
- subscription_start: string
1812
- subscription_end: string
1813
- }[]
1814
- }
1815
- | {
1816
- Args: {
1817
- userid: string
1818
- }
1819
- Returns: {
1820
- gid: string
1821
- created_by: string
1822
- logo: string
1823
- name: string
1824
- role: string
1825
- paying: boolean
1826
- trial_left: number
1827
- can_use_more: boolean
1828
- is_canceled: boolean
1829
- app_count: number
1830
- subscription_start: string
1831
- subscription_end: string
1832
- }[]
1833
- }
1834
- get_orgs_v5:
1835
- | {
1836
- Args: Record<PropertyKey, never>
1837
- Returns: {
1838
- gid: string
1839
- created_by: string
1840
- logo: string
1841
- name: string
1842
- role: string
1843
- paying: boolean
1844
- trial_left: number
1845
- can_use_more: boolean
1846
- is_canceled: boolean
1847
- app_count: number
1848
- subscription_start: string
1849
- subscription_end: string
1850
- management_email: string
1851
- }[]
1852
- }
1853
- | {
1854
- Args: {
1855
- userid: string
1856
- }
1857
- Returns: {
1858
- gid: string
1859
- created_by: string
1860
- logo: string
1861
- name: string
1862
- role: string
1863
- paying: boolean
1864
- trial_left: number
1865
- can_use_more: boolean
1866
- is_canceled: boolean
1867
- app_count: number
1868
- subscription_start: string
1869
- subscription_end: string
1870
- management_email: string
1871
- }[]
1872
- }
1873
- get_plan_usage_percent: {
1874
- Args: {
1875
- userid: string
1876
- }
1877
- Returns: number
1878
- }
1879
- get_plan_usage_percent_org: {
1880
- Args: {
1881
- orgid: string
1882
- }
1883
- Returns: number
1884
- }
1885
- get_total_app_storage_size:
1886
- | {
1887
- Args: {
1888
- appid: string
1889
- }
1890
- Returns: number
1891
- }
1892
- | {
1893
- Args: {
1894
- userid: string
1895
- appid: string
1896
- }
1897
- Returns: number
1898
- }
1899
- get_total_app_storage_size_orgs: {
1900
- Args: {
1901
- org_id: string
1902
- app_id: string
1903
- }
1904
- Returns: number
1905
- }
1906
- get_total_stats_v5: {
1907
- Args: {
1908
- userid: string
1909
- }
1910
- Returns: {
1911
- mau: number
1912
- bandwidth: number
1913
- storage: number
1914
- }[]
1915
- }
1916
- get_total_stats_v5_org: {
1917
- Args: {
1918
- orgid: string
1919
- }
1920
- Returns: {
1921
- mau: number
1922
- bandwidth: number
1923
- storage: number
1924
- }[]
1925
- }
1926
- get_total_storage_size:
1927
- | {
1928
- Args: Record<PropertyKey, never>
1929
- Returns: number
1930
- }
1931
- | {
1932
- Args: {
1933
- appid: string
1934
- }
1935
- Returns: number
1936
- }
1937
- | {
1938
- Args: {
1939
- userid: string
1940
- }
1941
- Returns: number
1942
- }
1943
- | {
1944
- Args: {
1945
- userid: string
1946
- appid: string
1947
- }
1948
- Returns: number
1949
- }
1950
- get_total_storage_size_org: {
1951
- Args: {
1952
- org_id: string
1953
- }
1954
- Returns: number
1955
- }
1956
- get_usage_mode_and_last_saved: {
1957
- Args: Record<PropertyKey, never>
1958
- Returns: {
1959
- usage_mode: Database['public']['Enums']['usage_mode']
1960
- last_saved: string
1961
- }[]
1962
- }
1963
- get_user_id:
1964
- | {
1965
- Args: {
1966
- apikey: string
1967
- }
1968
- Returns: string
1969
- }
1970
- | {
1971
- Args: {
1972
- apikey: string
1973
- app_id: string
1974
- }
1975
- Returns: string
1976
- }
1977
- get_user_main_org_id: {
1978
- Args: {
1979
- user_id: string
1980
- }
1981
- Returns: string
1982
- }
1983
- get_user_main_org_id_by_app_id: {
1984
- Args: {
1985
- app_id: string
1986
- }
1987
- Returns: string
1988
- }
1989
- get_weekly_stats: {
1990
- Args: {
1991
- app_id: string
1992
- }
1993
- Returns: {
1994
- all_updates: number
1995
- failed_updates: number
1996
- open_app: number
1997
- }[]
1998
- }
1999
- has_app_right: {
2000
- Args: {
2001
- appid: string
2002
- right: Database['public']['Enums']['user_min_right']
2003
- }
2004
- Returns: boolean
2005
- }
2006
- has_app_right_userid: {
2007
- Args: {
2008
- appid: string
2009
- right: Database['public']['Enums']['user_min_right']
2010
- userid: string
2011
- }
2012
- Returns: boolean
2013
- }
2014
- has_min_right: {
2015
- Args: {
2016
- _userid: string
2017
- _orgid: string
2018
- _right: Database['public']['Enums']['user_min_right']
2019
- _appid?: string
2020
- _channelid?: number
2021
- }
2022
- Returns: boolean
2023
- }
2024
- has_read_rights: {
2025
- Args: {
2026
- appid: string
2027
- }
2028
- Returns: boolean
2029
- }
2030
- http_post_helper: {
2031
- Args: {
2032
- function_name: string
2033
- function_type: string
2034
- body: Json
2035
- }
2036
- Returns: number
2037
- }
2038
- invite_user_to_org: {
2039
- Args: {
2040
- email: string
2041
- org_id: string
2042
- invite_type: Database['public']['Enums']['user_min_right']
2043
- }
2044
- Returns: string
2045
- }
2046
- is_admin:
2047
- | {
2048
- Args: Record<PropertyKey, never>
2049
- Returns: boolean
2050
- }
2051
- | {
2052
- Args: {
2053
- userid: string
2054
- }
2055
- Returns: boolean
2056
- }
2057
- is_allowed_action:
2058
- | {
2059
- Args: {
2060
- apikey: string
2061
- }
2062
- Returns: boolean
2063
- }
2064
- | {
2065
- Args: {
2066
- apikey: string
2067
- appid: string
2068
- }
2069
- Returns: boolean
2070
- }
2071
- is_allowed_action_org: {
2072
- Args: {
2073
- orgid: string
2074
- }
2075
- Returns: boolean
2076
- }
2077
- is_allowed_action_user:
2078
- | {
2079
- Args: Record<PropertyKey, never>
2080
- Returns: boolean
2081
- }
2082
- | {
2083
- Args: {
2084
- userid: string
2085
- }
2086
- Returns: boolean
2087
- }
2088
- is_allowed_capgkey:
2089
- | {
2090
- Args: {
2091
- apikey: string
2092
- keymode: Database['public']['Enums']['key_mode'][]
2093
- }
2094
- Returns: boolean
2095
- }
2096
- | {
2097
- Args: {
2098
- apikey: string
2099
- keymode: Database['public']['Enums']['key_mode'][]
2100
- app_id: string
2101
- }
2102
- Returns: boolean
2103
- }
2104
- | {
2105
- Args: {
2106
- apikey: string
2107
- keymode: Database['public']['Enums']['key_mode'][]
2108
- app_id: string
2109
- channel_id: number
2110
- right: Database['public']['Enums']['user_min_right']
2111
- user_id: string
2112
- }
2113
- Returns: boolean
2114
- }
2115
- | {
2116
- Args: {
2117
- apikey: string
2118
- keymode: Database['public']['Enums']['key_mode'][]
2119
- app_id: string
2120
- right: Database['public']['Enums']['user_min_right']
2121
- user_id: string
2122
- }
2123
- Returns: boolean
2124
- }
2125
- is_app_owner:
2126
- | {
2127
- Args: {
2128
- apikey: string
2129
- appid: string
2130
- }
2131
- Returns: boolean
2132
- }
2133
- | {
2134
- Args: {
2135
- appid: string
2136
- }
2137
- Returns: boolean
2138
- }
2139
- | {
2140
- Args: {
2141
- userid: string
2142
- appid: string
2143
- }
2144
- Returns: boolean
2145
- }
2146
- is_canceled:
2147
- | {
2148
- Args: Record<PropertyKey, never>
2149
- Returns: boolean
2150
- }
2151
- | {
2152
- Args: {
2153
- userid: string
2154
- }
2155
- Returns: boolean
2156
- }
2157
- is_canceled_org: {
2158
- Args: {
2159
- orgid: string
2160
- }
2161
- Returns: boolean
2162
- }
2163
- is_free_usage:
2164
- | {
2165
- Args: Record<PropertyKey, never>
2166
- Returns: boolean
2167
- }
2168
- | {
2169
- Args: {
2170
- userid: string
2171
- }
2172
- Returns: boolean
2173
- }
2174
- is_good_plan_v5: {
2175
- Args: {
2176
- userid: string
2177
- }
2178
- Returns: boolean
2179
- }
2180
- is_good_plan_v5_org: {
2181
- Args: {
2182
- orgid: string
2183
- }
2184
- Returns: boolean
2185
- }
2186
- is_member_of_org: {
2187
- Args: {
2188
- user_id: string
2189
- org_id: string
2190
- }
2191
- Returns: boolean
2192
- }
2193
- is_not_deleted: {
2194
- Args: {
2195
- email_check: string
2196
- }
2197
- Returns: boolean
2198
- }
2199
- is_onboarded:
2200
- | {
2201
- Args: Record<PropertyKey, never>
2202
- Returns: boolean
2203
- }
2204
- | {
2205
- Args: {
2206
- userid: string
2207
- }
2208
- Returns: boolean
2209
- }
2210
- is_onboarded_org: {
2211
- Args: {
2212
- orgid: string
2213
- }
2214
- Returns: boolean
2215
- }
2216
- is_onboarding_needed:
2217
- | {
2218
- Args: Record<PropertyKey, never>
2219
- Returns: boolean
2220
- }
2221
- | {
2222
- Args: {
2223
- userid: string
2224
- }
2225
- Returns: boolean
2226
- }
2227
- is_owner_of_org: {
2228
- Args: {
2229
- user_id: string
2230
- org_id: string
2231
- }
2232
- Returns: boolean
2233
- }
2234
- is_paying:
2235
- | {
2236
- Args: Record<PropertyKey, never>
2237
- Returns: boolean
2238
- }
2239
- | {
2240
- Args: {
2241
- userid: string
2242
- }
2243
- Returns: boolean
2244
- }
2245
- is_paying_and_good_plan:
2246
- | {
2247
- Args: Record<PropertyKey, never>
2248
- Returns: boolean
2249
- }
2250
- | {
2251
- Args: {
2252
- userid: string
2253
- }
2254
- Returns: boolean
2255
- }
2256
- is_paying_and_good_plan_org: {
2257
- Args: {
2258
- orgid: string
2259
- }
2260
- Returns: boolean
2261
- }
2262
- is_paying_org: {
2263
- Args: {
2264
- orgid: string
2265
- }
2266
- Returns: boolean
2267
- }
2268
- is_trial:
2269
- | {
2270
- Args: Record<PropertyKey, never>
2271
- Returns: number
2272
- }
2273
- | {
2274
- Args: {
2275
- userid: string
2276
- }
2277
- Returns: number
2278
- }
2279
- is_trial_org: {
2280
- Args: {
2281
- orgid: string
2282
- }
2283
- Returns: number
2284
- }
2285
- one_month_ahead: {
2286
- Args: Record<PropertyKey, never>
2287
- Returns: string
2288
- }
2289
- post_replication_sql:
2290
- | {
2291
- Args: {
2292
- sql_query: string
2293
- }
2294
- Returns: undefined
2295
- }
2296
- | {
2297
- Args: {
2298
- sql_query: string
2299
- params: string[]
2300
- }
2301
- Returns: undefined
2302
- }
2303
- process_current_jobs_if_unlocked: {
2304
- Args: Record<PropertyKey, never>
2305
- Returns: number[]
2306
- }
2307
- process_requested_jobs: {
2308
- Args: Record<PropertyKey, never>
2309
- Returns: undefined
2310
- }
2311
- reset_and_seed_data: {
2312
- Args: Record<PropertyKey, never>
2313
- Returns: undefined
2314
- }
2315
- retry_failed_jobs: {
2316
- Args: Record<PropertyKey, never>
2317
- Returns: undefined
2318
- }
2319
- update_app_usage:
2320
- | {
2321
- Args: Record<PropertyKey, never>
2322
- Returns: undefined
2323
- }
2324
- | {
2325
- Args: {
2326
- minutes_interval: number
2327
- }
2328
- Returns: undefined
2329
- }
2330
- verify_mfa: {
2331
- Args: Record<PropertyKey, never>
2332
- Returns: boolean
2333
- }
2334
- }
2335
- Enums: {
2336
- app_mode: 'prod' | 'dev' | 'livereload'
2337
- disable_update: 'major' | 'minor' | 'version_number' | 'none'
2338
- key_mode: 'read' | 'write' | 'all' | 'upload'
2339
- pay_as_you_go_type: 'base' | 'units'
2340
- platform_os: 'ios' | 'android'
2341
- queue_job_status: 'inserted' | 'requested' | 'failed'
2342
- stripe_status:
2343
- | 'created'
2344
- | 'succeeded'
2345
- | 'updated'
2346
- | 'failed'
2347
- | 'deleted'
2348
- | 'canceled'
2349
- usage_mode: '5min' | 'day' | 'month' | 'cycle' | 'last_saved'
2350
- user_min_right:
2351
- | 'invite_read'
2352
- | 'invite_upload'
2353
- | 'invite_write'
2354
- | 'invite_admin'
2355
- | 'invite_super_admin'
2356
- | 'read'
2357
- | 'upload'
2358
- | 'write'
2359
- | 'admin'
2360
- | 'super_admin'
2361
- user_role: 'read' | 'upload' | 'write' | 'admin'
2362
- }
2363
- CompositeTypes: {
2364
- match_plan: {
2365
- name: string | null
2366
- }
2367
- orgs_table: {
2368
- id: string | null
2369
- created_by: string | null
2370
- created_at: string | null
2371
- updated_at: string | null
2372
- logo: string | null
2373
- name: string | null
2374
- }
2375
- owned_orgs: {
2376
- id: string | null
2377
- created_by: string | null
2378
- logo: string | null
2379
- name: string | null
2380
- role: string | null
2381
- }
2382
- stats_table: {
2383
- mau: number | null
2384
- bandwidth: number | null
2385
- storage: number | null
2386
- }
2387
- }
2388
- }
2389
- }
2390
-
2391
- type PublicSchema = Database[Extract<keyof Database, 'public'>]
2392
-
2393
- export type Tables<
2394
- PublicTableNameOrOptions extends
2395
- | keyof (PublicSchema['Tables'] & PublicSchema['Views'])
2396
- | { schema: keyof Database },
2397
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
2398
- ? keyof (Database[PublicTableNameOrOptions['schema']]['Tables'] &
2399
- Database[PublicTableNameOrOptions['schema']]['Views'])
2400
- : never = never,
2401
- > = PublicTableNameOrOptions extends { schema: keyof Database }
2402
- ? (Database[PublicTableNameOrOptions['schema']]['Tables'] &
2403
- Database[PublicTableNameOrOptions['schema']]['Views'])[TableName] extends {
2404
- Row: infer R
2405
- }
2406
- ? R
2407
- : never
2408
- : PublicTableNameOrOptions extends keyof (PublicSchema['Tables'] &
2409
- PublicSchema['Views'])
2410
- ? (PublicSchema['Tables'] &
2411
- PublicSchema['Views'])[PublicTableNameOrOptions] extends {
2412
- Row: infer R
2413
- }
2414
- ? R
2415
- : never
2416
- : never
2417
-
2418
- export type TablesInsert<
2419
- PublicTableNameOrOptions extends
2420
- | keyof PublicSchema['Tables']
2421
- | { schema: keyof Database },
2422
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
2423
- ? keyof Database[PublicTableNameOrOptions['schema']]['Tables']
2424
- : never = never,
2425
- > = PublicTableNameOrOptions extends { schema: keyof Database }
2426
- ? Database[PublicTableNameOrOptions['schema']]['Tables'][TableName] extends {
2427
- Insert: infer I
2428
- }
2429
- ? I
2430
- : never
2431
- : PublicTableNameOrOptions extends keyof PublicSchema['Tables']
2432
- ? PublicSchema['Tables'][PublicTableNameOrOptions] extends {
2433
- Insert: infer I
2434
- }
2435
- ? I
2436
- : never
2437
- : never
2438
-
2439
- export type TablesUpdate<
2440
- PublicTableNameOrOptions extends
2441
- | keyof PublicSchema['Tables']
2442
- | { schema: keyof Database },
2443
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
2444
- ? keyof Database[PublicTableNameOrOptions['schema']]['Tables']
2445
- : never = never,
2446
- > = PublicTableNameOrOptions extends { schema: keyof Database }
2447
- ? Database[PublicTableNameOrOptions['schema']]['Tables'][TableName] extends {
2448
- Update: infer U
2449
- }
2450
- ? U
2451
- : never
2452
- : PublicTableNameOrOptions extends keyof PublicSchema['Tables']
2453
- ? PublicSchema['Tables'][PublicTableNameOrOptions] extends {
2454
- Update: infer U
2455
- }
2456
- ? U
2457
- : never
2458
- : never
2459
-
2460
- export type Enums<
2461
- PublicEnumNameOrOptions extends
2462
- | keyof PublicSchema['Enums']
2463
- | { schema: keyof Database },
2464
- EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
2465
- ? keyof Database[PublicEnumNameOrOptions['schema']]['Enums']
2466
- : never = never,
2467
- > = PublicEnumNameOrOptions extends { schema: keyof Database }
2468
- ? Database[PublicEnumNameOrOptions['schema']]['Enums'][EnumName]
2469
- : PublicEnumNameOrOptions extends keyof PublicSchema['Enums']
2470
- ? PublicSchema['Enums'][PublicEnumNameOrOptions]
2471
- : never