@capgo/cli 4.9.3 → 4.10.1
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/CHANGELOG.md +14 -0
- package/dist/index.js +64434 -64424
- package/package.json +1 -1
- package/src/channel/delete.ts +1 -0
- package/src/index.ts +11 -0
- package/src/user/account.ts +11 -0
package/package.json
CHANGED
package/src/channel/delete.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { program } from 'commander'
|
|
2
|
+
import { getUserId } from 'user/account'
|
|
2
3
|
import pack from '../package.json'
|
|
3
4
|
import { zipBundle } from './bundle/zip'
|
|
4
5
|
import { initApp } from './init'
|
|
@@ -293,4 +294,14 @@ program
|
|
|
293
294
|
'Minimal version required to update to this version. Used only if the disable auto update is set to metadata in channel',
|
|
294
295
|
)
|
|
295
296
|
|
|
297
|
+
const user = program
|
|
298
|
+
.command('user')
|
|
299
|
+
.description('Manage user')
|
|
300
|
+
|
|
301
|
+
user.command('account')
|
|
302
|
+
.alias('a')
|
|
303
|
+
.description('Get your account ID')
|
|
304
|
+
.action(getUserId)
|
|
305
|
+
.option('-a, --apikey <apikey>', 'apikey to link to your account')
|
|
306
|
+
|
|
296
307
|
program.parseAsync()
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as p from '@clack/prompts'
|
|
2
|
+
import { createSupabaseClient, findSavedKey, verifyUser } from '../utils'
|
|
3
|
+
import type { Options } from '../api/app'
|
|
4
|
+
|
|
5
|
+
export async function getUserId(options: Options) {
|
|
6
|
+
p.intro(`Getting user id`)
|
|
7
|
+
options.apikey = options.apikey || findSavedKey()
|
|
8
|
+
const supabase = await createSupabaseClient(options.apikey)
|
|
9
|
+
const userId = await verifyUser(supabase, options.apikey, ['read'])
|
|
10
|
+
p.outro(`Done ✅: ${userId}`)
|
|
11
|
+
}
|