siluzan-tso-cli 1.1.13 → 1.1.14-beta.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/README.md +2 -3
- package/assets/siluzan-ads/references/hosted-automation-user-catalog.md +40 -0
- package/dist/index.js +371 -55
- package/dist/skill/SKILL.md +78 -37
- package/dist/skill/_meta.json +2 -2
- package/dist/skill/references/account-analytics.md +69 -2
- package/dist/skill/references/accounts.md +8 -5
- package/dist/skill/references/clue.md +5 -0
- package/dist/skill/references/finance.md +9 -5
- package/dist/skill/references/forewarning.md +7 -0
- package/dist/skill/references/google-ads-rules/google-ads-campaign-optimization.md +3 -2
- package/dist/skill/references/google-ads.md +123 -101
- package/dist/skill/references/hosted-automation-monitoring-json.md +94 -0
- package/dist/skill/references/hosted-automation-optimize-ab-winner.md +69 -0
- package/dist/skill/references/hosted-automation-optimize-index.md +32 -0
- package/dist/skill/references/hosted-automation-optimize-scale.md +99 -0
- package/dist/skill/references/hosted-automation-optimize-weak-downbid.md +94 -0
- package/dist/skill/references/hosted-automation-scenarios.md +23 -0
- package/dist/skill/references/hosted-automation-self-control.md +216 -0
- package/dist/skill/references/hosted-automation-user-catalog.md +40 -0
- package/dist/skill/references/open-account-google-ui.md +0 -6
- package/dist/skill/references/reporting.md +4 -2
- package/dist/skill/references/setup.md +5 -5
- package/dist/skill/references/tips.md +6 -0
- package/dist/skill/references/tso-home.md +1 -1
- package/dist/skill/references/workflows.md +14 -1
- package/dist/skill/report-templates/google-account-diagnosis-report.md +1 -1
- package/dist/skill/report-templates/google-period-report.md +1 -0
- package/dist/skill/scripts/install.ps1 +2 -2
- package/dist/skill/scripts/install.sh +2 -2
- package/eval/cases/accounts-entityid-vs-mediaccustomerid.scenario.json +23 -0
- package/eval/cases/accounts-mcc-bind-inquiry.scenario.json +12 -0
- package/eval/cases/accounts-single-balance-not-bulk.scenario.json +23 -0
- package/eval/cases/budget-display-not-raw-micros.scenario.json +17 -0
- package/eval/cases/clue-meta-leads-json.scenario.json +23 -0
- package/eval/cases/clue-tiktok-leads-json.scenario.json +20 -0
- package/eval/cases/destructive-account-delink-needs-confirm.scenario.json +15 -0
- package/eval/cases/destructive-forewarning-delete-needs-confirm.scenario.json +15 -0
- package/eval/cases/destructive-invoice-apply-needs-confirm.scenario.json +15 -0
- package/eval/cases/destructive-unshare-needs-confirm.scenario.json +9 -0
- package/eval/cases/finance-invoice-info-list.scenario.json +17 -0
- package/eval/cases/forewarning-list-google.scenario.json +20 -0
- package/eval/cases/google-ads-no-structural-without-confirm.scenario.json +12 -0
- package/eval/cases/google-analysis-keywords-route.scenario.json +23 -0
- package/eval/cases/hosted-sop-cpa-spike-downbid.scenario.json +14 -0
- package/eval/cases/hosted-sop-daily-budget-circuit-breaker.scenario.json +13 -0
- package/eval/cases/hosted-sop-empty-spend-pause-p1.scenario.json +14 -0
- package/eval/cases/human-p1-multiturn.scenario.json +17 -0
- package/eval/cases/meta-single-balance-not-bulk.scenario.json +26 -0
- package/eval/cases/open-account-bing-noninteractive.scenario.json +13 -0
- package/eval/cases/open-account-google-noninteractive.scenario.json +12 -0
- package/eval/cases/open-account-tiktok-license-file.scenario.json +12 -0
- package/eval/cases/optimize-list-by-account.scenario.json +17 -0
- package/eval/cases/p1-single-account-profile.scenario.json +20 -0
- package/eval/cases/p2-balance-scan-bulk.scenario.json +18 -0
- package/eval/cases/p3-accounts-digest.scenario.json +20 -0
- package/eval/cases/p4-period-report-window.scenario.json +17 -0
- package/eval/cases/report-list-google.scenario.json +20 -0
- package/eval/cases/report-push-list-google.scenario.json +20 -0
- package/eval/cases/reporting-vs-account-analytics-routing.scenario.json +13 -0
- package/eval/cases/setup-login-or-env.scenario.json +12 -0
- package/eval/cases/setup-siluzan-data-permission-env.scenario.json +19 -0
- package/eval/cases/skill-async-poll-guidance.scenario.json +9 -0
- package/eval/cases/skill-optimize-vs-google-ads-distinction.scenario.json +13 -0
- package/eval/cases/tiktok-bc-bind-inquiry.scenario.json +12 -0
- package/eval/cases/time-range-must-ask.scenario.json +16 -0
- package/eval/cases/time-range-user-delegates-default.scenario.json +17 -0
- package/eval/cases/tips-json-filtering.scenario.json +12 -0
- package/eval/cases/tips-large-json-pagination.scenario.json +19 -0
- package/eval/cases/uj-ad-bluetooth-keywords-exclude-cheap-free.scenario.json +9 -0
- package/eval/cases/uj-ad-keywords-camping-tent-outdoor-plan.scenario.json +9 -0
- package/eval/cases/uj-ad-outdoor-campgear-search-plan.scenario.json +12 -0
- package/eval/cases/uj-analytics-30d-pdf-campaign-device-geo.scenario.json +29 -0
- package/eval/cases/uj-analytics-compare-google-tiktok-last-month-roi.scenario.json +17 -0
- package/eval/cases/uj-analytics-google-weekly-trends-campaigns-keywords.scenario.json +20 -0
- package/eval/cases/uj-analytics-report-push-weekly-email.scenario.json +12 -0
- package/eval/cases/uj-finance-invoice-records-this-month.scenario.json +20 -0
- package/eval/cases/uj-life-newbie-siluzan-google-end-to-end.scenario.json +13 -0
- package/eval/cases/uj-ops-google-accounts-list-normal.scenario.json +23 -0
- package/eval/cases/uj-ops-google-yesterday-spend-conversions.scenario.json +23 -0
- package/eval/cases/uj-ops-open-google-b2c-usd-shenzhen.scenario.json +13 -0
- package/eval/cases/uj-ops-pause-worst-adgroup-confirm.scenario.json +12 -0
- package/eval/cases/uj-ops-tiktok-leads-last-week.scenario.json +23 -0
- package/eval/cases/uj-patrol-all-media-balance-stats-forewarning.scenario.json +9 -0
- package/eval/cases/uj-patrol-cpc-spike-adgroups-over-15.scenario.json +18 -0
- package/eval/cases/uj-patrol-forewarning-create-daily-cap-3000.scenario.json +12 -0
- package/eval/cases/uj-patrol-forewarning-trigger-records.scenario.json +23 -0
- package/eval/cases/uj-patrol-google-balances-low.scenario.json +20 -0
- package/eval/cases/uj-roi-full-google-account-diagnosis.scenario.json +9 -0
- package/eval/cases/uj-roi-keywords-high-cpa-low-cvr-triage.scenario.json +9 -0
- package/eval/cases/uj-roi-optimize-records-then-execute-cautiously.scenario.json +20 -0
- package/eval/cases/uj-roi-search-terms-add-negative-keywords.scenario.json +23 -0
- package/eval/stub-fixtures/accounts-digest.json +33 -0
- package/eval/stub-fixtures/ad-campaigns.json +14 -0
- package/eval/stub-fixtures/balance-meta.json +6 -0
- package/eval/stub-fixtures/balance-scan.json +21 -0
- package/eval/stub-fixtures/balance.json +6 -0
- package/eval/stub-fixtures/clue-meta.json +7 -0
- package/eval/stub-fixtures/clue-tiktok.json +7 -0
- package/eval/stub-fixtures/forewarning-create-ok.json +1 -0
- package/eval/stub-fixtures/forewarning-records.json +7 -0
- package/eval/stub-fixtures/generic-ok.json +1 -0
- package/eval/stub-fixtures/google-analysis-search-terms.json +10 -0
- package/eval/stub-fixtures/google-analysis.json +7 -0
- package/eval/stub-fixtures/invoice-billable.json +7 -0
- package/eval/stub-fixtures/invoice-info-list.json +13 -0
- package/eval/stub-fixtures/invoice-list.json +10 -0
- package/eval/stub-fixtures/list-accounts.json +13 -0
- package/eval/stub-fixtures/optimize-list.json +7 -0
- package/eval/stub-fixtures/report-push-list.json +7 -0
- package/eval/stub-fixtures/stats.json +9 -0
- package/package.json +7 -2
- package/scripts/postinstall.mjs +27 -2
- package/dist/skill/references/open-account-by-media.md +0 -61
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ok": true,
|
|
3
|
+
"data": {
|
|
4
|
+
"items": [
|
|
5
|
+
{ "invoiceNo": "INV202604001", "status": "Issued", "amount": 1200.0, "currency": "CNY", "media": "Google" },
|
|
6
|
+
{ "invoiceNo": "INV202604002", "status": "Pending", "amount": 800.0, "currency": "CNY", "media": "TikTok" }
|
|
7
|
+
]
|
|
8
|
+
},
|
|
9
|
+
"meta": { "stub": true }
|
|
10
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "siluzan-tso-cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.14-beta.10",
|
|
4
4
|
"description": "Siluzan 广告账户管理 CLI — 查询账户、余额、消耗数据,管理绑定关系与充值。",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ad-account",
|
|
@@ -18,8 +18,11 @@
|
|
|
18
18
|
},
|
|
19
19
|
"files": [
|
|
20
20
|
"dist",
|
|
21
|
+
"eval/cases",
|
|
22
|
+
"eval/stub-fixtures",
|
|
21
23
|
"README.md",
|
|
22
|
-
"scripts/postinstall.mjs"
|
|
24
|
+
"scripts/postinstall.mjs",
|
|
25
|
+
"assets/siluzan-ads/references/hosted-automation-user-catalog.md"
|
|
23
26
|
],
|
|
24
27
|
"type": "module",
|
|
25
28
|
"publishConfig": {
|
|
@@ -36,6 +39,7 @@
|
|
|
36
39
|
"@types/node": "^22.10.0",
|
|
37
40
|
"@types/qrcode": "^1.5.6",
|
|
38
41
|
"tsup": "^8.3.0",
|
|
42
|
+
"tsx": "^4.19.0",
|
|
39
43
|
"typescript": "^5.7.2",
|
|
40
44
|
"siluzan-cli-common": "1.0.0"
|
|
41
45
|
},
|
|
@@ -71,6 +75,7 @@
|
|
|
71
75
|
"build": "node scripts/write-defaults.mjs --env production && tsup && node scripts/copy-skill-assets.mjs --env production",
|
|
72
76
|
"build:prod": "node scripts/write-defaults.mjs --env production && tsup && node scripts/copy-skill-assets.mjs --env production",
|
|
73
77
|
"build:test": "node scripts/write-defaults.mjs --env test && tsup && node scripts/copy-skill-assets.mjs --env test",
|
|
78
|
+
"eval:export-cases": "tsx eval/scripts/export-scenarios.mts",
|
|
74
79
|
"test:ad-read": "node scripts/test-ad-api-read.mjs",
|
|
75
80
|
"start": "node dist/index.js"
|
|
76
81
|
}
|
package/scripts/postinstall.mjs
CHANGED
|
@@ -1,7 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 安装本包后提示:升级 CLI 后请同步 Skill(见 siluzan-tso update)。
|
|
3
3
|
* monorepo / 本地 link 时每次 install 也会执行,属预期。
|
|
4
|
+
*
|
|
5
|
+
* 自动化场景说明从 `assets/.../hosted-automation-user-catalog.md` 读取,避免在脚本内嵌含反引号的模板字符串导致语法错误。
|
|
4
6
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
import fs from "node:fs";
|
|
8
|
+
import path from "node:path";
|
|
9
|
+
import { fileURLToPath } from "node:url";
|
|
10
|
+
|
|
11
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
const catalogPath = path.join(
|
|
13
|
+
__dirname,
|
|
14
|
+
"..",
|
|
15
|
+
"assets",
|
|
16
|
+
"siluzan-ads",
|
|
17
|
+
"references",
|
|
18
|
+
"hosted-automation-user-catalog.md",
|
|
7
19
|
);
|
|
20
|
+
|
|
21
|
+
const header =
|
|
22
|
+
"[siluzan-tso]: 安装成功,请执行 siluzan-tso init -d /path/to/skills 复制项目中最新的 skill 文件来更新你的 skill";
|
|
23
|
+
|
|
24
|
+
let body = "";
|
|
25
|
+
try {
|
|
26
|
+
body = "\n\n" + fs.readFileSync(catalogPath, "utf8").trimEnd();
|
|
27
|
+
} catch {
|
|
28
|
+
body =
|
|
29
|
+
"\n\n";
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
console.log(header + body);
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
# 各媒体开户:接口与参数技术细节
|
|
2
|
-
|
|
3
|
-
> 业务流程(步骤、所需资料、审核处理)见 `references/workflows.md` 流程一。
|
|
4
|
-
> 本文件仅记录各媒体的底层接口路径与请求体结构,供排查问题或深度定制时参考。
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## 路由对照
|
|
9
|
-
|
|
10
|
-
| 媒体 | 前端路由(path) | 说明 |
|
|
11
|
-
| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------ |
|
|
12
|
-
| **Google** | `/openAnAccount?mediaType=Google` | 与 TikTok 共用 `openAnAccount.vue`;从开户记录进入 Google 时往往先弹 **GGwarn** 合规提示再进表单 |
|
|
13
|
-
| **TikTok** | `/openAnAccount?mediaType=TikTok` | 同上组件,`mediaType` 区分字段与提交流程 |
|
|
14
|
-
| **Yandex** | `/YandexOpenAnAccount` | 独立页面 `YandexOpenAnAccount_v2.vue` |
|
|
15
|
-
| **BingV2** | `/bingOpenAnAccount` | 独立页面 `bingOpenAnAccount.vue` |
|
|
16
|
-
| **Kwai** | `/KwaiOpenAnAccount` | 独立页面 `KwaiOpenAnAccount.vue` |
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## 广告主组(magKey)接口
|
|
21
|
-
|
|
22
|
-
所有媒体在提交开户前都需要一个广告主组,并取得 `magKey`(MediaAccountGroupId):
|
|
23
|
-
|
|
24
|
-
- **查询列表**:`GET {apiBaseUrl}/query/profile/steward-individual` → `profile.mediaAccountGroups[]`,项上 `key` 即 magKey
|
|
25
|
-
- **创建**:`PUT {apiBaseUrl}/command/profile/steward-individual`,Header `s-command-type: AddMediaAccountGroup`
|
|
26
|
-
- **更新**:`PUT {apiBaseUrl}/command/profile/steward-individual/{id}`,Header `s-command-type: UpdateMediaAccountGroup`
|
|
27
|
-
|
|
28
|
-
**所有媒体均无需手动查询 magKey**:CLI 对每个媒体都会按 `--company`(或 `--advertiser-name` / `--company-name`)自动查找同名广告主组——存在则更新,不存在则创建——再用拿到的 magKey 提交开户。`--advertiser-id` 在所有开户命令中均为可选,仅供调试时手动指定。
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## 各媒体提交接口
|
|
33
|
-
|
|
34
|
-
| CLI 子命令 | 提交接口 | Method | 关键 Header / 特点 |
|
|
35
|
-
| --------------------- | ------------------------------------------ | ------ | ---------------------------------------------------------------------------------------------------------------------- |
|
|
36
|
-
| `open-account google` | `/command/media-account/google` | POST | `s-command-type: AddExistingMediaAccountList`;前置自动创建广告主组 |
|
|
37
|
-
| `open-account tiktok` | `/command/media-account`(不是 `/google`) | POST | 同上;前置 `POST .../tiktok/Upload` 上传执照图片;可选 `POST .../command/attachment` 存档、`GET .../CheckUnionpayInfo` |
|
|
38
|
-
| `open-account yandex` | `/command/media-account/AddAgencyClient` | POST | Body:`MediaAccountGroupId` + `AgencyClientInfo`(登录名、税号、电话等) |
|
|
39
|
-
| `open-account bing` | `/command/media-account/AddBingV2Account` | POST | Body:`BingCustomerInfo` / `BingV2AccountInfo` + 执照 `FileId`;前置 `POST .../command/attachment` |
|
|
40
|
-
| `open-account kwai` | `/command/media-account/AddKwaiAccount` | POST | Body:Kwai 专用主体/行业/执照结构 + `blobstoreKey`;前置 `POST .../KwaiAccount/Management/Upload` |
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## 辅助接口
|
|
45
|
-
|
|
46
|
-
| 用途 | 接口 | CLI 命令 |
|
|
47
|
-
| ----------------- | ------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
|
|
48
|
-
| Google 时区列表 | `GET {apiBaseUrl}/query/media-account/Google/TimeZoneInfo/ReadFile` | `open-account google-timezones` |
|
|
49
|
-
| TikTok 时区列表 | `GET {apiBaseUrl}/query/media-account/tiktok/TikTokTimeZoneInfo/Read` | `open-account tiktok-timezones` |
|
|
50
|
-
| TikTok 行业列表 | `GET {apiBaseUrl}/query/media-account/tiktok/TikTokIndustryInfo/Read` | `open-account tiktok-industries` |
|
|
51
|
-
| TikTok 注册地列表 | `GET {apiBaseUrl}/query/media-account/tiktok/TikTokAreacode/Read` | `open-account tiktok-areas` |
|
|
52
|
-
| Bing 行业列表 | `GET {apiBaseUrl}/query/media-account/bing/BingTradeList/Read`(返回中文行业名,`name` 字段即为 `--trade-id` 的值) | `open-account bing-industries` |
|
|
53
|
-
| 修改 Google 申请 | `PUT .../command/media-account/google/{entityId}`,`s-command-type: UpdateMediaAccount` | — |
|
|
54
|
-
| 修改 TikTok 申请 | `PUT .../command/media-account/{entityId}`,`s-command-type: UpdateMediaAccount` | — |
|
|
55
|
-
| 修改 Yandex 申请 | `POST .../command/media-account/UpdateAgencyClient/{id}` | — |
|
|
56
|
-
|
|
57
|
-
## 公司名称(广告主组)联想说明
|
|
58
|
-
|
|
59
|
-
网页上「公司名称」下拉的数据来自 `GET {apiBaseUrl}/query/profile/steward-individual`(与 `open-account list-groups` 同一接口),**无搜索接口,为本地过滤**。
|
|
60
|
-
|
|
61
|
-
选中已有广告主后,网页会自动回填推广链接、行业、推广类型等字段。CLI 的 `open-account google` 同样按 `--company` 名称自动匹配或创建广告主组,行为与网页一致。
|