figmanage 1.0.0 → 1.0.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/dist/cli/whoami.js +3 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/cli/whoami.js
CHANGED
|
@@ -11,7 +11,7 @@ export async function handleWhoami() {
|
|
|
11
11
|
if (hasCookie(config)) {
|
|
12
12
|
authMethods.push('cookie');
|
|
13
13
|
try {
|
|
14
|
-
const res = await axios.get('https://www.figma.com/api/
|
|
14
|
+
const res = await axios.get('https://www.figma.com/api/user/state', {
|
|
15
15
|
headers: {
|
|
16
16
|
'Cookie': `__Host-figma.authn=${config.cookie}`,
|
|
17
17
|
'X-CSRF-Bypass': 'yes',
|
|
@@ -19,7 +19,8 @@ export async function handleWhoami() {
|
|
|
19
19
|
},
|
|
20
20
|
timeout: 15000,
|
|
21
21
|
});
|
|
22
|
-
const
|
|
22
|
+
const meta = res.data?.meta || res.data || {};
|
|
23
|
+
const user = meta.user || meta;
|
|
23
24
|
console.log(`User: ${user.handle || user.email || config.userId}`);
|
|
24
25
|
if (user.email)
|
|
25
26
|
console.log(`Email: ${user.email}`);
|
package/dist/index.js
CHANGED
|
@@ -21,7 +21,7 @@ else {
|
|
|
21
21
|
program
|
|
22
22
|
.name('figmanage')
|
|
23
23
|
.description('Figma workspace management CLI')
|
|
24
|
-
.version('
|
|
24
|
+
.version(JSON.parse((await import('node:fs')).readFileSync(new URL('../package.json', import.meta.url), 'utf-8')).version);
|
|
25
25
|
registerCliCommands(program);
|
|
26
26
|
// No subcommand given -- show help
|
|
27
27
|
if (process.argv.length <= 2) {
|
package/package.json
CHANGED