Skip to content

Commit ba8936e

Browse files
committed
chore(release): 1.1.6
1 parent c33688b commit ba8936e

File tree

21 files changed

+59
-66
lines changed

21 files changed

+59
-66
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
### [1.1.6](https://github.com/boilingdata/boilingdata-bdcli/compare/v1.1.5...v1.1.6) (2024-11-05)
6+
57
### [1.1.5](https://github.com/boilingdata/boilingdata-bdcli/compare/v1.1.4...v1.1.5) (2024-11-05)
68

79
### [1.1.4](https://github.com/boilingdata/boilingdata-bdcli/compare/v1.1.3...v1.1.4) (2024-05-09)

dist/cjs/VERSION.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export declare const VERSION = "1.1.5";
1+
export declare const VERSION = "1.1.6";

dist/cjs/VERSION.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
"use strict";
22
Object.defineProperty(exports, "__esModule", { value: true });
33
exports.VERSION = void 0;
4-
exports.VERSION = "1.1.5";
4+
exports.VERSION = "1.1.6";

dist/cjs/bdcli/commands/account/bdcli-account-token-share.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ async function show(options, _command) {
6464
if (!region)
6565
throw new Error("Pass --region parameter or set AWS_REGION env");
6666
const bdAccount = new account_js_1.BDAccount({ logger, authToken: token });
67-
await bdAccount.shareToken(`${options.lifetime}` ?? "1h", options.vendingSchedule, users, options.name, options.sql);
67+
await bdAccount.shareToken(`${options.lifetime ?? "1h"}`, options.vendingSchedule, users, options.name, options.sql);
6868
(0, spinner_util_js_1.spinnerSuccess)();
6969
}
7070
catch (err) {

dist/cjs/bdcli/utils/auth_util.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
2626
return (mod && mod.__esModule) ? mod : { "default": mod };
2727
};
2828
Object.defineProperty(exports, "__esModule", { value: true });
29-
exports.getIdToken = exports.setupMfa = exports.recoverPassword = exports.updatePassword = exports.registerToBoilingData = exports.confirmEmailToBoilingData = exports.getPw = exports.getEmail = exports.validateTokenLifetime = exports.authSpinnerWithConfigCheck = exports.clientId = exports.userPoolId = void 0;
29+
exports.clientId = exports.userPoolId = void 0;
30+
exports.authSpinnerWithConfigCheck = authSpinnerWithConfigCheck;
31+
exports.validateTokenLifetime = validateTokenLifetime;
32+
exports.getEmail = getEmail;
33+
exports.getPw = getPw;
34+
exports.confirmEmailToBoilingData = confirmEmailToBoilingData;
35+
exports.registerToBoilingData = registerToBoilingData;
36+
exports.updatePassword = updatePassword;
37+
exports.recoverPassword = recoverPassword;
38+
exports.setupMfa = setupMfa;
39+
exports.getIdToken = getIdToken;
3040
const id = __importStar(require("amazon-cognito-identity-js"));
3141
const config_util_js_1 = require("./config_util.js");
3242
const boilingdata_api_js_1 = require("../../integration/boilingdata/boilingdata_api.js");
@@ -45,7 +55,6 @@ async function authSpinnerWithConfigCheck() {
4555
}
4656
return true;
4757
}
48-
exports.authSpinnerWithConfigCheck = authSpinnerWithConfigCheck;
4958
async function validateTokenLifetime(lifetime, logger) {
5059
const lifetimeInMs = (0, ms_1.default)(`${lifetime}`);
5160
logger?.debug({ lifetimeInMs });
@@ -55,7 +64,6 @@ async function validateTokenLifetime(lifetime, logger) {
5564
"Lifetime must be at min. 10min. Free tier max is 24h.");
5665
}
5766
}
58-
exports.validateTokenLifetime = validateTokenLifetime;
5967
async function getEmail() {
6068
(0, spinner_util_js_1.stopSpinner)();
6169
const inp = await (0, prompts_1.default)({
@@ -72,7 +80,6 @@ async function getEmail() {
7280
(0, spinner_util_js_1.resumeSpinner)();
7381
return inp["email"];
7482
}
75-
exports.getEmail = getEmail;
7683
async function getPw(message) {
7784
(0, spinner_util_js_1.stopSpinner)();
7885
const inp = await (0, prompts_1.default)({
@@ -87,7 +94,6 @@ async function getPw(message) {
8794
(0, spinner_util_js_1.resumeSpinner)();
8895
return inp["pw"];
8996
}
90-
exports.getPw = getPw;
9197
async function getCognitoUser(_logger, Username) {
9298
if (!Username) {
9399
const creds = await (0, config_util_js_1.getConfigCredentials)();
@@ -123,7 +129,6 @@ async function confirmEmailToBoilingData(confirm, logger) {
123129
});
124130
});
125131
}
126-
exports.confirmEmailToBoilingData = confirmEmailToBoilingData;
127132
async function registerToBoilingData(optsRegion, optsEnvironment, optsEmail, optsPassword, logger) {
128133
logger?.debug({ status: "registerToBoilingData" });
129134
const creds = await (0, config_util_js_1.getConfigCredentials)(logger);
@@ -164,7 +169,6 @@ async function registerToBoilingData(optsRegion, optsEnvironment, optsEmail, opt
164169
});
165170
});
166171
}
167-
exports.registerToBoilingData = registerToBoilingData;
168172
async function updatePassword(_logger) {
169173
const cognitoUser = await getCognitoUserSession();
170174
const oldPassword = (await (0, config_util_js_1.getConfigCredentials)()).password;
@@ -181,7 +185,6 @@ async function updatePassword(_logger) {
181185
});
182186
});
183187
}
184-
exports.updatePassword = updatePassword;
185188
async function recoverPassword(logger) {
186189
const cognitoUser = await getCognitoUser(logger);
187190
return new Promise((resolve, reject) => {
@@ -231,7 +234,6 @@ async function recoverPassword(logger) {
231234
});
232235
});
233236
}
234-
exports.recoverPassword = recoverPassword;
235237
async function setupMfa(logger) {
236238
const cognitoUser = await getCognitoUserSession(logger);
237239
const mfaSettings = { PreferredMfa: true, Enabled: true };
@@ -286,7 +288,6 @@ async function setupMfa(logger) {
286288
});
287289
});
288290
}
289-
exports.setupMfa = setupMfa;
290291
// NOTE: "accesstoken" does not work, it has to be "idtoken".
291292
async function getIdToken(logger) {
292293
const creds = await (0, config_util_js_1.getConfigCredentials)(logger);
@@ -378,4 +379,3 @@ async function getIdToken(logger) {
378379
});
379380
});
380381
}
381-
exports.getIdToken = getIdToken;

