siluzan-tso-cli 1.1.35-beta.4 → 1.1.35-beta.5
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/dist/index.js +49 -1
- package/dist/skill/_meta.json +2 -2
- package/dist/skill/references/analytics/account-analytics.md +7 -0
- package/dist/skill/references/report-templates/google-period-report.md +13 -0
- package/dist/skill/report-templates/google-period-report.md +13 -0
- package/dist/skill/scripts/install.ps1 +1 -1
- package/dist/skill/scripts/install.sh +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -51,7 +51,7 @@ siluzan-tso init -d /path/to/skills # 写入自定义目录
|
|
|
51
51
|
siluzan-tso init --force # 强制覆盖已存在文件
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
> **注意**:当前为测试版(1.1.35-beta.
|
|
54
|
+
> **注意**:当前为测试版(1.1.35-beta.5),供内部测试使用。正式发布后安装命令将改为 `npm install -g siluzan-tso-cli`。
|
|
55
55
|
|
|
56
56
|
| 助手 | 建议 `--ai` |
|
|
57
57
|
| ----------------------- | ------------------------------------ |
|
package/dist/index.js
CHANGED
|
@@ -5471,7 +5471,8 @@ var init_google_analysis = __esm({
|
|
|
5471
5471
|
};
|
|
5472
5472
|
GOOGLE_ANALYSIS_CAMPAIGNS_OUTLINE_BUDGET_HINTS = [
|
|
5473
5473
|
"// \u91D1\u989D\uFF1A`campaigns[].budgetAmountYuan` / `campaignTargetCpaYuan` / `maximizeConversionsTargetCpaYuan` \u5747\u4E3A**\u5143**\uFF08CLI \u51FA\u53E3\u7EDF\u4E00\uFF09\uFF1B\u540C\u884C `spend` / `averageCpc` / `costPerConversion` \u4E5F\u662F\u5143\u3002",
|
|
5474
|
-
"// \u65E7\u5B57\u6BB5 `budgetAmount`\uFF08\u5206\uFF09/ `*Micros`\uFF08\u5FAE\u5143\uFF09\u5DF2\u4E0D\u518D\u843D\u76D8\uFF0C**\u7981\u6B62**\u518D\u505A \xF7100 / \xF71_000_000 \u6362\u7B97\u3002"
|
|
5474
|
+
"// \u65E7\u5B57\u6BB5 `budgetAmount`\uFF08\u5206\uFF09/ `*Micros`\uFF08\u5FAE\u5143\uFF09\u5DF2\u4E0D\u518D\u843D\u76D8\uFF0C**\u7981\u6B62**\u518D\u505A \xF7100 / \xF71_000_000 \u6362\u7B97\u3002",
|
|
5475
|
+
"// \u72B6\u6001\uFF1A\u6BCF\u884C\u542B `campaignStatusDisplay`\uFF08\u6295\u653E\u4E2D/\u5DF2\u6682\u505C/\u5DF2\u79FB\u9664\uFF09\uFF1B\u62A5\u544A\u72B6\u6001\u5217**\u76F4\u63A5\u8BFB\u6B64\u5B57\u6BB5**\uFF0C\u7981\u6B62\u5BF9 `campaignStatus` \u5199 `MAP[s]||'\u5DF2\u79FB\u9664'`\u3002"
|
|
5475
5476
|
];
|
|
5476
5477
|
GOOGLE_ANALYSIS_ADS_OUTLINE_BUDGET_HINTS = [
|
|
5477
5478
|
"// \u91D1\u989D\uFF1A`ads[].spend` / `averageCpc` / `costPerConversion` \u843D\u76D8\u524D\u5DF2\u7EDF\u4E00\u4E3A**\u5143**\uFF08`costPerConversion` \u7531\u7F51\u5173\u5FAE\u5143 \xF71e6\uFF09\uFF1B**\u7981\u6B62**\u518D\u5BF9 `costPerConversion` \u505A \xF71_000_000\u3002"
|
|
@@ -101445,6 +101446,38 @@ var init_city_to_country = __esm({
|
|
|
101445
101446
|
}
|
|
101446
101447
|
});
|
|
101447
101448
|
|
|
101449
|
+
// src/commands/google-analysis/format-campaign-status.ts
|
|
101450
|
+
function formatGoogleCampaignStatusDisplay(status) {
|
|
101451
|
+
if (status == null) return "\u2014";
|
|
101452
|
+
const raw = String(status).trim();
|
|
101453
|
+
if (raw === "") return "\u2014";
|
|
101454
|
+
switch (raw.toUpperCase()) {
|
|
101455
|
+
case "ENABLED":
|
|
101456
|
+
return "\u6295\u653E\u4E2D";
|
|
101457
|
+
case "PAUSED":
|
|
101458
|
+
return "\u5DF2\u6682\u505C";
|
|
101459
|
+
case "REMOVED":
|
|
101460
|
+
return "\u5DF2\u79FB\u9664";
|
|
101461
|
+
default:
|
|
101462
|
+
return "\u672A\u77E5";
|
|
101463
|
+
}
|
|
101464
|
+
}
|
|
101465
|
+
function readGoogleCampaignStatusRaw(row) {
|
|
101466
|
+
if (row.campaignStatusV2 !== void 0 && row.campaignStatusV2 !== null) {
|
|
101467
|
+
return row.campaignStatusV2;
|
|
101468
|
+
}
|
|
101469
|
+
return row.campaignStatus;
|
|
101470
|
+
}
|
|
101471
|
+
function annotateCampaignStatusDisplay(row) {
|
|
101472
|
+
if (row.campaignStatusDisplay !== void 0) return;
|
|
101473
|
+
row.campaignStatusDisplay = formatGoogleCampaignStatusDisplay(readGoogleCampaignStatusRaw(row));
|
|
101474
|
+
}
|
|
101475
|
+
var init_format_campaign_status = __esm({
|
|
101476
|
+
"src/commands/google-analysis/format-campaign-status.ts"() {
|
|
101477
|
+
"use strict";
|
|
101478
|
+
}
|
|
101479
|
+
});
|
|
101480
|
+
|
|
101448
101481
|
// src/commands/google-analysis/translate-fields.ts
|
|
101449
101482
|
function lookupZh(dict, key) {
|
|
101450
101483
|
if (typeof key !== "string" || key === "") return void 0;
|
|
@@ -101463,6 +101496,14 @@ function annotateArrayRows(rows, source, target, dict) {
|
|
|
101463
101496
|
}
|
|
101464
101497
|
}
|
|
101465
101498
|
}
|
|
101499
|
+
function annotateCampaignStatusDisplayRows(rows) {
|
|
101500
|
+
if (!Array.isArray(rows)) return;
|
|
101501
|
+
for (const r of rows) {
|
|
101502
|
+
if (r && typeof r === "object" && !Array.isArray(r)) {
|
|
101503
|
+
annotateCampaignStatusDisplay(r);
|
|
101504
|
+
}
|
|
101505
|
+
}
|
|
101506
|
+
}
|
|
101466
101507
|
function annotateCountryRollup(rows) {
|
|
101467
101508
|
if (!Array.isArray(rows)) return;
|
|
101468
101509
|
for (const r of rows) {
|
|
@@ -101483,9 +101524,15 @@ function annotateCountryRollup(rows) {
|
|
|
101483
101524
|
function annotateZhFields(payload, section) {
|
|
101484
101525
|
if (payload === null || typeof payload !== "object") return payload;
|
|
101485
101526
|
switch (section) {
|
|
101527
|
+
case "campaigns": {
|
|
101528
|
+
const rows = payload.campaigns;
|
|
101529
|
+
annotateCampaignStatusDisplayRows(rows);
|
|
101530
|
+
break;
|
|
101531
|
+
}
|
|
101486
101532
|
case "keywords": {
|
|
101487
101533
|
const rows = payload.keywords;
|
|
101488
101534
|
annotateArrayRows(rows, "keywordMatchType", "keywordMatchTypeZh", MATCH_TYPE_DICT);
|
|
101535
|
+
annotateCampaignStatusDisplayRows(rows);
|
|
101489
101536
|
break;
|
|
101490
101537
|
}
|
|
101491
101538
|
case "search-terms": {
|
|
@@ -101520,6 +101567,7 @@ var init_translate_fields = __esm({
|
|
|
101520
101567
|
init_match_type_en2zh();
|
|
101521
101568
|
init_geo_en2zh();
|
|
101522
101569
|
init_city_to_country();
|
|
101570
|
+
init_format_campaign_status();
|
|
101523
101571
|
MATCH_TYPE_DICT = match_type_en2zh_default;
|
|
101524
101572
|
GEO_DICT = geo_en2zh_default;
|
|
101525
101573
|
CITY_DICT = city_to_country_default.byName ?? {};
|
package/dist/skill/_meta.json
CHANGED
|
@@ -42,6 +42,8 @@
|
|
|
42
42
|
|
|
43
43
|
报告中「系列状态列」不得来自账户接口(账户状态 ≠ 系列状态,见 `references/core/agent-conventions.md` §四):系列是否启用**必须**来自 `ad campaigns`(含 `statusDisplay`)或 `google-analysis --sections campaigns` 落盘的系列数据。
|
|
44
44
|
|
|
45
|
+
**报告脚本禁止自行映射 `campaignStatus` 枚举**:网关值为 PascalCase(`Enabled`/`Paused`/`Removed`),Agent 若写 `STATUS_MAP[s] || '已移除'` 且未归一大小写,会把「投放中」误显示为「已移除」。`campaigns-*.json` 的 `items[]` 已注入 **`campaignStatusDisplay`**(`投放中` / `已暂停` / `已移除` / `—` / `未知`),HTML/Excel 状态列**直接读该字段**。
|
|
46
|
+
|
|
45
47
|
### 金额单位
|
|
46
48
|
|
|
47
49
|
CLI 出口的所有 JSON / 表格金额已统一为**元**,关键字段:
|
|
@@ -197,6 +199,11 @@ const data = d.record ?? d.items; // record 非空=汇总维度;否则=列表
|
|
|
197
199
|
|
|
198
200
|
`items[]` 每行额外包含:`conversionsValue`、`conversionsValuePerCost`(`spend ≤ 0` 时为 0)、`campaignTargetCpaYuan`、`maximizeConversionsTargetCpaYuan`、`manualCpcEnhancedCpcEnabled`、`percentCpcEnhancedCpcEnabled`。所有金额字段(`*Yuan` 后缀)已统一为元,可直接展示,无需换算。
|
|
199
201
|
|
|
202
|
+
| 字段 | 含义 |
|
|
203
|
+
| ---- | ---- |
|
|
204
|
+
| `campaignStatus` / `campaignStatusV2` | 网关原始枚举(`Enabled` / `Paused` / `Removed`) |
|
|
205
|
+
| `campaignStatusDisplay` | CLI 注入的中文状态文案;**报告状态列读此字段** |
|
|
206
|
+
|
|
200
207
|
日预算字段为 `budgetAmountYuan`(元),脚本可直接 `row.budgetAmountYuan`;网关原始 `budgetAmount`(分)已不再落盘。
|
|
201
208
|
|
|
202
209
|
#### 竞争指标 `competitiveMetrics`
|
|
@@ -58,3 +58,16 @@ siluzan-tso google-analysis -a <id> --start <s> --end <e> --json-out ./snap-goog
|
|
|
58
58
|
如果用户**追加**了维度(按上文「可选追加」表),把它们加入 `--sections` 即可;要全 21 维则省略 `--sections`。
|
|
59
59
|
|
|
60
60
|
> 仅在调试单个维度或需要传 `all` 暂未透传的特殊参数时,才回落到逐条 `siluzan-tso google-analysis <子命令> -a <id> …` 调用。
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## 广告系列状态列(必读)
|
|
65
|
+
|
|
66
|
+
`campaigns-*.json` → `items[]` 每行含 CLI 注入的 **`campaignStatusDisplay`**(`投放中` / `已暂停` / `已移除`)。
|
|
67
|
+
|
|
68
|
+
| 正确 | 错误 |
|
|
69
|
+
| ---- | ---- |
|
|
70
|
+
| 直接展示 `row.campaignStatusDisplay` | 读 `campaignStatus` 后自行 `MAP[s] \|\| '已移除'`(`Enabled` 未命中键时会全变「已移除」) |
|
|
71
|
+
| 需要英文枚举时读 `campaignStatus` 或 `campaignStatusV2`,展示前 `.upper()` 再映射 | 用 `stats` / `list-accounts` 的账户 `status` 充当系列状态 |
|
|
72
|
+
|
|
73
|
+
原始枚举为 PascalCase(`Enabled`),与 `ad campaigns` 的 `statusDisplay`(有效/未投放/已结束使用)口径不同;周期报告「状态」列统一用 **`campaignStatusDisplay`**。
|
|
@@ -58,3 +58,16 @@ siluzan-tso google-analysis -a <id> --start <s> --end <e> --json-out ./snap-goog
|
|
|
58
58
|
如果用户**追加**了维度(按上文「可选追加」表),把它们加入 `--sections` 即可;要全 21 维则省略 `--sections`。
|
|
59
59
|
|
|
60
60
|
> 仅在调试单个维度或需要传 `all` 暂未透传的特殊参数时,才回落到逐条 `siluzan-tso google-analysis <子命令> -a <id> …` 调用。
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## 广告系列状态列(必读)
|
|
65
|
+
|
|
66
|
+
`campaigns-*.json` → `items[]` 每行含 CLI 注入的 **`campaignStatusDisplay`**(`投放中` / `已暂停` / `已移除`)。
|
|
67
|
+
|
|
68
|
+
| 正确 | 错误 |
|
|
69
|
+
| ---- | ---- |
|
|
70
|
+
| 直接展示 `row.campaignStatusDisplay` | 读 `campaignStatus` 后自行 `MAP[s] \|\| '已移除'`(`Enabled` 未命中键时会全变「已移除」) |
|
|
71
|
+
| 需要英文枚举时读 `campaignStatus` 或 `campaignStatusV2`,展示前 `.upper()` 再映射 | 用 `stats` / `list-accounts` 的账户 `status` 充当系列状态 |
|
|
72
|
+
|
|
73
|
+
原始枚举为 PascalCase(`Enabled`),与 `ad campaigns` 的 `statusDisplay`(有效/未投放/已结束使用)口径不同;周期报告「状态」列统一用 **`campaignStatusDisplay`**。
|
|
@@ -9,7 +9,7 @@ $ErrorActionPreference = 'Stop'
|
|
|
9
9
|
# -- Package info (injected at build time) ------------------------------------
|
|
10
10
|
$PKG_NAME = 'siluzan-tso-cli'
|
|
11
11
|
# PKG_VERSION 锁定到与本脚本同批构建产物一致的版本,避免与 dist/skill 错位
|
|
12
|
-
$PKG_VERSION = '1.1.35-beta.
|
|
12
|
+
$PKG_VERSION = '1.1.35-beta.5'
|
|
13
13
|
$CLI_BIN = 'siluzan-tso'
|
|
14
14
|
$SKILL_LABEL = 'Siluzan TSO'
|
|
15
15
|
$INSTALL_CMD = 'npm install -g siluzan-tso-cli@beta'
|
|
@@ -9,7 +9,7 @@ set -euo pipefail
|
|
|
9
9
|
# -- Package info (injected at build time) ------------------------------------
|
|
10
10
|
readonly PKG_NAME="siluzan-tso-cli"
|
|
11
11
|
# PKG_VERSION 锁定到与本脚本同批构建产物一致的版本,避免与 dist/skill 错位
|
|
12
|
-
readonly PKG_VERSION="1.1.35-beta.
|
|
12
|
+
readonly PKG_VERSION="1.1.35-beta.5"
|
|
13
13
|
readonly CLI_BIN="siluzan-tso"
|
|
14
14
|
readonly SKILL_LABEL="Siluzan TSO"
|
|
15
15
|
readonly INSTALL_CMD="npm install -g siluzan-tso-cli@beta"
|