@agledger/cli 1.0.1 → 1.0.3
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,WAAW;IAC3C,OAAgB,WAAW,SACiF;IAE5G,OAAgB,KAAK;;;;;;MAAgC;IAE/C,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,WAAW;IAC3C,OAAgB,WAAW,SACiF;IAE5G,OAAgB,KAAK;;;;;;MAAgC;IAE/C,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA0B3B"}
|
package/dist/commands/auth.js
CHANGED
|
@@ -9,8 +9,12 @@ export default class Auth extends BaseCommand {
|
|
|
9
9
|
static flags = { ...BaseCommand.baseFlags };
|
|
10
10
|
async run() {
|
|
11
11
|
const { flags } = await this.parse(Auth);
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
// Resolve the key the same way an actual call does: --api-key flag > env >
|
|
13
|
+
// stored profile in ~/.agledger/config.json. The previous check looked only
|
|
14
|
+
// at the flag/env, so `agledger auth` reported not-authenticated right after
|
|
15
|
+
// a successful `login` wrote the key to a profile (cross-repo #94).
|
|
16
|
+
const auth = this.resolvedAuth(flags);
|
|
17
|
+
if (auth.source === 'none') {
|
|
14
18
|
this.output({ authenticated: false, message: 'No API key configured. Run `agledger login --api-key <key>`.' });
|
|
15
19
|
return;
|
|
16
20
|
}
|
|
@@ -19,7 +23,12 @@ export default class Auth extends BaseCommand {
|
|
|
19
23
|
if (!response.ok) {
|
|
20
24
|
this.handleApiError(response);
|
|
21
25
|
}
|
|
22
|
-
this.output({
|
|
26
|
+
this.output({
|
|
27
|
+
authenticated: true,
|
|
28
|
+
source: auth.source,
|
|
29
|
+
...(auth.profile ? { profile: auth.profile } : {}),
|
|
30
|
+
account: response.body,
|
|
31
|
+
});
|
|
23
32
|
}
|
|
24
33
|
catch (err) {
|
|
25
34
|
this.handleError(err);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,WAAW;IAC3C,MAAM,CAAU,WAAW,GACzB,yGAAyG,CAAC;IAE5G,MAAM,CAAU,KAAK,GAAG,EAAE,GAAG,WAAW,CAAC,SAAS,EAAE,CAAC;IAErD,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACzC,
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,WAAW;IAC3C,MAAM,CAAU,WAAW,GACzB,yGAAyG,CAAC;IAE5G,MAAM,CAAU,KAAK,GAAG,EAAE,GAAG,WAAW,CAAC,SAAS,EAAE,CAAC;IAErD,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACzC,2EAA2E;QAC3E,4EAA4E;QAC5E,6EAA6E;QAC7E,oEAAoE;QACpE,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QACtC,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;YAC3B,IAAI,CAAC,MAAM,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,8DAA8D,EAAE,CAAC,CAAC;YAC/G,OAAO;QACT,CAAC;QACD,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC;YACjE,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;gBACjB,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;YAChC,CAAC;YACD,IAAI,CAAC,MAAM,CAAC;gBACV,aAAa,EAAE,IAAI;gBACnB,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAClD,OAAO,EAAE,QAAQ,CAAC,IAAI;aACvB,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;IACH,CAAC"}
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agledger/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "AGLedger CLI — Developer and agent interface for AGLedger",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"prepublishOnly": "npm run build && npm run lint:pkg"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@agledger/verify-core": "^0.
|
|
31
|
+
"@agledger/verify-core": "^1.0.0",
|
|
32
32
|
"@oclif/core": "^4.9.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|