onlineornot 0.0.9 → 0.0.10
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/onlineornot-dist/cli.js +22 -16
- package/onlineornot-dist/cli.js.map +3 -3
- package/package.json +1 -1
package/onlineornot-dist/cli.js
CHANGED
|
@@ -24051,7 +24051,7 @@ var Yargs = YargsFactory(esm_default);
|
|
|
24051
24051
|
var yargs_default = Yargs;
|
|
24052
24052
|
|
|
24053
24053
|
// package.json
|
|
24054
|
-
var version = "0.0.
|
|
24054
|
+
var version = "0.0.10";
|
|
24055
24055
|
var package_default = {
|
|
24056
24056
|
name: "onlineornot",
|
|
24057
24057
|
version,
|
|
@@ -24733,6 +24733,22 @@ var supports_color_default2 = supportsColor2;
|
|
|
24733
24733
|
var import_node_util = require("node:util");
|
|
24734
24734
|
var import_cli_table3 = __toESM(require_cli_table3());
|
|
24735
24735
|
var import_esbuild = require("esbuild");
|
|
24736
|
+
|
|
24737
|
+
// src/environment-variables/factory.ts
|
|
24738
|
+
function getEnvironmentVariableFactory({
|
|
24739
|
+
variableName,
|
|
24740
|
+
defaultValue
|
|
24741
|
+
}) {
|
|
24742
|
+
return () => {
|
|
24743
|
+
if (process.env[variableName]) {
|
|
24744
|
+
return process.env[variableName];
|
|
24745
|
+
} else {
|
|
24746
|
+
return defaultValue?.();
|
|
24747
|
+
}
|
|
24748
|
+
};
|
|
24749
|
+
}
|
|
24750
|
+
|
|
24751
|
+
// src/logger.ts
|
|
24736
24752
|
var LOGGER_LEVELS = {
|
|
24737
24753
|
none: -1,
|
|
24738
24754
|
error: 0,
|
|
@@ -24748,10 +24764,14 @@ var LOGGER_LEVEL_FORMAT_TYPE_MAP = {
|
|
|
24748
24764
|
log: void 0,
|
|
24749
24765
|
debug: void 0
|
|
24750
24766
|
};
|
|
24767
|
+
var getLogLevelFromEnv = getEnvironmentVariableFactory({
|
|
24768
|
+
variableName: "ONLINEORNOT_LOG",
|
|
24769
|
+
defaultValue: () => "log"
|
|
24770
|
+
});
|
|
24751
24771
|
var Logger = class {
|
|
24752
24772
|
constructor() {
|
|
24753
24773
|
}
|
|
24754
|
-
loggerLevel = "log";
|
|
24774
|
+
loggerLevel = getLogLevelFromEnv() ?? "log";
|
|
24755
24775
|
columns = process.stdout.columns;
|
|
24756
24776
|
debug = (...args) => this.doLog("debug", args);
|
|
24757
24777
|
info = (...args) => this.doLog("info", args);
|
|
@@ -24869,20 +24889,6 @@ var import_undici = __toESM(require_undici());
|
|
|
24869
24889
|
// src/constants.ts
|
|
24870
24890
|
var API_BASE_URL = "https://api.onlineornot.com/v1";
|
|
24871
24891
|
|
|
24872
|
-
// src/environment-variables/factory.ts
|
|
24873
|
-
function getEnvironmentVariableFactory({
|
|
24874
|
-
variableName,
|
|
24875
|
-
defaultValue
|
|
24876
|
-
}) {
|
|
24877
|
-
return () => {
|
|
24878
|
-
if (process.env[variableName]) {
|
|
24879
|
-
return process.env[variableName];
|
|
24880
|
-
} else {
|
|
24881
|
-
return defaultValue?.();
|
|
24882
|
-
}
|
|
24883
|
-
};
|
|
24884
|
-
}
|
|
24885
|
-
|
|
24886
24892
|
// src/environment-variables/misc-variables.ts
|
|
24887
24893
|
var getOnlineOrNotAPITokenFromEnv = getEnvironmentVariableFactory({
|
|
24888
24894
|
variableName: "ONLINEORNOT_API_TOKEN",
|