@editframe/cli 0.11.0-beta.3 → 0.11.0-beta.5
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/VERSION.d.ts +1 -1
- package/dist/VERSION.js +1 -1
- package/dist/commands/auth.d.ts +2 -2
- package/dist/commands/auth.js +8 -8
- package/package.json +5 -5
- package/src/commands/auth.ts +9 -9
package/dist/VERSION.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.11.0-beta.
|
|
1
|
+
export declare const VERSION = "0.11.0-beta.5";
|
package/dist/VERSION.js
CHANGED
package/dist/commands/auth.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export interface APIOrgResult {
|
|
2
|
-
|
|
2
|
+
apiKeyName: string;
|
|
3
3
|
id: string;
|
|
4
4
|
org_id: string;
|
|
5
5
|
created_at: unknown;
|
|
6
6
|
updated_at: unknown;
|
|
7
|
-
|
|
7
|
+
displayName: string;
|
|
8
8
|
}
|
|
9
9
|
export declare const getApiData: () => Promise<APIOrgResult>;
|
package/dist/commands/auth.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { program } from "commander";
|
|
2
|
-
import ora from "ora";
|
|
3
1
|
import chalk from "chalk";
|
|
2
|
+
import { program } from "commander";
|
|
4
3
|
import debug from "debug";
|
|
4
|
+
import ora from "ora";
|
|
5
5
|
import { getClient } from "../utils/index.js";
|
|
6
6
|
const log = debug("ef:cli:auth");
|
|
7
7
|
const getApiData = async () => {
|
|
8
|
-
const response = await getClient().authenticatedFetch("/api/
|
|
8
|
+
const response = await getClient().authenticatedFetch("/api/v1/organization");
|
|
9
9
|
return response.json();
|
|
10
10
|
};
|
|
11
11
|
const authCommand = program.command("auth").description("Fetch organization data using API token").action(async () => {
|
|
@@ -15,16 +15,16 @@ const authCommand = program.command("auth").description("Fetch organization data
|
|
|
15
15
|
try {
|
|
16
16
|
const apiData = await getApiData();
|
|
17
17
|
spinner.succeed("You are authenticated! 🎉");
|
|
18
|
-
process.stderr.write(chalk.green(`Name: ${apiData.name}
|
|
19
|
-
`));
|
|
20
18
|
process.stderr.write(
|
|
21
|
-
chalk.green(`
|
|
19
|
+
chalk.green(`You're using ${apiData.apiKeyName} API key 🚀
|
|
20
|
+
`)
|
|
21
|
+
);
|
|
22
|
+
process.stderr.write(
|
|
23
|
+
chalk.blue(`Welcome to ${apiData.displayName} organization 🎉
|
|
22
24
|
`)
|
|
23
25
|
);
|
|
24
26
|
} catch (error) {
|
|
25
27
|
spinner.fail("Authentication failed!");
|
|
26
|
-
process.stderr.write(error?.message);
|
|
27
|
-
process.stderr.write("\n");
|
|
28
28
|
log("Error:", error);
|
|
29
29
|
}
|
|
30
30
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@editframe/cli",
|
|
3
|
-
"version": "0.11.0-beta.
|
|
3
|
+
"version": "0.11.0-beta.5",
|
|
4
4
|
"description": "Command line interface for EditFrame",
|
|
5
5
|
"bin": {
|
|
6
6
|
"editframe": "./dist/index.js"
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"vite-tsconfig-paths": "^4.3.2"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@editframe/api": "0.11.0-beta.
|
|
27
|
-
"@editframe/assets": "0.11.0-beta.
|
|
28
|
-
"@editframe/elements": "0.11.0-beta.
|
|
29
|
-
"@editframe/vite-plugin": "0.11.0-beta.
|
|
26
|
+
"@editframe/api": "0.11.0-beta.5",
|
|
27
|
+
"@editframe/assets": "0.11.0-beta.5",
|
|
28
|
+
"@editframe/elements": "0.11.0-beta.5",
|
|
29
|
+
"@editframe/vite-plugin": "0.11.0-beta.5",
|
|
30
30
|
"@inquirer/prompts": "^5.3.8",
|
|
31
31
|
"axios": "^1.6.8",
|
|
32
32
|
"chalk": "^5.3.0",
|
package/src/commands/auth.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { program } from "commander";
|
|
2
|
-
import ora from "ora";
|
|
3
1
|
import chalk from "chalk";
|
|
2
|
+
import { program } from "commander";
|
|
4
3
|
import debug from "debug";
|
|
4
|
+
import ora from "ora";
|
|
5
5
|
|
|
6
6
|
import { getClient } from "../utils/index.ts";
|
|
7
7
|
|
|
8
8
|
const log = debug("ef:cli:auth");
|
|
9
9
|
|
|
10
10
|
export interface APIOrgResult {
|
|
11
|
-
|
|
11
|
+
apiKeyName: string;
|
|
12
12
|
id: string;
|
|
13
13
|
org_id: string;
|
|
14
14
|
created_at: unknown;
|
|
15
15
|
updated_at: unknown;
|
|
16
|
-
|
|
16
|
+
displayName: string;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export const getApiData = async () => {
|
|
20
|
-
const response = await getClient().authenticatedFetch("/api/
|
|
20
|
+
const response = await getClient().authenticatedFetch("/api/v1/organization");
|
|
21
21
|
return response.json() as Promise<APIOrgResult>;
|
|
22
22
|
};
|
|
23
23
|
|
|
@@ -33,14 +33,14 @@ const authCommand = program
|
|
|
33
33
|
try {
|
|
34
34
|
const apiData = await getApiData();
|
|
35
35
|
spinner.succeed("You are authenticated! 🎉");
|
|
36
|
-
process.stderr.write(chalk.green(`Name: ${apiData.name}\n`));
|
|
37
36
|
process.stderr.write(
|
|
38
|
-
chalk.green(`
|
|
37
|
+
chalk.green(`You're using ${apiData.apiKeyName} API key 🚀\n`),
|
|
38
|
+
);
|
|
39
|
+
process.stderr.write(
|
|
40
|
+
chalk.blue(`Welcome to ${apiData.displayName} organization 🎉\n`),
|
|
39
41
|
);
|
|
40
42
|
} catch (error: any) {
|
|
41
43
|
spinner.fail("Authentication failed!");
|
|
42
|
-
process.stderr.write(error?.message);
|
|
43
|
-
process.stderr.write("\n");
|
|
44
44
|
log("Error:", error);
|
|
45
45
|
}
|
|
46
46
|
});
|