@miracleplus/mplus 0.2.2 → 0.2.4
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/README.md +1 -1
- package/commands/mplus-ds-report.md +72 -0
- package/commands/mplus-reports-summary.md +76 -0
- package/dist/api_client.js +1 -1
- package/dist/auth.js +1 -1
- package/dist/commands/admission.js +1 -1
- package/dist/commands/application.js +1 -1
- package/dist/commands/batch.js +1 -1
- package/dist/commands/company.js +1 -1
- package/dist/commands/install-skills.js +1 -1
- package/dist/commands/login.js +1 -1
- package/dist/commands/logout.js +1 -1
- package/dist/commands/profiles.js +1 -1
- package/dist/commands/reports-attribution.js +1 -0
- package/dist/commands/reports-period.js +1 -0
- package/dist/commands/reports-summary.js +1 -0
- package/dist/commands/reports.js +1 -0
- package/dist/commands/status.js +1 -1
- package/dist/commands/use.js +1 -1
- package/dist/commands/user-lifecycle.js +1 -1
- package/dist/commands/whoami.js +1 -1
- package/dist/config.js +1 -1
- package/dist/env.js +1 -1
- package/dist/format.js +1 -1
- package/dist/help.js +1 -1
- package/dist/index.js +1 -1
- package/dist/oauth.js +1 -1
- package/dist/registry.js +1 -1
- package/package.json +2 -1
- package/scripts/postinstall-skills.js +55 -26
- package/skills/mplus-reports/SKILL.md +81 -0
- package/skills/mplus-reports/references/reports-query.md +168 -0
- package/dist/commands/configure.js +0 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mplus-reports
|
|
3
|
+
version: 0.1.0
|
|
4
|
+
description: "奇绩创坛 DS 报告数据源:拉取线索/人脉统计明细(手机号 contacts、企微 soc_channel_users),支持按业务时间段(本期累计/本周/上期同比等)查询。当用户要统计奇绩线索来源、做周期/同比分析、或生成「线索来源周期对比报告」(DS 报告) 时使用。"
|
|
5
|
+
metadata:
|
|
6
|
+
requires:
|
|
7
|
+
bins: ["mplus"]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# reports(DS 报告数据源)
|
|
11
|
+
|
|
12
|
+
**CRITICAL — 开始前 MUST 先用 Read 工具读取 [`../mplus-shared/SKILL.md`](../mplus-shared/SKILL.md)(认证、登录、错误处理、`--json`)**
|
|
13
|
+
|
|
14
|
+
## 这是什么
|
|
15
|
+
|
|
16
|
+
reports 提供「线索来源周期对比分析报告」(DS 报告) 的**数据源**。它返回某日期区间内的线索**原始明细**,你(AI)再按归属原则归类、聚合、套 prompt 生成报告。
|
|
17
|
+
|
|
18
|
+
- 两类数据源(各一条命令):
|
|
19
|
+
- **contacts**(手机号人脉)
|
|
20
|
+
- **soc_channel_users**(企微好友,别名 `qywechat`)
|
|
21
|
+
- 接口本质:「日期区间 → 原始明细」的瘦查询,只认 `start_date` / `end_date`。
|
|
22
|
+
- **归类与聚合是你的工作**:接口对渠道字段(`s_channel`/`s_product`/`utm_source`)做了中文映射(如 `inbound`/`创业营`/`公众号`),但**不做渠道归类**。你要按「归属原则」把线索归到 13 个报告渠道(见 [references/reports-query.md](references/reports-query.md) 的「归属规则」)。
|
|
23
|
+
|
|
24
|
+
## 业务周期与 6 个时间段
|
|
25
|
+
|
|
26
|
+
奇绩按**半年一期**(26 周):上半年 1/13–7/12、下半年 7/13–次年1/12。报告对比 6 个时间段,用 `--period` 一键指定(纯客户端换算成日期区间):
|
|
27
|
+
|
|
28
|
+
| `--period` | 含义 | 区间口径 |
|
|
29
|
+
|---|---|---|
|
|
30
|
+
| `benqi-leiji` | 本期累计 | 本期周期起始日 ~ 今天 |
|
|
31
|
+
| `shangqi-tongri-leiji` | 上期同日累计 | 上期周期起始日 ~ 今天−26周 |
|
|
32
|
+
| `shangshangqi-leiji` | 上上期累计 | 上上期周期起始日 ~ 今天−52周 |
|
|
33
|
+
| `benzhou` | 本周 | 本周一 ~ 今天 |
|
|
34
|
+
| `shangqi-tongzhou` | 上期同周 | 本周区间整体 −26周 |
|
|
35
|
+
| `shangshangqi-tongzhou` | 上上期同周 | 本周区间整体 −52周 |
|
|
36
|
+
|
|
37
|
+
> 命令输出会回显实际区间,便于核对。也可用 `--start-date`/`--end-date` 自定义(与 `--period` 互斥)。
|
|
38
|
+
|
|
39
|
+
## 认证要求
|
|
40
|
+
|
|
41
|
+
reports 是**管理员命令**,需 `apply_admin` 角色。先 `mplus login`(OAuth)或 `mplus configure`(API Key)。非管理员看不到该命令。详见 mplus-shared。
|
|
42
|
+
|
|
43
|
+
## 命令速查
|
|
44
|
+
|
|
45
|
+
| 命令 | 说明 | 参考 |
|
|
46
|
+
|---|---|---|
|
|
47
|
+
| `mplus reports contacts` | 手机号人脉明细 | [references/reports-query.md](references/reports-query.md) |
|
|
48
|
+
| `mplus reports soc-channel-users` | 企微好友明细(别名 `qywechat`) | 同上 |
|
|
49
|
+
| `mplus reports summary` | **周期对比聚合**:一条命令拉全 6 时段 + 归类 13 渠道 + 剥离批量数据 | [references/reports-query.md](references/reports-query.md) |
|
|
50
|
+
|
|
51
|
+
contacts / soc 参数相同:`--period <key>` 或 `--start-date`/`--end-date`,外加 `--profile`、`--json`;summary 只接 `--profile`/`--json`。
|
|
52
|
+
|
|
53
|
+
## 自然语言 → 命令
|
|
54
|
+
|
|
55
|
+
| 用户说 | 命令 |
|
|
56
|
+
|---|---|
|
|
57
|
+
| 统计奇绩线索来源**本期**数据 | `mplus reports contacts --period benqi-leiji --json`(企微再调 `soc-channel-users`) |
|
|
58
|
+
| **本周**新增 | `mplus reports contacts --period benzhou --json` |
|
|
59
|
+
| 本期**与上期同比** | 调两次:`--period benqi-leiji` + `--period shangqi-tongri-leiji`,再对比 |
|
|
60
|
+
| 某个**自定义区间** | `--start-date 2026-03-01 --end-date 2026-03-31 --json` |
|
|
61
|
+
|
|
62
|
+
> 一份完整 DS 报告通常要 **2 类数据 × 6 个时间段 = 12 次调用**。
|
|
63
|
+
|
|
64
|
+
## 生成 DS 报告的流程
|
|
65
|
+
|
|
66
|
+
**推荐:一条命令出聚合** —— `mplus reports summary --json` 对 6 时段 ×(手机号 + 企微)用 `mode=count` 拿原始字段组合计数,按归属规则归类到 13 渠道,聚合成「渠道 × 时段」(每段含 `total`、`channels` 各渠道 phone/qy/total)。**秒级**(约 5s),接口默认已剥离批量数据。
|
|
67
|
+
|
|
68
|
+
1. **拉聚合**:`mplus reports summary --json`。
|
|
69
|
+
2. **成文**:套报告 prompt(角色 = 销售数据分析助手),按 prompt 的**四段结构**:① 整体总结(本周结构与关键变化);② 本期累计/本周 vs 上期同日累计/上期同周;③ 本期累计/本周 vs 上上期累计/上上期同周;④ 管理层可关注的判断。②③ 用 `total`/`phone_total`/`qy_total` 做总量对比、`channels` 做 13 渠道逐条原因分析(表格);④ 给管理视角的判断与建议(结构分化、累计欠账、各渠道是节奏波动还是供给不足、复盘/清洗方向)。
|
|
70
|
+
|
|
71
|
+
13 渠道:自然流量 / 创业社区 / 潜空间 / SS / 前沿信号 / 算力 / outbound汇总 / 大厂 / 高校 / 广告投放 / 北美 / mapping / 校友。
|
|
72
|
+
|
|
73
|
+
> summary 的归类是程序化近似(归属规则内嵌在 CLI,会随运营变动)。count 现已纳入 `source_other`(后端 Q6② 已加,「奇绩主编/PRteam→创业社区」已精确归类);但**仍不含 `qy_tag_names`**,故 soc 的「Olivia/Leo 标签细分」会降级(归 outbound汇总)。存疑渠道用 `reports contacts/soc-channel-users --json`(detail,中文字段、精度全)复核。
|
|
74
|
+
|
|
75
|
+
## AI 使用建议
|
|
76
|
+
|
|
77
|
+
1. **始终加 `--json`**:默认文本只给区间 + 条数;解析数据必须 `--json`。
|
|
78
|
+
2. **同比要多次调用**:6 个时间段是 6 次独立请求,自己组合对比。
|
|
79
|
+
3. **大区间用 count**:detail 半年级累计区间会超时;统计用 `--mode count`(秒级、不超时)。
|
|
80
|
+
4. **字段差异**:信封字段是 `message`;数组 key——detail 为 `contacts`/`soc_channel_users`、count 为 `groups`;**detail 字段是中文(inbound/创业营)、count 是代码(ib/ba)**,归类时注意。
|
|
81
|
+
5. **保护 PII**:明细含手机号 / 微信,不要直接回显给用户,按需聚合后再呈现。
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# reports 查询(contacts / soc-channel-users)
|
|
2
|
+
|
|
3
|
+
> **前置条件:** 先用 Read 工具读取 [`../../mplus-shared/SKILL.md`](../../mplus-shared/SKILL.md)(认证、全局参数),以及 [`../SKILL.md`](../SKILL.md)(reports 概览、6 时间段、自然语言映射)。
|
|
4
|
+
|
|
5
|
+
查询某日期区间内的线索原始明细。两个子命令同构:
|
|
6
|
+
|
|
7
|
+
- `mplus reports contacts` → `GET /open_api/v2/reports/contacts`(只返回有手机号的人脉)
|
|
8
|
+
- `mplus reports soc-channel-users` → `GET /open_api/v2/reports/soc_channel_users`(企微好友;别名 `qywechat`)
|
|
9
|
+
|
|
10
|
+
均为**管理员命令**(需 `apply_admin` 角色),走 apply 主站 open_api(API Key 换 JWT,或 OAuth access token,由 CLI 自动处理)。
|
|
11
|
+
|
|
12
|
+
## 命令示例
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# 本期累计(推荐用 --period,自动换算区间)
|
|
16
|
+
mplus reports contacts --period benqi-leiji --json
|
|
17
|
+
|
|
18
|
+
# 本周企微新增
|
|
19
|
+
mplus reports qywechat --period benzhou --json
|
|
20
|
+
|
|
21
|
+
# 自定义区间(与 --period 互斥)
|
|
22
|
+
mplus reports contacts --start-date 2026-03-01 --end-date 2026-03-31 --json
|
|
23
|
+
|
|
24
|
+
# 同比:本期累计 vs 上期同日累计(调两次再对比)
|
|
25
|
+
mplus reports contacts --period benqi-leiji --json
|
|
26
|
+
mplus reports contacts --period shangqi-tongri-leiji --json
|
|
27
|
+
|
|
28
|
+
# 大区间统计用 count(秒级、不超时):按原始字段分组计数
|
|
29
|
+
mplus reports contacts --period shangqi-tongri-leiji --mode count --group-by s_channel,s_product,utm_source --json
|
|
30
|
+
mplus reports qywechat --period shangqi-tongri-leiji --mode count --group-by add_juzi_follow_user_earliest_name --json
|
|
31
|
+
|
|
32
|
+
# 过滤 + 字段裁剪
|
|
33
|
+
mplus reports contacts --period benzhou --s-channel ib --fields id,phone,s_channel --json # 过滤值用代码 ib(非中文 inbound)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## 参数
|
|
37
|
+
|
|
38
|
+
| 参数 | 必填 | 类型 | 默认 | 说明 |
|
|
39
|
+
|------|------|------|------|------|
|
|
40
|
+
| `--period <key>` | 否 | string | — | 便捷时间段,6 选 1:`benqi-leiji` / `shangqi-tongri-leiji` / `shangshangqi-leiji` / `benzhou` / `shangqi-tongzhou` / `shangshangqi-tongzhou`。**与 `--start-date`/`--end-date` 互斥** |
|
|
41
|
+
| `--start-date <date>` | 否 | string | 当期周期起始日 | `YYYY-MM-DD`,区间开始 |
|
|
42
|
+
| `--end-date <date>` | 否 | string | 今天 | `YYYY-MM-DD`,区间结束 |
|
|
43
|
+
| `--mode <mode>` | 否 | string | `detail` | `detail`=明细;`count`=计数统计(返回 `groups`+`total`,大区间秒级、不超时) |
|
|
44
|
+
| `--group-by <fields>` | 否 | string | — | 仅 count:按原始字段分组 CSV,如 `s_channel,s_product,utm_source`(contacts)/ `add_juzi_follow_user_earliest_name`(soc) |
|
|
45
|
+
| `--fields <fields>` | 否 | string | 全量 | 只返回指定字段,CSV |
|
|
46
|
+
| `--date-field <field>` | 否 | string | `created_at` | 按哪个时间字段过滤区间 |
|
|
47
|
+
| `--page <n>` / `--page-size <n>` | 否 | int | 1 / — | 仅 detail,分页 |
|
|
48
|
+
| `--include-batch` | 否 | bool | 关 | 默认接口已剥离批量数据;加此开关才包含 |
|
|
49
|
+
| `--meeting-success <bool>` | 否 | string | — | 按是否成功开会过滤 |
|
|
50
|
+
| contacts 过滤 | 否 | string | — | `--s-channel`/`--s-product`/`--utm-source`/`--utm-campaign`/`--utm-content`/`--s-referral`(**值用原始代码**,如 `--s-channel ib`、`--utm-source gzh`,**不是**中文 inbound/公众号) |
|
|
51
|
+
| soc 过滤 | 否 | string | — | `--channel-type`/`--early-follower`/`--qy-tag`/`--qy-tag-match`(any\|all\|none) |
|
|
52
|
+
| `--profile <name>` | 否 | string | 当前 profile/session | 临时指定,不改变默认 |
|
|
53
|
+
| `--json` | 否 | boolean | false | 输出完整 JSON 响应 |
|
|
54
|
+
|
|
55
|
+
## 6 个时间段的区间口径
|
|
56
|
+
|
|
57
|
+
业务周期半年一期(26 周):上半年 1/13–7/12、下半年 7/13–次年1/12。`--period` 换算规则:
|
|
58
|
+
|
|
59
|
+
| key | start_date | end_date |
|
|
60
|
+
|---|---|---|
|
|
61
|
+
| `benqi-leiji` 本期累计 | 本期周期起始日(1/13 或 7/13) | 今天 |
|
|
62
|
+
| `shangqi-tongri-leiji` 上期同日累计 | 上期周期起始日 | 今天 − 26 周 |
|
|
63
|
+
| `shangshangqi-leiji` 上上期累计 | 上上期周期起始日 | 今天 − 52 周 |
|
|
64
|
+
| `benzhou` 本周 | 本周一 | 今天 |
|
|
65
|
+
| `shangqi-tongzhou` 上期同周 | 本周一 − 26 周 | 今天 − 26 周 |
|
|
66
|
+
| `shangshangqi-tongzhou` 上上期同周 | 本周一 − 52 周 | 今天 − 52 周 |
|
|
67
|
+
|
|
68
|
+
> 口径(已按刘绍栋 prompt 定稿):周期边界取 prompt 口径(7/13 起下半年);同日/同周用 26/52 周整体平移近似半年/一年。命令输出会回显实际区间,可核对。
|
|
69
|
+
|
|
70
|
+
## 响应结构
|
|
71
|
+
|
|
72
|
+
统一信封 `{ code, message, data }`(**注意:字段是 `message`,不是 `msg`**)。
|
|
73
|
+
|
|
74
|
+
**detail 模式**(明细行):
|
|
75
|
+
|
|
76
|
+
```json
|
|
77
|
+
{ "code": 0, "message": "success",
|
|
78
|
+
"data": { "start_date": "2026-01-13", "end_date": "2026-06-08",
|
|
79
|
+
"contacts": [ { "id": "...", "phone": "...", "s_channel": "inbound", "s_product": "创业营", "utm_source": "公众号", ... } ] } }
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**count 模式**(`--mode count`,计数统计):
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{ "code": 0, "message": "success",
|
|
86
|
+
"data": { "start_date": "2026-01-13", "end_date": "2026-06-08", "total": 7766,
|
|
87
|
+
"group_by": ["s_channel","s_product"],
|
|
88
|
+
"groups": [ { "s_channel": "ib", "s_product": "ba", "count": 125 } ] } }
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
- `code` = 0 表示成功;非 0 时看 `message`。
|
|
92
|
+
- 数组 key:**detail** 模式 contacts 接口为 `contacts`、soc 接口为 `soc_channel_users`;**count** 模式两者均为 `groups`(每组 `{分组字段..., count}`)+ `total`。
|
|
93
|
+
- **字段值差异(重要!)**:**detail** 的渠道字段是**中文映射值**(`s_channel="inbound"`、`s_product="创业营"`、`utm_source="公众号"`);**count** 的 groups 字段是**原始代码**(`s_channel="ib"`、`s_product="ba"`、`utm_source="gzh"`)。归类到 13 渠道仍需自行按下方「归属规则」完成——**detail 用中文匹配、count 用代码匹配**。
|
|
94
|
+
|
|
95
|
+
### contacts 字段(21)
|
|
96
|
+
|
|
97
|
+
`id, wechat_unionid, phone, email, wechat, msg_active, contact_method, created_at(录入时间), revisit_at(最新跟进), confirm_meeting_at, meeting_at, successful_contact_at, contact_at, meeting_success, s_product(来源产品), s_channel(渠道大类), utm_source(一级渠道), utm_campaign(二级渠道), utm_content(三级渠道), source_other(来源备注), s_referral(分享人)`
|
|
98
|
+
|
|
99
|
+
### soc_channel_users 字段(11)
|
|
100
|
+
|
|
101
|
+
`id, unionid, add_juzi_follow_user_earliest_name(最早托管账号), qy_tag_names(企微标签,逗号分隔), created_at, revisit_at, successful_contact_at, contact_at, confirm_meeting_at, meeting_at, meeting_success`
|
|
102
|
+
|
|
103
|
+
## 归属规则(把原始明细归到 13 个报告渠道)
|
|
104
|
+
|
|
105
|
+
报告拆分渠道:自然流量、创业社区、潜空间、SS、前沿信号、算力、outbound汇总(外部活动/学术活动/政府活动/Github)、大厂、高校、广告投放、北美、mapping、校友。
|
|
106
|
+
|
|
107
|
+
> 来源:飞书「提交归属原则」表。以下为规则要点,最终以该表为准。
|
|
108
|
+
|
|
109
|
+
### 手机号(contacts)— 按 `s_channel`/`s_product`/`utm_source`(一级)/`utm_campaign`(二级)/`source_other`(备注)
|
|
110
|
+
|
|
111
|
+
| 归属 | 规则 |
|
|
112
|
+
|---|---|
|
|
113
|
+
| 自然流量 | `s_channel`=inbound + 产品∉{潜空间,公开课,前沿信号,算力} + 一级∉社媒* + 备注∉{奇绩主编,PRteam} |
|
|
114
|
+
| 创业社区 | inbound + 产品∉{潜空间,公开课,前沿信号,算力} + (一级∈社媒* 或 备注∈{奇绩主编,PRteam}) |
|
|
115
|
+
| 潜空间 / SS / 前沿信号 / 算力 | inbound + 产品 = 潜空间 / 公开课 / 前沿信号 / 算力 |
|
|
116
|
+
| 外部活动 | outbound + 创业营 + 一级=外部活动 + 二级∉{学术活动,政府活动,大厂/媒体活动} |
|
|
117
|
+
| 学术活动 / 政府活动 | outbound + 创业营 + 外部活动 + 二级 = %学术活动% / %政府活动% |
|
|
118
|
+
| Github(跑活动) | outbound + 创业营 + 一级=外部平台 |
|
|
119
|
+
| 大厂 | outbound + 创业营 + 二级 = %大厂/媒体活动% |
|
|
120
|
+
| 高校 | outbound + 创业营 + 一级=高校 |
|
|
121
|
+
| 广告投放 | `s_channel` = 广告投放 |
|
|
122
|
+
| 北美 | `s_channel` = Researcher Founder + 创业营 |
|
|
123
|
+
| mapping (RF) | Researcher Founder + 潜空间 + 一级=researcher |
|
|
124
|
+
| 校友 | `s_channel` = 校友 |
|
|
125
|
+
| 其他(未归类) | 总计 − 所有已归类 |
|
|
126
|
+
|
|
127
|
+
> *社媒 = {公众号,B站,视频号,小红书,小宇宙,抖音,即刻,X,Instagram,GitHub,Linkedln,知乎,YouTube}
|
|
128
|
+
|
|
129
|
+
### 企微(soc_channel_users)— 按 `add_juzi_follow_user_earliest_name`(账号) + `qy_tag_names`(标签)
|
|
130
|
+
|
|
131
|
+
| 归属 | 账号 / 标签 |
|
|
132
|
+
|---|---|
|
|
133
|
+
| 创业社区 | 账号∈{大模型空间站小助手1-3号, 奇绩创业社区助手1/2/6号} |
|
|
134
|
+
| 潜空间 | 账号 = 潜空间小助手 |
|
|
135
|
+
| SS | 账号∈{创业公开课小助手/④/⑤, 高校巡讲小助手} |
|
|
136
|
+
| 算力 | 账号 = 刘婷婷 |
|
|
137
|
+
| 外部活动/学术/政府/Github | 账号∈{Olivia,Leo} + 标签=%外部活动%(排除学术/政府/大厂) / %学术活动% / %政府活动% / %外部平台% |
|
|
138
|
+
| 数据运营 | 账号∈{吴冰冰, 陈知微, 奇绩创业营申请助手} |
|
|
139
|
+
| 大厂 | 账号=李思睿;或 {Olivia,Leo}+标签%大厂/媒体活动% |
|
|
140
|
+
| 高校 | 账号 = 高校创业社区助手 |
|
|
141
|
+
| 广告投放 | 账号∈{奇绩创业社区助手4号, 张晓微, 蒋瑶瑶, 李佳冉, 张小微, 张晓薇} |
|
|
142
|
+
| 北美 | 账号 = 奇绩海外创业者社区小助手 |
|
|
143
|
+
| mapping (RF) | 账号 = Researcher Founder 助手 + 标签%原始来源产品>潜空间%;或 账号=Mark |
|
|
144
|
+
| 校友 | 账号 = 产品日小助手 |
|
|
145
|
+
| 其他(未归类) | 总计 − 所有已归类 |
|
|
146
|
+
|
|
147
|
+
## 已知限制
|
|
148
|
+
|
|
149
|
+
- **detail 大区间会超时**:detail 返回全量明细,半年级累计区间服务端扫描慢(易 60s 超时)。**统计大区间用 `--mode count`**(不返明细、秒级、不超时),或缩小区间。
|
|
150
|
+
- **批量数据**:接口默认 `exclude_batch`(已剥离工商导入的批量数据);要包含用 `--include-batch`。
|
|
151
|
+
- **PII**:detail 含手机号/微信,聚合后再呈现勿直接回显;count 模式只返计数,无 PII。
|
|
152
|
+
|
|
153
|
+
## 常见错误
|
|
154
|
+
|
|
155
|
+
| 现象 | 原因 | 解决 |
|
|
156
|
+
|------|------|------|
|
|
157
|
+
| `错误:未知命令:reports` | 当前账号非管理员(admin 命令对非 admin 隐藏) | 用 `apply_admin` 账号登录 |
|
|
158
|
+
| `OAuth 鉴权失败,请运行 mplus login 重新登录` | token 失效 | `mplus login` |
|
|
159
|
+
| `服务器错误,请稍后重试` | 大区间全量明细致后端 5xx | 缩小日期区间分段查询 |
|
|
160
|
+
| `--period 仅支持:...` | period 取值非法 | 用 6 个合法 key 之一 |
|
|
161
|
+
| `--start-date 格式应为 YYYY-MM-DD` | 日期格式错 | 用 `YYYY-MM-DD` |
|
|
162
|
+
| `--period 与 --start-date/--end-date 不能同时使用` | 两者互斥 | 二选一 |
|
|
163
|
+
|
|
164
|
+
## 参考
|
|
165
|
+
|
|
166
|
+
- [mplus-reports](../SKILL.md) — reports 概览、6 时间段、报告生成流程
|
|
167
|
+
- [mplus-shared](../../mplus-shared/SKILL.md) — 认证和全局参数
|
|
168
|
+
- `doc/8-reports接口与CLI.md`(仓库内)— 接口契约 + 上层 CLI 能力
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';const _0x25a293=_0x215f;(function(_0x1492b6,_0x2805f9){const _0x3b949a=_0x215f,_0x4b7569=_0x1492b6();while(!![]){try{const _0x256db3=parseInt(_0x3b949a(0x16f))/0x1+-parseInt(_0x3b949a(0x177))/0x2*(-parseInt(_0x3b949a(0x180))/0x3)+-parseInt(_0x3b949a(0x138))/0x4+parseInt(_0x3b949a(0x133))/0x5+parseInt(_0x3b949a(0x15b))/0x6*(-parseInt(_0x3b949a(0x172))/0x7)+-parseInt(_0x3b949a(0x17a))/0x8*(-parseInt(_0x3b949a(0x185))/0x9)+-parseInt(_0x3b949a(0x182))/0xa;if(_0x256db3===_0x2805f9)break;else _0x4b7569['push'](_0x4b7569['shift']());}catch(_0x12e9ca){_0x4b7569['push'](_0x4b7569['shift']());}}}(_0x2ad1,0xa2d05));function _0x215f(_0x2d953f,_0x4a190b){_0x2d953f=_0x2d953f-0x130;const _0x2ad1ac=_0x2ad1();let _0x215fde=_0x2ad1ac[_0x2d953f];if(_0x215f['OsSYqc']===undefined){var _0x285fea=function(_0x13c880){const _0x2d90ab='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5e2e26='',_0x470dc2='';for(let _0x40106d=0x0,_0x26cc80,_0x19e049,_0x57732c=0x0;_0x19e049=_0x13c880['charAt'](_0x57732c++);~_0x19e049&&(_0x26cc80=_0x40106d%0x4?_0x26cc80*0x40+_0x19e049:_0x19e049,_0x40106d++%0x4)?_0x5e2e26+=String['fromCharCode'](0xff&_0x26cc80>>(-0x2*_0x40106d&0x6)):0x0){_0x19e049=_0x2d90ab['indexOf'](_0x19e049);}for(let _0x36a5b9=0x0,_0x2c3cb5=_0x5e2e26['length'];_0x36a5b9<_0x2c3cb5;_0x36a5b9++){_0x470dc2+='%'+('00'+_0x5e2e26['charCodeAt'](_0x36a5b9)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x470dc2);};_0x215f['WjhuVj']=_0x285fea,_0x215f['RJqUgH']={},_0x215f['OsSYqc']=!![];}const _0x5e35d2=_0x2ad1ac[0x0],_0xed5d8d=_0x2d953f+_0x5e35d2,_0x3db79f=_0x215f['RJqUgH'][_0xed5d8d];return!_0x3db79f?(_0x215fde=_0x215f['WjhuVj'](_0x215fde),_0x215f['RJqUgH'][_0xed5d8d]=_0x215fde):_0x215fde=_0x3db79f,_0x215fde;}function _0x2ad1(){const _0x1cfed1=['CMvNAxn0zxjdB25MAwD1CMu','C3rKzxjY','D3jPDgfIBgu','ios5I+MxToEAHoAvSowTLW','5AsN5AsA5PwW5lQ65y+Q6zYa6kAb5lIa5lIQigrLzMf1BhqGChjVzMLSzsdLSlhLPj/KUOBJGilMM7tLPjRLUk7LIQNOR7FNNiSGBxbSDxmGChjVzMLSzxmGls1OzwXW','s2v5ieLe','y29UzMLNDxjHyMXL','Ahr0Chm6lY9HChbSEs1ZDgfNAw5NlM1PCMfJBgvWBhvZlMnVBq','x19PBxbVCNrtDgfY','s2v5ieLeicHRAv94EhGPoIa','y2fSBa','y29UzMLNDxjL','Dg9tDhjPBMC','C3rKAw4','ls1WCM9MAwXLidXUyw1LpG','CMvTB3zLtgLZDgvUzxi','y3jLyxrL','zM9YrwfJAa','CxvLC3rPB24','s2v5ifnLy3jLDa','lI4Vy29UzMLN','uhjVzMLSzsdMMk/KUidLPzCI56UV54k5icSG5A+g6zkLiUEAHoE7HowqIo+8JoAuR+AmGEwKMUwLL+EoR+wIG+MAJ+AxTUwiH+AnOU+8JoAVLowMGUs4Gos4QIbWCM9MAwXLioAmH+wqKEEuN+s6P+EoR+wIG++8Ja','ChjVDg90ExbL','z2v0','icdIMQaG','ChjVzMLSzq','AgfZt3DUuhjVCgvYDhK','mtq0CwHfzhjf','Bg9N','5OYh5A6AihbYB2zPBguG5zcn56EW77Yi6BUy6k6KoIbKzwzHDwX077Yj','zgvMyxvSDa','z2v0t3DUuhjVCgvYDhLoyw1LCW','rvjsx1vtrv9brLrfuL9dte9trq','6ywn572U5AsX6lsL77YA','y2XVC2u','cUkCKYdPHy3NVA7MIjdLIP/VViZLT7lPGjROV4CG','ksdOH6RLRPRKUyNOVPpLHAu','6ywn572U5l2G55QeienmssdOUQVKU73JGilPPPBMRkhKVB/NLkJLIy3LV4xPOBVOV5dOOyZMRAtLKB3KU6tJGiikcUwhHUwKH+w3PEs9No+8MGOGideUioIUV+MxRIbHChbSEs5TAxjHy2XLCgX1CY5JB20VDxnLCI9HCgLFA2v5CWOGidiUiowiM+w7UUs4GowVUEIUV+MxRUwVHUMsPE+8JoIUSow9LsbRzxLFAwtVViHRAv/LVidLPltVViNLKOWGA2v5x3nLy3jLDo+8IgTZx+w8GowKTo+8IqOGidmUioI/KoIHJcbTCgX1CYbJB25MAwD1CMxVViZMJiNMJ5dNPlROVPpLHAukcG','lI4U','xE+8IoM7MoIUPcaX77YjoIa','56UV54k5ifvsta','DxjS','5lQK5lQs5BYp6ywn572UiefqssdOV57MJQxKV6hMGA/VViHJB25MAwD1CMuG55Qe5yIR5zcn77Yj','x19LC01VzhvSzq','ywn0Aw9U','Ahr0Chm6lY9HChbSEs5TAxjHy2XLCgX1CY5JB20','5lIa5lIQihbYB2zPBguG5OYh5zcr5Rwl6k+v546V5Akd77Ym5lIa5lIQihbYB2zPBguG5OYh5zcr5PYS5zYW5BYa5y+r546V5Akd44cc','mZiYntq1A0LkswvV','cM1WBhvZignVBMzPz3vYzsdIGjqG6ywn572UienmssdORR/PL67OUQVKU73VViZLROZMIjdLKi7LJBpLJ6/PGjROV4FLKB3KU6tOOyZOR7VLHPNLPyFNU6KGyxbWBhKGlYbIDwLSzcdMLBdMJA7JGiik','D3jPDgu','mZe1mZC4CefcCgLO','CMvWzwf0','C3rKB3v0','zgvZy3jPChrPB24','DhjPBq','mZaYnJi4qKrTA0rH','B3b0Aw9U','ywz0zxi','mJC1mJi0BLDnsuzs','C2XPy2u','DxbKyxrLuhjVzMLSzvjVBgu','x19JCMvHDgvcAw5KAw5N','ywrKsgvSCfrLEhq','CMvHzgXPBMu','mtvSsK5eCNe','BgvUz3rO','mZi5mJG4mgL3wgTLuq','5lIn6io95lI656M677Ym6k+36yEn5PAW6l6t5ywL','y29UzMLN','mtq0Aw1xrKzR','zxHPDa','BgfIzwW','zgvMAw5LuhjVCgvYDhK','yMvMB3jL','5B2t5yMn5Q2J5zYO6ywn572UihbYB2zPBgu6ia','mZmZnJm4nxPmCvL2Ea','5Rwl6k+v546V5Akd','y29Kzq','qvbjioERR+EcUsbvuKW6ia','zgf0yq','odC3ndG0D3jtqxDQ','C2v0uMf3tw9Kzq','lI4Vyxv0Aa','x19ZzxrnB2r1BgvezwzHDwX0','cUEKUUs+I++8MGOGig1WBhvZignVBMzPz3vYzsaGicaGicaGicaGicaGicaGicaGicaGicdPPPBMRkhPHy3NVA7VViJKVB/NLkJPU5JORQqGChjVzMLSzsaIzgvMyxvSDclVViKkicbTCgX1CYbJB25MAwD1CMuGls1WCM9MAwXLihbYB2r1y3rPB24GicaG6ywn572U5lIa5lIQ5zcn5lI6icjWCM9KDwn0Aw9UiIdNMOqGChjVzMLSzqOk5AsAifbYB2zPBgxVVjOkicdKUidKUkOGChjVzMLSzsdKV53LRzJKUidNU4tOV57MJQxPHy3NVA7VViHbueKG5zYW5z2aicSG6k6/6zEU5A+g6zkL77Yj44cccIaG5AsN6yoO5yIg55sO5OI35y+Q6zYa6kAb5lIa5lIQigrLzMf1BhqGChjVzMLSzEoaGUwMGUAENoMCGoIMGEwmUUwiHUEoR+wIG++8IowMGUEuN+s6PY/MTyVOR5xVViNVViWkicdLJ6/KU6xNLkGGls1WCM9MAwXLiowpGUAvSowiM+w7UUwKMUs4QU+8JoEuQcbTCgX1CYb1C2uGpowqJEENSd4G5yIh5O2I44cccIaG6l+q6kgmig1WBhvZihbYB2zPBgvZic0TAgvSCcdMN6xNNiVOR6BNU4BOR7tMMi7JGiik','5BYa5y+r546V5Akd','s2v5ifnLy3jLDcaOA3nFEhH4ktOG','C2f2zvbYB2zPBgu'];_0x2ad1=function(){return _0x1cfed1;};return _0x2ad1();}var __createBinding=this&&this[_0x25a293(0x17d)]||(Object['create']?function(_0x5e2e26,_0x470dc2,_0x40106d,_0x26cc80){const _0x293979=_0x25a293;if(_0x26cc80===undefined)_0x26cc80=_0x40106d;var _0x19e049=Object['getOwnPropertyDescriptor'](_0x470dc2,_0x40106d);(!_0x19e049||(_0x293979(0x157)in _0x19e049?!_0x470dc2[_0x293979(0x16b)]:_0x19e049[_0x293979(0x142)]||_0x19e049[_0x293979(0x146)]))&&(_0x19e049={'enumerable':!![],'get':function(){return _0x470dc2[_0x40106d];}}),Object['defineProperty'](_0x5e2e26,_0x26cc80,_0x19e049);}:function(_0x57732c,_0x36a5b9,_0x2c3cb5,_0x403e31){if(_0x403e31===undefined)_0x403e31=_0x2c3cb5;_0x57732c[_0x403e31]=_0x36a5b9[_0x2c3cb5];}),__setModuleDefault=this&&this[_0x25a293(0x13b)]||(Object[_0x25a293(0x150)]?function(_0x35b089,_0x587312){const _0x14836d=_0x25a293;Object[_0x14836d(0x130)](_0x35b089,'default',{'enumerable':!![],'value':_0x587312});}:function(_0x3b0077,_0x10bbb5){const _0x150f5b=_0x25a293;_0x3b0077[_0x150f5b(0x15e)]=_0x10bbb5;}),__importStar=this&&this[_0x25a293(0x148)]||(function(){var _0x933be=function(_0x12f528){const _0x12d771=_0x215f;return _0x933be=Object[_0x12d771(0x15f)]||function(_0x253cf6){const _0x1a063c=_0x12d771;var _0x18642f=[];for(var _0x4d2b38 in _0x253cf6)if(Object[_0x1a063c(0x156)][_0x1a063c(0x15a)][_0x1a063c(0x14a)](_0x253cf6,_0x4d2b38))_0x18642f[_0x18642f[_0x1a063c(0x181)]]=_0x4d2b38;return _0x18642f;},_0x933be(_0x12f528);};return function(_0x20279d){const _0x158334=_0x215f;if(_0x20279d&&_0x20279d[_0x158334(0x16b)])return _0x20279d;var _0x4afa7e={};if(_0x20279d!=null){for(var _0x58e6eb=_0x933be(_0x20279d),_0xf324b9=0x0;_0xf324b9<_0x58e6eb['length'];_0xf324b9++)if(_0x58e6eb[_0xf324b9]!==_0x158334(0x15e))__createBinding(_0x4afa7e,_0x20279d,_0x58e6eb[_0xf324b9]);}return __setModuleDefault(_0x4afa7e,_0x20279d),_0x4afa7e;};}());Object[_0x25a293(0x130)](exports,_0x25a293(0x16b),{'value':!![]}),exports[_0x25a293(0x140)]=registerConfigure;const readline=__importStar(require(_0x25a293(0x17f))),config_1=require(_0x25a293(0x154)),auth_1=require(_0x25a293(0x13a));function prompt(_0x317a68,_0x23f5fc){return new Promise(_0x5cf2be=>{const _0x3272c0=_0x215f;_0x317a68[_0x3272c0(0x152)](_0x23f5fc,_0x2a8b77=>{const _0x52a89d=_0x3272c0;_0x5cf2be(_0x2a8b77[_0x52a89d(0x176)]());});});}async function promptRequired(_0xcbb356,_0x366817,_0xc6af01){const _0x16cf28=_0x25a293;while(!![]){const _0x11c412=await prompt(_0xcbb356,_0x366817);if(_0x11c412)return _0x11c412;console[_0x16cf28(0x15c)](_0x16cf28(0x158)+_0xc6af01+'不能为空,请重新输入');}}async function promptSecretRequired(_0x7c35e1,_0x148b6c,_0x61603b){const _0xb4195c=_0x25a293;while(!![]){const _0x3df174=await promptSecret(_0x7c35e1,_0x148b6c);if(_0x3df174)return _0x3df174;console['log'](_0xb4195c(0x158)+_0x61603b+_0xb4195c(0x183));}}function promptSecret(_0x514071,_0x5099bf){const _0x559db5=_0x25a293;if(!process[_0x559db5(0x174)]['isTTY'])return prompt(_0x514071,_0x5099bf);return new Promise(_0x5c2dc8=>{const _0x327027=_0x559db5;process[_0x327027(0x174)][_0x327027(0x171)](_0x5099bf);const _0x1ec228=process[_0x327027(0x14d)];_0x1ec228[_0x327027(0x139)]?.(!![]);let _0x30e6be='';const _0x218038=_0xf68e2b=>{const _0x4c4b61=_0x327027,_0x3c14fd=_0xf68e2b[_0x4c4b61(0x14c)]();if(_0x3c14fd==='\x0d'||_0x3c14fd==='\x0a')_0x1ec228[_0x4c4b61(0x139)]?.(![]),_0x1ec228[_0x4c4b61(0x14f)](_0x4c4b61(0x137),_0x218038),process[_0x4c4b61(0x174)][_0x4c4b61(0x171)]('\x0a'),_0x5c2dc8(_0x30e6be);else{if(_0x3c14fd==='\x03')process['stdout']['write']('\x0a'),process[_0x4c4b61(0x186)](0x1);else _0x3c14fd==='\x7f'||_0x3c14fd==='\x08'?_0x30e6be['length']>0x0&&(_0x30e6be=_0x30e6be[_0x4c4b61(0x17b)](0x0,-0x1)):_0x30e6be+=_0x3c14fd;}};_0x1ec228['on'](_0x327027(0x137),_0x218038);});}function registerConfigure(_0x517a06){const _0x10e5d9=_0x25a293,_0x42c32a=_0x10e5d9(0x165),_0x1cb1ee=_0x10e5d9(0x13c),_0x1f4f59=[{'label':'生产环境','url':_0x10e5d9(0x16d)},{'label':_0x10e5d9(0x134),'url':_0x10e5d9(0x147)},{'label':_0x10e5d9(0x13d),'url':'http://127.0.0.1:3000'}],_0x1b3ab9=async _0x1ece51=>{const _0x28a1f8=_0x10e5d9,_0x2cbfad=_0x1ece51[_0x28a1f8(0x159)]??_0x28a1f8(0x15e),_0x1df805=readline['createInterface']({'input':process[_0x28a1f8(0x14d)],'output':process['stdout'],'terminal':!![]});console['log'](_0x28a1f8(0x170)),console[_0x28a1f8(0x15c)](_0x28a1f8(0x132)+_0x2cbfad),console[_0x28a1f8(0x15c)](_0x28a1f8(0x155)),console['log'](_0x28a1f8(0x16e)),console[_0x28a1f8(0x15c)](_0x28a1f8(0x144)),console[_0x28a1f8(0x15c)]('\x0a'+'─'[_0x28a1f8(0x173)](0x34)+'\x0a');try{console[_0x28a1f8(0x15c)]('选择\x20API\x20端点:'),_0x1f4f59[_0x28a1f8(0x151)]((_0x50f601,_0xbb9e2f)=>{const _0x11ecef=_0x28a1f8;console[_0x11ecef(0x15c)]('\x20\x20'+(_0xbb9e2f+0x1)+')\x20'+_0x50f601[_0x11ecef(0x187)]+'\x20\x20'+_0x50f601[_0x11ecef(0x169)]);}),console[_0x28a1f8(0x15c)]('\x20\x20'+(_0x1f4f59['length']+0x1)+_0x28a1f8(0x164)),console[_0x28a1f8(0x15c)]('');let _0x401dc4;while(!_0x401dc4){const _0x5beffa=await prompt(_0x1df805,'请选择\x20[1-'+(_0x1f4f59[_0x28a1f8(0x181)]+0x1)+_0x28a1f8(0x167)),_0x145344=_0x5beffa?parseInt(_0x5beffa,0xa):0x1;if(!_0x145344||_0x145344<0x1||_0x145344>_0x1f4f59[_0x28a1f8(0x181)]+0x1)console['log']('\x20\x20⚠\x20请输入\x201-'+(_0x1f4f59[_0x28a1f8(0x181)]+0x1)+_0x28a1f8(0x143));else{if(_0x145344<=_0x1f4f59[_0x28a1f8(0x181)])_0x401dc4=_0x1f4f59[_0x145344-0x1][_0x28a1f8(0x169)];else{const _0x4f0600=await promptRequired(_0x1df805,_0x28a1f8(0x136),_0x28a1f8(0x168));_0x401dc4=_0x4f0600;}}}console[_0x28a1f8(0x15c)]('\x0a→\x20端点:'+_0x401dc4+'\x0a');const _0x2768ed=await promptRequired(_0x1df805,_0x28a1f8(0x149),_0x28a1f8(0x145)),_0x48751b=await promptSecretRequired(_0x1df805,_0x28a1f8(0x13e),_0x28a1f8(0x153));_0x1df805[_0x28a1f8(0x162)](),(0x0,config_1[_0x28a1f8(0x13f)])(_0x2cbfad,{'endpoint':_0x401dc4,'key_id':_0x2768ed,'key_secret':_0x48751b}),process[_0x28a1f8(0x174)][_0x28a1f8(0x171)]('\x0a正在验证配置...\x0a');const {token:_0x268b62,email:_0x3b4132,name:_0x44b281,role:_0x5eb9ec}=await(0x0,auth_1['refreshToken'])(_0x2cbfad,_0x401dc4,_0x2768ed,_0x48751b);_0x5eb9ec&&(0x0,config_1[_0x28a1f8(0x17c)])(_0x2cbfad,_0x5eb9ec,_0x3b4132,_0x44b281),console[_0x28a1f8(0x15c)](_0x28a1f8(0x163)+(_0x3b4132??_0x268b62['slice'](0x0,0x8)+_0x28a1f8(0x166))+'\x20身份验证(profile:\x20'+_0x2cbfad+')');}catch(_0x59e4c0){_0x1df805[_0x28a1f8(0x162)](),_0x59e4c0[_0x28a1f8(0x135)]!==_0x28a1f8(0x160)&&process[_0x28a1f8(0x141)][_0x28a1f8(0x171)](_0x28a1f8(0x161)+_0x59e4c0['message']+'\x0a'),process[_0x28a1f8(0x186)](0x1);}};_0x517a06['command'](_0x10e5d9(0x14b))['description']('交互式配置\x20API\x20连接信息(endpoint、key_id、key_secret)')[_0x10e5d9(0x178)](_0x10e5d9(0x14e),_0x10e5d9(0x15d))[_0x10e5d9(0x17e)](_0x10e5d9(0x131),_0x42c32a)[_0x10e5d9(0x17e)](_0x10e5d9(0x179),_0x1cb1ee)[_0x10e5d9(0x16c)](_0x1b3ab9),_0x517a06['command'](_0x10e5d9(0x184))[_0x10e5d9(0x175)](_0x10e5d9(0x16a))['option'](_0x10e5d9(0x14e),'指定\x20profile\x20名称(默认:\x20default)')[_0x10e5d9(0x17e)]('before',_0x42c32a)[_0x10e5d9(0x17e)]('after',_0x1cb1ee)[_0x10e5d9(0x16c)](_0x1b3ab9);}
|