@capgo/cli 7.18.1 → 7.18.3

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