@reporting-bi/cli 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/dist/index.js +195 -120
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1055,13 +1055,13 @@ var require_implementation = __commonJS({
|
|
|
1055
1055
|
if (typeof target !== "function" || toStr2.apply(target) !== funcType) {
|
|
1056
1056
|
throw new TypeError(ERROR_MESSAGE + target);
|
|
1057
1057
|
}
|
|
1058
|
-
var
|
|
1058
|
+
var args = slicy(arguments, 1);
|
|
1059
1059
|
var bound;
|
|
1060
1060
|
var binder = function() {
|
|
1061
1061
|
if (this instanceof bound) {
|
|
1062
1062
|
var result = target.apply(
|
|
1063
1063
|
this,
|
|
1064
|
-
concatty(
|
|
1064
|
+
concatty(args, arguments)
|
|
1065
1065
|
);
|
|
1066
1066
|
if (Object(result) === result) {
|
|
1067
1067
|
return result;
|
|
@@ -1070,10 +1070,10 @@ var require_implementation = __commonJS({
|
|
|
1070
1070
|
}
|
|
1071
1071
|
return target.apply(
|
|
1072
1072
|
that,
|
|
1073
|
-
concatty(
|
|
1073
|
+
concatty(args, arguments)
|
|
1074
1074
|
);
|
|
1075
1075
|
};
|
|
1076
|
-
var boundLength = max(0, target.length -
|
|
1076
|
+
var boundLength = max(0, target.length - args.length);
|
|
1077
1077
|
var boundArgs = [];
|
|
1078
1078
|
for (var i = 0; i < boundLength; i++) {
|
|
1079
1079
|
boundArgs[i] = "$" + i;
|
|
@@ -1144,11 +1144,11 @@ var require_call_bind_apply_helpers = __commonJS({
|
|
|
1144
1144
|
var $TypeError = require_type();
|
|
1145
1145
|
var $call = require_functionCall();
|
|
1146
1146
|
var $actualApply = require_actualApply();
|
|
1147
|
-
module2.exports = function callBindBasic(
|
|
1148
|
-
if (
|
|
1147
|
+
module2.exports = function callBindBasic(args) {
|
|
1148
|
+
if (args.length < 1 || typeof args[0] !== "function") {
|
|
1149
1149
|
throw new $TypeError("a function is required");
|
|
1150
1150
|
}
|
|
1151
|
-
return $actualApply(bind, $call,
|
|
1151
|
+
return $actualApply(bind, $call, args);
|
|
1152
1152
|
};
|
|
1153
1153
|
}
|
|
1154
1154
|
});
|
|
@@ -2650,7 +2650,7 @@ var require_service = __commonJS({
|
|
|
2650
2650
|
this.options.baseUrl = `https://${this.options.baseUrl}`;
|
|
2651
2651
|
}
|
|
2652
2652
|
}
|
|
2653
|
-
createUrl(
|
|
2653
|
+
createUrl(path3 = "", params) {
|
|
2654
2654
|
if (this.options.xdebugSession) {
|
|
2655
2655
|
params = params || {};
|
|
2656
2656
|
params.XDEBUG_SESSION = this.options.xdebugSession === true ? "1" : this.options.xdebugSession.toString();
|
|
@@ -2660,8 +2660,8 @@ var require_service = __commonJS({
|
|
|
2660
2660
|
}
|
|
2661
2661
|
const queryString = params ? "?" + serializeRequestParams(params) : "";
|
|
2662
2662
|
const a = params && params.accounting ? params.accounting.toString() : this.a ? this.a.toString() : null;
|
|
2663
|
-
|
|
2664
|
-
const parts = [this.options.baseUrl, a, this.options.name,
|
|
2663
|
+
path3 = path3.replace(/^\//, "");
|
|
2664
|
+
const parts = [this.options.baseUrl, a, this.options.name, path3];
|
|
2665
2665
|
return parts.filter((p) => p != null && p !== "").join("/") + queryString;
|
|
2666
2666
|
}
|
|
2667
2667
|
async createHeaders(headers) {
|
|
@@ -2702,28 +2702,28 @@ var require_service = __commonJS({
|
|
|
2702
2702
|
return await response.text();
|
|
2703
2703
|
}
|
|
2704
2704
|
}
|
|
2705
|
-
async getRaw(
|
|
2706
|
-
return fetch(this.createUrl(
|
|
2705
|
+
async getRaw(path3, params, options) {
|
|
2706
|
+
return fetch(this.createUrl(path3, params), {
|
|
2707
2707
|
headers: await this.createHeaders(options?.headers),
|
|
2708
2708
|
credentials: this.credentials
|
|
2709
2709
|
});
|
|
2710
2710
|
}
|
|
2711
|
-
async get(
|
|
2711
|
+
async get(path3, params, options) {
|
|
2712
2712
|
if (options?.cache) {
|
|
2713
|
-
const cachedData = this.cache.get({ path:
|
|
2713
|
+
const cachedData = this.cache.get({ path: path3, params });
|
|
2714
2714
|
if (cachedData)
|
|
2715
2715
|
return cachedData;
|
|
2716
2716
|
}
|
|
2717
|
-
const response = await this.getRaw(
|
|
2717
|
+
const response = await this.getRaw(path3, params, options);
|
|
2718
2718
|
const responseData = await this.handleResponse(response, options?.parseResponse);
|
|
2719
2719
|
if (options?.cache && responseData) {
|
|
2720
|
-
this.cache.set({ path:
|
|
2720
|
+
this.cache.set({ path: path3, params }, responseData);
|
|
2721
2721
|
}
|
|
2722
2722
|
return responseData;
|
|
2723
2723
|
}
|
|
2724
|
-
async postRaw(
|
|
2724
|
+
async postRaw(path3, data, params, options) {
|
|
2725
2725
|
const json = isObject(data) || Array.isArray(data);
|
|
2726
|
-
return fetch(this.createUrl(
|
|
2726
|
+
return fetch(this.createUrl(path3, params), {
|
|
2727
2727
|
method: "POST",
|
|
2728
2728
|
body: json ? JSON.stringify(data) : data,
|
|
2729
2729
|
headers: await this.createHeaders({
|
|
@@ -2733,24 +2733,24 @@ var require_service = __commonJS({
|
|
|
2733
2733
|
credentials: this.credentials
|
|
2734
2734
|
});
|
|
2735
2735
|
}
|
|
2736
|
-
async post(
|
|
2737
|
-
const response = await this.postRaw(
|
|
2736
|
+
async post(path3, data, params, options) {
|
|
2737
|
+
const response = await this.postRaw(path3, data, params, options);
|
|
2738
2738
|
return this.handleResponse(response);
|
|
2739
2739
|
}
|
|
2740
|
-
async deleteRaw(
|
|
2741
|
-
return fetch(this.createUrl(
|
|
2740
|
+
async deleteRaw(path3, params, options) {
|
|
2741
|
+
return fetch(this.createUrl(path3, params), {
|
|
2742
2742
|
method: "DELETE",
|
|
2743
2743
|
headers: await this.createHeaders(options?.headers),
|
|
2744
2744
|
credentials: this.credentials
|
|
2745
2745
|
});
|
|
2746
2746
|
}
|
|
2747
|
-
async delete(
|
|
2748
|
-
const response = await this.deleteRaw(
|
|
2747
|
+
async delete(path3, params, options) {
|
|
2748
|
+
const response = await this.deleteRaw(path3, params, options);
|
|
2749
2749
|
return this.handleResponse(response);
|
|
2750
2750
|
}
|
|
2751
|
-
async putRaw(
|
|
2751
|
+
async putRaw(path3, data, params, options) {
|
|
2752
2752
|
const json = isObject(data) || Array.isArray(data);
|
|
2753
|
-
return fetch(this.createUrl(
|
|
2753
|
+
return fetch(this.createUrl(path3, params), {
|
|
2754
2754
|
method: "PUT",
|
|
2755
2755
|
body: json ? JSON.stringify(data) : data,
|
|
2756
2756
|
headers: await this.createHeaders({
|
|
@@ -2760,8 +2760,8 @@ var require_service = __commonJS({
|
|
|
2760
2760
|
credentials: this.credentials
|
|
2761
2761
|
});
|
|
2762
2762
|
}
|
|
2763
|
-
async put(
|
|
2764
|
-
const response = await this.putRaw(
|
|
2763
|
+
async put(path3, data, params, options) {
|
|
2764
|
+
const response = await this.putRaw(path3, data, params, options);
|
|
2765
2765
|
return this.handleResponse(response);
|
|
2766
2766
|
}
|
|
2767
2767
|
};
|
|
@@ -3136,21 +3136,21 @@ var FLAG_ALIASES = {
|
|
|
3136
3136
|
s: "sort",
|
|
3137
3137
|
f: "filter"
|
|
3138
3138
|
};
|
|
3139
|
-
function parseArgs(
|
|
3139
|
+
function parseArgs(args) {
|
|
3140
3140
|
const positional = [];
|
|
3141
3141
|
const flags = {};
|
|
3142
|
-
for (let i = 0; i <
|
|
3143
|
-
if (
|
|
3144
|
-
flags[
|
|
3145
|
-
} else if (
|
|
3146
|
-
flags[
|
|
3142
|
+
for (let i = 0; i < args.length; i++) {
|
|
3143
|
+
if (args[i].startsWith("--") && (i + 1 >= args.length || args[i + 1].startsWith("-"))) {
|
|
3144
|
+
flags[args[i].slice(2)] = "true";
|
|
3145
|
+
} else if (args[i].startsWith("--") && i + 1 < args.length) {
|
|
3146
|
+
flags[args[i].slice(2)] = args[i + 1];
|
|
3147
3147
|
i++;
|
|
3148
|
-
} else if (
|
|
3149
|
-
const key = FLAG_ALIASES[
|
|
3150
|
-
flags[key] =
|
|
3148
|
+
} else if (args[i].startsWith("-") && !args[i].startsWith("--") && i + 1 < args.length) {
|
|
3149
|
+
const key = FLAG_ALIASES[args[i].slice(1)] || args[i].slice(1);
|
|
3150
|
+
flags[key] = args[i + 1];
|
|
3151
3151
|
i++;
|
|
3152
3152
|
} else {
|
|
3153
|
-
positional.push(
|
|
3153
|
+
positional.push(args[i]);
|
|
3154
3154
|
}
|
|
3155
3155
|
}
|
|
3156
3156
|
return { positional, flags };
|
|
@@ -3209,8 +3209,8 @@ async function fetchAccountingName(accountingId) {
|
|
|
3209
3209
|
const match = accountings?.find((a) => a.accounting === accountingId);
|
|
3210
3210
|
return match?.company ?? null;
|
|
3211
3211
|
}
|
|
3212
|
-
async function accounting(
|
|
3213
|
-
const { positional, flags } = parseArgs(
|
|
3212
|
+
async function accounting(args) {
|
|
3213
|
+
const { positional, flags } = parseArgs(args);
|
|
3214
3214
|
const [subcommand] = positional;
|
|
3215
3215
|
switch (subcommand) {
|
|
3216
3216
|
case "list":
|
|
@@ -3294,8 +3294,8 @@ function openBrowser(url) {
|
|
|
3294
3294
|
const cmd = platform === "darwin" ? "open" : platform === "win32" ? 'start ""' : "xdg-open";
|
|
3295
3295
|
(0, import_node_child_process.exec)(`${cmd} ${JSON.stringify(url)}`);
|
|
3296
3296
|
}
|
|
3297
|
-
async function login(
|
|
3298
|
-
const { positional, flags } = parseArgs(
|
|
3297
|
+
async function login(args) {
|
|
3298
|
+
const { positional, flags } = parseArgs(args);
|
|
3299
3299
|
const domain = positional[0] || "https://reporting.bi";
|
|
3300
3300
|
const accounting2 = flags.accounting ? parseInt(flags.accounting) : void 0;
|
|
3301
3301
|
console.log(`Logging in to ${domain}...`);
|
|
@@ -3426,8 +3426,8 @@ function status() {
|
|
|
3426
3426
|
}
|
|
3427
3427
|
|
|
3428
3428
|
// src/commands/use.ts
|
|
3429
|
-
async function use(
|
|
3430
|
-
const { positional, flags } = parseArgs(
|
|
3429
|
+
async function use(args) {
|
|
3430
|
+
const { positional, flags } = parseArgs(args);
|
|
3431
3431
|
const accounting2 = flags.accounting ? parseInt(flags.accounting) : void 0;
|
|
3432
3432
|
let domain = positional[0];
|
|
3433
3433
|
if (!domain && !accounting2) {
|
|
@@ -3525,8 +3525,8 @@ async function del(id, flags) {
|
|
|
3525
3525
|
await service.delete(`page/${lang}/${id}`);
|
|
3526
3526
|
console.log(`Page ${id} deleted.`);
|
|
3527
3527
|
}
|
|
3528
|
-
async function wiki(
|
|
3529
|
-
const { positional, flags } = parseArgs(
|
|
3528
|
+
async function wiki(args) {
|
|
3529
|
+
const { positional, flags } = parseArgs(args);
|
|
3530
3530
|
const [subcommand, ...rest] = positional;
|
|
3531
3531
|
switch (subcommand) {
|
|
3532
3532
|
case "list":
|
|
@@ -3597,8 +3597,8 @@ async function search2(query, flags) {
|
|
|
3597
3597
|
const results = await service.get("search", { ...getListParams(flags, DEFAULT_FIELDS), q: query });
|
|
3598
3598
|
output(results || [], flags);
|
|
3599
3599
|
}
|
|
3600
|
-
async function etl(
|
|
3601
|
-
const { positional, flags } = parseArgs(
|
|
3600
|
+
async function etl(args) {
|
|
3601
|
+
const { positional, flags } = parseArgs(args);
|
|
3602
3602
|
const [subcommand, ...rest] = positional;
|
|
3603
3603
|
switch (subcommand) {
|
|
3604
3604
|
case "list":
|
|
@@ -3656,8 +3656,8 @@ async function statusCmd(flags) {
|
|
|
3656
3656
|
const statuses = await service.get("jobStatuses", getListParams(flags, DEFAULT_STATUS_FIELDS));
|
|
3657
3657
|
output(statuses || [], flags);
|
|
3658
3658
|
}
|
|
3659
|
-
async function jobs(
|
|
3660
|
-
const { positional, flags } = parseArgs(
|
|
3659
|
+
async function jobs(args) {
|
|
3660
|
+
const { positional, flags } = parseArgs(args);
|
|
3661
3661
|
const [subcommand, ...rest] = positional;
|
|
3662
3662
|
switch (subcommand) {
|
|
3663
3663
|
case "list":
|
|
@@ -3684,8 +3684,8 @@ async function jobs(args2) {
|
|
|
3684
3684
|
|
|
3685
3685
|
// src/commands/analytics.ts
|
|
3686
3686
|
var DEFAULT_CONTEXT_FIELDS = ["id_context", "name", "module", "user_name"];
|
|
3687
|
-
async function context(
|
|
3688
|
-
const { positional, flags } = parseArgs(
|
|
3687
|
+
async function context(args) {
|
|
3688
|
+
const { positional, flags } = parseArgs(args);
|
|
3689
3689
|
const [subcommand, ...rest] = positional;
|
|
3690
3690
|
switch (subcommand) {
|
|
3691
3691
|
case "list":
|
|
@@ -3710,8 +3710,8 @@ async function context(args2) {
|
|
|
3710
3710
|
break;
|
|
3711
3711
|
}
|
|
3712
3712
|
}
|
|
3713
|
-
async function report(
|
|
3714
|
-
const { positional, flags } = parseArgs(
|
|
3713
|
+
async function report(args) {
|
|
3714
|
+
const { positional, flags } = parseArgs(args);
|
|
3715
3715
|
const id = positional[0];
|
|
3716
3716
|
if (!id) {
|
|
3717
3717
|
console.error("Usage: rpbi report <context_id> [--index N]");
|
|
@@ -3722,8 +3722,8 @@ async function report(args2) {
|
|
|
3722
3722
|
const result = await service.get(`report/${id}/${index}`, void 0, { parseResponse: false });
|
|
3723
3723
|
process.stdout.write(result || "");
|
|
3724
3724
|
}
|
|
3725
|
-
async function dimensions(
|
|
3726
|
-
const { positional, flags } = parseArgs(
|
|
3725
|
+
async function dimensions(args) {
|
|
3726
|
+
const { positional, flags } = parseArgs(args);
|
|
3727
3727
|
const module2 = flags.module || flags.m;
|
|
3728
3728
|
if (!module2) {
|
|
3729
3729
|
console.error("Usage: rpbi dimensions --module <module>");
|
|
@@ -3733,8 +3733,8 @@ async function dimensions(args2) {
|
|
|
3733
3733
|
const dims = await service.get(`visibleDimensions/${module2}`, getListParams(flags));
|
|
3734
3734
|
output(dims || [], flags);
|
|
3735
3735
|
}
|
|
3736
|
-
async function years(
|
|
3737
|
-
const { positional, flags } = parseArgs(
|
|
3736
|
+
async function years(args) {
|
|
3737
|
+
const { positional, flags } = parseArgs(args);
|
|
3738
3738
|
const service = await createService("analytics");
|
|
3739
3739
|
const tree = await service.get("years");
|
|
3740
3740
|
output(tree || [], flags);
|
|
@@ -3764,8 +3764,8 @@ async function roles(flags) {
|
|
|
3764
3764
|
const result = await service.get("accessRoles", getListParams(flags, DEFAULT_ROLES_FIELDS));
|
|
3765
3765
|
output(result || [], flags);
|
|
3766
3766
|
}
|
|
3767
|
-
async function users(
|
|
3768
|
-
const { positional, flags } = parseArgs(
|
|
3767
|
+
async function users(args) {
|
|
3768
|
+
const { positional, flags } = parseArgs(args);
|
|
3769
3769
|
const [subcommand, ...rest] = positional;
|
|
3770
3770
|
switch (subcommand) {
|
|
3771
3771
|
case "list":
|
|
@@ -3823,8 +3823,8 @@ async function fiscalYears(flags) {
|
|
|
3823
3823
|
const result = await service.get("fiscalYears", getListParams(flags));
|
|
3824
3824
|
output(result || [], flags);
|
|
3825
3825
|
}
|
|
3826
|
-
async function def(
|
|
3827
|
-
const { positional, flags } = parseArgs(
|
|
3826
|
+
async function def(args) {
|
|
3827
|
+
const { positional, flags } = parseArgs(args);
|
|
3828
3828
|
const [subcommand, ...rest] = positional;
|
|
3829
3829
|
switch (subcommand) {
|
|
3830
3830
|
case "statements":
|
|
@@ -3877,8 +3877,8 @@ async function exportCsv(id, flags) {
|
|
|
3877
3877
|
const result = await service.get(`export/${id}/${type}`, void 0, { parseResponse: false });
|
|
3878
3878
|
process.stdout.write(result || "");
|
|
3879
3879
|
}
|
|
3880
|
-
async function mdm(
|
|
3881
|
-
const { positional, flags } = parseArgs(
|
|
3880
|
+
async function mdm(args) {
|
|
3881
|
+
const { positional, flags } = parseArgs(args);
|
|
3882
3882
|
const [subcommand, ...rest] = positional;
|
|
3883
3883
|
switch (subcommand) {
|
|
3884
3884
|
case "tables":
|
|
@@ -3947,8 +3947,8 @@ async function create(flags) {
|
|
|
3947
3947
|
}
|
|
3948
3948
|
output(result, flags);
|
|
3949
3949
|
}
|
|
3950
|
-
async function helpdesk(
|
|
3951
|
-
const { positional, flags } = parseArgs(
|
|
3950
|
+
async function helpdesk(args) {
|
|
3951
|
+
const { positional, flags } = parseArgs(args);
|
|
3952
3952
|
const [subcommand, ...rest] = positional;
|
|
3953
3953
|
switch (subcommand) {
|
|
3954
3954
|
case "list":
|
|
@@ -3973,6 +3973,78 @@ async function helpdesk(args2) {
|
|
|
3973
3973
|
}
|
|
3974
3974
|
}
|
|
3975
3975
|
|
|
3976
|
+
// src/autoupdate.ts
|
|
3977
|
+
var fs4 = __toESM(require("node:fs"));
|
|
3978
|
+
var path2 = __toESM(require("node:path"));
|
|
3979
|
+
var os2 = __toESM(require("node:os"));
|
|
3980
|
+
var https = __toESM(require("node:https"));
|
|
3981
|
+
var import_node_child_process2 = require("node:child_process");
|
|
3982
|
+
var CONFIG_DIR2 = path2.join(os2.homedir(), ".config", "reporting-bi");
|
|
3983
|
+
var UPDATE_CHECK_FILE = path2.join(CONFIG_DIR2, "update-check.json");
|
|
3984
|
+
var CHECK_INTERVAL = 60 * 60 * 1e3;
|
|
3985
|
+
var PACKAGE_NAME = "@reporting-bi/cli";
|
|
3986
|
+
function loadUpdateCheck() {
|
|
3987
|
+
try {
|
|
3988
|
+
return JSON.parse(fs4.readFileSync(UPDATE_CHECK_FILE, "utf-8"));
|
|
3989
|
+
} catch {
|
|
3990
|
+
return { lastCheck: 0 };
|
|
3991
|
+
}
|
|
3992
|
+
}
|
|
3993
|
+
function saveUpdateCheck(data) {
|
|
3994
|
+
fs4.mkdirSync(CONFIG_DIR2, { recursive: true });
|
|
3995
|
+
fs4.writeFileSync(UPDATE_CHECK_FILE, JSON.stringify(data, null, 2));
|
|
3996
|
+
}
|
|
3997
|
+
function fetchLatestVersion() {
|
|
3998
|
+
return new Promise((resolve) => {
|
|
3999
|
+
const req = https.get(`https://registry.npmjs.org/${PACKAGE_NAME}/latest`, { timeout: 5e3 }, (res) => {
|
|
4000
|
+
if (res.statusCode !== 200) {
|
|
4001
|
+
res.resume();
|
|
4002
|
+
return resolve(null);
|
|
4003
|
+
}
|
|
4004
|
+
let body = "";
|
|
4005
|
+
res.on("data", (chunk) => body += chunk);
|
|
4006
|
+
res.on("end", () => {
|
|
4007
|
+
try {
|
|
4008
|
+
resolve(JSON.parse(body).version ?? null);
|
|
4009
|
+
} catch {
|
|
4010
|
+
resolve(null);
|
|
4011
|
+
}
|
|
4012
|
+
});
|
|
4013
|
+
});
|
|
4014
|
+
req.on("error", () => resolve(null));
|
|
4015
|
+
req.on("timeout", () => {
|
|
4016
|
+
req.destroy();
|
|
4017
|
+
resolve(null);
|
|
4018
|
+
});
|
|
4019
|
+
});
|
|
4020
|
+
}
|
|
4021
|
+
function isNewer(remote, local) {
|
|
4022
|
+
const r = remote.split(".").map(Number);
|
|
4023
|
+
const l = local.split(".").map(Number);
|
|
4024
|
+
for (let i = 0; i < Math.max(r.length, l.length); i++) {
|
|
4025
|
+
const rv = r[i] ?? 0;
|
|
4026
|
+
const lv = l[i] ?? 0;
|
|
4027
|
+
if (rv > lv) return true;
|
|
4028
|
+
if (rv < lv) return false;
|
|
4029
|
+
}
|
|
4030
|
+
return false;
|
|
4031
|
+
}
|
|
4032
|
+
async function checkForUpdate() {
|
|
4033
|
+
try {
|
|
4034
|
+
const data = loadUpdateCheck();
|
|
4035
|
+
const now = Date.now();
|
|
4036
|
+
if (now - data.lastCheck < CHECK_INTERVAL) return;
|
|
4037
|
+
saveUpdateCheck({ lastCheck: now });
|
|
4038
|
+
const latest = await fetchLatestVersion();
|
|
4039
|
+
if (!latest) return;
|
|
4040
|
+
if (!isNewer(latest, "0.0.10")) return;
|
|
4041
|
+
console.log(`\x1B[33mUpdating ${PACKAGE_NAME} ${"0.0.10"} \u2192 ${latest}...\x1B[0m`);
|
|
4042
|
+
(0, import_node_child_process2.execSync)(`npm install -g ${PACKAGE_NAME}@${latest}`, { stdio: "inherit" });
|
|
4043
|
+
console.log(`\x1B[32mUpdated to ${latest}.\x1B[0m`);
|
|
4044
|
+
} catch {
|
|
4045
|
+
}
|
|
4046
|
+
}
|
|
4047
|
+
|
|
3976
4048
|
// USAGE.md
|
|
3977
4049
|
var USAGE_default = `Reporting.bi CLI
|
|
3978
4050
|
|
|
@@ -4091,57 +4163,60 @@ Examples:
|
|
|
4091
4163
|
`;
|
|
4092
4164
|
|
|
4093
4165
|
// src/index.ts
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4166
|
+
(async () => {
|
|
4167
|
+
await checkForUpdate();
|
|
4168
|
+
const [command, ...args] = process.argv.slice(2);
|
|
4169
|
+
switch (command) {
|
|
4170
|
+
case "login":
|
|
4171
|
+
login(args);
|
|
4172
|
+
break;
|
|
4173
|
+
case "logout":
|
|
4174
|
+
logout(args[0]);
|
|
4175
|
+
break;
|
|
4176
|
+
case "use":
|
|
4177
|
+
use(args);
|
|
4178
|
+
break;
|
|
4179
|
+
case "wiki":
|
|
4180
|
+
wiki(args);
|
|
4181
|
+
break;
|
|
4182
|
+
case "accounting":
|
|
4183
|
+
accounting(args);
|
|
4184
|
+
break;
|
|
4185
|
+
case "etl":
|
|
4186
|
+
etl(args);
|
|
4187
|
+
break;
|
|
4188
|
+
case "jobs":
|
|
4189
|
+
jobs(args);
|
|
4190
|
+
break;
|
|
4191
|
+
case "context":
|
|
4192
|
+
context(args);
|
|
4193
|
+
break;
|
|
4194
|
+
case "report":
|
|
4195
|
+
report(args);
|
|
4196
|
+
break;
|
|
4197
|
+
case "dimensions":
|
|
4198
|
+
dimensions(args);
|
|
4199
|
+
break;
|
|
4200
|
+
case "years":
|
|
4201
|
+
years(args);
|
|
4202
|
+
break;
|
|
4203
|
+
case "users":
|
|
4204
|
+
users(args);
|
|
4205
|
+
break;
|
|
4206
|
+
case "def":
|
|
4207
|
+
def(args);
|
|
4208
|
+
break;
|
|
4209
|
+
case "mdm":
|
|
4210
|
+
mdm(args);
|
|
4211
|
+
break;
|
|
4212
|
+
case "helpdesk":
|
|
4213
|
+
helpdesk(args);
|
|
4214
|
+
break;
|
|
4215
|
+
case "status":
|
|
4216
|
+
status();
|
|
4217
|
+
break;
|
|
4218
|
+
default:
|
|
4219
|
+
console.log(USAGE_default);
|
|
4220
|
+
break;
|
|
4221
|
+
}
|
|
4222
|
+
})();
|