Skip to content

Commit e295aa5

Browse files
authored
typing: add loadSsoSessionsFrom and expose private util methods to IniLoader (#4456)
* typing: add loadSsoSessionsFrom method to IniLoader * typing: expose getDefaultFilePath and getHomeDir methods
1 parent 4bcdd9a commit e295aa5

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

lib/shared-ini/ini-loader.d.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,30 @@ export class IniLoader{
2424
* Load configurations from config/credentials files and cache them
2525
* for later use. If no file is specified it will try to load default
2626
* files.
27-
* @returns {object} object of all profile information in the file
27+
* @returns {Record<string, string>} object of all profile information in the file
2828
*/
2929
loadFrom(options: LoadFileOptions): IniFileContent;
30+
31+
/**
32+
* Load sso sessions from config/credentials files and cache them
33+
* for later use. If no file is specified it will try to load default
34+
* files.
35+
* @returns {Record<string, string>} object of all sso sessions information in the file
36+
*/
37+
loadSsoSessionsFrom(options: LoadFileOptions): IniFileContent;
38+
39+
/**
40+
* Get default file path for config/credentials files.
41+
*
42+
* @param isConfig whether the file is a config file or a credentials file
43+
* @returns {string} default file path
44+
*/
45+
getDefaultFilePath(isConfig: boolean): string;
46+
47+
/**
48+
* Get Home directory of the current user.
49+
*
50+
* @returns {string} home directory path
51+
* */
52+
getHomeDir(): string;
3053
}

lib/shared-ini/ini-loader.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ AWS.IniLoader = AWS.util.inherit({
103103
return this.resolvedSsoSessions[filename];
104104
},
105105

106-
/**
107-
* @api private
108-
*/
109106
getDefaultFilePath: function getDefaultFilePath(isConfig) {
110107
return path.join(
111108
this.getHomeDir(),
@@ -114,9 +111,6 @@ AWS.IniLoader = AWS.util.inherit({
114111
);
115112
},
116113

117-
/**
118-
* @api private
119-
*/
120114
getHomeDir: function getHomeDir() {
121115
var env = process.env;
122116
var home = env.HOME ||

0 commit comments

Comments
 (0)