@capgo/cli 4.4.5 → 4.5.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.
- package/.vscode/settings.json +43 -2
- package/CHANGELOG.md +7 -0
- package/bun.lockb +0 -0
- package/dist/index.js +30780 -30057
- package/eslint.config.js +8 -1
- package/package.json +29 -37
- package/src/api/update.ts +1 -1
- package/src/bundle/upload.ts +4 -8
- package/src/channel/add.ts +3 -2
- package/src/channel/set.ts +1 -0
- package/src/types/supabase.types.ts +697 -324
- package/src/utils.ts +0 -18
- package/.eslintignore +0 -4
package/src/utils.ts
CHANGED
|
@@ -18,7 +18,6 @@ export const baseKeyPub = `${baseKey}.pub`
|
|
|
18
18
|
export const defaultHost = 'https://capgo.app'
|
|
19
19
|
export const defaultApiHost = 'https://api.capgo.app'
|
|
20
20
|
export const defaultHostWeb = 'https://web.capgo.app'
|
|
21
|
-
export const EMPTY_UUID = '00000000-0000-0000-0000-000000000000'
|
|
22
21
|
|
|
23
22
|
export const regexSemver = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/
|
|
24
23
|
export const formatError = (error: any) => error ? `\n${prettyjson.render(error)}` : ''
|
|
@@ -163,23 +162,6 @@ export async function isAllowedActionAppIdApiKey(supabase: SupabaseClient<Databa
|
|
|
163
162
|
return !!data
|
|
164
163
|
}
|
|
165
164
|
|
|
166
|
-
export async function getAppOwner(supabase: SupabaseClient<Database>, appId: string): Promise<string> {
|
|
167
|
-
const { data, error } = await supabase
|
|
168
|
-
.from('apps')
|
|
169
|
-
.select('user_id')
|
|
170
|
-
.eq('app_id', appId)
|
|
171
|
-
.single()
|
|
172
|
-
|
|
173
|
-
if (error) {
|
|
174
|
-
p.log.error('Cannot get app owner, exiting')
|
|
175
|
-
p.log.error('Please report the following error to capgo\'s staff')
|
|
176
|
-
console.error(error)
|
|
177
|
-
process.exit(1)
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
return data.user_id
|
|
181
|
-
}
|
|
182
|
-
|
|
183
165
|
export async function isAllowedApp(supabase: SupabaseClient<Database>, apikey: string, appId: string): Promise<boolean> {
|
|
184
166
|
const { data } = await supabase
|
|
185
167
|
.rpc('is_app_owner', { apikey, appid: appId })
|
package/.eslintignore
DELETED