@grantjs/cli 1.5.3 → 1.5.4
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/api/client.d.ts +2 -10
- package/dist/config/index.d.ts +1 -2
- package/dist/config/storage.d.ts +0 -11
- package/dist/index.mjs +17 -12
- package/dist/index.mjs.map +1 -1
- package/dist/types/config.d.ts +4 -3
- package/package.json +5 -5
package/dist/api/client.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Minimal REST client for Grant API.
|
|
3
3
|
* Used by start (token exchange) and generate-types (resources/permissions).
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
interface TokenExchangeScope {
|
|
6
6
|
id: string;
|
|
7
7
|
tenant: string;
|
|
8
8
|
}
|
|
@@ -15,15 +15,6 @@ export interface TokenExchangeResponse {
|
|
|
15
15
|
accessToken: string;
|
|
16
16
|
expiresIn: number;
|
|
17
17
|
}
|
|
18
|
-
export interface ApiErrorBody {
|
|
19
|
-
success?: false;
|
|
20
|
-
error?: {
|
|
21
|
-
code?: string;
|
|
22
|
-
message?: string;
|
|
23
|
-
};
|
|
24
|
-
reason?: string;
|
|
25
|
-
code?: string;
|
|
26
|
-
}
|
|
27
18
|
export interface LoginAccount {
|
|
28
19
|
id: string;
|
|
29
20
|
type: string;
|
|
@@ -99,3 +90,4 @@ export declare function fetchResources(baseUrl: string, accessToken: string, sco
|
|
|
99
90
|
* Fetch all permissions for a scope (paginated). Requires Bearer token.
|
|
100
91
|
*/
|
|
101
92
|
export declare function fetchPermissions(baseUrl: string, accessToken: string, scope: ApiScope): Promise<PermissionItem[]>;
|
|
93
|
+
export {};
|
package/dist/config/index.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export type { ApiKeyCredentials, GrantConfig, GrantConfigFile, GrantScope, ProfileName, SessionCredentials, } from '../types/config.js';
|
|
2
1
|
export { resolveAccessToken } from './resolve-token.js';
|
|
3
|
-
export { DEFAULT_PROFILE_NAME,
|
|
2
|
+
export { DEFAULT_PROFILE_NAME, getConfigPath, listProfileNames, loadConfigFile, loadProfile, saveConfigFile, } from './storage.js';
|
package/dist/config/storage.d.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import { GrantConfig, GrantConfigFile } from '../types/config.js';
|
|
2
2
|
declare const DEFAULT_PROFILE_NAME = "default";
|
|
3
|
-
/**
|
|
4
|
-
* Returns the platform-specific config directory for Grant CLI.
|
|
5
|
-
* - Windows: %APPDATA%\grant
|
|
6
|
-
* - Linux/macOS: $XDG_CONFIG_HOME/grant or ~/.config/grant
|
|
7
|
-
*/
|
|
8
|
-
export declare function getConfigDir(): string;
|
|
9
3
|
/**
|
|
10
4
|
* Returns the path to the config file (config dir + config.json).
|
|
11
5
|
*/
|
|
@@ -33,11 +27,6 @@ export declare function getProfileConfig(file: GrantConfigFile, profileName: str
|
|
|
33
27
|
export declare function listProfileNames(file: GrantConfigFile | null): string[];
|
|
34
28
|
/** Default profile name constant for use in prompts/help. */
|
|
35
29
|
export { DEFAULT_PROFILE_NAME };
|
|
36
|
-
/**
|
|
37
|
-
* Load config file and return the default profile's config.
|
|
38
|
-
* Convenience for callers that only need one profile (default). Returns null if no file or default profile missing.
|
|
39
|
-
*/
|
|
40
|
-
export declare function loadConfig(): Promise<GrantConfig | null>;
|
|
41
30
|
/**
|
|
42
31
|
* Load config file and return the resolved profile's config plus file and name.
|
|
43
32
|
* Use when you need to read and then update (save) the file. Returns null if no file or profile does not exist.
|
package/dist/index.mjs
CHANGED
|
@@ -1527,9 +1527,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1527
1527
|
const oldValue = this.getOptionValue(name);
|
|
1528
1528
|
if (val !== null && option.parseArg) val = this._callParseArg(option, val, oldValue, invalidValueMessage);
|
|
1529
1529
|
else if (val !== null && option.variadic) val = option._collectValue(val, oldValue);
|
|
1530
|
-
if (val == null)
|
|
1531
|
-
|
|
1532
|
-
|
|
1530
|
+
if (val == null) {
|
|
1531
|
+
if (option.negate) val = false;
|
|
1532
|
+
else if (option.isBoolean() || option.optional) val = true;
|
|
1533
|
+
else val = "";
|
|
1534
|
+
}
|
|
1533
1535
|
this.setOptionValueWithSource(name, val, valueSource);
|
|
1534
1536
|
};
|
|
1535
1537
|
this.on("option:" + oname, (val) => {
|
|
@@ -1933,12 +1935,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1933
1935
|
}
|
|
1934
1936
|
const launchWithNode = sourceExt.includes(path.extname(executableFile));
|
|
1935
1937
|
let proc;
|
|
1936
|
-
if (process$1.platform !== "win32")
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1938
|
+
if (process$1.platform !== "win32") {
|
|
1939
|
+
if (launchWithNode) {
|
|
1940
|
+
args.unshift(executableFile);
|
|
1941
|
+
args = incrementNodeInspectorPort(process$1.execArgv).concat(args);
|
|
1942
|
+
proc = childProcess.spawn(process$1.argv[0], args, { stdio: "inherit" });
|
|
1943
|
+
} else proc = childProcess.spawn(executableFile, args, { stdio: "inherit" });
|
|
1944
|
+
} else {
|
|
1942
1945
|
this._checkForMissingExecutable(executableFile, executableDir, subcommand._name);
|
|
1943
1946
|
args.unshift(executableFile);
|
|
1944
1947
|
args = incrementNodeInspectorPort(process$1.execArgv).concat(args);
|
|
@@ -2382,8 +2385,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2382
2385
|
"default",
|
|
2383
2386
|
"config",
|
|
2384
2387
|
"env"
|
|
2385
|
-
].includes(this.getOptionValueSource(optionKey)))
|
|
2386
|
-
|
|
2388
|
+
].includes(this.getOptionValueSource(optionKey))) {
|
|
2389
|
+
if (option.required || option.optional) this.emit(`optionEnv:${option.name()}`, process$1.env[option.envVar]);
|
|
2390
|
+
else this.emit(`optionEnv:${option.name()}`);
|
|
2391
|
+
}
|
|
2387
2392
|
}
|
|
2388
2393
|
});
|
|
2389
2394
|
}
|
|
@@ -4111,7 +4116,7 @@ function createStartCommand(program) {
|
|
|
4111
4116
|
//#endregion
|
|
4112
4117
|
//#region src/utils/package.ts
|
|
4113
4118
|
function getPackageVersion() {
|
|
4114
|
-
return "1.5.
|
|
4119
|
+
return "1.5.4";
|
|
4115
4120
|
}
|
|
4116
4121
|
//#endregion
|
|
4117
4122
|
//#region src/commands/version.ts
|