@lark-apaas/miaoda-cli 0.1.1 → 0.1.2-alpha.b2b5ae5
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/app/api.js +25 -0
- package/dist/api/app/index.js +15 -0
- package/dist/api/app/schemas.js +79 -0
- package/dist/api/app/types.js +58 -0
- package/dist/api/db/api.js +83 -6
- package/dist/api/db/client.js +40 -29
- package/dist/api/db/parsers.js +33 -20
- package/dist/api/db/sql-keywords.js +123 -0
- package/dist/api/deploy/api.js +60 -0
- package/dist/api/deploy/index.js +16 -0
- package/dist/api/deploy/schemas.js +103 -0
- package/dist/api/deploy/types.js +22 -0
- package/dist/api/file/api.js +78 -24
- package/dist/api/file/client.js +1 -5
- package/dist/api/file/parsers.js +1 -5
- package/dist/api/index.js +7 -1
- package/dist/api/observability/api.js +52 -0
- package/dist/api/observability/index.js +16 -0
- package/dist/api/observability/schemas.js +39 -0
- package/dist/api/observability/types.js +27 -0
- package/dist/api/plugin/api.js +8 -3
- package/dist/cli/commands/app/index.js +62 -0
- package/dist/cli/commands/db/index.js +1 -0
- package/dist/cli/commands/deploy/index.js +139 -0
- package/dist/cli/commands/index.js +6 -0
- package/dist/cli/commands/observability/index.js +227 -0
- package/dist/cli/commands/plugin/index.js +18 -6
- package/dist/cli/commands/shared.js +38 -6
- package/dist/cli/handlers/app/get.js +48 -0
- package/dist/cli/handlers/app/index.js +7 -0
- package/dist/cli/handlers/app/update.js +59 -0
- package/dist/cli/handlers/db/data.js +22 -2
- package/dist/cli/handlers/db/schema.js +22 -8
- package/dist/cli/handlers/db/sql.js +304 -16
- package/dist/cli/handlers/deploy/deploy.js +83 -0
- package/dist/cli/handlers/deploy/error-log.js +61 -0
- package/dist/cli/handlers/deploy/get.js +70 -0
- package/dist/cli/handlers/deploy/helpers.js +41 -0
- package/dist/cli/handlers/deploy/history.js +70 -0
- package/dist/cli/handlers/deploy/index.js +14 -0
- package/dist/cli/handlers/deploy/polling.js +139 -0
- package/dist/cli/handlers/file/cp.js +39 -17
- package/dist/cli/handlers/file/ls.js +1 -3
- package/dist/cli/handlers/file/rm.js +4 -3
- package/dist/cli/handlers/observability/analytics.js +189 -0
- package/dist/cli/handlers/observability/helpers.js +66 -0
- package/dist/cli/handlers/observability/index.js +12 -0
- package/dist/cli/handlers/observability/log.js +94 -0
- package/dist/cli/handlers/observability/metric.js +208 -0
- package/dist/cli/handlers/observability/trace.js +102 -0
- package/dist/cli/handlers/plugin/plugin-local.js +23 -9
- package/dist/cli/handlers/plugin/plugin.js +21 -7
- package/dist/cli/help.js +5 -2
- package/dist/utils/colors.js +98 -0
- package/dist/utils/devops-error.js +28 -0
- package/dist/utils/error.js +11 -0
- package/dist/utils/fuzzy-match.js +91 -0
- package/dist/utils/git.js +29 -0
- package/dist/utils/http.js +32 -0
- package/dist/utils/index.js +13 -1
- package/dist/utils/output.js +397 -12
- package/dist/utils/render.js +61 -41
- package/dist/utils/time.js +132 -0
- package/package.json +16 -6
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* 终端彩色高亮的语义层封装。
|
|
4
|
+
*
|
|
5
|
+
* 三层结构(自上而下:稳定→灵活):
|
|
6
|
+
*
|
|
7
|
+
* 1. **ColorAdapter**(公共契约):6 个语义方法 string → string,业务代码
|
|
8
|
+
* 只接触这层,对底层库 0 感知。
|
|
9
|
+
* 2. **ColorFactory**(适配器签名):`(useColor: boolean) => ColorAdapter`,
|
|
10
|
+
* 把"是否染色"参数化,便于按需构造。一个三方库对应一个 factory 实现。
|
|
11
|
+
* 3. **当前底层库实现**:picocolors([picocolors npm](https://www.npmjs.com/package/picocolors),~3KB)。
|
|
12
|
+
* 切换到 chalk / kleur 等只需新增一个 ColorFactory 实现,并改最下方的
|
|
13
|
+
* `factory =` 一行赋值,业务代码与 ColorAdapter contract 0 改动。
|
|
14
|
+
*
|
|
15
|
+
* # 色谱(对齐 spec)
|
|
16
|
+
*
|
|
17
|
+
* - header 表头 / 命令名 / key 标签:bold + cyan
|
|
18
|
+
* - highlight 强调值(表名等):cyan
|
|
19
|
+
* - success ✓ Uploaded / ✓ Deleted:green
|
|
20
|
+
* - fail ✗ / Error::red
|
|
21
|
+
* - warn ⚠ Approaching quota:yellow
|
|
22
|
+
* - muted NULL / 辅助 hint / 次要信息:dim + gray
|
|
23
|
+
*
|
|
24
|
+
* # 染色判定(NO_COLOR / FORCE_COLOR / TTY,[no-color.org](https://no-color.org/) 业界标准)
|
|
25
|
+
*
|
|
26
|
+
* - `NO_COLOR=1` 强制关颜色(任何非空值生效)
|
|
27
|
+
* - `FORCE_COLOR=1` 强制开颜色(管道 / CI 场景)
|
|
28
|
+
* - 否则按 `process.stdout.isTTY` 判定
|
|
29
|
+
*
|
|
30
|
+
* 每次调用 `c.xxx(s)` 时按当前状态实时构造 adapter——避免模块加载时缓存的
|
|
31
|
+
* `process.stdout.isTTY` 与测试 / pipe 切换脱节。
|
|
32
|
+
*/
|
|
33
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
|
+
exports.c = void 0;
|
|
35
|
+
exports.shouldColorize = shouldColorize;
|
|
36
|
+
const picocolors_1 = require("picocolors");
|
|
37
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
38
|
+
// 2. 库无关的染色判定:哪个 factory 都能复用
|
|
39
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
40
|
+
/**
|
|
41
|
+
* 当前是否应当染色。读取的是**调用时**的状态,而非模块加载时缓存——
|
|
42
|
+
* 测试经常 `Object.defineProperty(process.stdout, "isTTY", ...)` 实时切换,
|
|
43
|
+
* 这里直接每次问 process。
|
|
44
|
+
*
|
|
45
|
+
* 优先级:FORCE_COLOR > NO_COLOR > TTY。
|
|
46
|
+
*/
|
|
47
|
+
function shouldColorize() {
|
|
48
|
+
const env = process.env;
|
|
49
|
+
const noColor = env.NO_COLOR != null && env.NO_COLOR !== "";
|
|
50
|
+
const forceColor = env.FORCE_COLOR != null && env.FORCE_COLOR !== "";
|
|
51
|
+
const isTTY = process.stdout.isTTY === true;
|
|
52
|
+
return forceColor || (!noColor && isTTY);
|
|
53
|
+
}
|
|
54
|
+
/** picocolors 实现:当前生产用 factory。~3KB,业界 CLI 标准之一。 */
|
|
55
|
+
const picocolorsFactory = (useColor) => {
|
|
56
|
+
const x = (0, picocolors_1.createColors)(useColor);
|
|
57
|
+
return {
|
|
58
|
+
header: (s) => x.bold(x.cyan(s)),
|
|
59
|
+
highlight: (s) => x.cyan(s),
|
|
60
|
+
success: (s) => x.green(s),
|
|
61
|
+
fail: (s) => x.red(s),
|
|
62
|
+
warn: (s) => x.yellow(s),
|
|
63
|
+
muted: (s) => x.dim(x.gray(s)),
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
67
|
+
// 4. 唯一切换点:换库改这一行(其它都不用动)
|
|
68
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
69
|
+
//
|
|
70
|
+
// 切换示例:
|
|
71
|
+
//
|
|
72
|
+
// import chalk, { Chalk } from "chalk";
|
|
73
|
+
// const chalkFactory: ColorFactory = (useColor) => {
|
|
74
|
+
// const k = new Chalk({ level: useColor ? 1 : 0 });
|
|
75
|
+
// return {
|
|
76
|
+
// header: (s) => k.bold.cyan(s),
|
|
77
|
+
// highlight: (s) => k.cyan(s),
|
|
78
|
+
// success: (s) => k.green(s),
|
|
79
|
+
// fail: (s) => k.red(s),
|
|
80
|
+
// warn: (s) => k.yellow(s),
|
|
81
|
+
// muted: (s) => k.dim.gray(s),
|
|
82
|
+
// };
|
|
83
|
+
// };
|
|
84
|
+
// const factory: ColorFactory = chalkFactory; // ← 改这里
|
|
85
|
+
//
|
|
86
|
+
const factory = picocolorsFactory;
|
|
87
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
88
|
+
// 5. 公共出口:业务代码 import { c } from "../utils/colors"
|
|
89
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
90
|
+
/** 语义染色器:业务代码唯一接触的对象。底层库切换 0 感知。 */
|
|
91
|
+
exports.c = {
|
|
92
|
+
header: (s) => factory(shouldColorize()).header(s),
|
|
93
|
+
highlight: (s) => factory(shouldColorize()).highlight(s),
|
|
94
|
+
success: (s) => factory(shouldColorize()).success(s),
|
|
95
|
+
fail: (s) => factory(shouldColorize()).fail(s),
|
|
96
|
+
warn: (s) => factory(shouldColorize()).warn(s),
|
|
97
|
+
muted: (s) => factory(shouldColorize()).muted(s),
|
|
98
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mapDevopsError = mapDevopsError;
|
|
4
|
+
const error_1 = require("./error");
|
|
5
|
+
/**
|
|
6
|
+
* 把 BAM lark.apaas.devops 的业务码(数字字符串)映射成 CLI 错误码。
|
|
7
|
+
* 来源:服务端技术方案 wiki L7P8wlNQ5iyShLkxzlOcCo8LnTg「业务错误码映射表」。
|
|
8
|
+
*
|
|
9
|
+
* 放在 utils 下而不是某个具体 api 域里:app / deploy 都跑在 lark.apaas.devops
|
|
10
|
+
* 这同一 PSM,业务码命名空间也共享;boundaries 规则又禁止 api 域间互引。
|
|
11
|
+
*/
|
|
12
|
+
function mapDevopsError(bizCode, message) {
|
|
13
|
+
switch (bizCode) {
|
|
14
|
+
case "400002577":
|
|
15
|
+
case "400002569":
|
|
16
|
+
return new error_1.AppError("APP_NOT_FOUND", message, {
|
|
17
|
+
next_actions: ["Run `miaoda app list` to see available apps"],
|
|
18
|
+
});
|
|
19
|
+
case "400002579":
|
|
20
|
+
return new error_1.AppError("APP_PERMISSION_DENIED", message);
|
|
21
|
+
case "400002575":
|
|
22
|
+
return new error_1.AppError("INVALID_ARG_VALUE", message, {
|
|
23
|
+
next_actions: ["缩短 --name / --description 后重试(后端有长度限制)"],
|
|
24
|
+
});
|
|
25
|
+
default:
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
}
|
package/dist/utils/error.js
CHANGED
|
@@ -6,6 +6,14 @@ class AppError extends Error {
|
|
|
6
6
|
retryable;
|
|
7
7
|
next_actions;
|
|
8
8
|
statement_index;
|
|
9
|
+
total_statements;
|
|
10
|
+
/**
|
|
11
|
+
* 多语句失败时由 api.db.execSql 透传服务端 results(已成功的 statement 原始结构)。
|
|
12
|
+
* 由 db sql handler 转成 PRD 友好的 `completed` 数组 + 推断 `rolled_back` 后挂回到本对象。
|
|
13
|
+
*/
|
|
14
|
+
partial_results;
|
|
15
|
+
completed;
|
|
16
|
+
rolled_back;
|
|
9
17
|
constructor(code, message, opts) {
|
|
10
18
|
super(message);
|
|
11
19
|
this.name = "AppError";
|
|
@@ -21,6 +29,9 @@ class AppError extends Error {
|
|
|
21
29
|
retryable: this.retryable,
|
|
22
30
|
next_actions: this.next_actions,
|
|
23
31
|
statement_index: this.statement_index,
|
|
32
|
+
total_statements: this.total_statements,
|
|
33
|
+
completed: this.completed,
|
|
34
|
+
rolled_back: this.rolled_back,
|
|
24
35
|
};
|
|
25
36
|
}
|
|
26
37
|
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* 模糊匹配:基于 Levenshtein 编辑距离的"did-you-mean"建议器。
|
|
4
|
+
*
|
|
5
|
+
* 用于 CLI 错误路径的拼写纠错提示——当用户输入的 token(关键字 / 表名 / 列名)
|
|
6
|
+
* 与某个有效候选词"接近"时,给出 "Did you mean X?" 类的 hint。
|
|
7
|
+
*
|
|
8
|
+
* # 设计取舍
|
|
9
|
+
*
|
|
10
|
+
* - **算法**:Damerau-Levenshtein DP(在标准 Levenshtein 基础上把"相邻字符
|
|
11
|
+
* 交换"算 1 步编辑——SQL 用户最常见的拼写错误就是 FORM/FROM、SELCT/SELECT
|
|
12
|
+
* 这类 transposition;纯 Levenshtein 把它们算 2 步会过严,触发不到 hint)。
|
|
13
|
+
* 约 30 行二维 DP 实现,不引第三方库;业界 CLI 拼写纠错事实标准。
|
|
14
|
+
* - **大小写不敏感**:CLI 用户混用 SELECT / select 是常态,统一 lowercase 比较
|
|
15
|
+
* - **阈值按候选词长度自适应**:避免短词过度匹配("id" 不应该建议成 "in")
|
|
16
|
+
* len ≤ 4:max 1 编辑(短词严)
|
|
17
|
+
* len 5-8:max 2 编辑
|
|
18
|
+
* len ≥ 9:max 3 编辑(长词宽)
|
|
19
|
+
* - **同分多候选**:返第一个;调用方负责候选词列表的稳定排序
|
|
20
|
+
* - **找不到不强凑**:阈值外返 null,不"硬贴"无关建议
|
|
21
|
+
*/
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.levenshtein = levenshtein;
|
|
24
|
+
exports.suggest = suggest;
|
|
25
|
+
/**
|
|
26
|
+
* 计算两个字符串的 Damerau-Levenshtein 编辑距离(不区分大小写)。
|
|
27
|
+
*
|
|
28
|
+
* 在标准 Levenshtein(增 / 删 / 替换)基础上加"相邻字符交换"作为单步编辑。
|
|
29
|
+
* 二维 DP 实现(transposition 需要回看 dp[i-2][j-2],所以不再用单行优化)。
|
|
30
|
+
* 候选词通常 < 30 字符,二维 DP 的常数空间开销可忽略。
|
|
31
|
+
*/
|
|
32
|
+
function levenshtein(a, b) {
|
|
33
|
+
const aa = a.toLowerCase();
|
|
34
|
+
const bb = b.toLowerCase();
|
|
35
|
+
const m = aa.length;
|
|
36
|
+
const n = bb.length;
|
|
37
|
+
if (m === 0)
|
|
38
|
+
return n;
|
|
39
|
+
if (n === 0)
|
|
40
|
+
return m;
|
|
41
|
+
const dp = Array.from({ length: m + 1 }, () => new Array(n + 1).fill(0));
|
|
42
|
+
for (let i = 0; i <= m; i++)
|
|
43
|
+
dp[i][0] = i;
|
|
44
|
+
for (let j = 0; j <= n; j++)
|
|
45
|
+
dp[0][j] = j;
|
|
46
|
+
for (let i = 1; i <= m; i++) {
|
|
47
|
+
for (let j = 1; j <= n; j++) {
|
|
48
|
+
const cost = aa[i - 1] === bb[j - 1] ? 0 : 1;
|
|
49
|
+
dp[i][j] = Math.min(dp[i - 1][j] + 1, // 删除
|
|
50
|
+
dp[i][j - 1] + 1, // 插入
|
|
51
|
+
dp[i - 1][j - 1] + cost);
|
|
52
|
+
// transposition: 当前字符 = 对方前一字符 && 我方前一字符 = 对方当前字符
|
|
53
|
+
// 例:aa="form", bb="from",i=2,j=2 时 aa[1]=o=bb[0]=f? 不命中;i=3,j=3
|
|
54
|
+
// 时 aa[2]=r=bb[1]=r? bb[2]=o, aa[1]=o → 命中 → dp[3][3] = dp[1][1] + 1 = 1
|
|
55
|
+
if (i > 1 && j > 1 && aa[i - 1] === bb[j - 2] && aa[i - 2] === bb[j - 1]) {
|
|
56
|
+
dp[i][j] = Math.min(dp[i][j], dp[i - 2][j - 2] + 1);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return dp[m][n];
|
|
61
|
+
}
|
|
62
|
+
/** 默认阈值:候选词越短匹配越严,越长越宽。避免 "id" 错配 "in" 这种 false positive。 */
|
|
63
|
+
function defaultThreshold(len) {
|
|
64
|
+
if (len <= 4)
|
|
65
|
+
return 1;
|
|
66
|
+
if (len <= 8)
|
|
67
|
+
return 2;
|
|
68
|
+
return 3;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* 在候选词列表里找与 input 最相近的一个。
|
|
72
|
+
*
|
|
73
|
+
* 距离 ≤ 阈值时按"距离最小"返回;多个候选词相同距离时返"列表中最先出现"的;
|
|
74
|
+
* 阈值外没有命中返 null(调用方按 null 静默不加 hint,不要强凑)。
|
|
75
|
+
*/
|
|
76
|
+
function suggest(input, candidates, opts) {
|
|
77
|
+
if (!input || candidates.length === 0)
|
|
78
|
+
return null;
|
|
79
|
+
const threshold = opts?.maxDistance ?? defaultThreshold;
|
|
80
|
+
let best = null;
|
|
81
|
+
let bestDist = Number.POSITIVE_INFINITY;
|
|
82
|
+
for (const cand of candidates) {
|
|
83
|
+
const d = levenshtein(input, cand);
|
|
84
|
+
const limit = threshold(cand.length);
|
|
85
|
+
if (d <= limit && d < bestDist) {
|
|
86
|
+
best = cand;
|
|
87
|
+
bestDist = d;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return best;
|
|
91
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCurrentGitBranch = getCurrentGitBranch;
|
|
4
|
+
const node_child_process_1 = require("node:child_process");
|
|
5
|
+
/**
|
|
6
|
+
* 读取 cwd 所在仓库的当前分支名。
|
|
7
|
+
*
|
|
8
|
+
* 不在 git 仓库、git 不可用、或处于 detached HEAD 时返回 undefined,
|
|
9
|
+
* 让调用方决定回退策略(如交给后端使用应用默认分支)。
|
|
10
|
+
*/
|
|
11
|
+
function getCurrentGitBranch(cwd = process.cwd()) {
|
|
12
|
+
let result;
|
|
13
|
+
try {
|
|
14
|
+
result = (0, node_child_process_1.spawnSync)("git", ["rev-parse", "--abbrev-ref", "HEAD"], {
|
|
15
|
+
cwd,
|
|
16
|
+
encoding: "utf8",
|
|
17
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
if (result.status !== 0)
|
|
24
|
+
return undefined;
|
|
25
|
+
const branch = result.stdout.trim();
|
|
26
|
+
if (!branch || branch === "HEAD")
|
|
27
|
+
return undefined;
|
|
28
|
+
return branch;
|
|
29
|
+
}
|
package/dist/utils/http.js
CHANGED
|
@@ -6,7 +6,10 @@ exports.resetHttpClient = resetHttpClient;
|
|
|
6
6
|
exports.setHttpClient = setHttpClient;
|
|
7
7
|
exports.setRuntimeHttpClient = setRuntimeHttpClient;
|
|
8
8
|
exports.applyCanaryHeader = applyCanaryHeader;
|
|
9
|
+
exports.postInnerApi = postInnerApi;
|
|
10
|
+
exports.getInnerApi = getInnerApi;
|
|
9
11
|
const http_client_1 = require("@lark-apaas/http-client");
|
|
12
|
+
const error_1 = require("./error");
|
|
10
13
|
let adminClient;
|
|
11
14
|
let runtimeClient;
|
|
12
15
|
/**
|
|
@@ -65,3 +68,32 @@ function applyCanaryHeader(reqConfig) {
|
|
|
65
68
|
reqConfig.headers = headers;
|
|
66
69
|
return reqConfig;
|
|
67
70
|
}
|
|
71
|
+
/** 走管理端 innerapi 的 POST + 信封解析 */
|
|
72
|
+
async function postInnerApi(url, body, opts) {
|
|
73
|
+
return handleInnerEnvelope(await getHttpClient().post(url, body), url, opts);
|
|
74
|
+
}
|
|
75
|
+
/** 走管理端 innerapi 的 GET + 信封解析 */
|
|
76
|
+
async function getInnerApi(url, opts) {
|
|
77
|
+
return handleInnerEnvelope(await getHttpClient().get(url), url, opts);
|
|
78
|
+
}
|
|
79
|
+
async function handleInnerEnvelope(response, url, opts) {
|
|
80
|
+
if (!response.ok) {
|
|
81
|
+
throw new error_1.HttpError(response.status, url, `${opts.errPrefix}: ${String(response.status)} ${response.statusText}`);
|
|
82
|
+
}
|
|
83
|
+
const result = await response.json();
|
|
84
|
+
if (typeof result === "object" && result !== null && "status_code" in result) {
|
|
85
|
+
const env = result;
|
|
86
|
+
if (env.status_code !== undefined && env.status_code !== "0") {
|
|
87
|
+
const msg = env.message ?? env.error_msg ?? "unknown error";
|
|
88
|
+
const mapped = opts.mapErr?.(env.status_code, msg);
|
|
89
|
+
if (mapped)
|
|
90
|
+
throw mapped;
|
|
91
|
+
throw new error_1.AppError(opts.defaultErrCode ?? "INTERNAL_API_ERROR", `${opts.errPrefix}: ${msg}`);
|
|
92
|
+
}
|
|
93
|
+
// status_code = "0":data 存在则解封;否则 envelope 自身就是业务体
|
|
94
|
+
if (env.data)
|
|
95
|
+
return env.data;
|
|
96
|
+
return result;
|
|
97
|
+
}
|
|
98
|
+
return result;
|
|
99
|
+
}
|
package/dist/utils/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setRuntimeHttpClient = exports.setHttpClient = exports.resetHttpClient = exports.getRuntimeHttpClient = exports.getHttpClient = exports.log = exports.debug = exports.isJsonMode = exports.emitError = exports.emit = exports.getLogId = exports.generateLogId = exports.initConfigFromOpts = exports.resetConfig = exports.setConfig = exports.getConfig = exports.HttpError = exports.AppError = void 0;
|
|
3
|
+
exports.msToSec = exports.msToNs = exports.parseToSec = exports.parseToNs = exports.parseToMs = exports.parseTimeToMs = exports.getInnerApi = exports.postInnerApi = exports.setRuntimeHttpClient = exports.setHttpClient = exports.resetHttpClient = exports.getRuntimeHttpClient = exports.getHttpClient = exports.log = exports.debug = exports.fmt = exports.isJsonMode = exports.emitPaged = exports.emitOk = exports.emitError = exports.emit = exports.getLogId = exports.generateLogId = exports.initConfigFromOpts = exports.resetConfig = exports.setConfig = exports.getConfig = exports.HttpError = exports.AppError = void 0;
|
|
4
4
|
var error_1 = require("./error");
|
|
5
5
|
Object.defineProperty(exports, "AppError", { enumerable: true, get: function () { return error_1.AppError; } });
|
|
6
6
|
Object.defineProperty(exports, "HttpError", { enumerable: true, get: function () { return error_1.HttpError; } });
|
|
@@ -15,7 +15,10 @@ Object.defineProperty(exports, "getLogId", { enumerable: true, get: function ()
|
|
|
15
15
|
var output_1 = require("./output");
|
|
16
16
|
Object.defineProperty(exports, "emit", { enumerable: true, get: function () { return output_1.emit; } });
|
|
17
17
|
Object.defineProperty(exports, "emitError", { enumerable: true, get: function () { return output_1.emitError; } });
|
|
18
|
+
Object.defineProperty(exports, "emitOk", { enumerable: true, get: function () { return output_1.emitOk; } });
|
|
19
|
+
Object.defineProperty(exports, "emitPaged", { enumerable: true, get: function () { return output_1.emitPaged; } });
|
|
18
20
|
Object.defineProperty(exports, "isJsonMode", { enumerable: true, get: function () { return output_1.isJsonMode; } });
|
|
21
|
+
Object.defineProperty(exports, "fmt", { enumerable: true, get: function () { return output_1.fmt; } });
|
|
19
22
|
var logger_1 = require("./logger");
|
|
20
23
|
Object.defineProperty(exports, "debug", { enumerable: true, get: function () { return logger_1.debug; } });
|
|
21
24
|
Object.defineProperty(exports, "log", { enumerable: true, get: function () { return logger_1.log; } });
|
|
@@ -25,3 +28,12 @@ Object.defineProperty(exports, "getRuntimeHttpClient", { enumerable: true, get:
|
|
|
25
28
|
Object.defineProperty(exports, "resetHttpClient", { enumerable: true, get: function () { return http_1.resetHttpClient; } });
|
|
26
29
|
Object.defineProperty(exports, "setHttpClient", { enumerable: true, get: function () { return http_1.setHttpClient; } });
|
|
27
30
|
Object.defineProperty(exports, "setRuntimeHttpClient", { enumerable: true, get: function () { return http_1.setRuntimeHttpClient; } });
|
|
31
|
+
Object.defineProperty(exports, "postInnerApi", { enumerable: true, get: function () { return http_1.postInnerApi; } });
|
|
32
|
+
Object.defineProperty(exports, "getInnerApi", { enumerable: true, get: function () { return http_1.getInnerApi; } });
|
|
33
|
+
var time_1 = require("./time");
|
|
34
|
+
Object.defineProperty(exports, "parseTimeToMs", { enumerable: true, get: function () { return time_1.parseTimeToMs; } });
|
|
35
|
+
Object.defineProperty(exports, "parseToMs", { enumerable: true, get: function () { return time_1.parseToMs; } });
|
|
36
|
+
Object.defineProperty(exports, "parseToNs", { enumerable: true, get: function () { return time_1.parseToNs; } });
|
|
37
|
+
Object.defineProperty(exports, "parseToSec", { enumerable: true, get: function () { return time_1.parseToSec; } });
|
|
38
|
+
Object.defineProperty(exports, "msToNs", { enumerable: true, get: function () { return time_1.msToNs; } });
|
|
39
|
+
Object.defineProperty(exports, "msToSec", { enumerable: true, get: function () { return time_1.msToSec; } });
|