@levr-one/cli 0.2.0 → 0.3.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.
@@ -1,8 +1,8 @@
1
- import "./env-hpzB56ay.js";
2
- import { authGetSitesV1, configureClient } from "./sdk-client-BCOB2qNU.js";
3
- import { saveWorkspace } from "./workspace-store-BcyMJAht.js";
4
- import "./token-refresh-BYu4XO3G.js";
5
- import { resolveToken } from "./resolve-token-DizP2xRY.js";
1
+ import "./env-NxtzJJPk.js";
2
+ import { authGetSitesV1, configureClient } from "./sdk-client-BWrIbeUg.js";
3
+ import { saveWorkspace } from "./workspace-store-4hfvsEHS.js";
4
+ import "./token-refresh-Cz-FqDtC.js";
5
+ import { resolveToken } from "./resolve-token-BRPrqdG-.js";
6
6
 
7
7
  //#region src/commands/workspace/selectHandler.ts
8
8
  async function selectHandler(_flags, workspaceId) {
@@ -1,6 +1,6 @@
1
- import { getApiUrl, getPatToken, readCredentials } from "./env-hpzB56ay.js";
2
- import { authGetProfileV1, configureClient } from "./sdk-client-BCOB2qNU.js";
3
- import { isTokenExpired } from "./token-refresh-BYu4XO3G.js";
1
+ import { getApiUrl, getPatToken, readCredentials } from "./env-NxtzJJPk.js";
2
+ import { authGetProfileV1, configureClient } from "./sdk-client-BWrIbeUg.js";
3
+ import { isTokenExpired } from "./token-refresh-Cz-FqDtC.js";
4
4
  import chalk from "chalk";
5
5
 
6
6
  //#region src/commands/auth/statusHandler.ts
@@ -1,4 +1,4 @@
1
- import { CLI_CLIENT_ID, deleteCredentials, getApiUrl, writeCredentials } from "./env-hpzB56ay.js";
1
+ import { CLI_CLIENT_ID, deleteCredentials, getApiUrl, writeCredentials } from "./env-NxtzJJPk.js";
2
2
 
3
3
  //#region src/auth/token-refresh.ts
4
4
  const REFRESH_BUFFER_MS = 300 * 1e3;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@levr-one/cli",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "The command-line interface for Levr",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -13,9 +13,11 @@
13
13
  "README.md"
14
14
  ],
15
15
  "dependencies": {
16
+ "@clack/prompts": "^1.7.0",
16
17
  "@stricli/auto-complete": "^1.2.0",
17
18
  "@stricli/core": "^1.2.0",
18
19
  "chalk": "^5.6.2",
20
+ "jsonc-parser": "^3.3.1",
19
21
  "open": "^10.1.0",
20
22
  "ora": "^9.0.0",
21
23
  "zod": "^3.25.0"
@@ -1,51 +0,0 @@
1
- import { performLogin } from "./loginHandler-BSrs0mHq.js";
2
- import { setSessionApiUrl } from "./env-hpzB56ay.js";
3
- import { authGetSitesV1, configureClient } from "./sdk-client-BCOB2qNU.js";
4
- import "./workspace-store-BcyMJAht.js";
5
- import "./resolve-workspace-EpjKI71z.js";
6
- import "./token-refresh-BYu4XO3G.js";
7
- import { CredentialsMismatchError, resolveToken } from "./resolve-token-DizP2xRY.js";
8
- import { printSites } from "./listHandler-DDd6scZ8.js";
9
- import chalk from "chalk";
10
-
11
- //#region src/commands/initHandler.ts
12
- /**
13
- * First-run onboarding: authenticate if needed, then list workspaces.
14
- * Composes the existing login flow (loginHandler's performLogin) with the
15
- * workspace listing (listHandler's printSites) — absorbs the retired
16
- * @levr-one/setup flow (ENG-2361).
17
- */
18
- async function initHandler(flags) {
19
- if (flags.url) setSessionApiUrl(flags.url);
20
- let auth;
21
- try {
22
- auth = await resolveToken();
23
- this.logger.success("Already authenticated.");
24
- } catch (resolveError) {
25
- if (resolveError instanceof CredentialsMismatchError) this.logger.warning(resolveError.message);
26
- if (!await performLogin(this, { deviceCode: flags["device-code"] })) return;
27
- try {
28
- auth = await resolveToken();
29
- } catch (error) {
30
- this.logger.error(error instanceof Error ? error.message : "Authentication failed.");
31
- this.process.exitCode = 1;
32
- return;
33
- }
34
- }
35
- if (auth.type === "pat") {
36
- this.logger.info("Authenticated via LEVR_TOKEN (PAT). Workspace listing requires JWT auth — run 'levr auth login' to browse workspaces.");
37
- return;
38
- }
39
- configureClient(auth);
40
- const result = await authGetSitesV1();
41
- if (result.error) {
42
- this.logger.error("Failed to list workspaces.");
43
- this.process.exitCode = 1;
44
- return;
45
- }
46
- printSites(this, result.data.sites);
47
- this.process.stdout.write(`Next: ${chalk.cyan("'levr workspace select <id>'")} to pick a workspace, then ${chalk.cyan("'levr push <file>'")} to upload results.\n`);
48
- }
49
-
50
- //#endregion
51
- export { initHandler };
@@ -1,8 +0,0 @@
1
- import "./env-hpzB56ay.js";
2
- import "./sdk-client-BCOB2qNU.js";
3
- import "./workspace-store-BcyMJAht.js";
4
- import "./token-refresh-BYu4XO3G.js";
5
- import "./resolve-token-DizP2xRY.js";
6
- import { listHandler, printSites } from "./listHandler-DDd6scZ8.js";
7
-
8
- export { listHandler };
@@ -1,7 +0,0 @@
1
- import { loginHandler, performLogin } from "./loginHandler-BSrs0mHq.js";
2
- import "./env-hpzB56ay.js";
3
- import "./sdk-client-BCOB2qNU.js";
4
- import "./workspace-store-BcyMJAht.js";
5
- import "./resolve-workspace-EpjKI71z.js";
6
-
7
- export { loginHandler };