dist/cjs/bdcli/utils/config_util.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
2626
return (mod && mod.__esModule) ? mod : { "default": mod };
2727
};
2828
Object.defineProperty(exports, "__esModule", { value: true });
29-
exports.getConfigCredentials = exports.getCachedTokenSessions = exports.serialiseTokensList = exports.combineOptsWithSettings = exports.applyGlobalConfigHooks = exports.getEnvSettings = exports.getConfigSettings = exports.getConfig = exports.setProfile = exports.updateConfig = exports.dumpConfigProfile = exports.listConfigProfiles = exports.hasValidConfig = exports.profile = exports.BDCONF = void 0;
29+
exports.profile = exports.BDCONF = void 0;
30+
exports.hasValidConfig = hasValidConfig;
31+
exports.listConfigProfiles = listConfigProfiles;
32+
exports.dumpConfigProfile = dumpConfigProfile;
33+
exports.updateConfig = updateConfig;
34+
exports.setProfile = setProfile;
35+
exports.getConfig = getConfig;
36+
exports.getConfigSettings = getConfigSettings;
37+
exports.getEnvSettings = getEnvSettings;
38+
exports.applyGlobalConfigHooks = applyGlobalConfigHooks;
39+
exports.combineOptsWithSettings = combineOptsWithSettings;
40+
exports.serialiseTokensList = serialiseTokensList;
41+
exports.getCachedTokenSessions = getCachedTokenSessions;
42+
exports.getConfigCredentials = getConfigCredentials;
3043
const fs = __importStar(require("fs/promises"));
3144
const yaml = __importStar(require("js-yaml"));
3245
const os = __importStar(require("os"));
@@ -53,7 +66,6 @@ async function hasValidConfig(logger) {
5366
return false;
5467
}
5568
}
56-
exports.hasValidConfig = hasValidConfig;
5769
async function listConfigProfiles(logger) {
5870
try {
5971
const config = yaml.load(await fs.readFile(configFile, "utf8"));
@@ -66,7 +78,6 @@ async function listConfigProfiles(logger) {
6678
throw err;
6779
}
6880
}
69-
exports.listConfigProfiles = listConfigProfiles;
7081
async function dumpConfigProfile(profile, logger) {
7182
logger?.debug({ profile });
7283
const config = yaml.load(await fs.readFile(configFile, "utf8"));
@@ -75,7 +86,6 @@ async function dumpConfigProfile(profile, logger) {
7586
return;
7687
return dump;
7788
}
78-
exports.dumpConfigProfile = dumpConfigProfile;
7989
async function updateConfig(updates, logger) {
8090
let config = {};
8191
try {
@@ -100,12 +110,10 @@ async function updateConfig(updates, logger) {
100110
mode: 0o600,
101111
});
102112
}
103-
exports.updateConfig = updateConfig;
104113
function setProfile(profileName, logger) {
105114
exports.profile = profileName;
106115
logger?.debug({ profile: exports.profile });
107116
}
108-
exports.setProfile = setProfile;
109117
async function getConfig(logger) {
110118
try {
111119
const configFileData = await fs.readFile(configFile, "utf8");
@@ -122,14 +130,12 @@ async function getConfig(logger) {
122130
}
123131
return;
124132
}
125-
exports.getConfig = getConfig;
126133
async function getConfigSettings(logger) {
127134
const conf = await getConfig(logger);
128135
const settings = conf?.settings ?? {};
129136
logger?.debug({ settings });
130137
return settings;
131138
}
132-
exports.getConfigSettings = getConfigSettings;
133139
function camalize(str) {
134140
return str.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g, (_m, chr) => chr.toUpperCase());
135141
}
@@ -141,7 +147,6 @@ function getEnvSettings(logger) {
141147
logger?.debug({ bdEnvs });
142148
return bdEnvs;
143149
}
144-
exports.getEnvSettings = getEnvSettings;
145150
function applyGlobalConfigHooks(opts, logger) {
146151
// global opts handling due to the Commander short comings
147152
if (opts["profile"])
@@ -153,7 +158,6 @@ function applyGlobalConfigHooks(opts, logger) {
153158
if (opts["disableSpinner"])
154159
(0, spinner_util_js_1.disableSpinner)();
155160
}
156-
exports.applyGlobalConfigHooks = applyGlobalConfigHooks;
157161
async function combineOptsWithSettings(opts, logger) {
158162
const envSettings = getEnvSettings(logger);
159163
// we get e.g. BD_PROFILE, so we can get settings
@@ -164,11 +168,9 @@ async function combineOptsWithSettings(opts, logger) {
164168
logger?.debug({ options: { ...options, password: options["password"] ? "**" : undefined } });
165169
return options;
166170
}
167-
exports.combineOptsWithSettings = combineOptsWithSettings;
168171
function serialiseTokensList(sharedTokens) {
169172
return sharedTokens.map(entry => `${entry.shareId}:${entry.bdStsToken}`);
170173
}
171-
exports.serialiseTokensList = serialiseTokensList;
172174
async function getCachedTokenSessions(logger, showExpired = false) {
173175
const conf = await getConfig();
174176
const decodedList = (conf?.credentials?.sharedTokens ?? [])
@@ -196,7 +198,6 @@ async function getCachedTokenSessions(logger, showExpired = false) {
196198
.filter(e => !!e);
197199
return decodedList ?? [];
198200
}
199-
exports.getCachedTokenSessions = getCachedTokenSessions;
200201
async function getConfigCredentials(logger) {
201202
if (currentCreds)
202203
return currentCreds; // cached in mem, so you can call this method multiple times
@@ -214,4 +215,3 @@ async function getConfigCredentials(logger) {
214215
logger?.debug({ ...currentCreds, password: currentCreds?.password ? "**" : undefined });
215216
return currentCreds;
216217
}
217-
exports.getConfigCredentials = getConfigCredentials;

dist/cjs/bdcli/utils/logger_util.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
2323
return result;
2424
};
2525
Object.defineProperty(exports, "__esModule", { value: true });
26-
exports.getLogger = exports.ELogLevel = void 0;
26+
exports.ELogLevel = void 0;
27+
exports.getLogger = getLogger;
2728
const util = __importStar(require("node:util"));
2829
const winston = __importStar(require("winston"));
2930
var ELogLevel;
@@ -64,4 +65,3 @@ function getLogger(service) {
6465
setLogLevel: (level) => (logger.level = level),
6566
};
6667
}
67-
exports.getLogger = getLogger;

dist/cjs/bdcli/utils/options_util.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
2323
return result;
2424
};
2525
Object.defineProperty(exports, "__esModule", { value: true });
26-
exports.addGlobalOptions = void 0;
26+
exports.addGlobalOptions = addGlobalOptions;
2727
const cmd = __importStar(require("commander"));
2828
const logger_util_js_1 = require("./logger_util.js");
2929
const spinner_util_js_1 = require("./spinner_util.js");
@@ -40,4 +40,3 @@ async function addGlobalOptions(program, logger) {
4040
.on("option:debug", () => logger.setLogLevel(logger_util_js_1.ELogLevel.DEBUG))
4141
.on("option:disable-spinner", () => (0, spinner_util_js_1.disableSpinner)());
4242
}
43-
exports.addGlobalOptions = addGlobalOptions;

dist/cjs/bdcli/utils/output_util.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
2323
return result;
2424
};
2525
Object.defineProperty(exports, "__esModule", { value: true });
26-
exports.outputResults = void 0;
26+
exports.outputResults = outputResults;
2727
const util = __importStar(require("node:util"));
2828
async function outputResults(results, flat = false) {
2929
if (!results)
3030
return;
3131
console.log(flat ? JSON.stringify(results) : util.inspect(results, false, 20, true));
3232
}
33-
exports.outputResults = outputResults;

dist/cjs/bdcli/utils/spinner_util.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
33
return (mod && mod.__esModule) ? mod : { "default": mod };
44
};
55
Object.defineProperty(exports, "__esModule", { value: true });
6-
exports.spinnerInfo = exports.spinnerSuccess = exports.spinnerError = exports.spinnerWarn = exports.stopSpinner = exports.resumeSpinner = exports.updateSpinnerText = exports.enableSpinner = exports.disableSpinner = void 0;
6+
exports.disableSpinner = disableSpinner;
7+
exports.enableSpinner = enableSpinner;
8+
exports.updateSpinnerText = updateSpinnerText;
9+
exports.resumeSpinner = resumeSpinner;
10+
exports.stopSpinner = stopSpinner;
11+
exports.spinnerWarn = spinnerWarn;
12+
exports.spinnerError = spinnerError;
13+
exports.spinnerSuccess = spinnerSuccess;
14+
exports.spinnerInfo = spinnerInfo;
715
const ora_1 = __importDefault(require("ora"));
816
const chalk_1 = __importDefault(require("chalk"));
917
const error = chalk_1.default.bold.red;
@@ -15,11 +23,9 @@ let isEnabled = true;
1523
function disableSpinner() {
1624
isEnabled = false;
1725
}
18-
exports.disableSpinner = disableSpinner;
1926
function enableSpinner() {
2027
isEnabled = true;
2128
}
22-
exports.enableSpinner = enableSpinner;
2329
function updateSpinnerText(message) {
2430
if (!isEnabled)
2531
return;
@@ -28,44 +34,37 @@ function updateSpinnerText(message) {
2834
return;
2935
spinner.start();
3036
}
31-
exports.updateSpinnerText = updateSpinnerText;
3237
function resumeSpinner() {
3338
if (!isEnabled)
3439
return;
3540
if (!spinner.text)
3641
return; // error?
3742
spinner.start();
3843
}
39-
exports.resumeSpinner = resumeSpinner;
4044
function stopSpinner() {
4145
if (!isEnabled)
4246
return;
4347
if (spinner.isSpinning)
4448
spinner.stop();
4549
}
46-
exports.stopSpinner = stopSpinner;
4750
function spinnerWarn(message) {
4851
if (!isEnabled)
4952
return;
5053
spinner.warn(message ? warning(message) : warning(spinner.text));
5154
}
52-
exports.spinnerWarn = spinnerWarn;
5355
function spinnerError(message, forceExit = true) {
5456
// We show errors regardless whether the spinner is disabled
5557
spinner.fail(message ? error(message) : undefined);
5658
if (forceExit)
5759
process.exit(1); // error
5860
}
59-
exports.spinnerError = spinnerError;
6061
function spinnerSuccess(message) {
6162
if (!isEnabled)
6263
return;
6364
spinner.succeed(message ? success(message) : undefined);
6465
}
65-
exports.spinnerSuccess = spinnerSuccess;
6666
function spinnerInfo(message) {
6767
if (!isEnabled)
6868
return;
6969
spinner.info(blue(message));
7070
}
71-
exports.spinnerInfo = spinnerInfo;

0 commit comments

Comments
 (0)