siluzan-tso-cli 1.1.21 → 1.1.22-beta.11
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 +3 -2
- package/dist/index.js +632 -535
- package/dist/skill/AGENTS.md +45 -0
- package/dist/skill/SKILL.md +55 -347
- package/dist/skill/_meta.json +2 -2
- package/dist/skill/assets/campaign-create-template.json +1 -1
- package/dist/skill/assets/campaign-create-template.md +5 -5
- package/dist/skill/assets/pmax-create-template.md +6 -5
- package/dist/skill/docs/skill-guide.md +44 -0
- package/dist/skill/references/README.md +73 -0
- package/dist/skill/references/{accounts.md → accounts/accounts.md} +37 -37
- package/dist/skill/references/{currency.md → accounts/currency.md} +7 -7
- package/dist/skill/references/{finance.md → accounts/finance.md} +18 -18
- package/dist/skill/references/accounts/open-account-by-media.md +153 -0
- package/dist/skill/references/{open-account-google-ui.md → accounts/open-account-google-ui.md} +2 -2
- package/dist/skill/references/{write-audit-restore.md → accounts/write-audit-restore.md} +4 -4
- package/dist/skill/references/{account-analytics.md → analytics/account-analytics.md} +62 -33
- package/dist/skill/references/{google-analysis-batch.md → analytics/google-analysis-batch.md} +2 -2
- package/dist/skill/references/{keyword-planner-workflows.md → analytics/keyword-planner-workflows.md} +17 -17
- package/dist/skill/references/{rag.md → analytics/rag.md} +11 -11
- package/dist/skill/references/{reporting.md → analytics/reporting.md} +16 -16
- package/dist/skill/references/core/agent-conventions.md +180 -0
- package/dist/skill/references/core/playbooks.md +141 -0
- package/dist/skill/references/{setup.md → core/setup.md} +5 -5
- package/dist/skill/references/core/skill-authoring.md +192 -0
- package/dist/skill/references/{tips.md → core/tips.md} +5 -6
- package/dist/skill/references/{workflows.md → core/workflows.md} +63 -65
- package/dist/skill/references/{google-ads-campaign-plan.md → google-ads/google-ads-campaign-plan.md} +25 -25
- package/dist/skill/references/{google-ads.md → google-ads/google-ads.md} +63 -67
- package/dist/skill/references/{pmax-api.md → google-ads/pmax-api.md} +0 -2
- package/dist/skill/references/google-ads/rules/README.md +21 -0
- package/dist/skill/references/{google-ads-rules → google-ads/rules}/google-ads-account-audit.md +19 -19
- package/dist/skill/references/{google-ads-rules → google-ads/rules}/google-ads-campaign-optimization.md +1 -1
- package/dist/skill/references/{google-ads-rules → google-ads/rules}/google-ads-keyword-optimization.md +1 -1
- package/dist/skill/references/{google-ads-rules → google-ads/rules}/google-ads-keyword-strategy.md +3 -3
- package/dist/skill/references/{google-ads-rules → google-ads/rules}/google-ads-keyword-taxonomy.md +2 -2
- package/dist/skill/references/{google-ads-rules → google-ads/rules}/google-ads-launch-plan-template.md +8 -8
- package/dist/skill/references/{google-ads-rules → google-ads/rules}/google-ads-pmax-guide.md +2 -2
- package/dist/skill/references/{tso-home.md → misc/tso-home.md} +5 -5
- package/dist/skill/references/{clue.md → operations/clue.md} +7 -7
- package/dist/skill/references/{forewarning.md → operations/forewarning.md} +6 -6
- package/dist/skill/references/{hosted-automation-monitoring-json.md → operations/hosted-automation-monitoring-json.md} +14 -14
- package/dist/skill/references/{hosted-automation-optimize-ab-winner.md → operations/hosted-automation-optimize-ab-winner.md} +4 -4
- package/dist/skill/references/{hosted-automation-optimize-index.md → operations/hosted-automation-optimize-index.md} +6 -6
- package/dist/skill/references/{hosted-automation-optimize-scale.md → operations/hosted-automation-optimize-scale.md} +8 -8
- package/dist/skill/references/{hosted-automation-optimize-weak-downbid.md → operations/hosted-automation-optimize-weak-downbid.md} +9 -9
- package/dist/skill/references/operations/hosted-automation-scenarios.md +23 -0
- package/dist/skill/references/{hosted-automation-self-control.md → operations/hosted-automation-self-control.md} +28 -28
- package/{assets/siluzan-ads/references → dist/skill/references/operations}/hosted-automation-user-catalog.md +13 -13
- package/dist/skill/references/{optimize.md → operations/optimize.md} +5 -5
- package/dist/skill/report-templates/README.md +2 -1
- package/dist/skill/report-templates/REPORT-WORKFLOW.md +2 -2
- package/dist/skill/report-templates/google-ads-diagnosis.md +2 -2
- package/dist/skill/report-templates/google-inquiry-analysis.md +11 -12
- package/dist/skill/report-templates/google-period-report.md +2 -2
- package/dist/skill/report-templates/okki-weekly-google-client.md +12 -12
- package/dist/skill/scripts/install.ps1 +3 -3
- package/dist/skill/scripts/install.sh +3 -3
- package/eval/cases/accounts-entityid-vs-mediaccustomerid.scenario.json +4 -4
- package/eval/cases/accounts-mcc-bind-inquiry.scenario.json +3 -3
- package/eval/cases/accounts-single-balance-not-bulk.scenario.json +3 -3
- package/eval/cases/budget-display-not-raw-micros.scenario.json +3 -3
- package/eval/cases/clue-meta-leads-json.scenario.json +4 -4
- package/eval/cases/clue-tiktok-leads-json.scenario.json +3 -3
- package/eval/cases/destructive-account-delink-needs-confirm.scenario.json +1 -1
- package/eval/cases/destructive-forewarning-delete-needs-confirm.scenario.json +1 -1
- package/eval/cases/destructive-invoice-apply-needs-confirm.scenario.json +1 -1
- package/eval/cases/finance-invoice-info-list.scenario.json +3 -3
- package/eval/cases/forewarning-list-google.scenario.json +3 -3
- package/eval/cases/google-ads-no-structural-without-confirm.scenario.json +3 -3
- package/eval/cases/google-analysis-keywords-route.scenario.json +2 -2
- package/eval/cases/hosted-sop-cpa-spike-downbid.scenario.json +6 -6
- package/eval/cases/hosted-sop-daily-budget-circuit-breaker.scenario.json +4 -4
- package/eval/cases/hosted-sop-empty-spend-pause-p1.scenario.json +5 -5
- package/eval/cases/human-p1-multiturn.scenario.json +1 -1
- package/eval/cases/meta-single-balance-not-bulk.scenario.json +4 -4
- package/eval/cases/no-legacy-json-flag.scenario.json +12 -0
- package/eval/cases/open-account-bing-noninteractive.scenario.json +3 -3
- package/eval/cases/open-account-google-noninteractive.scenario.json +2 -2
- package/eval/cases/open-account-tiktok-license-file.scenario.json +2 -2
- package/eval/cases/optimize-list-by-account.scenario.json +3 -3
- package/eval/cases/p1-single-account-profile.scenario.json +2 -2
- package/eval/cases/p2-balance-scan-bulk.scenario.json +1 -1
- package/eval/cases/p4-period-report-window.scenario.json +1 -1
- package/eval/cases/rag-before-keyword-expand.scenario.json +3 -3
- package/eval/cases/rag-list-then-query.scenario.json +5 -5
- package/eval/cases/report-list-google.scenario.json +3 -3
- package/eval/cases/report-push-list-google.scenario.json +3 -3
- package/eval/cases/reporting-vs-account-analytics-routing.scenario.json +4 -4
- package/eval/cases/setup-login-or-env.scenario.json +2 -2
- package/eval/cases/setup-siluzan-data-permission-env.scenario.json +2 -2
- package/eval/cases/skill-optimize-vs-google-ads-distinction.scenario.json +4 -4
- package/eval/cases/tiktok-bc-bind-inquiry.scenario.json +2 -2
- package/eval/cases/time-range-user-delegates-default.scenario.json +2 -2
- package/eval/cases/tips-json-out-filtering.scenario.json +12 -0
- package/eval/cases/tips-large-json-pagination.scenario.json +3 -3
- package/eval/cases/uj-ad-bluetooth-keywords-exclude-cheap-free.scenario.json +1 -1
- package/eval/cases/uj-ad-campaign-validate-before-create-stub.scenario.json +3 -3
- package/eval/cases/uj-ad-keywords-camping-tent-outdoor-plan.scenario.json +1 -1
- package/eval/cases/uj-ad-outdoor-campgear-search-plan.scenario.json +3 -3
- package/eval/cases/uj-analytics-30d-pdf-campaign-device-geo.scenario.json +2 -2
- package/eval/cases/uj-analytics-compare-google-tiktok-last-month-roi.scenario.json +3 -3
- package/eval/cases/uj-analytics-google-weekly-trends-campaigns-keywords.scenario.json +4 -4
- package/eval/cases/uj-analytics-report-push-weekly-email.scenario.json +3 -3
- package/eval/cases/uj-finance-invoice-records-this-month.scenario.json +4 -4
- package/eval/cases/uj-life-newbie-siluzan-google-end-to-end.scenario.json +2 -2
- package/eval/cases/uj-ops-google-accounts-list-normal.scenario.json +4 -4
- package/eval/cases/uj-ops-google-yesterday-spend-conversions.scenario.json +5 -5
- package/eval/cases/uj-ops-open-google-b2c-usd-shenzhen.scenario.json +3 -3
- package/eval/cases/uj-ops-pause-worst-adgroup-confirm.scenario.json +2 -2
- package/eval/cases/uj-ops-tiktok-leads-last-week.scenario.json +4 -4
- package/eval/cases/uj-patrol-cpc-spike-adgroups-over-15.scenario.json +3 -3
- package/eval/cases/uj-patrol-forewarning-create-daily-cap-3000.scenario.json +3 -3
- package/eval/cases/uj-patrol-forewarning-trigger-records.scenario.json +4 -4
- package/eval/cases/uj-patrol-google-balances-low.scenario.json +3 -3
- package/eval/cases/uj-roi-full-google-account-diagnosis.scenario.json +1 -1
- package/eval/cases/uj-roi-keywords-high-cpa-low-cvr-triage.scenario.json +1 -1
- package/eval/cases/uj-roi-optimize-records-then-execute-cautiously.scenario.json +4 -4
- package/eval/cases/uj-roi-search-terms-add-negative-keywords.scenario.json +2 -2
- package/package.json +4 -3
- package/dist/skill/references/hosted-automation-scenarios.md +0 -23
- package/dist/skill/references/hosted-automation-user-catalog.md +0 -38
- package/eval/cases/tips-json-filtering.scenario.json +0 -12
- /package/dist/skill/references/{geo-continents.json → analytics/geo-continents.json} +0 -0
- /package/dist/skill/references/{google-ads-rules → google-ads/rules}/google-ads-audience-strategy.md +0 -0
- /package/dist/skill/references/{google-ads-rules → google-ads/rules}/google-ads-compliance.md +0 -0
- /package/dist/skill/references/{google-ads-rules → google-ads/rules}/google-ads-conversion-architecture.md +0 -0
- /package/dist/skill/references/{google-ads-rules → google-ads/rules}/google-ads-creative-optimization.md +0 -0
- /package/dist/skill/references/{google-ads-rules → google-ads/rules}/google-ads-landing-page-discovery-via-webfetch.md +0 -0
- /package/dist/skill/references/{google-ads-rules → google-ads/rules}/sensitive-industries.md +0 -0
package/dist/index.js
CHANGED
|
@@ -3328,7 +3328,7 @@ var DEFAULT_API_BASE;
|
|
|
3328
3328
|
var init_defaults = __esm({
|
|
3329
3329
|
"src/config/defaults.ts"() {
|
|
3330
3330
|
"use strict";
|
|
3331
|
-
DEFAULT_API_BASE = "https://tso-api.siluzan.com";
|
|
3331
|
+
DEFAULT_API_BASE = "https://tso-api-ci.siluzan.com";
|
|
3332
3332
|
}
|
|
3333
3333
|
});
|
|
3334
3334
|
|
|
@@ -3839,11 +3839,13 @@ function mergeCliSnapshotManifest(existing, params) {
|
|
|
3839
3839
|
artifacts
|
|
3840
3840
|
};
|
|
3841
3841
|
}
|
|
3842
|
-
function
|
|
3843
|
-
if (json
|
|
3844
|
-
console.error(
|
|
3845
|
-
|
|
3846
|
-
|
|
3842
|
+
function rejectDeprecatedJsonFlag(json, commandLabel) {
|
|
3843
|
+
if (json) {
|
|
3844
|
+
console.error(
|
|
3845
|
+
`
|
|
3846
|
+
\u274C ${commandLabel}\uFF1A--json \u5DF2\u79FB\u9664\u3002\u8BF7\u4F7F\u7528 --json-out <\u76EE\u5F55\u6216 *.json \u6587\u4EF6> \u843D\u76D8\u7ED3\u6784\u5316\u6570\u636E\uFF08stdout \u4EC5\u4E00\u884C\u6458\u8981\uFF09\u3002
|
|
3847
|
+
`
|
|
3848
|
+
);
|
|
3847
3849
|
process.exit(1);
|
|
3848
3850
|
}
|
|
3849
3851
|
}
|
|
@@ -3990,7 +3992,6 @@ async function writeCliJsonSnapshot(params) {
|
|
|
3990
3992
|
};
|
|
3991
3993
|
}
|
|
3992
3994
|
async function emitCliJsonOrSnapshot(opts, params) {
|
|
3993
|
-
assertJsonXorJsonOut(opts.json, opts.jsonOut, params.commandLabel);
|
|
3994
3995
|
if (opts.jsonOut) {
|
|
3995
3996
|
const summary = await writeCliJsonSnapshot({
|
|
3996
3997
|
snapshotDir: opts.jsonOut,
|
|
@@ -4002,10 +4003,6 @@ async function emitCliJsonOrSnapshot(opts, params) {
|
|
|
4002
4003
|
console.log(JSON.stringify(summary));
|
|
4003
4004
|
return true;
|
|
4004
4005
|
}
|
|
4005
|
-
if (opts.json) {
|
|
4006
|
-
console.log(JSON.stringify(params.payload, null, 2));
|
|
4007
|
-
return true;
|
|
4008
|
-
}
|
|
4009
4006
|
return false;
|
|
4010
4007
|
}
|
|
4011
4008
|
var CLI_SNAPSHOT_MANIFEST_FILE, CLI_PACKAGE, SCHEMA_VERSION, OUTLINE_AGENT_HINT, DEFAULT_FIELD_GUIDE, TS_LIKE_ARRAY_SAMPLE_MAX;
|
|
@@ -4019,7 +4016,7 @@ var init_cli_json = __esm({
|
|
|
4019
4016
|
SCHEMA_VERSION = 1;
|
|
4020
4017
|
OUTLINE_AGENT_HINT = "\u5904\u7406\u987A\u5E8F\uFF1A\u5148\u8BFB outlineFile\uFF08schema \u63CF\u8FF0\uFF0C\u975E\u6570\u636E\uFF09\u4E86\u89E3\u5B57\u6BB5\u7C7B\u578B\uFF0C\u518D\u7528\u811A\u672C\u8BFB writtenFiles[0]\uFF08\u771F\u5B9E JSON \u6570\u636E\uFF09\u505A\u7B5B\u9009/\u805A\u5408\uFF1B\u4E0D\u8981\u628A outline \u5F53\u6210\u6570\u636E\uFF0C\u4E5F\u4E0D\u8981\u628A JSON \u5F53\u6210 schema\u3002";
|
|
4021
4018
|
DEFAULT_FIELD_GUIDE = {
|
|
4022
|
-
markdownRefs: ["references/currency.md", "references/tips.md", "references/accounts.md"]
|
|
4019
|
+
markdownRefs: ["references/accounts/currency.md", "references/core/tips.md", "references/accounts/accounts.md"]
|
|
4023
4020
|
};
|
|
4024
4021
|
TS_LIKE_ARRAY_SAMPLE_MAX = 8;
|
|
4025
4022
|
}
|
|
@@ -4124,6 +4121,23 @@ function parseGoogleAccountSpendOverviewRows(raw) {
|
|
|
4124
4121
|
if (!Number.isFinite(n)) return null;
|
|
4125
4122
|
return Math.round(n / 1e6 * 100) / 100;
|
|
4126
4123
|
};
|
|
4124
|
+
const rowsFromAccountsDict = (accounts2, mode) => {
|
|
4125
|
+
const rows = [];
|
|
4126
|
+
for (const [id, item] of Object.entries(accounts2)) {
|
|
4127
|
+
const data = item?.data;
|
|
4128
|
+
if (!data) continue;
|
|
4129
|
+
rows.push({
|
|
4130
|
+
mode,
|
|
4131
|
+
mediaAccountId: String(id),
|
|
4132
|
+
spend: typeof data.spend === "number" ? data.spend : void 0,
|
|
4133
|
+
impressions: typeof data.impressions === "number" ? data.impressions : void 0,
|
|
4134
|
+
clicks: typeof data.clicks === "number" ? data.clicks : void 0,
|
|
4135
|
+
conversions: typeof data.conversions === "number" ? data.conversions : void 0,
|
|
4136
|
+
costPerClick: typeof data.averageCpc === "number" ? data.averageCpc : void 0
|
|
4137
|
+
});
|
|
4138
|
+
}
|
|
4139
|
+
return rows;
|
|
4140
|
+
};
|
|
4127
4141
|
const fromDbItem = (it) => {
|
|
4128
4142
|
if (it == null || it.mediaAccountId == null) return null;
|
|
4129
4143
|
return {
|
|
@@ -4148,25 +4162,23 @@ function parseGoogleAccountSpendOverviewRows(raw) {
|
|
|
4148
4162
|
if (!raw || typeof raw !== "object") return [];
|
|
4149
4163
|
const r = raw;
|
|
4150
4164
|
if (r.mode === "googleCombined") {
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
mediaAccountId: String(id),
|
|
4161
|
-
spend: typeof data.spend === "number" ? data.spend : void 0,
|
|
4162
|
-
impressions: typeof data.impressions === "number" ? data.impressions : void 0,
|
|
4163
|
-
clicks: typeof data.clicks === "number" ? data.clicks : void 0,
|
|
4164
|
-
conversions: typeof data.conversions === "number" ? data.conversions : void 0,
|
|
4165
|
-
// 实时模式下 averageCpc 即点击均价(CPC)
|
|
4166
|
-
costPerClick: typeof data.averageCpc === "number" ? data.averageCpc : void 0
|
|
4167
|
-
});
|
|
4165
|
+
return rowsFromAccountsDict(
|
|
4166
|
+
r.accounts ?? {},
|
|
4167
|
+
"googleCombined"
|
|
4168
|
+
);
|
|
4169
|
+
}
|
|
4170
|
+
if (r.mode === "database") {
|
|
4171
|
+
const items2 = Array.isArray(r.items) ? r.items : [];
|
|
4172
|
+
if (items2.length > 0) {
|
|
4173
|
+
return items2.map(fromDbItem).filter((row) => row !== null);
|
|
4168
4174
|
}
|
|
4169
|
-
|
|
4175
|
+
}
|
|
4176
|
+
const accounts = r.accounts;
|
|
4177
|
+
if (accounts && Object.keys(accounts).length > 0) {
|
|
4178
|
+
return rowsFromAccountsDict(
|
|
4179
|
+
accounts,
|
|
4180
|
+
"database"
|
|
4181
|
+
);
|
|
4170
4182
|
}
|
|
4171
4183
|
const items = Array.isArray(r.items) ? r.items : [];
|
|
4172
4184
|
return items.map(fromDbItem).filter((row) => row !== null);
|
|
@@ -4520,7 +4532,7 @@ ${media} \u8D26\u6237\u6295\u653E\u753B\u50CF\uFF1A\u8FD4\u56DE ${rows.length} \
|
|
|
4520
4532
|
`
|
|
4521
4533
|
\u6C47\u603B\uFF1A\u6D88\u8017 ${meta.totals.spend}\uFF0C\u70B9\u51FB ${meta.totals.clicks}\uFF0C\u5C55\u793A ${meta.totals.impressions}\uFF0C\u8F6C\u5316 ${meta.totals.conversions}
|
|
4522
4534
|
\u63D0\u793A\uFF1A
|
|
4523
|
-
- \u91D1\u989D\u4F7F\u7528\u5404\u8D26\u6237\u4E3B\u5E01\u79CD\uFF1B\u8DE8\u5E01\u79CD\u8D26\u6237\u52A0 --json \u81EA\u884C\u6309 currencyCode \u805A\u5408
|
|
4535
|
+
- \u91D1\u989D\u4F7F\u7528\u5404\u8D26\u6237\u4E3B\u5E01\u79CD\uFF1B\u8DE8\u5E01\u79CD\u8D26\u6237\u52A0 --json-out \u81EA\u884C\u6309 currencyCode \u805A\u5408
|
|
4524
4536
|
- \u6307\u5B9A\u8D26\u6237\u5B50\u96C6\uFF1A--accounts <id1,id2,...>\uFF08\u4E0E list-accounts \u7684 mediaCustomerId \u4E00\u81F4\uFF09
|
|
4525
4537
|
- \u8FC7\u6EE4\u4F4E\u6D88\u8017\uFF1A--min-spend 10\uFF08\u53EA\u4FDD\u7559\u533A\u95F4\u5185\u6D88\u8017 > 10 \u7684\u8D26\u6237\uFF09
|
|
4526
4538
|
`
|
|
@@ -4552,9 +4564,9 @@ function register10(program2) {
|
|
|
4552
4564
|
"--min-spend <n>",
|
|
4553
4565
|
"\u8FC7\u6EE4\uFF1A\u533A\u95F4\u5185\u6D88\u8017 \u2264 \u6B64\u503C\u7684\u8D26\u6237\u4E0D\u8FD4\u56DE\uFF08\u9ED8\u8BA4 0\uFF09",
|
|
4554
4566
|
(v) => parseFloat(v)
|
|
4555
|
-
).option("--page-size <n>", "\u8D26\u6237\u6E05\u5355\u5206\u9875\u5927\u5C0F\uFF08\u9ED8\u8BA4 200\uFF0C\u4E0A\u9650 500\uFF09", (v) => parseInt(v, 10)).option("--max-pages <n>", "\u6700\u591A\u626B\u63CF\u9875\u6570\uFF08\u9ED8\u8BA4 20\uFF0C\u4E0A\u9650 200\uFF09", (v) => parseInt(v, 10)).option("-t, --token <token>", "Token\uFF08\u53EF\u9009\uFF1B\u4F18\u5148\u4E8E ~/.siluzan/config.json\uFF09").option(
|
|
4567
|
+
).option("--page-size <n>", "\u8D26\u6237\u6E05\u5355\u5206\u9875\u5927\u5C0F\uFF08\u9ED8\u8BA4 200\uFF0C\u4E0A\u9650 500\uFF09", (v) => parseInt(v, 10)).option("--max-pages <n>", "\u6700\u591A\u626B\u63CF\u9875\u6570\uFF08\u9ED8\u8BA4 20\uFF0C\u4E0A\u9650 200\uFF09", (v) => parseInt(v, 10)).option("-t, --token <token>", "Token\uFF08\u53EF\u9009\uFF1B\u4F18\u5148\u4E8E ~/.siluzan/config.json\uFF09").option(
|
|
4556
4568
|
"--json-out <path>",
|
|
4557
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
4569
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
4558
4570
|
void 0
|
|
4559
4571
|
).option("--refresh-dp", "\u5F3A\u5236\u91CD\u62C9 Datapermission \u540E\u518D\u8BF7\u6C42", false).option("--verbose", "\u663E\u793A\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
4560
4572
|
async (opts) => {
|
|
@@ -4567,7 +4579,6 @@ function register10(program2) {
|
|
|
4567
4579
|
minSpend: opts.minSpend,
|
|
4568
4580
|
pageSize: opts.pageSize,
|
|
4569
4581
|
maxPages: opts.maxPages,
|
|
4570
|
-
json: opts.json,
|
|
4571
4582
|
jsonOut: opts.jsonOut,
|
|
4572
4583
|
refreshDp: opts.refreshDp,
|
|
4573
4584
|
verbose: opts.verbose
|
|
@@ -4612,7 +4623,10 @@ function buildOutlineHints(section) {
|
|
|
4612
4623
|
hints.push(...GOOGLE_ANALYSIS_RATE_NORMALIZED_OUTLINE_HINTS);
|
|
4613
4624
|
}
|
|
4614
4625
|
if (section === "campaigns") {
|
|
4615
|
-
hints.push(
|
|
4626
|
+
hints.push(
|
|
4627
|
+
...GOOGLE_ANALYSIS_CAMPAIGNS_OUTLINE_BUDGET_HINTS,
|
|
4628
|
+
...GOOGLE_ANALYSIS_CAMPAIGNS_COMPETITIVE_METRICS_HINTS
|
|
4629
|
+
);
|
|
4616
4630
|
}
|
|
4617
4631
|
const zhHints = GOOGLE_ANALYSIS_ZH_FIELD_HINTS_BY_SECTION[section];
|
|
4618
4632
|
if (zhHints) hints.push(...zhHints);
|
|
@@ -4721,7 +4735,7 @@ async function writeGoogleAnalysisSnapshot(params) {
|
|
|
4721
4735
|
agentHint: OUTLINE_AGENT_HINT
|
|
4722
4736
|
};
|
|
4723
4737
|
}
|
|
4724
|
-
var LEGACY_MANIFEST_FILE, CLI_PACKAGE2, SCHEMA_VERSION2, DEFAULT_FIELD_GUIDE2, GOOGLE_ANALYSIS_CAMPAIGNS_OUTLINE_BUDGET_HINTS, RATE_BEARING_SECTIONS, GOOGLE_ANALYSIS_RATE_NORMALIZED_OUTLINE_HINTS, GOOGLE_ANALYSIS_ZH_FIELD_HINTS_BY_SECTION;
|
|
4738
|
+
var LEGACY_MANIFEST_FILE, CLI_PACKAGE2, SCHEMA_VERSION2, DEFAULT_FIELD_GUIDE2, GOOGLE_ANALYSIS_CAMPAIGNS_OUTLINE_BUDGET_HINTS, GOOGLE_ANALYSIS_CAMPAIGNS_COMPETITIVE_METRICS_HINTS, RATE_BEARING_SECTIONS, GOOGLE_ANALYSIS_RATE_NORMALIZED_OUTLINE_HINTS, GOOGLE_ANALYSIS_ZH_FIELD_HINTS_BY_SECTION;
|
|
4725
4739
|
var init_google_analysis = __esm({
|
|
4726
4740
|
"src/utils/snapshot/google-analysis.ts"() {
|
|
4727
4741
|
"use strict";
|
|
@@ -4731,13 +4745,17 @@ var init_google_analysis = __esm({
|
|
|
4731
4745
|
CLI_PACKAGE2 = "siluzan-tso-cli";
|
|
4732
4746
|
SCHEMA_VERSION2 = 2;
|
|
4733
4747
|
DEFAULT_FIELD_GUIDE2 = {
|
|
4734
|
-
markdownRefs: ["references/currency.md", "references/account-analytics.md"],
|
|
4748
|
+
markdownRefs: ["references/accounts/currency.md", "references/analytics/account-analytics.md"],
|
|
4735
4749
|
tsTypesModule: "tso-cli/src/types/google-analysis-api.ts"
|
|
4736
4750
|
};
|
|
4737
4751
|
GOOGLE_ANALYSIS_CAMPAIGNS_OUTLINE_BUDGET_HINTS = [
|
|
4738
4752
|
"// \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",
|
|
4739
4753
|
"// \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"
|
|
4740
4754
|
];
|
|
4755
|
+
GOOGLE_ANALYSIS_CAMPAIGNS_COMPETITIVE_METRICS_HINTS = [
|
|
4756
|
+
"// \u7ADE\u4E89\u6307\u6807\uFF1A`campaigns[].competitiveMetrics` \u4E3A Google \u539F\u751F **0~1 \u5C0F\u6570**\uFF08\u5982 `0.0999` = 9.99%\uFF09\uFF0C\u542B Top/AbsoluteTop/Content/ClickShare \u7B49 15 \u9879\uFF1B\u65E0 GAQL \u7ADE\u4E89\u6570\u636E\u65F6\u4E3A `null`\u3002",
|
|
4757
|
+
"// \u884C\u9876 `searchImpressionShare` / `searchBudgetLostImpressionShare` / `searchRankLostImpressionShare` \u4ECD\u4E3A **0~100 \u767E\u5206\u6570**\uFF08\u4EC5 3 \u9879\uFF09\uFF1B**\u7981\u6B62**\u4E0E `competitiveMetrics.*` \u76F8\u52A0\u6216\u6DF7\u7B97\u3002"
|
|
4758
|
+
];
|
|
4741
4759
|
RATE_BEARING_SECTIONS = /* @__PURE__ */ new Set([
|
|
4742
4760
|
"overview",
|
|
4743
4761
|
"keywords",
|
|
@@ -4747,7 +4765,9 @@ var init_google_analysis = __esm({
|
|
|
4747
4765
|
"extensions",
|
|
4748
4766
|
"devices",
|
|
4749
4767
|
"geographic",
|
|
4768
|
+
"geo-matched",
|
|
4750
4769
|
"campaign-geo",
|
|
4770
|
+
"campaign-geo-matched",
|
|
4751
4771
|
"campaign-device",
|
|
4752
4772
|
"audience",
|
|
4753
4773
|
"asset-images",
|
|
@@ -4770,6 +4790,12 @@ var init_google_analysis = __esm({
|
|
|
4770
4790
|
],
|
|
4771
4791
|
"campaign-geo": [
|
|
4772
4792
|
"// \u4E2D\u6587\u8BD1\u540D\uFF1A`countryOrRegionZh`\uFF08\u7531 `countryOrRegion` \u7ECF geo-en2zh.json \u7FFB\u8BD1\uFF0C\u76EE\u524D\u8986\u76D6 105 \u4E2A\u56FD\u5BB6/\u5730\u533A\uFF1B\u672A\u547D\u4E2D\u65F6\u8BE5\u5B57\u6BB5\u7F3A\u7701\uFF09\u3002"
|
|
4793
|
+
],
|
|
4794
|
+
"campaign-geo-matched": [
|
|
4795
|
+
"// \u4E2D\u6587\u8BD1\u540D\uFF1A`countryOrRegionZh`\uFF08\u7531 `countryOrRegion` \u7ECF geo-en2zh.json \u7FFB\u8BD1\uFF0C\u76EE\u524D\u8986\u76D6 105 \u4E2A\u56FD\u5BB6/\u5730\u533A\uFF1B\u672A\u547D\u4E2D\u65F6\u8BE5\u5B57\u6BB5\u7F3A\u7701\uFF09\u3002"
|
|
4796
|
+
],
|
|
4797
|
+
"geo-matched": [
|
|
4798
|
+
"// \u4E2D\u6587\u8BD1\u540D\uFF1A`countryOrRegionZh`\uFF08\u7531 `countryOrRegion` \u7ECF geo-en2zh.json \u7FFB\u8BD1\uFF0C\u76EE\u524D\u8986\u76D6 105 \u4E2A\u56FD\u5BB6/\u5730\u533A\uFF1B\u672A\u547D\u4E2D\u65F6\u8BE5\u5B57\u6BB5\u7F3A\u7701\uFF09\u3002"
|
|
4773
4799
|
]
|
|
4774
4800
|
};
|
|
4775
4801
|
}
|
|
@@ -4826,18 +4852,19 @@ var init_sections = __esm({
|
|
|
4826
4852
|
},
|
|
4827
4853
|
{
|
|
4828
4854
|
name: "keywords",
|
|
4829
|
-
description: "\u5173\u952E\u8BCD\u5206\u6BB5 KeywordSectionData",
|
|
4855
|
+
description: "\u5173\u952E\u8BCD\u5206\u6BB5 KeywordSectionData\uFF08\u9ED8\u8BA4 costGreater=0 \u4EC5\u6709\u6D88\u8017\u3001limit=0 \u4E0D\u5C01\u9876\uFF1B\u53EF\u7528 --limit \u9650\u5236\u6761\u6570\uFF09",
|
|
4830
4856
|
dateMode: "range",
|
|
4831
4857
|
path: (id) => `/reporting/media-account/${id}/KeywordSectionData`,
|
|
4832
|
-
|
|
4858
|
+
/** costGreater 单位:微分(0 → metrics.cost_micros>0);limit=0 表示网关不加 LIMIT */
|
|
4859
|
+
defaultQuery: { limit: 0, orderByCost: true, costGreater: 0 },
|
|
4833
4860
|
keywordOptions: true
|
|
4834
4861
|
},
|
|
4835
4862
|
{
|
|
4836
4863
|
name: "search-terms",
|
|
4837
|
-
description: "\u641C\u7D22\u8BCD searchtermmanagement/v2/list",
|
|
4864
|
+
description: "\u641C\u7D22\u8BCD searchtermmanagement/v2/list\uFF08\u9ED8\u8BA4 limit=0 \u4E0D\u5C01\u9876\uFF0CCLI \u843D\u76D8\u524D\u8FC7\u6EE4 spend>0\uFF09",
|
|
4838
4865
|
dateMode: "range",
|
|
4839
4866
|
path: (id) => `/searchtermmanagement/v2/list/${id}`,
|
|
4840
|
-
defaultQuery: { limit:
|
|
4867
|
+
defaultQuery: { limit: 0, orderByCost: true },
|
|
4841
4868
|
keywordOptions: true
|
|
4842
4869
|
},
|
|
4843
4870
|
{
|
|
@@ -4877,6 +4904,13 @@ var init_sections = __esm({
|
|
|
4877
4904
|
dateMode: "range",
|
|
4878
4905
|
path: (id) => `/reporting/media-account/${id}/GeographicSectionData`
|
|
4879
4906
|
},
|
|
4907
|
+
{
|
|
4908
|
+
name: "geo-matched",
|
|
4909
|
+
description: "\u76F8\u7B26\u5730\u7406\u4F4D\u7F6E\uFF08Matched locations\uFF0Cuser_location_view\uFF09\u8D26\u6237\u7EA7\u6309\u56FD\u5BB6/\u5730\u533A\u6C47\u603B GET \u2026/reports/geo/matched/combined",
|
|
4910
|
+
dateMode: "range",
|
|
4911
|
+
path: (id) => `/reporting/media-account/${id}/reports/geo/matched/combined`,
|
|
4912
|
+
campaignGeoFilterOption: true
|
|
4913
|
+
},
|
|
4880
4914
|
{
|
|
4881
4915
|
name: "campaign-geo",
|
|
4882
4916
|
description: "\u5E7F\u544A\u7CFB\u5217\u7EF4\u5EA6\u5730\u7406 GET \u2026/campaigns/reports/geo\uFF08GetCampaignGeoReport\uFF1B\u884C\u53EF\u542B campaign/adGroup\uFF09",
|
|
@@ -4884,6 +4918,13 @@ var init_sections = __esm({
|
|
|
4884
4918
|
path: (id) => `/reporting/media-account/${id}/campaigns/reports/geo`,
|
|
4885
4919
|
campaignGeoFilterOption: true
|
|
4886
4920
|
},
|
|
4921
|
+
{
|
|
4922
|
+
name: "campaign-geo-matched",
|
|
4923
|
+
description: "\u76F8\u7B26\u5730\u7406\u4F4D\u7F6E\uFF08Matched locations\uFF0Cuser_location_view\uFF09\u7CFB\u5217\u7EA7\u660E\u7EC6 GET \u2026/campaigns/reports/geo/matched/combined",
|
|
4924
|
+
dateMode: "range",
|
|
4925
|
+
path: (id) => `/reporting/media-account/${id}/campaigns/reports/geo/matched/combined`,
|
|
4926
|
+
campaignGeoFilterOption: true
|
|
4927
|
+
},
|
|
4887
4928
|
{
|
|
4888
4929
|
name: "campaign-device",
|
|
4889
4930
|
description: "\u5E7F\u544A\u7CFB\u5217\u7EF4\u5EA6\u8BBE\u5907 GET \u2026/campaigns/reports/device\uFF08GetCampaignDeviceReport\uFF1B\u884C\u53EF\u542B campaign/adGroup\uFF09",
|
|
@@ -100506,9 +100547,17 @@ function annotateZhFields(payload, section) {
|
|
|
100506
100547
|
case "search-terms": {
|
|
100507
100548
|
const rows = payload.data;
|
|
100508
100549
|
annotateArrayRows(rows, "matchType", "matchTypeZh", MATCH_TYPE_DICT);
|
|
100550
|
+
annotateArrayRows(
|
|
100551
|
+
rows,
|
|
100552
|
+
"queryTargetingStatus",
|
|
100553
|
+
"queryTargetingStatusZh",
|
|
100554
|
+
QUERY_TARGETING_STATUS_ZH
|
|
100555
|
+
);
|
|
100509
100556
|
break;
|
|
100510
100557
|
}
|
|
100511
100558
|
case "campaign-geo":
|
|
100559
|
+
case "campaign-geo-matched":
|
|
100560
|
+
case "geo-matched":
|
|
100512
100561
|
case "geographic": {
|
|
100513
100562
|
const rows = payload.countries;
|
|
100514
100563
|
annotateArrayRows(rows, "countryOrRegion", "countryOrRegionZh", GEO_DICT);
|
|
@@ -100520,7 +100569,7 @@ function annotateZhFields(payload, section) {
|
|
|
100520
100569
|
}
|
|
100521
100570
|
return payload;
|
|
100522
100571
|
}
|
|
100523
|
-
var MATCH_TYPE_DICT, GEO_DICT, CITY_DICT, ISO_ZH_DICT;
|
|
100572
|
+
var MATCH_TYPE_DICT, GEO_DICT, CITY_DICT, ISO_ZH_DICT, QUERY_TARGETING_STATUS_ZH;
|
|
100524
100573
|
var init_translate_fields = __esm({
|
|
100525
100574
|
"src/commands/google-analysis/translate-fields.ts"() {
|
|
100526
100575
|
"use strict";
|
|
@@ -100531,6 +100580,14 @@ var init_translate_fields = __esm({
|
|
|
100531
100580
|
GEO_DICT = geo_en2zh_default;
|
|
100532
100581
|
CITY_DICT = city_to_country_default.byName ?? {};
|
|
100533
100582
|
ISO_ZH_DICT = city_to_country_default.isoToZh ?? {};
|
|
100583
|
+
QUERY_TARGETING_STATUS_ZH = {
|
|
100584
|
+
Added: "\u5DF2\u6DFB\u52A0",
|
|
100585
|
+
Excluded: "\u5DF2\u6392\u9664",
|
|
100586
|
+
None: "\u90FD\u6CA1\u6709",
|
|
100587
|
+
AddedExcluded: "\u5DF2\u6DFB\u52A0/\u5DF2\u6392\u9664",
|
|
100588
|
+
UNSPECIFIED: "\u90FD\u6CA1\u6709",
|
|
100589
|
+
UNKNOWN: "\u90FD\u6CA1\u6709"
|
|
100590
|
+
};
|
|
100534
100591
|
}
|
|
100535
100592
|
});
|
|
100536
100593
|
|
|
@@ -100596,6 +100653,22 @@ function mergeDeviceBidModifiersIntoReport(report, modifiers) {
|
|
|
100596
100653
|
function assertNever(x, ctx) {
|
|
100597
100654
|
throw new Error(`${ctx}\uFF1A\u672A\u5904\u7406\u7684\u5206\u652F ${String(x)}`);
|
|
100598
100655
|
}
|
|
100656
|
+
function filterRowsWithPositiveSpend(rows) {
|
|
100657
|
+
return rows.filter((r) => typeof r.spend === "number" && r.spend > 0);
|
|
100658
|
+
}
|
|
100659
|
+
function applySpendOnlySectionFilter(payload, section) {
|
|
100660
|
+
if (section === "keywords") {
|
|
100661
|
+
const bag = payload;
|
|
100662
|
+
if (!Array.isArray(bag.keywords)) return payload;
|
|
100663
|
+
return { ...bag, keywords: filterRowsWithPositiveSpend(bag.keywords) };
|
|
100664
|
+
}
|
|
100665
|
+
if (section === "search-terms") {
|
|
100666
|
+
const bag = payload;
|
|
100667
|
+
if (!Array.isArray(bag.data)) return payload;
|
|
100668
|
+
return { ...bag, data: filterRowsWithPositiveSpend(bag.data) };
|
|
100669
|
+
}
|
|
100670
|
+
return payload;
|
|
100671
|
+
}
|
|
100599
100672
|
function rowsFromAccountDailyReportsEnvelope(raw, mediaCustomerId) {
|
|
100600
100673
|
const block = raw.accounts?.[mediaCustomerId];
|
|
100601
100674
|
const list = block?.data;
|
|
@@ -100621,8 +100694,12 @@ async function fetchGoogleAnalysisSectionJson(config, fullPath, verbose, name2)
|
|
|
100621
100694
|
return fetchJson(config, fullPath, verbose);
|
|
100622
100695
|
case "geographic":
|
|
100623
100696
|
return fetchJson(config, fullPath, verbose);
|
|
100697
|
+
case "geo-matched":
|
|
100698
|
+
return fetchJson(config, fullPath, verbose);
|
|
100624
100699
|
case "campaign-geo":
|
|
100625
100700
|
return fetchJson(config, fullPath, verbose);
|
|
100701
|
+
case "campaign-geo-matched":
|
|
100702
|
+
return fetchJson(config, fullPath, verbose);
|
|
100626
100703
|
case "campaign-device":
|
|
100627
100704
|
return fetchJson(config, fullPath, verbose);
|
|
100628
100705
|
case "audience":
|
|
@@ -100751,6 +100828,9 @@ async function fetchSectionPayload(def, opts, config, id) {
|
|
|
100751
100828
|
if (def.name === "overview") {
|
|
100752
100829
|
payload = normalizeOverviewPayload(payload);
|
|
100753
100830
|
}
|
|
100831
|
+
if (def.keywordOptions) {
|
|
100832
|
+
payload = applySpendOnlySectionFilter(payload, def.name);
|
|
100833
|
+
}
|
|
100754
100834
|
return annotateZhFields(payload, def.name);
|
|
100755
100835
|
}
|
|
100756
100836
|
function endpointHintForSection(def) {
|
|
@@ -102173,7 +102253,7 @@ async function runAllSections(opts) {
|
|
|
102173
102253
|
}
|
|
102174
102254
|
if (!opts.jsonOut || !opts.jsonOut.trim()) {
|
|
102175
102255
|
console.error(
|
|
102176
|
-
"\n\u274C all \u6A21\u5F0F\u5FC5\u987B\u4F20 --json-out <\u76EE\u5F55>\
|
|
102256
|
+
"\n\u274C all \u6A21\u5F0F\u5FC5\u987B\u4F20 --json-out <\u76EE\u5F55>\uFF0825 \u4E2A\u7EF4\u5EA6\u7ED3\u679C\u843D\u76D8\u540E\u7531 manifest \u7D22\u5F15\uFF09\u3002\n"
|
|
102177
102257
|
);
|
|
102178
102258
|
process.exit(1);
|
|
102179
102259
|
}
|
|
@@ -102330,7 +102410,7 @@ function registerGoogleAnalysisCommands(program2) {
|
|
|
102330
102410
|
"\u5F00\u59CB\u65E5\u671F YYYY-MM-DD\uFF08range \u7C7B\u7EF4\u5EA6\u751F\u6548\uFF1B\u7701\u7565=\u8FD1 7 \u5929\u622A\u81F3\u6628\u5929\uFF1B\u4E0E --end \u540C\u4F20\u6216\u540C\u7701\uFF09"
|
|
102331
102411
|
).option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option(
|
|
102332
102412
|
"--sections <list>",
|
|
102333
|
-
"\u4EC5\u6267\u884C\u6307\u5B9A\u7EF4\u5EA6\uFF08\u9017\u53F7\u5206\u9694\uFF09\uFF0C\u5982 overview,keywords,ads\uFF1B\u7701\u7565=\u5168\u90E8
|
|
102413
|
+
"\u4EC5\u6267\u884C\u6307\u5B9A\u7EF4\u5EA6\uFF08\u9017\u53F7\u5206\u9694\uFF09\uFF0C\u5982 overview,keywords,ads\uFF1B\u7701\u7565=\u5168\u90E8 25 \u4E2A"
|
|
102334
102414
|
).option(
|
|
102335
102415
|
"--exclude <list>",
|
|
102336
102416
|
"\u6392\u9664\u6307\u5B9A\u7EF4\u5EA6\uFF08\u9017\u53F7\u5206\u9694\uFF09\uFF0C\u5982 materials,gold-account\uFF1B\u4E0E --sections \u53EF\u53E0\u52A0"
|
|
@@ -102340,32 +102420,32 @@ function registerGoogleAnalysisCommands(program2) {
|
|
|
102340
102420
|
(v) => parseInt(v, 10)
|
|
102341
102421
|
).option(
|
|
102342
102422
|
"--limit <n>",
|
|
102343
|
-
"\u900F\u4F20\u7ED9 keywords / search-terms \
|
|
102423
|
+
"\u900F\u4F20\u7ED9 keywords / search-terms \u7684\u6761\u6570\u4E0A\u9650\uFF08\u9ED8\u8BA4 0=\u4E0D\u5C01\u9876\uFF1Bkeywords \u9ED8\u8BA4\u53E6\u5E26 costGreater=0 \u4EC5\u6709\u6D88\u8017\uFF09",
|
|
102344
102424
|
(v) => parseInt(v, 10)
|
|
102345
102425
|
).option("--no-order-by-cost", "\u900F\u4F20\uFF1Akeywords / search-terms \u4E0D\u6309\u6D88\u8017\u6392\u5E8F", false).option("--level <level>", "\u900F\u4F20\u7ED9 extensions \u7EF4\u5EA6\u7684 level \u8FC7\u6EE4\uFF1AAccount | Campaign | Ad Group").option(
|
|
102346
102426
|
"--audience-type <type>",
|
|
102347
102427
|
"\u900F\u4F20\u7ED9 audience \u7EF4\u5EA6\u7684 audienceTypeFilter\uFF1ASystemDefined | UserDefined"
|
|
102348
102428
|
).option(
|
|
102349
102429
|
"--cost-greater <n>",
|
|
102350
|
-
"\u4EC5 campaign-geo\uFF1A\u7F51\u5173\u53EF\u9009\u8FC7\u6EE4 costGreater\uFF08\u6574\u6570\uFF0C\u5355\u4F4D\u4EE5\u540E\u7AEF\u4E3A\u51C6\uFF09",
|
|
102430
|
+
"\u4EC5 geo-matched / campaign-geo / campaign-geo-matched\uFF1A\u7F51\u5173\u53EF\u9009\u8FC7\u6EE4 costGreater\uFF08\u6574\u6570\uFF0C\u5355\u4F4D\u4EE5\u540E\u7AEF\u4E3A\u51C6\uFF09",
|
|
102351
102431
|
(v) => parseInt(v, 10)
|
|
102352
102432
|
).option(
|
|
102353
102433
|
"--click-greater <n>",
|
|
102354
|
-
"\u4EC5 campaign-geo\uFF1A\u7F51\u5173\u53EF\u9009\u8FC7\u6EE4 clickGreater\uFF08\u6574\u6570\uFF09",
|
|
102434
|
+
"\u4EC5 geo-matched / campaign-geo / campaign-geo-matched\uFF1A\u7F51\u5173\u53EF\u9009\u8FC7\u6EE4 clickGreater\uFF08\u6574\u6570\uFF09",
|
|
102355
102435
|
(v) => parseInt(v, 10)
|
|
102356
102436
|
).option(
|
|
102357
102437
|
"--conversions-greater <n>",
|
|
102358
|
-
"\u4EC5 campaign-geo\uFF1A\u7F51\u5173\u53EF\u9009\u8FC7\u6EE4 conversionsGreater\uFF08\u6574\u6570\uFF09",
|
|
102438
|
+
"\u4EC5 geo-matched / campaign-geo / campaign-geo-matched\uFF1A\u7F51\u5173\u53EF\u9009\u8FC7\u6EE4 conversionsGreater\uFF08\u6574\u6570\uFF09",
|
|
102359
102439
|
(v) => parseInt(v, 10)
|
|
102360
102440
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).addHelpText(
|
|
102361
102441
|
"after",
|
|
102362
102442
|
[
|
|
102363
102443
|
"",
|
|
102364
|
-
"\u53EF\u7528\u7EF4\u5EA6\
|
|
102365
|
-
...SECTIONS.map((s) => ` ${s.name.padEnd(
|
|
102444
|
+
"\u53EF\u7528\u7EF4\u5EA6\uFF0825 \u4E2A\uFF0C\u4E0E --sections / --exclude \u53D6\u503C\u4E00\u81F4\uFF09\uFF1A",
|
|
102445
|
+
...SECTIONS.map((s) => ` ${s.name.padEnd(22)} ${s.description}`),
|
|
102366
102446
|
"",
|
|
102367
102447
|
"\u793A\u4F8B\uFF1A",
|
|
102368
|
-
" # \u5355\u8D26\u6237\uFF1A\u62C9\u5168\u90E8
|
|
102448
|
+
" # \u5355\u8D26\u6237\uFF1A\u62C9\u5168\u90E8 25 \u4E2A\u7EF4\u5EA6",
|
|
102369
102449
|
" siluzan-tso google-analysis -a <mediaCustomerId> --json-out ./snap",
|
|
102370
102450
|
"",
|
|
102371
102451
|
" # \u5355\u8D26\u6237\uFF1A\u4EC5\u62C9\u5355\u4E2A\u7EF4\u5EA6\uFF08\u66FF\u4EE3\u5386\u53F2\u7684 google-analysis overview ...\uFF09",
|
|
@@ -102381,8 +102461,8 @@ function registerGoogleAnalysisCommands(program2) {
|
|
|
102381
102461
|
"",
|
|
102382
102462
|
" # \u591A\u8D26\u6237\u573A\u666F\u5982\u9700 resume / \u81EA\u9002\u5E94\u9650\u6D41 / deadline\uFF0C\u8BF7\u76F4\u63A5\u7528 google-analysis-batch run -a ...",
|
|
102383
102463
|
"",
|
|
102384
|
-
" # campaign-geo \u53EF\u9009\u9608\u503C\uFF08\u4E0E\u7F51\u5173
|
|
102385
|
-
" siluzan-tso google-analysis -a <id> --sections campaign-geo --start <s> --end <e> \\",
|
|
102464
|
+
" # campaign-geo / geo-matched / campaign-geo-matched \u53EF\u9009\u9608\u503C\uFF08\u4E0E\u7F51\u5173\u4E00\u81F4\uFF09",
|
|
102465
|
+
" siluzan-tso google-analysis -a <id> --sections campaign-geo-matched --start <s> --end <e> \\",
|
|
102386
102466
|
" --cost-greater 1000000 --json-out ./snap"
|
|
102387
102467
|
].join("\n")
|
|
102388
102468
|
).action(async (legacySection, opts) => {
|
|
@@ -103157,7 +103237,7 @@ ${r.urlRedacted}`);
|
|
|
103157
103237
|
}
|
|
103158
103238
|
}
|
|
103159
103239
|
console.log(
|
|
103160
|
-
"\n\u63D0\u793A\uFF1A\u5B8C\u6574 JSON \u4F7F\u7528 siluzan-tso audit list --days <N> [--match \u2026] --json\uFF1B\u5355\u6761 siluzan-tso audit show --id <auditId>\u3002\n \u8865\u507F\u5199\uFF08\u6062\u590D\u4FEE\u6539\u524D\uFF09\uFF1Aaudit restore-plan \u2192 \u4EBA\u786E\u8BA4 \u2192 audit restore-apply --i-confirm\u3002\n"
|
|
103240
|
+
"\n\u63D0\u793A\uFF1A\u5B8C\u6574 JSON \u4F7F\u7528 siluzan-tso audit list --days <N> [--match \u2026] --json-out <\u8DEF\u5F84>\uFF1B\u5355\u6761 siluzan-tso audit show --id <auditId> --json-out <\u8DEF\u5F84>\u3002\n \u8865\u507F\u5199\uFF08\u6062\u590D\u4FEE\u6539\u524D\uFF09\uFF1Aaudit restore-plan \u2192 \u4EBA\u786E\u8BA4 \u2192 audit restore-apply --i-confirm\u3002\n"
|
|
103161
103241
|
);
|
|
103162
103242
|
}
|
|
103163
103243
|
async function runAuditShow(opts) {
|
|
@@ -103182,7 +103262,7 @@ async function runAuditShow(opts) {
|
|
|
103182
103262
|
preSnapshotFileReadable: snapshotOk
|
|
103183
103263
|
};
|
|
103184
103264
|
if (await emitCliJsonOrSnapshot(
|
|
103185
|
-
{
|
|
103265
|
+
{ jsonOut: opts.jsonOut },
|
|
103186
103266
|
{ section: "audit-show", commandLabel: "audit show", payload, idSuffix: opts.id }
|
|
103187
103267
|
)) {
|
|
103188
103268
|
return;
|
|
@@ -103387,7 +103467,7 @@ async function runAuditRestorePlan(opts) {
|
|
|
103387
103467
|
plan
|
|
103388
103468
|
};
|
|
103389
103469
|
if (await emitCliJsonOrSnapshot(
|
|
103390
|
-
{
|
|
103470
|
+
{ jsonOut: opts.jsonOut },
|
|
103391
103471
|
{
|
|
103392
103472
|
section: "audit-restore-plan",
|
|
103393
103473
|
commandLabel: "audit restore-plan",
|
|
@@ -103437,7 +103517,7 @@ function printPlanForHuman(envelope) {
|
|
|
103437
103517
|
}
|
|
103438
103518
|
if (plan.subsequentWrites.length > 10) {
|
|
103439
103519
|
console.log(
|
|
103440
|
-
` \u2026\u2026 \u8FD8\u6709 ${plan.subsequentWrites.length - 10} \u6761\uFF0C\u8BF7\u8FD0\u884C audit list --resource-key "${plan.resourceKey ?? ""}" --json \u67E5\u770B\u5B8C\u6574\u5386\u53F2`
|
|
103520
|
+
` \u2026\u2026 \u8FD8\u6709 ${plan.subsequentWrites.length - 10} \u6761\uFF0C\u8BF7\u8FD0\u884C audit list --resource-key "${plan.resourceKey ?? ""}" --json-out <\u8DEF\u5F84> \u67E5\u770B\u5B8C\u6574\u5386\u53F2`
|
|
103441
103521
|
);
|
|
103442
103522
|
}
|
|
103443
103523
|
}
|
|
@@ -103520,13 +103600,20 @@ async function runAuditRestoreApply(opts) {
|
|
|
103520
103600
|
overwrittenSubsequentSuccessfulWrites: expected,
|
|
103521
103601
|
message: "\u8865\u507F\u5199\u5DF2\u63D0\u4EA4\uFF08\u5E76\u8BB0\u5165\u65B0\u7684\u5BA1\u8BA1\u884C\uFF09\u3002"
|
|
103522
103602
|
};
|
|
103523
|
-
if (
|
|
103524
|
-
|
|
103525
|
-
|
|
103526
|
-
|
|
103603
|
+
if (await emitCliJsonOrSnapshot(
|
|
103604
|
+
{ jsonOut: opts.jsonOut },
|
|
103605
|
+
{
|
|
103606
|
+
section: "audit-restore-apply",
|
|
103607
|
+
commandLabel: "audit restore-apply",
|
|
103608
|
+
payload: out,
|
|
103609
|
+
idSuffix: auditId
|
|
103610
|
+
}
|
|
103611
|
+
)) {
|
|
103612
|
+
return;
|
|
103613
|
+
}
|
|
103614
|
+
console.log(`
|
|
103527
103615
|
${out.message}\uFF08\u5DF2\u8986\u76D6 ${expected} \u6761\u540E\u7EED\u6210\u529F\u5199\uFF09
|
|
103528
103616
|
`);
|
|
103529
|
-
}
|
|
103530
103617
|
}
|
|
103531
103618
|
|
|
103532
103619
|
// src/commands/audit.ts
|
|
@@ -103535,10 +103622,10 @@ function register3(program2) {
|
|
|
103535
103622
|
"\u672C\u673A HTTP \u5199\u64CD\u4F5C\u5BA1\u8BA1\uFF08POST/PUT/PATCH/DELETE\uFF09\uFF1A~/.siluzan/write-audit/tso/\uFF1B\u987B --commit\uFF1B\u652F\u6301 list/show\u3001restore-plan\uFF08\u8865\u507F\u5199\u8BA1\u5212\uFF09\u4E0E restore-apply\uFF1B\u4FDD\u7559 90 \u65E5\uFF1B"
|
|
103536
103623
|
);
|
|
103537
103624
|
auditCmd.command("list").description(
|
|
103538
|
-
"\u5217\u51FA\u6700\u8FD1 N \u4E2A\u5317\u4EAC\u65E5\u5386\u65E5\u7684\u5199\u8BF7\u6C42\u6458\u8981\uFF08\u6210\u529F/\u5931\u8D25\u3001\u8DEF\u5F84\u3001\u51ED\u636E\u63D0\u793A\uFF09\uFF1B--json \u542B\u8131\u654F body"
|
|
103539
|
-
).option("--days <n>", "\u56DE\u6EAF\u5929\u6570\uFF081\u2013400\uFF0C\u9ED8\u8BA4 7\uFF09", "7").option(
|
|
103625
|
+
"\u5217\u51FA\u6700\u8FD1 N \u4E2A\u5317\u4EAC\u65E5\u5386\u65E5\u7684\u5199\u8BF7\u6C42\u6458\u8981\uFF08\u6210\u529F/\u5931\u8D25\u3001\u8DEF\u5F84\u3001\u51ED\u636E\u63D0\u793A\uFF09\uFF1B--json-out \u542B\u8131\u654F body"
|
|
103626
|
+
).option("--days <n>", "\u56DE\u6EAF\u5929\u6570\uFF081\u2013400\uFF0C\u9ED8\u8BA4 7\uFF09", "7").option(
|
|
103540
103627
|
"--json-out <path>",
|
|
103541
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
103628
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
103542
103629
|
void 0
|
|
103543
103630
|
).option("--failures-only", "\u4EC5\u5931\u8D25\u8BB0\u5F55", false).option(
|
|
103544
103631
|
"--match <sub>",
|
|
@@ -103555,7 +103642,6 @@ function register3(program2) {
|
|
|
103555
103642
|
).action(async (opts) => {
|
|
103556
103643
|
await runAuditList({
|
|
103557
103644
|
days: opts.days,
|
|
103558
|
-
json: Boolean(opts.json),
|
|
103559
103645
|
jsonOut: opts.jsonOut,
|
|
103560
103646
|
failuresOnly: Boolean(opts.failuresOnly),
|
|
103561
103647
|
match: opts.match,
|
|
@@ -103566,11 +103652,11 @@ function register3(program2) {
|
|
|
103566
103652
|
resourceKey: opts.resourceKey
|
|
103567
103653
|
});
|
|
103568
103654
|
});
|
|
103569
|
-
auditCmd.command("show").description("\u6309 auditId \u5C55\u793A\u5355\u6761\u5BA1\u8BA1\uFF08\u4ECE\u672C\u673A JSONL \u68C0\u7D22\uFF0C\u4E0D\u4F9D\u8D56\u5BF9\u8BDD\u8BB0\u5FC6\uFF09").requiredOption("--id <auditId>", "\u5BA1\u8BA1\u884C auditId\uFF08v2\uFF09").option("--json
|
|
103570
|
-
await runAuditShow({ id: opts.id,
|
|
103655
|
+
auditCmd.command("show").description("\u6309 auditId \u5C55\u793A\u5355\u6761\u5BA1\u8BA1\uFF08\u4ECE\u672C\u673A JSONL \u68C0\u7D22\uFF0C\u4E0D\u4F9D\u8D56\u5BF9\u8BDD\u8BB0\u5FC6\uFF09").requiredOption("--id <auditId>", "\u5BA1\u8BA1\u884C auditId\uFF08v2\uFF09").option("--json-out <path>", "\u843D\u76D8\u5FEB\u7167", void 0).action(async (opts) => {
|
|
103656
|
+
await runAuditShow({ id: opts.id, jsonOut: opts.jsonOut });
|
|
103571
103657
|
});
|
|
103572
|
-
auditCmd.command("restore-plan").description("\u6839\u636E\u5BA1\u8BA1 + \u5199\u524D\u5FEB\u7167\u751F\u6210\u8865\u507F\u5199\u8BA1\u5212\uFF08\u53EA\u8BFB\uFF0C\u4E0D\u8C03\u7528\u4E1A\u52A1\u63A5\u53E3\uFF09").requiredOption("--id <auditId>", "\u76EE\u6807\u5BA1\u8BA1 auditId").option("--json
|
|
103573
|
-
await runAuditRestorePlan({ id: opts.id,
|
|
103658
|
+
auditCmd.command("restore-plan").description("\u6839\u636E\u5BA1\u8BA1 + \u5199\u524D\u5FEB\u7167\u751F\u6210\u8865\u507F\u5199\u8BA1\u5212\uFF08\u53EA\u8BFB\uFF0C\u4E0D\u8C03\u7528\u4E1A\u52A1\u63A5\u53E3\uFF09").requiredOption("--id <auditId>", "\u76EE\u6807\u5BA1\u8BA1 auditId").option("--json-out <path>", "\u843D\u76D8", void 0).action(async (opts) => {
|
|
103659
|
+
await runAuditRestorePlan({ id: opts.id, jsonOut: opts.jsonOut });
|
|
103574
103660
|
});
|
|
103575
103661
|
auditCmd.command("restore-apply").description(
|
|
103576
103662
|
"\u6267\u884C\u8865\u507F\u5199\uFF08\u5C06\u8D44\u6E90\u5199\u56DE\u5FEB\u7167\u4E2D\u7684\u72B6\u6001\uFF09\uFF1B\u987B\u5148 restore-plan\uFF0C\u5E76\u7ECF --i-confirm + --ack-subsequent-writes \u5B88\u536B"
|
|
@@ -103578,14 +103664,14 @@ function register3(program2) {
|
|
|
103578
103664
|
"--ack-subsequent-writes <n>",
|
|
103579
103665
|
"\u663E\u5F0F\u786E\u8BA4\u4F1A\u88AB\u672C\u6B21\u56DE\u9000\u8986\u76D6\u7684\u540C resourceKey \u540E\u7EED\u6210\u529F\u5199\u6570\u91CF\uFF1B\u5FC5\u987B\u7B49\u4E8E restore-plan.guardChecks.ackSubsequentWrites",
|
|
103580
103666
|
(v) => Number.parseInt(v, 10)
|
|
103581
|
-
).option("-t, --token <token>", "JWT\uFF08\u53EF\u9009\uFF0C\u4E0E\u5168\u5C40\u4E00\u81F4\uFF09", void 0).option("--
|
|
103667
|
+
).option("-t, --token <token>", "JWT\uFF08\u53EF\u9009\uFF0C\u4E0E\u5168\u5C40\u4E00\u81F4\uFF09", void 0).option("--json-out <path>", "\u843D\u76D8 apply \u7ED3\u679C", void 0).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF", false).action(async (opts) => {
|
|
103582
103668
|
await runAuditRestoreApply({
|
|
103583
103669
|
id: opts.id,
|
|
103584
103670
|
iConfirm: Boolean(opts.iConfirm),
|
|
103585
103671
|
ackSubsequentWrites: opts.ackSubsequentWrites,
|
|
103586
103672
|
token: opts.token,
|
|
103587
103673
|
verbose: Boolean(opts.verbose),
|
|
103588
|
-
|
|
103674
|
+
jsonOut: opts.jsonOut
|
|
103589
103675
|
});
|
|
103590
103676
|
});
|
|
103591
103677
|
}
|
|
@@ -104607,12 +104693,8 @@ function register6(program2) {
|
|
|
104607
104693
|
"\u8D26\u6237\u72B6\u6001\uFF1Anormal\uFF08\u6B63\u5E38\uFF09| invalid\uFF08\u5931\u6548\uFF09| all\uFF08\u5168\u90E8\uFF0C\u9ED8\u8BA4\uFF09",
|
|
104608
104694
|
"all"
|
|
104609
104695
|
).option("-p, --page <n>", "\u9875\u7801\uFF08\u9ED8\u8BA4 1\uFF09", parseInt).option("--page-size <n>", "\u6BCF\u9875\u6570\u91CF\uFF08\u9ED8\u8BA4 20\uFF09", parseInt).option("-t, --token <token>", "Token\uFF08\u53EF\u9009\uFF1B\u4F18\u5148\u4E8E ~/.siluzan/config.json\uFF09").option(
|
|
104610
|
-
"--json",
|
|
104611
|
-
"\u4EE5 JSON \u8F93\u51FA\uFF08\u542B\u5206\u9875\u4FE1\u5C01\u4E0E items\uFF1B\u9ED8\u8BA4\u4ECD\u4F1A\u5408\u5E76\u4F59\u989D/\u6D88\u8017/Arit\uFF0C\u4E0E\u8868\u683C\u4E00\u81F4\u3002\u52A0 --quick \u5219 items \u4EC5\u542B\u5217\u8868\u63A5\u53E3\u5B57\u6BB5\uFF09",
|
|
104612
|
-
false
|
|
104613
|
-
).option(
|
|
104614
104696
|
"--json-out <path>",
|
|
104615
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
104697
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
104616
104698
|
void 0
|
|
104617
104699
|
).option(
|
|
104618
104700
|
"--quick",
|
|
@@ -104631,7 +104713,6 @@ function register6(program2) {
|
|
|
104631
104713
|
status: opts.status,
|
|
104632
104714
|
page: opts.page,
|
|
104633
104715
|
pageSize: opts.pageSize,
|
|
104634
|
-
json: opts.json,
|
|
104635
104716
|
jsonOut: opts.jsonOut,
|
|
104636
104717
|
quick: opts.quick,
|
|
104637
104718
|
unicode: opts.unicode,
|
|
@@ -104731,16 +104812,16 @@ async function runAccountActiveBills(opts) {
|
|
|
104731
104812
|
}
|
|
104732
104813
|
function register7(program2) {
|
|
104733
104814
|
program2.command("account-active-bills").description(
|
|
104734
|
-
"\u67E5\u8BE2\u8D26\u6237\u6FC0\u6D3B/\u5145\u503C\u8D26\u5355\u660E\u7EC6\uFF08GET TSO /AccountActiveBills/{\u5A92\u4F53}/{entityId}\uFF1BentityId \u6765\u81EA list-accounts --json\uFF09"
|
|
104815
|
+
"\u67E5\u8BE2\u8D26\u6237\u6FC0\u6D3B/\u5145\u503C\u8D26\u5355\u660E\u7EC6\uFF08GET TSO /AccountActiveBills/{\u5A92\u4F53}/{entityId}\uFF1BentityId \u6765\u81EA list-accounts --json-out ./snap\uFF09"
|
|
104735
104816
|
).requiredOption(
|
|
104736
104817
|
"-m, --media <type>",
|
|
104737
104818
|
"\u5A92\u4F53\u7C7B\u578B\uFF1AGoogle | TikTok | Yandex | MetaAd | BingV2 | Kwai"
|
|
104738
104819
|
).requiredOption(
|
|
104739
104820
|
"--id <entityId>",
|
|
104740
|
-
"\u8D26\u6237 entityId\uFF08list-accounts --json \u4E2D\u6BCF\u6761 ma.entityId\uFF0C\u975E mediaCustomerId\uFF09"
|
|
104741
|
-
).option("-t, --token <token>", "Token\uFF08\u53EF\u9009\uFF09").option(
|
|
104821
|
+
"\u8D26\u6237 entityId\uFF08list-accounts --json-out ./snap-out \u4E2D\u6BCF\u6761 ma.entityId\uFF0C\u975E mediaCustomerId\uFF09"
|
|
104822
|
+
).option("-t, --token <token>", "Token\uFF08\u53EF\u9009\uFF09").option(
|
|
104742
104823
|
"--json-out <path>",
|
|
104743
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
104824
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
104744
104825
|
void 0
|
|
104745
104826
|
).option("--verbose", "\u663E\u793A\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
104746
104827
|
async (opts) => {
|
|
@@ -104748,7 +104829,6 @@ function register7(program2) {
|
|
|
104748
104829
|
token: opts.token,
|
|
104749
104830
|
media: opts.media,
|
|
104750
104831
|
entityId: opts.id,
|
|
104751
|
-
json: opts.json,
|
|
104752
104832
|
jsonOut: opts.jsonOut,
|
|
104753
104833
|
verbose: opts.verbose
|
|
104754
104834
|
});
|
|
@@ -104888,9 +104968,9 @@ function register8(program2) {
|
|
|
104888
104968
|
).requiredOption(
|
|
104889
104969
|
"-a, --accounts <ids>",
|
|
104890
104970
|
"\u8D26\u6237 ID\uFF0C\u591A\u4E2A\u7528\u9017\u53F7\u5206\u9694\uFF08\u6765\u81EA list-accounts \u7684 mediaCustomerId\uFF09"
|
|
104891
|
-
).option("-t, --token <token>", "Token\uFF08\u53EF\u9009\uFF1B\u4F18\u5148\u4E8E ~/.siluzan/config.json\uFF09").option("--start-date <date>", "\u7EDF\u8BA1\u5F00\u59CB\u65E5\u671F yyyy-MM-dd\uFF08\u9ED8\u8BA4\uFF1A7 \u5929\u524D\uFF0CMetaAd \u4E0D\u9700\u8981\uFF09").option("--end-date <date>", "\u7EDF\u8BA1\u7ED3\u675F\u65E5\u671F yyyy-MM-dd\uFF08\u9ED8\u8BA4\uFF1A\u4ECA\u5929\uFF0CMetaAd \u4E0D\u9700\u8981\uFF09").option(
|
|
104971
|
+
).option("-t, --token <token>", "Token\uFF08\u53EF\u9009\uFF1B\u4F18\u5148\u4E8E ~/.siluzan/config.json\uFF09").option("--start-date <date>", "\u7EDF\u8BA1\u5F00\u59CB\u65E5\u671F yyyy-MM-dd\uFF08\u9ED8\u8BA4\uFF1A7 \u5929\u524D\uFF0CMetaAd \u4E0D\u9700\u8981\uFF09").option("--end-date <date>", "\u7EDF\u8BA1\u7ED3\u675F\u65E5\u671F yyyy-MM-dd\uFF08\u9ED8\u8BA4\uFF1A\u4ECA\u5929\uFF0CMetaAd \u4E0D\u9700\u8981\uFF09").option(
|
|
104892
104972
|
"--json-out <path>",
|
|
104893
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
104973
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
104894
104974
|
void 0
|
|
104895
104975
|
).option("--verbose", "\u663E\u793A\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
104896
104976
|
async (opts) => {
|
|
@@ -104900,7 +104980,6 @@ function register8(program2) {
|
|
|
104900
104980
|
accounts: opts.accounts,
|
|
104901
104981
|
startDate: opts.startDate,
|
|
104902
104982
|
endDate: opts.endDate,
|
|
104903
|
-
json: opts.json,
|
|
104904
104983
|
jsonOut: opts.jsonOut,
|
|
104905
104984
|
verbose: opts.verbose
|
|
104906
104985
|
});
|
|
@@ -105315,9 +105394,9 @@ function register9(program2) {
|
|
|
105315
105394
|
"--max-pages <n>",
|
|
105316
105395
|
"\u6700\u591A\u626B\u63CF\u9875\u6570\uFF08\u9ED8\u8BA4 20\uFF0C\u4E0A\u9650 200\uFF1B\u8D85\u51FA\u540E\u8BF7\u63D0\u9AD8 --page-size \u6216\u5206\u6B21\u626B\u63CF\uFF09",
|
|
105317
105396
|
(v) => parseInt(v, 10)
|
|
105318
|
-
).option("-t, --token <token>", "Token\uFF08\u53EF\u9009\uFF1B\u4F18\u5148\u4E8E ~/.siluzan/config.json\uFF09").option(
|
|
105397
|
+
).option("-t, --token <token>", "Token\uFF08\u53EF\u9009\uFF1B\u4F18\u5148\u4E8E ~/.siluzan/config.json\uFF09").option(
|
|
105319
105398
|
"--json-out <path>",
|
|
105320
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
105399
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
105321
105400
|
void 0
|
|
105322
105401
|
).option("--refresh-dp", "\u5F3A\u5236\u91CD\u62C9 Datapermission \u540E\u518D\u626B\u63CF\uFF08\u6392\u67E5\u4F1A\u8BDD\u5F02\u5E38\uFF09", false).option("--verbose", "\u663E\u793A\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
105323
105402
|
async (opts) => {
|
|
@@ -105330,7 +105409,6 @@ function register9(program2) {
|
|
|
105330
105409
|
targetDays: opts.targetDays,
|
|
105331
105410
|
pageSize: opts.pageSize,
|
|
105332
105411
|
maxPages: opts.maxPages,
|
|
105333
|
-
json: opts.json,
|
|
105334
105412
|
jsonOut: opts.jsonOut,
|
|
105335
105413
|
refreshDp: opts.refreshDp,
|
|
105336
105414
|
verbose: opts.verbose
|
|
@@ -105497,9 +105575,9 @@ function register11(program2) {
|
|
|
105497
105575
|
program2.command("stats").description("\u67E5\u8BE2\u5E7F\u544A\u6D88\u8017\u3001\u70B9\u51FB\u3001\u8F6C\u5316\u7B49\u6295\u653E\u6570\u636E\uFF08\u9ED8\u8BA4\u8FD1 7 \u5929\uFF0C\u4E0D\u542B\u4ECA\u5929\uFF09").requiredOption(
|
|
105498
105576
|
"-m, --media <type>",
|
|
105499
105577
|
"\u5A92\u4F53\u7C7B\u578B\uFF1AGoogle | TikTok | Yandex | MetaAd | BingV2 | Kwai"
|
|
105500
|
-
).option("-a, --accounts <ids>", "\u8D26\u6237 ID\uFF0C\u591A\u4E2A\u7528\u9017\u53F7\u5206\u9694\uFF08\u7559\u7A7A\u5219\u67E5\u5168\u90E8\u8D26\u6237\uFF09").option("--start <date>", "\u5F00\u59CB\u65E5\u671F\uFF0C\u683C\u5F0F YYYY-MM-DD\uFF08\u9ED8\u8BA4 7 \u5929\u524D\uFF09").option("--end <date>", "\u7ED3\u675F\u65E5\u671F\uFF0C\u683C\u5F0F YYYY-MM-DD\uFF08\u9ED8\u8BA4\u6628\u5929\uFF09").option("--start-date <date>", "\u540C --start\uFF08\u6587\u6863/Playbook \u517C\u5BB9\u522B\u540D\uFF09").option("--end-date <date>", "\u540C --end\uFF08\u6587\u6863/Playbook \u517C\u5BB9\u522B\u540D\uFF09").option("-t, --token <token>", "Token\uFF08\u53EF\u9009\uFF1B\u4F18\u5148\u4E8E ~/.siluzan/config.json\uFF09").option(
|
|
105578
|
+
).option("-a, --accounts <ids>", "\u8D26\u6237 ID\uFF0C\u591A\u4E2A\u7528\u9017\u53F7\u5206\u9694\uFF08\u7559\u7A7A\u5219\u67E5\u5168\u90E8\u8D26\u6237\uFF09").option("--start <date>", "\u5F00\u59CB\u65E5\u671F\uFF0C\u683C\u5F0F YYYY-MM-DD\uFF08\u9ED8\u8BA4 7 \u5929\u524D\uFF09").option("--end <date>", "\u7ED3\u675F\u65E5\u671F\uFF0C\u683C\u5F0F YYYY-MM-DD\uFF08\u9ED8\u8BA4\u6628\u5929\uFF09").option("--start-date <date>", "\u540C --start\uFF08\u6587\u6863/Playbook \u517C\u5BB9\u522B\u540D\uFF09").option("--end-date <date>", "\u540C --end\uFF08\u6587\u6863/Playbook \u517C\u5BB9\u522B\u540D\uFF09").option("-t, --token <token>", "Token\uFF08\u53EF\u9009\uFF1B\u4F18\u5148\u4E8E ~/.siluzan/config.json\uFF09").option(
|
|
105501
105579
|
"--json-out <path>",
|
|
105502
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
105580
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
105503
105581
|
void 0
|
|
105504
105582
|
).option("--verbose", "\u663E\u793A\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
105505
105583
|
async (opts) => {
|
|
@@ -105509,7 +105587,6 @@ function register11(program2) {
|
|
|
105509
105587
|
accounts: opts.accounts,
|
|
105510
105588
|
startDate: opts.start ?? opts.startDate,
|
|
105511
105589
|
endDate: opts.end ?? opts.endDate,
|
|
105512
|
-
json: opts.json,
|
|
105513
105590
|
jsonOut: opts.jsonOut,
|
|
105514
105591
|
verbose: opts.verbose
|
|
105515
105592
|
});
|
|
@@ -105604,9 +105681,9 @@ async function runAccountHistory(opts) {
|
|
|
105604
105681
|
console.log();
|
|
105605
105682
|
}
|
|
105606
105683
|
function register12(program2) {
|
|
105607
|
-
program2.command("account-history").description("\u67E5\u8BE2\u5F00\u6237\u7533\u8BF7\u5386\u53F2\u8BB0\u5F55").option("-m, --media <type>", "\u5A92\u4F53\u7C7B\u578B\uFF1AGoogle | TikTok | MetaAd | BingV2 | Kwai").option("-s, --status <status>", "\u7533\u8BF7\u72B6\u6001\u5173\u952E\u5B57").option("-k, --keyword <text>", "\u641C\u7D22\u5173\u952E\u5B57\uFF08\u8D26\u6237\u540D/ID\uFF09").option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("-p, --page <n>", "\u9875\u7801", parseInt).option("--page-size <n>", "\u6BCF\u9875\u6570\u91CF\uFF08\u9ED8\u8BA4 20\uFF09", parseInt).option("-t, --token <token>", "Auth Token").option(
|
|
105684
|
+
program2.command("account-history").description("\u67E5\u8BE2\u5F00\u6237\u7533\u8BF7\u5386\u53F2\u8BB0\u5F55").option("-m, --media <type>", "\u5A92\u4F53\u7C7B\u578B\uFF1AGoogle | TikTok | MetaAd | BingV2 | Kwai").option("-s, --status <status>", "\u7533\u8BF7\u72B6\u6001\u5173\u952E\u5B57").option("-k, --keyword <text>", "\u641C\u7D22\u5173\u952E\u5B57\uFF08\u8D26\u6237\u540D/ID\uFF09").option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("-p, --page <n>", "\u9875\u7801", parseInt).option("--page-size <n>", "\u6BCF\u9875\u6570\u91CF\uFF08\u9ED8\u8BA4 20\uFF09", parseInt).option("-t, --token <token>", "Auth Token").option(
|
|
105608
105685
|
"--json-out <path>",
|
|
105609
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
105686
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
105610
105687
|
void 0
|
|
105611
105688
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
105612
105689
|
async (opts) => {
|
|
@@ -105619,7 +105696,6 @@ function register12(program2) {
|
|
|
105619
105696
|
endDate: opts.end,
|
|
105620
105697
|
page: opts.page,
|
|
105621
105698
|
pageSize: opts.pageSize,
|
|
105622
|
-
json: opts.json,
|
|
105623
105699
|
jsonOut: opts.jsonOut,
|
|
105624
105700
|
verbose: opts.verbose
|
|
105625
105701
|
});
|
|
@@ -105686,7 +105762,7 @@ function reportManifestFile(accountId) {
|
|
|
105686
105762
|
return `${applyIdSuffix("report-manifest", accountId)}.json`;
|
|
105687
105763
|
}
|
|
105688
105764
|
var DEFAULT_FIELD_GUIDE3 = {
|
|
105689
|
-
markdownRefs: ["references/account-analytics.md"]
|
|
105765
|
+
markdownRefs: ["references/analytics/account-analytics.md"]
|
|
105690
105766
|
};
|
|
105691
105767
|
function sectionToFilename(section, accountId) {
|
|
105692
105768
|
if (!/^[a-z0-9_-]+$/.test(section)) {
|
|
@@ -105901,11 +105977,6 @@ async function runReportMetaOverview(opts) {
|
|
|
105901
105977
|
`);
|
|
105902
105978
|
process.exit(1);
|
|
105903
105979
|
}
|
|
105904
|
-
assertJsonXorJsonOut(opts.json, opts.jsonOut, "report meta-overview");
|
|
105905
|
-
if (opts.json) {
|
|
105906
|
-
console.log(JSON.stringify(data, null, 2));
|
|
105907
|
-
return;
|
|
105908
|
-
}
|
|
105909
105980
|
if (opts.jsonOut) {
|
|
105910
105981
|
const summary = await writeReportAnalysisSnapshot({
|
|
105911
105982
|
snapshotDir: opts.jsonOut,
|
|
@@ -106032,7 +106103,6 @@ async function runReportCreate(opts) {
|
|
|
106032
106103
|
`);
|
|
106033
106104
|
process.exit(1);
|
|
106034
106105
|
}
|
|
106035
|
-
assertJsonXorJsonOut(opts.json, opts.jsonOut, "report create");
|
|
106036
106106
|
if (await emitCliJsonOrSnapshot(opts, {
|
|
106037
106107
|
section: "report-create",
|
|
106038
106108
|
commandLabel: "report create",
|
|
@@ -106104,7 +106174,6 @@ async function runReportPushList(opts) {
|
|
|
106104
106174
|
const total = data.totalResultCount ?? 0;
|
|
106105
106175
|
const page = opts.page ?? 1;
|
|
106106
106176
|
const pageSize = opts.pageSize ?? 20;
|
|
106107
|
-
assertJsonXorJsonOut(opts.json, opts.jsonOut, "report push list");
|
|
106108
106177
|
const pushListPayload = wrapListJson({ page, pageSize, total, items });
|
|
106109
106178
|
if (await emitCliJsonOrSnapshot(opts, {
|
|
106110
106179
|
section: "report-push-list",
|
|
@@ -106255,7 +106324,6 @@ async function runReportPushHistory(opts) {
|
|
|
106255
106324
|
const total = data.totalResultCount ?? 0;
|
|
106256
106325
|
const page = opts.page ?? 1;
|
|
106257
106326
|
const pageSize = opts.pageSize ?? 20;
|
|
106258
|
-
assertJsonXorJsonOut(opts.json, opts.jsonOut, "report push history");
|
|
106259
106327
|
const pushHistoryPayload = wrapListJson({ page, pageSize, total, items });
|
|
106260
106328
|
if (await emitCliJsonOrSnapshot(opts, {
|
|
106261
106329
|
section: "report-push-history",
|
|
@@ -106310,7 +106378,6 @@ async function runReportPushReceiveEmails(opts) {
|
|
|
106310
106378
|
process.exit(1);
|
|
106311
106379
|
}
|
|
106312
106380
|
const list = Array.isArray(data) ? data.map((x) => String(x)) : [];
|
|
106313
|
-
assertJsonXorJsonOut(opts.json, opts.jsonOut, "report push receive-emails");
|
|
106314
106381
|
if (await emitCliJsonOrSnapshot(opts, {
|
|
106315
106382
|
section: "report-push-receive-emails",
|
|
106316
106383
|
commandLabel: "report push receive-emails",
|
|
@@ -106405,11 +106472,6 @@ async function runReportTikTokOverview(opts) {
|
|
|
106405
106472
|
const url = reportingUrl(config, id, "OverviewSectionData", params.toString());
|
|
106406
106473
|
try {
|
|
106407
106474
|
const data = await fetchTikTokJson(config, url, !!opts.verbose);
|
|
106408
|
-
assertJsonXorJsonOut(opts.json, opts.jsonOut, "report tiktok-overview");
|
|
106409
|
-
if (opts.json) {
|
|
106410
|
-
console.log(JSON.stringify(data, null, 2));
|
|
106411
|
-
return;
|
|
106412
|
-
}
|
|
106413
106475
|
if (opts.jsonOut) {
|
|
106414
106476
|
await emitTiktokSnapshot(opts, "tiktok-overview", id, startDate, endDate, data);
|
|
106415
106477
|
return;
|
|
@@ -106437,11 +106499,6 @@ async function runReportTikTokCampaigns(opts) {
|
|
|
106437
106499
|
const url = reportingUrl(config, id, "CampaignSectionData", params.toString());
|
|
106438
106500
|
try {
|
|
106439
106501
|
const data = await fetchTikTokJson(config, url, !!opts.verbose);
|
|
106440
|
-
assertJsonXorJsonOut(opts.json, opts.jsonOut, "report tiktok-campaigns");
|
|
106441
|
-
if (opts.json) {
|
|
106442
|
-
console.log(JSON.stringify(data, null, 2));
|
|
106443
|
-
return;
|
|
106444
|
-
}
|
|
106445
106502
|
if (opts.jsonOut) {
|
|
106446
106503
|
await emitTiktokSnapshot(opts, "tiktok-campaigns", id, startDate, endDate, data);
|
|
106447
106504
|
return;
|
|
@@ -106469,11 +106526,6 @@ async function runReportTikTokAdGroups(opts) {
|
|
|
106469
106526
|
const url = reportingUrl(config, id, "AdGroupReport", params.toString());
|
|
106470
106527
|
try {
|
|
106471
106528
|
const data = await fetchTikTokJson(config, url, !!opts.verbose);
|
|
106472
|
-
assertJsonXorJsonOut(opts.json, opts.jsonOut, "report tiktok-ad-groups");
|
|
106473
|
-
if (opts.json) {
|
|
106474
|
-
console.log(JSON.stringify(data, null, 2));
|
|
106475
|
-
return;
|
|
106476
|
-
}
|
|
106477
106529
|
if (opts.jsonOut) {
|
|
106478
106530
|
await emitTiktokSnapshot(opts, "tiktok-ad-groups", id, startDate, endDate, data);
|
|
106479
106531
|
return;
|
|
@@ -106501,11 +106553,6 @@ async function runReportTikTokAds(opts) {
|
|
|
106501
106553
|
const url = reportingUrl(config, id, "AdReport", params.toString());
|
|
106502
106554
|
try {
|
|
106503
106555
|
const data = await fetchTikTokJson(config, url, !!opts.verbose);
|
|
106504
|
-
assertJsonXorJsonOut(opts.json, opts.jsonOut, "report tiktok-ads");
|
|
106505
|
-
if (opts.json) {
|
|
106506
|
-
console.log(JSON.stringify(data, null, 2));
|
|
106507
|
-
return;
|
|
106508
|
-
}
|
|
106509
106556
|
if (opts.jsonOut) {
|
|
106510
106557
|
await emitTiktokSnapshot(opts, "tiktok-ads", id, startDate, endDate, data);
|
|
106511
106558
|
return;
|
|
@@ -106534,11 +106581,6 @@ async function runReportTikTokAudience(opts) {
|
|
|
106534
106581
|
const url = reportingUrl(config, id, "AudienceReport", params.toString());
|
|
106535
106582
|
try {
|
|
106536
106583
|
const data = await fetchTikTokJson(config, url, !!opts.verbose);
|
|
106537
|
-
assertJsonXorJsonOut(opts.json, opts.jsonOut, "report tiktok-audience");
|
|
106538
|
-
if (opts.json) {
|
|
106539
|
-
console.log(JSON.stringify(data, null, 2));
|
|
106540
|
-
return;
|
|
106541
|
-
}
|
|
106542
106584
|
if (opts.jsonOut) {
|
|
106543
106585
|
await emitTiktokSnapshot(
|
|
106544
106586
|
opts,
|
|
@@ -106579,7 +106621,6 @@ async function runReportTikTokAudienceMerged(opts) {
|
|
|
106579
106621
|
parts[dimension] = await fetchTikTokJson(config, url, !!opts.verbose);
|
|
106580
106622
|
}
|
|
106581
106623
|
const merged = { mergedDimensions: dims, startDate, endDate, account: id, data: parts };
|
|
106582
|
-
assertJsonXorJsonOut(opts.json, opts.jsonOut, "report tiktok-audience-merged");
|
|
106583
106624
|
if (opts.jsonOut) {
|
|
106584
106625
|
await emitTiktokSnapshot(opts, "tiktok-audience-merged", id, startDate, endDate, merged);
|
|
106585
106626
|
return;
|
|
@@ -106605,11 +106646,6 @@ async function runReportTikTokVideos(opts) {
|
|
|
106605
106646
|
const url = reportingUrl(config, id, "VideoReport", params.toString());
|
|
106606
106647
|
try {
|
|
106607
106648
|
const data = await fetchTikTokJson(config, url, !!opts.verbose);
|
|
106608
|
-
assertJsonXorJsonOut(opts.json, opts.jsonOut, "report tiktok-videos");
|
|
106609
|
-
if (opts.json) {
|
|
106610
|
-
console.log(JSON.stringify(data, null, 2));
|
|
106611
|
-
return;
|
|
106612
|
-
}
|
|
106613
106649
|
if (opts.jsonOut) {
|
|
106614
106650
|
await emitTiktokSnapshot(opts, "tiktok-videos", id, startDate, endDate, data);
|
|
106615
106651
|
return;
|
|
@@ -106634,11 +106670,6 @@ async function runReportTikTokAreacode(opts) {
|
|
|
106634
106670
|
const url = `${base}/query/media-account/tiktok/TikTokAreacode/Read`;
|
|
106635
106671
|
try {
|
|
106636
106672
|
const data = await fetchTikTokJson(config, url, !!opts.verbose);
|
|
106637
|
-
assertJsonXorJsonOut(opts.json, opts.jsonOut, "report tiktok-areacode");
|
|
106638
|
-
if (opts.json) {
|
|
106639
|
-
console.log(JSON.stringify(data, null, 2));
|
|
106640
|
-
return;
|
|
106641
|
-
}
|
|
106642
106673
|
if (opts.jsonOut) {
|
|
106643
106674
|
const summary = await writeReportAnalysisSnapshot({
|
|
106644
106675
|
snapshotDir: opts.jsonOut,
|
|
@@ -106670,11 +106701,6 @@ async function runReportTikTokInterestList(opts) {
|
|
|
106670
106701
|
const url = `${tt}/tiktokadgroupmanagement/adgroup/tiktok/GetInterestList?${params}`;
|
|
106671
106702
|
try {
|
|
106672
106703
|
const data = await fetchTikTokJson(config, url, !!opts.verbose);
|
|
106673
|
-
assertJsonXorJsonOut(opts.json, opts.jsonOut, "report tiktok-interest-list");
|
|
106674
|
-
if (opts.json) {
|
|
106675
|
-
console.log(JSON.stringify(data, null, 2));
|
|
106676
|
-
return;
|
|
106677
|
-
}
|
|
106678
106704
|
if (opts.jsonOut) {
|
|
106679
106705
|
const summary = await writeReportAnalysisSnapshot({
|
|
106680
106706
|
snapshotDir: opts.jsonOut,
|
|
@@ -106700,16 +106726,16 @@ async function runReportTikTokInterestList(opts) {
|
|
|
106700
106726
|
|
|
106701
106727
|
// src/commands/report-tiktok-analysis/_register.ts
|
|
106702
106728
|
function addDateAndFetchOptions(c) {
|
|
106703
|
-
return c.requiredOption("-a, --account <id>", "TikTok \u5E7F\u544A\u4E3B mediaCustomerId\uFF08\u6570\u5B57\uFF09").option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD\uFF08\u4E0E --end \u540C\u4F20\u6216\u540C\u7701\u7565\uFF09").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("--take <n>", "\u6D88\u8017/\u6761\u6570\u4E0A\u9650\uFF08\u9ED8\u8BA4 100\uFF0C\u4E0E\u524D\u7AEF take \u4E00\u81F4\uFF09", (v) => parseInt(v, 10)).option("-t, --token <token>", "Auth Token").option(
|
|
106729
|
+
return c.requiredOption("-a, --account <id>", "TikTok \u5E7F\u544A\u4E3B mediaCustomerId\uFF08\u6570\u5B57\uFF09").option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD\uFF08\u4E0E --end \u540C\u4F20\u6216\u540C\u7701\u7565\uFF09").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("--take <n>", "\u6D88\u8017/\u6761\u6570\u4E0A\u9650\uFF08\u9ED8\u8BA4 100\uFF0C\u4E0E\u524D\u7AEF take \u4E00\u81F4\uFF09", (v) => parseInt(v, 10)).option("-t, --token <token>", "Auth Token").option(
|
|
106704
106730
|
"--json-out <dir>",
|
|
106705
|
-
"\u5C06 JSON \u5199\u5165\u76EE\u5F55\uFF08\u6587\u4EF6\u540D\u5E26 accountId \u540E\u7F00\uFF09\u5E76\u66F4\u65B0 report-manifest-<accountId>.json\
|
|
106731
|
+
"\u5C06 JSON \u5199\u5165\u76EE\u5F55\uFF08\u6587\u4EF6\u540D\u5E26 accountId \u540E\u7F00\uFF09\u5E76\u66F4\u65B0 report-manifest-<accountId>.json\uFF1Bstdout \u4EC5\u4E00\u884C\u6458\u8981 JSON"
|
|
106706
106732
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false);
|
|
106707
106733
|
}
|
|
106708
106734
|
function registerReportTiktokCommands(reportCmd) {
|
|
106709
106735
|
const desc = "TikTok \u8D26\u6237\u5206\u6790\uFF08TSO reporting/media-account/TikTok/...\uFF0C\u4E0E\u5468\u671F\u62A5\u544A\u6570\u636E\u5757\u4E00\u81F4\uFF09";
|
|
106710
|
-
reportCmd.command("tiktok-overview").description(`${desc} \u2014 \u603B\u89C8 OverviewSectionData`).requiredOption("-a, --account <id>", "TikTok mediaCustomerId").option("--start <date>", "\u5F00\u59CB\u65E5\u671F").option("--end <date>", "\u7ED3\u675F\u65E5\u671F").option("-t, --token <token>", "Auth Token").option(
|
|
106736
|
+
reportCmd.command("tiktok-overview").description(`${desc} \u2014 \u603B\u89C8 OverviewSectionData`).requiredOption("-a, --account <id>", "TikTok mediaCustomerId").option("--start <date>", "\u5F00\u59CB\u65E5\u671F").option("--end <date>", "\u7ED3\u675F\u65E5\u671F").option("-t, --token <token>", "Auth Token").option(
|
|
106711
106737
|
"--json-out <dir>",
|
|
106712
|
-
"\u5C06 JSON \u5199\u5165\u76EE\u5F55\uFF08\u6587\u4EF6\u540D\u5E26 accountId \u540E\u7F00\uFF09\u5E76\u66F4\u65B0 report-manifest-<accountId>.json\
|
|
106738
|
+
"\u5C06 JSON \u5199\u5165\u76EE\u5F55\uFF08\u6587\u4EF6\u540D\u5E26 accountId \u540E\u7F00\uFF09\u5E76\u66F4\u65B0 report-manifest-<accountId>.json\uFF1Bstdout \u4EC5\u4E00\u884C\u6458\u8981 JSON"
|
|
106713
106739
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (opts) => {
|
|
106714
106740
|
await runReportTikTokOverview(opts);
|
|
106715
106741
|
});
|
|
@@ -106724,9 +106750,9 @@ function registerReportTiktokCommands(reportCmd) {
|
|
|
106724
106750
|
bindTake("tiktok-ad-groups", "AdGroupReport", runReportTikTokAdGroups);
|
|
106725
106751
|
bindTake("tiktok-ads", "AdReport", runReportTikTokAds);
|
|
106726
106752
|
bindTake("tiktok-videos", "VideoReport", runReportTikTokVideos);
|
|
106727
|
-
reportCmd.command("tiktok-audience").description(`${desc} \u2014 AudienceReport\uFF08\u5355\u7EF4\u5EA6 dimensions\uFF09`).requiredOption("-a, --account <id>", "TikTok mediaCustomerId").requiredOption("-d, --dimension <dim>", `\u7EF4\u5EA6\uFF1A${AUDIENCE_DIMENSIONS.join(" | ")}`).option("--start <date>", "\u5F00\u59CB\u65E5\u671F").option("--end <date>", "\u7ED3\u675F\u65E5\u671F").option("--take <n>", "\u6761\u6570\u4E0A\u9650\uFF08\u9ED8\u8BA4 100\uFF09", (v) => parseInt(v, 10)).option("-t, --token <token>", "Auth Token").option(
|
|
106753
|
+
reportCmd.command("tiktok-audience").description(`${desc} \u2014 AudienceReport\uFF08\u5355\u7EF4\u5EA6 dimensions\uFF09`).requiredOption("-a, --account <id>", "TikTok mediaCustomerId").requiredOption("-d, --dimension <dim>", `\u7EF4\u5EA6\uFF1A${AUDIENCE_DIMENSIONS.join(" | ")}`).option("--start <date>", "\u5F00\u59CB\u65E5\u671F").option("--end <date>", "\u7ED3\u675F\u65E5\u671F").option("--take <n>", "\u6761\u6570\u4E0A\u9650\uFF08\u9ED8\u8BA4 100\uFF09", (v) => parseInt(v, 10)).option("-t, --token <token>", "Auth Token").option(
|
|
106728
106754
|
"--json-out <dir>",
|
|
106729
|
-
"\u5C06 JSON \u5199\u5165\u76EE\u5F55\uFF08\u6587\u4EF6\u540D\u5E26 accountId \u540E\u7F00\uFF09\u5E76\u66F4\u65B0 report-manifest-<accountId>.json\
|
|
106755
|
+
"\u5C06 JSON \u5199\u5165\u76EE\u5F55\uFF08\u6587\u4EF6\u540D\u5E26 accountId \u540E\u7F00\uFF09\u5E76\u66F4\u65B0 report-manifest-<accountId>.json\uFF1Bstdout \u4EC5\u4E00\u884C\u6458\u8981 JSON"
|
|
106730
106756
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (opts) => {
|
|
106731
106757
|
const d = opts.dimension;
|
|
106732
106758
|
if (!AUDIENCE_DIMENSIONS.includes(d)) {
|
|
@@ -106739,15 +106765,15 @@ function registerReportTiktokCommands(reportCmd) {
|
|
|
106739
106765
|
});
|
|
106740
106766
|
reportCmd.command("tiktok-audience-merged").description(
|
|
106741
106767
|
`${desc} \u2014 \u5408\u5E76 gender + age + interest_category \u4E09\u6B21 AudienceReport\uFF08\u9ED8\u8BA4 stdout \u4E3A JSON\uFF09`
|
|
106742
|
-
).requiredOption("-a, --account <id>", "TikTok mediaCustomerId").option("--start <date>", "\u5F00\u59CB\u65E5\u671F").option("--end <date>", "\u7ED3\u675F\u65E5\u671F").option("--take <n>", "\u6761\u6570\u4E0A\u9650\uFF08\u9ED8\u8BA4 100\uFF09", (v) => parseInt(v, 10)).option("-t, --token <token>", "Auth Token").option(
|
|
106768
|
+
).requiredOption("-a, --account <id>", "TikTok mediaCustomerId").option("--start <date>", "\u5F00\u59CB\u65E5\u671F").option("--end <date>", "\u7ED3\u675F\u65E5\u671F").option("--take <n>", "\u6761\u6570\u4E0A\u9650\uFF08\u9ED8\u8BA4 100\uFF09", (v) => parseInt(v, 10)).option("-t, --token <token>", "Auth Token").option(
|
|
106743
106769
|
"--json-out <dir>",
|
|
106744
106770
|
"\u5C06\u5408\u5E76 JSON \u5199\u5165\u76EE\u5F55\uFF08\u6587\u4EF6\u540D\u5E26 accountId \u540E\u7F00\uFF09\u5E76\u66F4\u65B0 report-manifest-<accountId>.json\uFF1Bstdout \u4EC5\u4E00\u884C\u6458\u8981 JSON"
|
|
106745
106771
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (opts) => {
|
|
106746
106772
|
await runReportTikTokAudienceMerged(opts);
|
|
106747
106773
|
});
|
|
106748
|
-
reportCmd.command("tiktok-areacode").description("TikTok \u5730\u533A\u4EE3\u7801\u679A\u4E3E\uFF08\u4E3B\u5E73\u53F0 query/media-account/tiktok/TikTokAreacode/Read\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
106774
|
+
reportCmd.command("tiktok-areacode").description("TikTok \u5730\u533A\u4EE3\u7801\u679A\u4E3E\uFF08\u4E3B\u5E73\u53F0 query/media-account/tiktok/TikTokAreacode/Read\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
106749
106775
|
"--json-out <dir>",
|
|
106750
|
-
"\u5C06 JSON \u5199\u5165\u76EE\u5F55\uFF08\u6587\u4EF6\u540D\u5E26 accountId \u540E\u7F00\uFF09\u5E76\u66F4\u65B0 report-manifest-<accountId>.json\
|
|
106776
|
+
"\u5C06 JSON \u5199\u5165\u76EE\u5F55\uFF08\u6587\u4EF6\u540D\u5E26 accountId \u540E\u7F00\uFF09\u5E76\u66F4\u65B0 report-manifest-<accountId>.json\uFF1Bstdout \u4EC5\u4E00\u884C\u6458\u8981 JSON"
|
|
106751
106777
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
106752
106778
|
async (opts) => {
|
|
106753
106779
|
await runReportTikTokAreacode(opts);
|
|
@@ -106755,9 +106781,9 @@ function registerReportTiktokCommands(reportCmd) {
|
|
|
106755
106781
|
);
|
|
106756
106782
|
reportCmd.command("tiktok-interest-list").description(
|
|
106757
106783
|
"TikTok \u5174\u8DA3\u7C7B\u76EE\uFF08tiktokApiUrl GetInterestList\uFF0C\u89E3\u6790 country_code/interest \u62A5\u8868\u65F6\u5E38\u7528\uFF09"
|
|
106758
|
-
).requiredOption("-a, --account <id>", "TikTok mediaCustomerId").option("-t, --token <token>", "Auth Token").option(
|
|
106784
|
+
).requiredOption("-a, --account <id>", "TikTok mediaCustomerId").option("-t, --token <token>", "Auth Token").option(
|
|
106759
106785
|
"--json-out <dir>",
|
|
106760
|
-
"\u5C06 JSON \u5199\u5165\u76EE\u5F55\uFF08\u6587\u4EF6\u540D\u5E26 accountId \u540E\u7F00\uFF09\u5E76\u66F4\u65B0 report-manifest-<accountId>.json\
|
|
106786
|
+
"\u5C06 JSON \u5199\u5165\u76EE\u5F55\uFF08\u6587\u4EF6\u540D\u5E26 accountId \u540E\u7F00\uFF09\u5E76\u66F4\u65B0 report-manifest-<accountId>.json\uFF1Bstdout \u4EC5\u4E00\u884C\u6458\u8981 JSON"
|
|
106761
106787
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
106762
106788
|
async (opts) => {
|
|
106763
106789
|
await runReportTikTokInterestList(opts);
|
|
@@ -106880,11 +106906,6 @@ async function runReportBingOverview(opts) {
|
|
|
106880
106906
|
const url = reportingUrl2(config, id, "OverviewSectionData", params.toString());
|
|
106881
106907
|
try {
|
|
106882
106908
|
const data = await fetchBingJson(config, url, !!opts.verbose);
|
|
106883
|
-
assertJsonXorJsonOut(opts.json, opts.jsonOut, "report bing-overview");
|
|
106884
|
-
if (opts.json) {
|
|
106885
|
-
console.log(JSON.stringify(data, null, 2));
|
|
106886
|
-
return;
|
|
106887
|
-
}
|
|
106888
106909
|
if (opts.jsonOut) {
|
|
106889
106910
|
await emitBingSnapshot(opts, "bing-overview", id, startDate, endDate, data);
|
|
106890
106911
|
return;
|
|
@@ -106907,11 +106928,6 @@ async function runReportBingDevice(opts) {
|
|
|
106907
106928
|
const url = reportingUrl2(config, id, "DeviceSectionData", params.toString());
|
|
106908
106929
|
try {
|
|
106909
106930
|
const data = await fetchBingJson(config, url, !!opts.verbose);
|
|
106910
|
-
assertJsonXorJsonOut(opts.json, opts.jsonOut, "report bing-device");
|
|
106911
|
-
if (opts.json) {
|
|
106912
|
-
console.log(JSON.stringify(data, null, 2));
|
|
106913
|
-
return;
|
|
106914
|
-
}
|
|
106915
106931
|
if (opts.jsonOut) {
|
|
106916
106932
|
await emitBingSnapshot(opts, "bing-device", id, startDate, endDate, data);
|
|
106917
106933
|
return;
|
|
@@ -106934,11 +106950,6 @@ async function runReportBingGeographic(opts) {
|
|
|
106934
106950
|
const url = reportingUrl2(config, id, "GeographicSectionData", params.toString());
|
|
106935
106951
|
try {
|
|
106936
106952
|
const data = await fetchBingJson(config, url, !!opts.verbose);
|
|
106937
|
-
assertJsonXorJsonOut(opts.json, opts.jsonOut, "report bing-geographic");
|
|
106938
|
-
if (opts.json) {
|
|
106939
|
-
console.log(JSON.stringify(data, null, 2));
|
|
106940
|
-
return;
|
|
106941
|
-
}
|
|
106942
106953
|
if (opts.jsonOut) {
|
|
106943
106954
|
await emitBingSnapshot(opts, "bing-geographic", id, startDate, endDate, data);
|
|
106944
106955
|
return;
|
|
@@ -106961,11 +106972,6 @@ async function runReportBingAgeAudience(opts) {
|
|
|
106961
106972
|
const url = reportingUrl2(config, id, "AgeAudienceData", params.toString());
|
|
106962
106973
|
try {
|
|
106963
106974
|
const data = await fetchBingJson(config, url, !!opts.verbose);
|
|
106964
|
-
assertJsonXorJsonOut(opts.json, opts.jsonOut, "report bing-age-audience");
|
|
106965
|
-
if (opts.json) {
|
|
106966
|
-
console.log(JSON.stringify(data, null, 2));
|
|
106967
|
-
return;
|
|
106968
|
-
}
|
|
106969
106975
|
if (opts.jsonOut) {
|
|
106970
106976
|
await emitBingSnapshot(opts, "bing-age-audience", id, startDate, endDate, data);
|
|
106971
106977
|
return;
|
|
@@ -106988,11 +106994,6 @@ async function runReportBingGenderAudience(opts) {
|
|
|
106988
106994
|
const url = reportingUrl2(config, id, "GenderAudienceData", params.toString());
|
|
106989
106995
|
try {
|
|
106990
106996
|
const data = await fetchBingJson(config, url, !!opts.verbose);
|
|
106991
|
-
assertJsonXorJsonOut(opts.json, opts.jsonOut, "report bing-gender-audience");
|
|
106992
|
-
if (opts.json) {
|
|
106993
|
-
console.log(JSON.stringify(data, null, 2));
|
|
106994
|
-
return;
|
|
106995
|
-
}
|
|
106996
106997
|
if (opts.jsonOut) {
|
|
106997
106998
|
await emitBingSnapshot(opts, "bing-gender-audience", id, startDate, endDate, data);
|
|
106998
106999
|
return;
|
|
@@ -107026,7 +107027,6 @@ async function runReportBingAudienceMerged(opts) {
|
|
|
107026
107027
|
account: id,
|
|
107027
107028
|
data: { ageAudience: ageData, genderAudience: genderData }
|
|
107028
107029
|
};
|
|
107029
|
-
assertJsonXorJsonOut(opts.json, opts.jsonOut, "report bing-audience-merged");
|
|
107030
107030
|
if (opts.jsonOut) {
|
|
107031
107031
|
await emitBingSnapshot(opts, "bing-audience-merged", id, startDate, endDate, merged);
|
|
107032
107032
|
return;
|
|
@@ -107047,11 +107047,6 @@ async function runReportBingCampaigns(opts) {
|
|
|
107047
107047
|
const url = reportingUrl2(config, id, "CampaignReport", params.toString());
|
|
107048
107048
|
try {
|
|
107049
107049
|
const data = await fetchBingJson(config, url, !!opts.verbose);
|
|
107050
|
-
assertJsonXorJsonOut(opts.json, opts.jsonOut, "report bing-campaigns");
|
|
107051
|
-
if (opts.json) {
|
|
107052
|
-
console.log(JSON.stringify(data, null, 2));
|
|
107053
|
-
return;
|
|
107054
|
-
}
|
|
107055
107050
|
if (opts.jsonOut) {
|
|
107056
107051
|
await emitBingSnapshot(opts, "bing-campaigns", id, startDate, endDate, data);
|
|
107057
107052
|
return;
|
|
@@ -107074,11 +107069,6 @@ async function runReportBingAdGroups(opts) {
|
|
|
107074
107069
|
const url = reportingUrl2(config, id, "AdGroupReport", params.toString());
|
|
107075
107070
|
try {
|
|
107076
107071
|
const data = await fetchBingJson(config, url, !!opts.verbose);
|
|
107077
|
-
assertJsonXorJsonOut(opts.json, opts.jsonOut, "report bing-ad-groups");
|
|
107078
|
-
if (opts.json) {
|
|
107079
|
-
console.log(JSON.stringify(data, null, 2));
|
|
107080
|
-
return;
|
|
107081
|
-
}
|
|
107082
107072
|
if (opts.jsonOut) {
|
|
107083
107073
|
await emitBingSnapshot(opts, "bing-ad-groups", id, startDate, endDate, data);
|
|
107084
107074
|
return;
|
|
@@ -107101,11 +107091,6 @@ async function runReportBingAds(opts) {
|
|
|
107101
107091
|
const url = reportingUrl2(config, id, "AdReport", params.toString());
|
|
107102
107092
|
try {
|
|
107103
107093
|
const data = await fetchBingJson(config, url, !!opts.verbose);
|
|
107104
|
-
assertJsonXorJsonOut(opts.json, opts.jsonOut, "report bing-ads");
|
|
107105
|
-
if (opts.json) {
|
|
107106
|
-
console.log(JSON.stringify(data, null, 2));
|
|
107107
|
-
return;
|
|
107108
|
-
}
|
|
107109
107094
|
if (opts.jsonOut) {
|
|
107110
107095
|
await emitBingSnapshot(opts, "bing-ads", id, startDate, endDate, data);
|
|
107111
107096
|
return;
|
|
@@ -107134,11 +107119,6 @@ async function runReportBingKeywords(opts) {
|
|
|
107134
107119
|
const url = reportingUrl2(config, id, "KeywordReport", params.toString());
|
|
107135
107120
|
try {
|
|
107136
107121
|
const data = await fetchBingJson(config, url, !!opts.verbose);
|
|
107137
|
-
assertJsonXorJsonOut(opts.json, opts.jsonOut, "report bing-keywords");
|
|
107138
|
-
if (opts.json) {
|
|
107139
|
-
console.log(JSON.stringify(data, null, 2));
|
|
107140
|
-
return;
|
|
107141
|
-
}
|
|
107142
107122
|
if (opts.jsonOut) {
|
|
107143
107123
|
await emitBingSnapshot(opts, "bing-keywords", id, startDate, endDate, data);
|
|
107144
107124
|
return;
|
|
@@ -107167,11 +107147,6 @@ async function runReportBingSearchTerms(opts) {
|
|
|
107167
107147
|
const url = reportingUrl2(config, id, "SearchQueryReport", params.toString());
|
|
107168
107148
|
try {
|
|
107169
107149
|
const data = await fetchBingJson(config, url, !!opts.verbose);
|
|
107170
|
-
assertJsonXorJsonOut(opts.json, opts.jsonOut, "report bing-search-terms");
|
|
107171
|
-
if (opts.json) {
|
|
107172
|
-
console.log(JSON.stringify(data, null, 2));
|
|
107173
|
-
return;
|
|
107174
|
-
}
|
|
107175
107150
|
if (opts.jsonOut) {
|
|
107176
107151
|
await emitBingSnapshot(opts, "bing-search-terms", id, startDate, endDate, data);
|
|
107177
107152
|
return;
|
|
@@ -107192,9 +107167,9 @@ function addBingDateOptions(c) {
|
|
|
107192
107167
|
return c.requiredOption(
|
|
107193
107168
|
"-a, --account <id>",
|
|
107194
107169
|
"Bing mediaCustomerId\uFF08\u6570\u5B57\uFF0C\u4E0E list-accounts -m BingV2 \u4E00\u81F4\uFF09"
|
|
107195
|
-
).option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD\uFF08\u4E0E --end \u540C\u4F20\u6216\u540C\u7701\u7565\uFF1B\u4E0D\u53EF\u542B\u4ECA\u5929/\u6628\u5929\uFF09").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("-t, --token <token>", "Auth Token").option(
|
|
107170
|
+
).option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD\uFF08\u4E0E --end \u540C\u4F20\u6216\u540C\u7701\u7565\uFF1B\u4E0D\u53EF\u542B\u4ECA\u5929/\u6628\u5929\uFF09").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("-t, --token <token>", "Auth Token").option(
|
|
107196
107171
|
"--json-out <dir>",
|
|
107197
|
-
"\u5C06 JSON \u5199\u5165\u76EE\u5F55\uFF08\u6587\u4EF6\u540D\u5E26 accountId \u540E\u7F00\uFF09\u5E76\u66F4\u65B0 report-manifest-<accountId>.json\
|
|
107172
|
+
"\u5C06 JSON \u5199\u5165\u76EE\u5F55\uFF08\u6587\u4EF6\u540D\u5E26 accountId \u540E\u7F00\uFF09\u5E76\u66F4\u65B0 report-manifest-<accountId>.json\uFF1Bstdout \u4EC5\u4E00\u884C\u6458\u8981 JSON"
|
|
107198
107173
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false);
|
|
107199
107174
|
}
|
|
107200
107175
|
function registerReportBingCommands(reportCmd) {
|
|
@@ -107214,7 +107189,7 @@ function registerReportBingCommands(reportCmd) {
|
|
|
107214
107189
|
bindSimple("bing-campaigns", "\u5E7F\u544A\u7CFB\u5217 CampaignReport", runReportBingCampaigns);
|
|
107215
107190
|
bindSimple("bing-ad-groups", "\u5E7F\u544A\u7EC4 AdGroupReport", runReportBingAdGroups);
|
|
107216
107191
|
bindSimple("bing-ads", "\u5E7F\u544A AdReport", runReportBingAds);
|
|
107217
|
-
reportCmd.command("bing-audience-merged").description(`${desc} \u2014 \u5408\u5E76 AgeAudienceData + GenderAudienceData\uFF08\u9ED8\u8BA4 stdout \u4E3A JSON\uFF09`).requiredOption("-a, --account <id>", "Bing mediaCustomerId").option("--start <date>", "\u5F00\u59CB\u65E5\u671F").option("--end <date>", "\u7ED3\u675F\u65E5\u671F").option("-t, --token <token>", "Auth Token").option(
|
|
107192
|
+
reportCmd.command("bing-audience-merged").description(`${desc} \u2014 \u5408\u5E76 AgeAudienceData + GenderAudienceData\uFF08\u9ED8\u8BA4 stdout \u4E3A JSON\uFF09`).requiredOption("-a, --account <id>", "Bing mediaCustomerId").option("--start <date>", "\u5F00\u59CB\u65E5\u671F").option("--end <date>", "\u7ED3\u675F\u65E5\u671F").option("-t, --token <token>", "Auth Token").option(
|
|
107218
107193
|
"--json-out <dir>",
|
|
107219
107194
|
"\u5C06\u5408\u5E76 JSON \u5199\u5165\u76EE\u5F55\uFF08\u6587\u4EF6\u540D\u5E26 accountId \u540E\u7F00\uFF09\u5E76\u66F4\u65B0 report-manifest-<accountId>.json\uFF1Bstdout \u4EC5\u4E00\u884C\u6458\u8981 JSON"
|
|
107220
107195
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (opts) => {
|
|
@@ -107247,9 +107222,9 @@ function registerReportBingCommands(reportCmd) {
|
|
|
107247
107222
|
// src/commands/report/register.ts
|
|
107248
107223
|
function register13(program2) {
|
|
107249
107224
|
const reportCmd = program2.command("report").description("\u4F18\u5316\u62A5\u544A\u4E0E\u63A8\u9001\u7BA1\u7406");
|
|
107250
|
-
reportCmd.command("list").description("\u67E5\u8BE2\u4F18\u5316\u62A5\u544A\u5217\u8868").requiredOption("-m, --media <type>", "\u5A92\u4F53\u7C7B\u578B\uFF1AGoogle | TikTok").option("-t, --type <type>", "\u62A5\u544A\u7C7B\u578B\uFF08\u5982 Daily / Hourly\uFF09").option("-s, --status <ready>", "\u751F\u6210\u72B6\u6001\uFF08true/false\uFF09").option("-k, --keyword <text>", "\u62A5\u544A\u540D\u79F0\u5173\u952E\u5B57").option("--start <date>", "\u5F00\u59CB\u65E5\u671F").option("--end <date>", "\u7ED3\u675F\u65E5\u671F").option("-p, --page <n>", "\u9875\u7801", parseInt).option("--page-size <n>", "\u6BCF\u9875\u6570\u91CF", parseInt).option("--token <token>", "Auth Token").option(
|
|
107225
|
+
reportCmd.command("list").description("\u67E5\u8BE2\u4F18\u5316\u62A5\u544A\u5217\u8868").requiredOption("-m, --media <type>", "\u5A92\u4F53\u7C7B\u578B\uFF1AGoogle | TikTok").option("-t, --type <type>", "\u62A5\u544A\u7C7B\u578B\uFF08\u5982 Daily / Hourly\uFF09").option("-s, --status <ready>", "\u751F\u6210\u72B6\u6001\uFF08true/false\uFF09").option("-k, --keyword <text>", "\u62A5\u544A\u540D\u79F0\u5173\u952E\u5B57").option("--start <date>", "\u5F00\u59CB\u65E5\u671F").option("--end <date>", "\u7ED3\u675F\u65E5\u671F").option("-p, --page <n>", "\u9875\u7801", parseInt).option("--page-size <n>", "\u6BCF\u9875\u6570\u91CF", parseInt).option("--token <token>", "Auth Token").option(
|
|
107251
107226
|
"--json-out <path>",
|
|
107252
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
107227
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
107253
107228
|
void 0
|
|
107254
107229
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (opts) => {
|
|
107255
107230
|
await runReportList({
|
|
@@ -107262,14 +107237,13 @@ function register13(program2) {
|
|
|
107262
107237
|
endDate: opts.end,
|
|
107263
107238
|
page: opts.page,
|
|
107264
107239
|
pageSize: opts.pageSize,
|
|
107265
|
-
json: opts.json,
|
|
107266
107240
|
jsonOut: opts.jsonOut,
|
|
107267
107241
|
verbose: opts.verbose
|
|
107268
107242
|
});
|
|
107269
107243
|
});
|
|
107270
|
-
reportCmd.command("create").description("\u6279\u91CF\u751F\u6210\u4F18\u5316\u62A5\u544A").requiredOption("-m, --media <type>", "\u5A92\u4F53\u7C7B\u578B\uFF1AGoogle | TikTok").requiredOption("-a, --accounts <ids>", "\u8D26\u6237 ID\uFF0C\u9017\u53F7\u5206\u9694").requiredOption("-t, --type <type>", "\u62A5\u544A\u7C7B\u578B\uFF0C\u5982 Daily").requiredOption("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD").requiredOption("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("--token <token>", "Auth Token").option(
|
|
107244
|
+
reportCmd.command("create").description("\u6279\u91CF\u751F\u6210\u4F18\u5316\u62A5\u544A").requiredOption("-m, --media <type>", "\u5A92\u4F53\u7C7B\u578B\uFF1AGoogle | TikTok").requiredOption("-a, --accounts <ids>", "\u8D26\u6237 ID\uFF0C\u9017\u53F7\u5206\u9694").requiredOption("-t, --type <type>", "\u62A5\u544A\u7C7B\u578B\uFF0C\u5982 Daily").requiredOption("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD").requiredOption("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("--token <token>", "Auth Token").option(
|
|
107271
107245
|
"--json-out <path>",
|
|
107272
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
107246
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
107273
107247
|
void 0
|
|
107274
107248
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (opts) => {
|
|
107275
107249
|
await runReportCreate({
|
|
@@ -107279,7 +107253,6 @@ function register13(program2) {
|
|
|
107279
107253
|
type: opts.type,
|
|
107280
107254
|
startDate: opts.start,
|
|
107281
107255
|
endDate: opts.end,
|
|
107282
|
-
json: opts.json,
|
|
107283
107256
|
jsonOut: opts.jsonOut,
|
|
107284
107257
|
verbose: opts.verbose
|
|
107285
107258
|
});
|
|
@@ -107292,16 +107265,15 @@ function register13(program2) {
|
|
|
107292
107265
|
verbose: opts.verbose
|
|
107293
107266
|
});
|
|
107294
107267
|
});
|
|
107295
|
-
reportCmd.command("meta-overview").description("Meta \u8D26\u6237\u5206\u6790\u603B\u89C8\uFF08OverviewSectionData\uFF0C\u9700 tsoApiBaseUrl \u9274\u6743\uFF09").requiredOption("-a, --account <id>", "Meta \u5E7F\u544A\u8D26\u6237 mediaCustomerId").option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD\uFF08\u4E0E --end \u540C\u4F20\u6216\u540C\u7701\u7565\uFF09").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("--token <token>", "Auth Token").option(
|
|
107268
|
+
reportCmd.command("meta-overview").description("Meta \u8D26\u6237\u5206\u6790\u603B\u89C8\uFF08OverviewSectionData\uFF0C\u9700 tsoApiBaseUrl \u9274\u6743\uFF09").requiredOption("-a, --account <id>", "Meta \u5E7F\u544A\u8D26\u6237 mediaCustomerId").option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD\uFF08\u4E0E --end \u540C\u4F20\u6216\u540C\u7701\u7565\uFF09").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("--token <token>", "Auth Token").option(
|
|
107296
107269
|
"--json-out <path>",
|
|
107297
|
-
"\u843D\u76D8\u76EE\u5F55\u5E76\u66F4\u65B0 report-manifest[-<accountId>].json\
|
|
107270
|
+
"\u843D\u76D8\u76EE\u5F55\u5E76\u66F4\u65B0 report-manifest[-<accountId>].json\uFF1B\u6587\u4EF6\u540D\u4E3A `<section>[-<accountId>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09"
|
|
107298
107271
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (opts) => {
|
|
107299
107272
|
await runReportMetaOverview({
|
|
107300
107273
|
token: opts.token,
|
|
107301
107274
|
account: opts.account,
|
|
107302
107275
|
startDate: opts.start,
|
|
107303
107276
|
endDate: opts.end,
|
|
107304
|
-
json: opts.json,
|
|
107305
107277
|
jsonOut: opts.jsonOut,
|
|
107306
107278
|
verbose: opts.verbose
|
|
107307
107279
|
});
|
|
@@ -107309,9 +107281,9 @@ function register13(program2) {
|
|
|
107309
107281
|
registerReportTiktokCommands(reportCmd);
|
|
107310
107282
|
registerReportBingCommands(reportCmd);
|
|
107311
107283
|
const pushCmd = reportCmd.command("push").description("\u63A8\u9001\u7BA1\u7406\uFF08\u90AE\u4EF6\u62A5\u544A\u63A8\u9001\u4EFB\u52A1\uFF09");
|
|
107312
|
-
pushCmd.command("list").description("\u67E5\u8BE2\u63A8\u9001\u4EFB\u52A1\u5217\u8868").requiredOption("-m, --media <type>", "\u5A92\u4F53\u7C7B\u578B\uFF1AGoogle | TikTok").option("-k, --keyword <text>", "\u63A8\u9001\u540D\u79F0\u5173\u952E\u5B57").option("-t, --type <type>", "\u62A5\u544A\u7C7B\u578B").option("--stopped", "\u53EA\u663E\u793A\u5DF2\u505C\u7528\u7684\u63A8\u9001", false).option("--start <date>", "\u5F00\u59CB\u65E5\u671F").option("--end <date>", "\u7ED3\u675F\u65E5\u671F").option("-p, --page <n>", "\u9875\u7801", parseInt).option("--page-size <n>", "\u6BCF\u9875\u6570\u91CF", parseInt).option("--token <token>", "Auth Token").option(
|
|
107284
|
+
pushCmd.command("list").description("\u67E5\u8BE2\u63A8\u9001\u4EFB\u52A1\u5217\u8868").requiredOption("-m, --media <type>", "\u5A92\u4F53\u7C7B\u578B\uFF1AGoogle | TikTok").option("-k, --keyword <text>", "\u63A8\u9001\u540D\u79F0\u5173\u952E\u5B57").option("-t, --type <type>", "\u62A5\u544A\u7C7B\u578B").option("--stopped", "\u53EA\u663E\u793A\u5DF2\u505C\u7528\u7684\u63A8\u9001", false).option("--start <date>", "\u5F00\u59CB\u65E5\u671F").option("--end <date>", "\u7ED3\u675F\u65E5\u671F").option("-p, --page <n>", "\u9875\u7801", parseInt).option("--page-size <n>", "\u6BCF\u9875\u6570\u91CF", parseInt).option("--token <token>", "Auth Token").option(
|
|
107313
107285
|
"--json-out <path>",
|
|
107314
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
107286
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
107315
107287
|
void 0
|
|
107316
107288
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (opts) => {
|
|
107317
107289
|
await runReportPushList({
|
|
@@ -107324,7 +107296,6 @@ function register13(program2) {
|
|
|
107324
107296
|
endDate: opts.end,
|
|
107325
107297
|
page: opts.page,
|
|
107326
107298
|
pageSize: opts.pageSize,
|
|
107327
|
-
json: opts.json,
|
|
107328
107299
|
jsonOut: opts.jsonOut,
|
|
107329
107300
|
verbose: opts.verbose
|
|
107330
107301
|
});
|
|
@@ -107333,7 +107304,7 @@ function register13(program2) {
|
|
|
107333
107304
|
"\u65B0\u5EFA\u63A8\u9001\u914D\u7F6E\uFF08POST /command/report-push/settings/{\u5A92\u4F53}\uFF0C\u4E0E\u7F51\u9875\u300C\u6DFB\u52A0\u63A8\u9001\u300D\u4E00\u81F4\uFF09"
|
|
107334
107305
|
).requiredOption("-m, --media <type>", "\u5A92\u4F53\uFF1AGoogle | TikTok").requiredOption("--name <name>", "\u63A8\u9001\u540D\u79F0\uFF08\u5BF9\u5E94 body.Name\uFF09").requiredOption(
|
|
107335
107306
|
"--media-accounts <ids>",
|
|
107336
|
-
"\u5E7F\u544A\u8D26\u6237 entityId\uFF0C\u9017\u53F7\u5206\u9694\uFF08list-accounts --json \u2192 ma.entityId\uFF09",
|
|
107307
|
+
"\u5E7F\u544A\u8D26\u6237 entityId\uFF0C\u9017\u53F7\u5206\u9694\uFF08list-accounts --json-out \u2192 ma.entityId\uFF09",
|
|
107337
107308
|
splitCsv
|
|
107338
107309
|
).requiredOption("--emails <list>", "\u6536\u4EF6\u90AE\u7BB1\uFF0C\u9017\u53F7\u5206\u9694", splitCsv).requiredOption("--types <list>", "\u62A5\u544A\u7C7B\u578B\uFF0C\u9017\u53F7\u5206\u9694\uFF1ADaily | Weekly | Monthly", splitCsv).option("--title <text>", "\u90AE\u4EF6\u6807\u9898\uFF08ReceiveTitle\uFF0C\u53EF\u7A7A\uFF09", "").option("--ai-suggest", "\u4EC5 Google\uFF1AAiSuggest=true", false).option("--token <token>", "Auth Token").option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (opts) => {
|
|
107339
107310
|
await runReportPushCreate({
|
|
@@ -107350,7 +107321,7 @@ function register13(program2) {
|
|
|
107350
107321
|
});
|
|
107351
107322
|
pushCmd.command("update").description(
|
|
107352
107323
|
"\u7F16\u8F91\u63A8\u9001\u914D\u7F6E\uFF08PUT /command/report-push/settings/{\u5A92\u4F53}/{id}\uFF1Bid \u4E0E\u7F51\u9875\u7F16\u8F91\u7528 row.id \u4E00\u81F4\uFF0C\u901A\u5E38\u540C entityId\uFF09"
|
|
107353
|
-
).requiredOption("-m, --media <type>", "\u5A92\u4F53\uFF1AGoogle | TikTok").requiredOption("--id <id>", "\u63A8\u9001\u914D\u7F6E id\uFF08push list --json \u2192 items[].id \u6216 entityId\uFF09").requiredOption("--name <name>", "\u63A8\u9001\u540D\u79F0").requiredOption("--media-accounts <ids>", "\u5E7F\u544A\u8D26\u6237 entityId\uFF0C\u9017\u53F7\u5206\u9694", splitCsv).requiredOption("--emails <list>", "\u6536\u4EF6\u90AE\u7BB1\uFF0C\u9017\u53F7\u5206\u9694", splitCsv).requiredOption("--types <list>", "\u62A5\u544A\u7C7B\u578B\uFF0C\u9017\u53F7\u5206\u9694\uFF1ADaily | Weekly | Monthly", splitCsv).option("--title <text>", "\u90AE\u4EF6\u6807\u9898", "").option("--ai-suggest", "\u4EC5 Google\uFF1AAiSuggest=true", false).option("--token <token>", "Auth Token").option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (opts) => {
|
|
107324
|
+
).requiredOption("-m, --media <type>", "\u5A92\u4F53\uFF1AGoogle | TikTok").requiredOption("--id <id>", "\u63A8\u9001\u914D\u7F6E id\uFF08push list --json-out \u2192 items[].id \u6216 entityId\uFF09").requiredOption("--name <name>", "\u63A8\u9001\u540D\u79F0").requiredOption("--media-accounts <ids>", "\u5E7F\u544A\u8D26\u6237 entityId\uFF0C\u9017\u53F7\u5206\u9694", splitCsv).requiredOption("--emails <list>", "\u6536\u4EF6\u90AE\u7BB1\uFF0C\u9017\u53F7\u5206\u9694", splitCsv).requiredOption("--types <list>", "\u62A5\u544A\u7C7B\u578B\uFF0C\u9017\u53F7\u5206\u9694\uFF1ADaily | Weekly | Monthly", splitCsv).option("--title <text>", "\u90AE\u4EF6\u6807\u9898", "").option("--ai-suggest", "\u4EC5 Google\uFF1AAiSuggest=true", false).option("--token <token>", "Auth Token").option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (opts) => {
|
|
107354
107325
|
await runReportPushUpdate({
|
|
107355
107326
|
token: opts.token,
|
|
107356
107327
|
media: opts.media,
|
|
@@ -107369,9 +107340,9 @@ function register13(program2) {
|
|
|
107369
107340
|
).requiredOption("-m, --media <type>", "\u5A92\u4F53\uFF1AGoogle | TikTok").requiredOption(
|
|
107370
107341
|
"--setting-id <id>",
|
|
107371
107342
|
"\u63A8\u9001\u89C4\u5219 id\uFF08\u4E0E push list \u7684 entityId \u4E00\u81F4\uFF1B\u7F51\u9875\u8DEF\u7531 entityId\uFF09"
|
|
107372
|
-
).option("-p, --page <n>", "\u9875\u7801", parseInt).option("--page-size <n>", "\u6BCF\u9875\u6570\u91CF", parseInt).option("--start <date>", "\u7B5B\u9009\u5F00\u59CB\u65E5\u671F YYYY-MM-DD").option("--end <date>", "\u7B5B\u9009\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("--receive-email <email>", "\u7B5B\u9009\u6536\u4EF6\u90AE\u7BB1").option("--report-type <type>", "\u7B5B\u9009\u62A5\u544A\u7C7B\u578B").option("--media-account-id <entityId>", "\u7B5B\u9009\u8D26\u6237\uFF08\u4F20\u8D26\u6237 entityId\uFF09").option("--token <token>", "Auth Token").option(
|
|
107343
|
+
).option("-p, --page <n>", "\u9875\u7801", parseInt).option("--page-size <n>", "\u6BCF\u9875\u6570\u91CF", parseInt).option("--start <date>", "\u7B5B\u9009\u5F00\u59CB\u65E5\u671F YYYY-MM-DD").option("--end <date>", "\u7B5B\u9009\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("--receive-email <email>", "\u7B5B\u9009\u6536\u4EF6\u90AE\u7BB1").option("--report-type <type>", "\u7B5B\u9009\u62A5\u544A\u7C7B\u578B").option("--media-account-id <entityId>", "\u7B5B\u9009\u8D26\u6237\uFF08\u4F20\u8D26\u6237 entityId\uFF09").option("--token <token>", "Auth Token").option(
|
|
107373
107344
|
"--json-out <path>",
|
|
107374
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
107345
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
107375
107346
|
void 0
|
|
107376
107347
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (opts) => {
|
|
107377
107348
|
await runReportPushHistory({
|
|
@@ -107385,22 +107356,20 @@ function register13(program2) {
|
|
|
107385
107356
|
receiveEmail: opts.receiveEmail,
|
|
107386
107357
|
reportType: opts.reportType,
|
|
107387
107358
|
mediaAccountId: opts.mediaAccountId,
|
|
107388
|
-
json: opts.json,
|
|
107389
107359
|
jsonOut: opts.jsonOut,
|
|
107390
107360
|
verbose: opts.verbose
|
|
107391
107361
|
});
|
|
107392
107362
|
});
|
|
107393
107363
|
pushCmd.command("receive-emails").description(
|
|
107394
107364
|
"\u67E5\u8BE2\u63A8\u9001\u66FE\u7528\u8FC7\u7684\u6536\u4EF6\u90AE\u7BB1\u5217\u8868\uFF08GET /query/report-push/settings/{\u5A92\u4F53}/all/receive-emails\uFF0C\u4E0E\u7F51\u9875\u4E0B\u62C9\u4E00\u81F4\uFF09"
|
|
107395
|
-
).requiredOption("-m, --media <type>", "\u5A92\u4F53\uFF1AGoogle | TikTok").option("--token <token>", "Auth Token").option(
|
|
107365
|
+
).requiredOption("-m, --media <type>", "\u5A92\u4F53\uFF1AGoogle | TikTok").option("--token <token>", "Auth Token").option(
|
|
107396
107366
|
"--json-out <path>",
|
|
107397
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
107367
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
107398
107368
|
void 0
|
|
107399
107369
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (opts) => {
|
|
107400
107370
|
await runReportPushReceiveEmails({
|
|
107401
107371
|
token: opts.token,
|
|
107402
107372
|
media: opts.media,
|
|
107403
|
-
json: opts.json,
|
|
107404
107373
|
jsonOut: opts.jsonOut,
|
|
107405
107374
|
verbose: opts.verbose
|
|
107406
107375
|
});
|
|
@@ -107581,9 +107550,9 @@ async function runTransferList(opts) {
|
|
|
107581
107550
|
}
|
|
107582
107551
|
function register14(program2) {
|
|
107583
107552
|
const transferCmd = program2.command("transfer").description("\u5A92\u4F53\u8D26\u6237\u8F6C\u8D26\uFF1A\u63D0\u4EA4\u8F6C\u8D26\u7533\u8BF7\u6216\u67E5\u8BE2\u8F6C\u8D26\u8BB0\u5F55");
|
|
107584
|
-
transferCmd.command("create").description("\u63D0\u4EA4\u8D26\u6237\u95F4\u8F6C\u8D26\u7533\u8BF7\uFF08Google / TikTok / MetaAd / BingV2\uFF09").requiredOption("-m, --media <type>", "\u5A92\u4F53\u7C7B\u578B\uFF1AGoogle | TikTok | MetaAd | BingV2").requiredOption("--out <id>", "\u8F6C\u51FA\u8D26\u6237 mediaCustomerId\uFF08\u6765\u81EA list-accounts\uFF09").requiredOption("--in <id>", "\u8F6C\u5165\u8D26\u6237 mediaCustomerId\uFF08\u6765\u81EA list-accounts\uFF09").requiredOption("--amount <amount>", "\u8F6C\u8D26\u91D1\u989D\uFF08\u4E0E\u8D26\u6237\u8D27\u5E01\u5355\u4F4D\u4E00\u81F4\uFF09").option("--customer-name <name>", "\u5BA2\u6237\u540D\u79F0\uFF08\u5907\u6CE8\uFF0C\u53EF\u9009\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
107553
|
+
transferCmd.command("create").description("\u63D0\u4EA4\u8D26\u6237\u95F4\u8F6C\u8D26\u7533\u8BF7\uFF08Google / TikTok / MetaAd / BingV2\uFF09").requiredOption("-m, --media <type>", "\u5A92\u4F53\u7C7B\u578B\uFF1AGoogle | TikTok | MetaAd | BingV2").requiredOption("--out <id>", "\u8F6C\u51FA\u8D26\u6237 mediaCustomerId\uFF08\u6765\u81EA list-accounts\uFF09").requiredOption("--in <id>", "\u8F6C\u5165\u8D26\u6237 mediaCustomerId\uFF08\u6765\u81EA list-accounts\uFF09").requiredOption("--amount <amount>", "\u8F6C\u8D26\u91D1\u989D\uFF08\u4E0E\u8D26\u6237\u8D27\u5E01\u5355\u4F4D\u4E00\u81F4\uFF09").option("--customer-name <name>", "\u5BA2\u6237\u540D\u79F0\uFF08\u5907\u6CE8\uFF0C\u53EF\u9009\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
107585
107554
|
"--json-out <path>",
|
|
107586
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
107555
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
107587
107556
|
void 0
|
|
107588
107557
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (opts) => {
|
|
107589
107558
|
await runTransferCreate({
|
|
@@ -107593,14 +107562,13 @@ function register14(program2) {
|
|
|
107593
107562
|
inAccount: opts.in,
|
|
107594
107563
|
amount: opts.amount,
|
|
107595
107564
|
customerName: opts.customerName,
|
|
107596
|
-
json: opts.json,
|
|
107597
107565
|
jsonOut: opts.jsonOut,
|
|
107598
107566
|
verbose: opts.verbose
|
|
107599
107567
|
});
|
|
107600
107568
|
});
|
|
107601
|
-
transferCmd.command("list").description("\u67E5\u8BE2\u5A92\u4F53\u8D26\u6237\u8F6C\u8D26\u8BB0\u5F55").requiredOption("-m, --media <type>", "\u5A92\u4F53\u7C7B\u578B\uFF1AGoogle | TikTok | MetaAd | BingV2").option("-n, --number <no>", "\u8F6C\u8D26\u5355\u53F7").option("-s, --status <status>", "\u5230\u8D26\u72B6\u6001\u5173\u952E\u5B57").option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("-p, --page <n>", "\u9875\u7801", parseInt).option("--page-size <n>", "\u6BCF\u9875\u6570\u91CF", parseInt).option("-t, --token <token>", "Auth Token").option(
|
|
107569
|
+
transferCmd.command("list").description("\u67E5\u8BE2\u5A92\u4F53\u8D26\u6237\u8F6C\u8D26\u8BB0\u5F55").requiredOption("-m, --media <type>", "\u5A92\u4F53\u7C7B\u578B\uFF1AGoogle | TikTok | MetaAd | BingV2").option("-n, --number <no>", "\u8F6C\u8D26\u5355\u53F7").option("-s, --status <status>", "\u5230\u8D26\u72B6\u6001\u5173\u952E\u5B57").option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("-p, --page <n>", "\u9875\u7801", parseInt).option("--page-size <n>", "\u6BCF\u9875\u6570\u91CF", parseInt).option("-t, --token <token>", "Auth Token").option(
|
|
107602
107570
|
"--json-out <path>",
|
|
107603
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
107571
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
107604
107572
|
void 0
|
|
107605
107573
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (opts) => {
|
|
107606
107574
|
await runTransferList({
|
|
@@ -107612,7 +107580,6 @@ function register14(program2) {
|
|
|
107612
107580
|
endDate: opts.end,
|
|
107613
107581
|
page: opts.page,
|
|
107614
107582
|
pageSize: opts.pageSize,
|
|
107615
|
-
json: opts.json,
|
|
107616
107583
|
jsonOut: opts.jsonOut,
|
|
107617
107584
|
verbose: opts.verbose
|
|
107618
107585
|
});
|
|
@@ -108028,9 +107995,9 @@ async function runInvoiceApply(opts) {
|
|
|
108028
107995
|
// src/commands/invoice/_register.ts
|
|
108029
107996
|
function register15(program2) {
|
|
108030
107997
|
const invoiceCmd = program2.command("invoice").description("\u5F00\u7968\u8BB0\u5F55\u4E0E\u5F00\u7968\u7533\u8BF7\uFF0C\u4E0D\u652F\u6301\u8D26\u6237\u6FC0\u6D3B\u5145\u503C\u8BA2\u5355\u7684\u5F00\u7968\uFF0C\u5982\u9700\u5F00\u7968\u8BF7\u8054\u7CFB\u7EBF\u4E0B\u8FD0\u8425");
|
|
108031
|
-
invoiceCmd.command("list").description("\u67E5\u8BE2\u5F00\u7968\u7533\u8BF7\u8BB0\u5F55").option("-k, --keyword <text>", "\u53D1\u7968\u53F7\u6216\u5173\u952E\u5B57").option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("-p, --page <n>", "\u9875\u7801", parseInt).option("--page-size <n>", "\u6BCF\u9875\u6570\u91CF", parseInt).option("-t, --token <token>", "Auth Token").option(
|
|
107998
|
+
invoiceCmd.command("list").description("\u67E5\u8BE2\u5F00\u7968\u7533\u8BF7\u8BB0\u5F55").option("-k, --keyword <text>", "\u53D1\u7968\u53F7\u6216\u5173\u952E\u5B57").option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("-p, --page <n>", "\u9875\u7801", parseInt).option("--page-size <n>", "\u6BCF\u9875\u6570\u91CF", parseInt).option("-t, --token <token>", "Auth Token").option(
|
|
108032
107999
|
"--json-out <path>",
|
|
108033
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
108000
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
108034
108001
|
void 0
|
|
108035
108002
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (opts) => {
|
|
108036
108003
|
await runInvoiceList({
|
|
@@ -108040,15 +108007,14 @@ function register15(program2) {
|
|
|
108040
108007
|
endDate: opts.end,
|
|
108041
108008
|
page: opts.page,
|
|
108042
108009
|
pageSize: opts.pageSize,
|
|
108043
|
-
json: opts.json,
|
|
108044
108010
|
jsonOut: opts.jsonOut,
|
|
108045
108011
|
verbose: opts.verbose
|
|
108046
108012
|
});
|
|
108047
108013
|
console.log("\u5F00\u7968\u8BB0\u5F55\u4E0E\u5F00\u7968\u7533\u8BF7\uFF0C\u4E0D\u652F\u6301\u8D26\u6237\u6FC0\u6D3B\u5145\u503C\u8BA2\u5355\uFF0C\u5982\u9700\u5F00\u7968\u8BF7\u8054\u7CFB\u7EBF\u4E0B\u8FD0\u8425");
|
|
108048
108014
|
});
|
|
108049
|
-
invoiceCmd.command("billable").description("\u67E5\u8BE2\u53EF\u5F00\u7968\u8BA2\u5355\u5217\u8868").option("-m, --media <type>", "\u5A92\u4F53\u7C7B\u578B").option("-c, --currency <code>", "\u5E01\u79CD\uFF0C\u5982 USD / CNY").option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("-p, --page <n>", "\u9875\u7801", parseInt).option("--page-size <n>", "\u6BCF\u9875\u6570\u91CF", parseInt).option("--wallet", "\u67E5\u8BE2\u94B1\u5305\u5145\u503C\u53EF\u5F00\u7968\u8BB0\u5F55", false).option("-t, --token <token>", "Auth Token").option(
|
|
108015
|
+
invoiceCmd.command("billable").description("\u67E5\u8BE2\u53EF\u5F00\u7968\u8BA2\u5355\u5217\u8868").option("-m, --media <type>", "\u5A92\u4F53\u7C7B\u578B").option("-c, --currency <code>", "\u5E01\u79CD\uFF0C\u5982 USD / CNY").option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("-p, --page <n>", "\u9875\u7801", parseInt).option("--page-size <n>", "\u6BCF\u9875\u6570\u91CF", parseInt).option("--wallet", "\u67E5\u8BE2\u94B1\u5305\u5145\u503C\u53EF\u5F00\u7968\u8BB0\u5F55", false).option("-t, --token <token>", "Auth Token").option(
|
|
108050
108016
|
"--json-out <path>",
|
|
108051
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
108017
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
108052
108018
|
void 0
|
|
108053
108019
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (opts) => {
|
|
108054
108020
|
await runInvoiceBillable({
|
|
@@ -108060,7 +108026,6 @@ function register15(program2) {
|
|
|
108060
108026
|
page: opts.page,
|
|
108061
108027
|
pageSize: opts.pageSize,
|
|
108062
108028
|
wallet: opts.wallet,
|
|
108063
|
-
json: opts.json,
|
|
108064
108029
|
jsonOut: opts.jsonOut,
|
|
108065
108030
|
verbose: opts.verbose
|
|
108066
108031
|
});
|
|
@@ -108078,9 +108043,9 @@ function register15(program2) {
|
|
|
108078
108043
|
"--skip-currency-check",
|
|
108079
108044
|
"\u8DF3\u8FC7\u5E01\u79CD\u4E0E\u53D1\u7968\u7C7B\u578B\u6821\u9A8C\uFF08\u65E0\u6CD5\u4ECE\u53EF\u5F00\u7968\u5217\u8868\u89E3\u6790 entityId \u65F6\u4F7F\u7528\uFF0C\u9700\u81EA\u884C\u4FDD\u8BC1\u4E0E Web \u89C4\u5219\u4E00\u81F4\uFF09",
|
|
108080
108045
|
false
|
|
108081
|
-
).option("-t, --token <token>", "Auth Token").option(
|
|
108046
|
+
).option("-t, --token <token>", "Auth Token").option(
|
|
108082
108047
|
"--json-out <path>",
|
|
108083
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
108048
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
108084
108049
|
void 0
|
|
108085
108050
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (opts) => {
|
|
108086
108051
|
await runInvoiceApply({
|
|
@@ -108099,7 +108064,6 @@ function register15(program2) {
|
|
|
108099
108064
|
companyPhone: opts.companyPhone,
|
|
108100
108065
|
mediaType: opts.media,
|
|
108101
108066
|
skipCurrencyCheck: opts.skipCurrencyCheck,
|
|
108102
|
-
json: opts.json,
|
|
108103
108067
|
jsonOut: opts.jsonOut,
|
|
108104
108068
|
verbose: opts.verbose
|
|
108105
108069
|
});
|
|
@@ -108302,9 +108266,9 @@ async function runInvoiceInfoDelete(opts) {
|
|
|
108302
108266
|
}
|
|
108303
108267
|
function register16(program2) {
|
|
108304
108268
|
const invoiceInfoCmd = program2.command("invoice-info").description("\u53D1\u7968\u62AC\u5934\u7BA1\u7406\uFF08\u5BF9\u5E94\u300C\u8BBE\u7F6E \u2192 \u53D1\u7968\u62AC\u5934\u300D\u9875\u9762\uFF09");
|
|
108305
|
-
invoiceInfoCmd.command("list").description("\u67E5\u8BE2\u5DF2\u4FDD\u5B58\u7684\u53D1\u7968\u62AC\u5934\u5217\u8868").option("-k, --keyword <text>", "\u6309\u516C\u53F8\u540D\u79F0\u641C\u7D22").option("--invoice-type <type>", "\u6309\u53D1\u7968\u7C7B\u578B\u7B5B\u9009\uFF1API | VATI | VATSI").option("--page <n>", "\u9875\u7801", (v) => parseInt(v), 1).option("--page-size <n>", "\u6BCF\u9875\u6761\u6570", (v) => parseInt(v), 20).option("-t, --token <token>", "Auth Token").option(
|
|
108269
|
+
invoiceInfoCmd.command("list").description("\u67E5\u8BE2\u5DF2\u4FDD\u5B58\u7684\u53D1\u7968\u62AC\u5934\u5217\u8868").option("-k, --keyword <text>", "\u6309\u516C\u53F8\u540D\u79F0\u641C\u7D22").option("--invoice-type <type>", "\u6309\u53D1\u7968\u7C7B\u578B\u7B5B\u9009\uFF1API | VATI | VATSI").option("--page <n>", "\u9875\u7801", (v) => parseInt(v), 1).option("--page-size <n>", "\u6BCF\u9875\u6761\u6570", (v) => parseInt(v), 20).option("-t, --token <token>", "Auth Token").option(
|
|
108306
108270
|
"--json-out <path>",
|
|
108307
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
108271
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
108308
108272
|
void 0
|
|
108309
108273
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (opts) => {
|
|
108310
108274
|
await runInvoiceInfoList({
|
|
@@ -108313,7 +108277,6 @@ function register16(program2) {
|
|
|
108313
108277
|
invoiceType: opts.invoiceType,
|
|
108314
108278
|
page: opts.page,
|
|
108315
108279
|
pageSize: opts.pageSize,
|
|
108316
|
-
json: opts.json,
|
|
108317
108280
|
jsonOut: opts.jsonOut,
|
|
108318
108281
|
verbose: opts.verbose
|
|
108319
108282
|
});
|
|
@@ -108321,9 +108284,9 @@ function register16(program2) {
|
|
|
108321
108284
|
invoiceInfoCmd.command("create").description("\u65B0\u589E\u53D1\u7968\u62AC\u5934").requiredOption(
|
|
108322
108285
|
"--invoice-type <type>",
|
|
108323
108286
|
"\u53D1\u7968\u7C7B\u578B\uFF1API\uFF08\u5F62\u5F0F\u53D1\u7968\uFF09| VATI\uFF08\u589E\u503C\u7A0E\u666E\u7968\uFF09| VATSI\uFF08\u589E\u503C\u7A0E\u4E13\u7968\uFF09"
|
|
108324
|
-
).requiredOption("--company-name <name>", "\u516C\u53F8\u540D\u79F0\uFF08PI \u7C7B\u578B\u4E3A\u82F1\u6587\uFF0CVATI/VATSI \u4E3A\u4E2D\u6587\uFF09").requiredOption("--contact <name>", "\u8054\u7CFB\u4EBA\u59D3\u540D").requiredOption("--phone <phone>", "\u8054\u7CFB\u4EBA\u624B\u673A\u53F7").option("--registered-address <addr>", "\u82F1\u6587\u6CE8\u518C\u5730\u5740\uFF08PI \u7C7B\u578B\u5FC5\u586B\uFF09").option("--tax-id <id>", "\u7A0E\u53F7\uFF08VATI/VATSI \u5FC5\u586B\uFF09").option("--title <title>", "\u53D1\u7968\u62AC\u5934\uFF08VATI/VATSI \u5FC5\u586B\uFF09").option("--landline <phone>", "\u5EA7\u673A\u53F7\u7801\uFF08VATI/VATSI \u5FC5\u586B\uFF09").option("--email <email>", "\u63A8\u9001\u90AE\u7BB1").option("-t, --token <token>", "Auth Token").option(
|
|
108287
|
+
).requiredOption("--company-name <name>", "\u516C\u53F8\u540D\u79F0\uFF08PI \u7C7B\u578B\u4E3A\u82F1\u6587\uFF0CVATI/VATSI \u4E3A\u4E2D\u6587\uFF09").requiredOption("--contact <name>", "\u8054\u7CFB\u4EBA\u59D3\u540D").requiredOption("--phone <phone>", "\u8054\u7CFB\u4EBA\u624B\u673A\u53F7").option("--registered-address <addr>", "\u82F1\u6587\u6CE8\u518C\u5730\u5740\uFF08PI \u7C7B\u578B\u5FC5\u586B\uFF09").option("--tax-id <id>", "\u7A0E\u53F7\uFF08VATI/VATSI \u5FC5\u586B\uFF09").option("--title <title>", "\u53D1\u7968\u62AC\u5934\uFF08VATI/VATSI \u5FC5\u586B\uFF09").option("--landline <phone>", "\u5EA7\u673A\u53F7\u7801\uFF08VATI/VATSI \u5FC5\u586B\uFF09").option("--email <email>", "\u63A8\u9001\u90AE\u7BB1").option("-t, --token <token>", "Auth Token").option(
|
|
108325
108288
|
"--json-out <path>",
|
|
108326
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
108289
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
108327
108290
|
void 0
|
|
108328
108291
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (opts) => {
|
|
108329
108292
|
await runInvoiceInfoCreate({
|
|
@@ -108337,14 +108300,13 @@ function register16(program2) {
|
|
|
108337
108300
|
contact: opts.contact,
|
|
108338
108301
|
phone: opts.phone,
|
|
108339
108302
|
email: opts.email,
|
|
108340
|
-
json: opts.json,
|
|
108341
108303
|
jsonOut: opts.jsonOut,
|
|
108342
108304
|
verbose: opts.verbose
|
|
108343
108305
|
});
|
|
108344
108306
|
});
|
|
108345
|
-
invoiceInfoCmd.command("update <id>").description("\u66F4\u65B0\u53D1\u7968\u62AC\u5934\uFF08id \u6765\u81EA invoice-info list\uFF09").requiredOption("--invoice-type <type>", "\u53D1\u7968\u7C7B\u578B\uFF1API | VATI | VATSI").requiredOption("--company-name <name>", "\u516C\u53F8\u540D\u79F0").requiredOption("--contact <name>", "\u8054\u7CFB\u4EBA\u59D3\u540D").requiredOption("--phone <phone>", "\u8054\u7CFB\u4EBA\u624B\u673A\u53F7").option("--registered-address <addr>", "\u82F1\u6587\u6CE8\u518C\u5730\u5740\uFF08PI \u7C7B\u578B\u5FC5\u586B\uFF09").option("--tax-id <id>", "\u7A0E\u53F7\uFF08VATI/VATSI \u5FC5\u586B\uFF09").option("--title <title>", "\u53D1\u7968\u62AC\u5934\uFF08VATI/VATSI \u5FC5\u586B\uFF09").option("--landline <phone>", "\u5EA7\u673A\u53F7\u7801\uFF08VATI/VATSI \u5FC5\u586B\uFF09").option("--email <email>", "\u63A8\u9001\u90AE\u7BB1").option("-t, --token <token>", "Auth Token").option(
|
|
108307
|
+
invoiceInfoCmd.command("update <id>").description("\u66F4\u65B0\u53D1\u7968\u62AC\u5934\uFF08id \u6765\u81EA invoice-info list\uFF09").requiredOption("--invoice-type <type>", "\u53D1\u7968\u7C7B\u578B\uFF1API | VATI | VATSI").requiredOption("--company-name <name>", "\u516C\u53F8\u540D\u79F0").requiredOption("--contact <name>", "\u8054\u7CFB\u4EBA\u59D3\u540D").requiredOption("--phone <phone>", "\u8054\u7CFB\u4EBA\u624B\u673A\u53F7").option("--registered-address <addr>", "\u82F1\u6587\u6CE8\u518C\u5730\u5740\uFF08PI \u7C7B\u578B\u5FC5\u586B\uFF09").option("--tax-id <id>", "\u7A0E\u53F7\uFF08VATI/VATSI \u5FC5\u586B\uFF09").option("--title <title>", "\u53D1\u7968\u62AC\u5934\uFF08VATI/VATSI \u5FC5\u586B\uFF09").option("--landline <phone>", "\u5EA7\u673A\u53F7\u7801\uFF08VATI/VATSI \u5FC5\u586B\uFF09").option("--email <email>", "\u63A8\u9001\u90AE\u7BB1").option("-t, --token <token>", "Auth Token").option(
|
|
108346
108308
|
"--json-out <path>",
|
|
108347
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
108309
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
108348
108310
|
void 0
|
|
108349
108311
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (id, opts) => {
|
|
108350
108312
|
await runInvoiceInfoUpdate({
|
|
@@ -108359,7 +108321,6 @@ function register16(program2) {
|
|
|
108359
108321
|
contact: opts.contact,
|
|
108360
108322
|
phone: opts.phone,
|
|
108361
108323
|
email: opts.email,
|
|
108362
|
-
json: opts.json,
|
|
108363
108324
|
jsonOut: opts.jsonOut,
|
|
108364
108325
|
verbose: opts.verbose
|
|
108365
108326
|
});
|
|
@@ -108655,10 +108616,10 @@ function register17(program2) {
|
|
|
108655
108616
|
const optimizeCmd = program2.command("optimize").description("AI \u5E7F\u544A\u4F18\u5316\uFF08Google\uFF09");
|
|
108656
108617
|
optimizeCmd.command("list").description("\u67E5\u8BE2\u8D26\u6237\u7EA7\u4F18\u5316\u4E3B\u5217\u8868\uFF08\u5BF9\u5E94\u9875\u9762 /advertising/intelligentOptimization\uFF09").option("-a, --account <id>", "\u8D26\u6237 mediaCustomerId\uFF08\u7559\u7A7A\u67E5\u5168\u90E8\uFF09").option(
|
|
108657
108618
|
"--match-media-customer-id <id>",
|
|
108658
|
-
"\u5728\u5168\u91CF\u5217\u8868\u4E2D\u7B5B\u9009\u8BE5 Google \u5BA2\u6237 ID\uFF08\u81EA\u52A8\u7FFB\u9875\uFF1B\u5DF2\u8131\u7BA1\u52FF\u7528 -a\uFF0C\u89C1 optimize.md\uFF09"
|
|
108659
|
-
).option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("-p, --page <n>", "\u9875\u7801", parseInt).option("--page-size <n>", "\u6BCF\u9875\u6570\u91CF", parseInt).option("-t, --token <token>", "Auth Token").option(
|
|
108619
|
+
"\u5728\u5168\u91CF\u5217\u8868\u4E2D\u7B5B\u9009\u8BE5 Google \u5BA2\u6237 ID\uFF08\u81EA\u52A8\u7FFB\u9875\uFF1B\u5DF2\u8131\u7BA1\u52FF\u7528 -a\uFF0C\u89C1 operations/optimize.md\uFF09"
|
|
108620
|
+
).option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("-p, --page <n>", "\u9875\u7801", parseInt).option("--page-size <n>", "\u6BCF\u9875\u6570\u91CF", parseInt).option("-t, --token <token>", "Auth Token").option(
|
|
108660
108621
|
"--json-out <path>",
|
|
108661
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
108622
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
108662
108623
|
void 0
|
|
108663
108624
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (opts) => {
|
|
108664
108625
|
await runOptimizeList({
|
|
@@ -108669,14 +108630,13 @@ function register17(program2) {
|
|
|
108669
108630
|
endDate: opts.end,
|
|
108670
108631
|
page: opts.page,
|
|
108671
108632
|
pageSize: opts.pageSize,
|
|
108672
|
-
json: opts.json,
|
|
108673
108633
|
jsonOut: opts.jsonOut,
|
|
108674
108634
|
verbose: opts.verbose
|
|
108675
108635
|
});
|
|
108676
108636
|
});
|
|
108677
|
-
optimizeCmd.command("records").description("\u67E5\u8BE2\u4F18\u5316\u8BB0\u5F55\u5217\u8868\uFF08\u5BF9\u5E94\u9875\u9762 /advertising/intelligentOptimizationRecords\uFF09").option("-a, --account <id>", "\u8D26\u6237 mediaCustomerId").option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("-p, --page <n>", "\u9875\u7801", parseInt).option("--page-size <n>", "\u6BCF\u9875\u6570\u91CF", parseInt).option("-t, --token <token>", "Auth Token").option(
|
|
108637
|
+
optimizeCmd.command("records").description("\u67E5\u8BE2\u4F18\u5316\u8BB0\u5F55\u5217\u8868\uFF08\u5BF9\u5E94\u9875\u9762 /advertising/intelligentOptimizationRecords\uFF09").option("-a, --account <id>", "\u8D26\u6237 mediaCustomerId").option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("-p, --page <n>", "\u9875\u7801", parseInt).option("--page-size <n>", "\u6BCF\u9875\u6570\u91CF", parseInt).option("-t, --token <token>", "Auth Token").option(
|
|
108678
108638
|
"--json-out <path>",
|
|
108679
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
108639
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
108680
108640
|
void 0
|
|
108681
108641
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (opts) => {
|
|
108682
108642
|
await runOptimizeRecords({
|
|
@@ -108686,19 +108646,18 @@ function register17(program2) {
|
|
|
108686
108646
|
endDate: opts.end,
|
|
108687
108647
|
page: opts.page,
|
|
108688
108648
|
pageSize: opts.pageSize,
|
|
108689
|
-
json: opts.json,
|
|
108690
108649
|
jsonOut: opts.jsonOut,
|
|
108691
108650
|
verbose: opts.verbose
|
|
108692
108651
|
});
|
|
108693
108652
|
});
|
|
108694
108653
|
optimizeCmd.command("get").description(
|
|
108695
|
-
"\u83B7\u53D6\u5355\u6761\u4F18\u5316\u8BE6\u60C5\uFF08GET /Smart-Ads-Optimize/v2/{id}\uFF09\u3002--id \u53EF\u53D6 optimize list --json \u7684\u8D26\u6237\u6279\u6B21 items[].id\uFF0C\u6216 optimize records --json \u7684\u7CFB\u5217\u7EA7 items[].id"
|
|
108654
|
+
"\u83B7\u53D6\u5355\u6761\u4F18\u5316\u8BE6\u60C5\uFF08GET /Smart-Ads-Optimize/v2/{id}\uFF09\u3002--id \u53EF\u53D6 optimize list --json-out \u7684\u8D26\u6237\u6279\u6B21 items[].id\uFF0C\u6216 optimize records --json-out \u7684\u7CFB\u5217\u7EA7 items[].id"
|
|
108696
108655
|
).requiredOption("--id <id>", "\u4F18\u5316\u8BB0\u5F55 ID\uFF08UUID\uFF0C\u4E0E\u5217\u8868\u9879 id \u4E00\u81F4\uFF09").option("-t, --token <token>", "Auth Token").option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (opts) => {
|
|
108697
108656
|
await runOptimizeGet({ token: opts.token, id: opts.id, verbose: opts.verbose });
|
|
108698
108657
|
});
|
|
108699
|
-
optimizeCmd.command("children").description("\u67E5\u8BE2\u5355\u6B21\u4F18\u5316\u7684\u5E7F\u544A\u7CFB\u5217\u7EA7\u660E\u7EC6").requiredOption("--parent-id <id>", "\u4F18\u5316\u4E3B\u8BB0\u5F55 ID").option("-p, --page <n>", "\u9875\u7801", parseInt).option("--page-size <n>", "\u6BCF\u9875\u6570\u91CF", parseInt).option("-t, --token <token>", "Auth Token").option(
|
|
108658
|
+
optimizeCmd.command("children").description("\u67E5\u8BE2\u5355\u6B21\u4F18\u5316\u7684\u5E7F\u544A\u7CFB\u5217\u7EA7\u660E\u7EC6").requiredOption("--parent-id <id>", "\u4F18\u5316\u4E3B\u8BB0\u5F55 ID").option("-p, --page <n>", "\u9875\u7801", parseInt).option("--page-size <n>", "\u6BCF\u9875\u6570\u91CF", parseInt).option("-t, --token <token>", "Auth Token").option(
|
|
108700
108659
|
"--json-out <path>",
|
|
108701
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
108660
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
108702
108661
|
void 0
|
|
108703
108662
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (opts) => {
|
|
108704
108663
|
await runOptimizeChildren({
|
|
@@ -108706,7 +108665,6 @@ function register17(program2) {
|
|
|
108706
108665
|
parentId: opts.parentId,
|
|
108707
108666
|
page: opts.page,
|
|
108708
108667
|
pageSize: opts.pageSize,
|
|
108709
|
-
json: opts.json,
|
|
108710
108668
|
jsonOut: opts.jsonOut,
|
|
108711
108669
|
verbose: opts.verbose
|
|
108712
108670
|
});
|
|
@@ -109102,9 +109060,9 @@ async function runForewarningCreate(opts) {
|
|
|
109102
109060
|
// src/commands/forewarning/_register.ts
|
|
109103
109061
|
function register18(program2) {
|
|
109104
109062
|
const forewarningCmd = program2.command("forewarning").description("\u667A\u80FD\u9884\u8B66\u89C4\u5219\u4E0E\u9884\u8B66\u8BB0\u5F55\u7BA1\u7406");
|
|
109105
|
-
forewarningCmd.command("list").description("\u67E5\u8BE2\u9884\u8B66\u89C4\u5219\u5217\u8868").requiredOption("-m, --media <type>", "\u5A92\u4F53\u7C7B\u578B\uFF1AGoogle | TikTok").option("-a, --account <id>", "\u8D26\u6237 ID \u7B5B\u9009").option("-k, --keyword <text>", "\u89C4\u5219\u540D\u79F0\u5173\u952E\u5B57").option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("-p, --page <n>", "\u9875\u7801", parseInt).option("--page-size <n>", "\u6BCF\u9875\u6570\u91CF", parseInt).option("-t, --token <token>", "Auth Token").option(
|
|
109063
|
+
forewarningCmd.command("list").description("\u67E5\u8BE2\u9884\u8B66\u89C4\u5219\u5217\u8868").requiredOption("-m, --media <type>", "\u5A92\u4F53\u7C7B\u578B\uFF1AGoogle | TikTok").option("-a, --account <id>", "\u8D26\u6237 ID \u7B5B\u9009").option("-k, --keyword <text>", "\u89C4\u5219\u540D\u79F0\u5173\u952E\u5B57").option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("-p, --page <n>", "\u9875\u7801", parseInt).option("--page-size <n>", "\u6BCF\u9875\u6570\u91CF", parseInt).option("-t, --token <token>", "Auth Token").option(
|
|
109106
109064
|
"--json-out <path>",
|
|
109107
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
109065
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
109108
109066
|
void 0
|
|
109109
109067
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (opts) => {
|
|
109110
109068
|
await runForewarningList({
|
|
@@ -109116,14 +109074,13 @@ function register18(program2) {
|
|
|
109116
109074
|
endDate: opts.end,
|
|
109117
109075
|
page: opts.page,
|
|
109118
109076
|
pageSize: opts.pageSize,
|
|
109119
|
-
json: opts.json,
|
|
109120
109077
|
jsonOut: opts.jsonOut,
|
|
109121
109078
|
verbose: opts.verbose
|
|
109122
109079
|
});
|
|
109123
109080
|
});
|
|
109124
|
-
forewarningCmd.command("records").description("\u67E5\u8BE2\u9884\u8B66\u89E6\u53D1\u8BB0\u5F55").requiredOption("-m, --media <type>", "\u5A92\u4F53\u7C7B\u578B\uFF1AGoogle | TikTok").option("-r, --rule-id <id>", "\u89C4\u5219 ID\uFF08\u7559\u7A7A\u67E5\u5168\u90E8\u89C4\u5219\uFF09").option("-s, --status <result>", "\u6267\u884C\u7ED3\u679C\u7B5B\u9009").option("-a, --account <id>", "\u8D26\u6237 ID \u7B5B\u9009").option("-k, --keyword <text>", "\u5173\u952E\u5B57").option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("-p, --page <n>", "\u9875\u7801", parseInt).option("--page-size <n>", "\u6BCF\u9875\u6570\u91CF", parseInt).option("-t, --token <token>", "Auth Token").option(
|
|
109081
|
+
forewarningCmd.command("records").description("\u67E5\u8BE2\u9884\u8B66\u89E6\u53D1\u8BB0\u5F55").requiredOption("-m, --media <type>", "\u5A92\u4F53\u7C7B\u578B\uFF1AGoogle | TikTok").option("-r, --rule-id <id>", "\u89C4\u5219 ID\uFF08\u7559\u7A7A\u67E5\u5168\u90E8\u89C4\u5219\uFF09").option("-s, --status <result>", "\u6267\u884C\u7ED3\u679C\u7B5B\u9009").option("-a, --account <id>", "\u8D26\u6237 ID \u7B5B\u9009").option("-k, --keyword <text>", "\u5173\u952E\u5B57").option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("-p, --page <n>", "\u9875\u7801", parseInt).option("--page-size <n>", "\u6BCF\u9875\u6570\u91CF", parseInt).option("-t, --token <token>", "Auth Token").option(
|
|
109125
109082
|
"--json-out <path>",
|
|
109126
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
109083
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
109127
109084
|
void 0
|
|
109128
109085
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (opts) => {
|
|
109129
109086
|
await runForewarningRecords({
|
|
@@ -109137,7 +109094,6 @@ function register18(program2) {
|
|
|
109137
109094
|
endDate: opts.end,
|
|
109138
109095
|
page: opts.page,
|
|
109139
109096
|
pageSize: opts.pageSize,
|
|
109140
|
-
json: opts.json,
|
|
109141
109097
|
jsonOut: opts.jsonOut,
|
|
109142
109098
|
verbose: opts.verbose
|
|
109143
109099
|
});
|
|
@@ -109174,15 +109130,14 @@ function register18(program2) {
|
|
|
109174
109130
|
verbose: opts.verbose
|
|
109175
109131
|
});
|
|
109176
109132
|
});
|
|
109177
|
-
forewarningCmd.command("notify-accounts").description("\u67E5\u8BE2\u53EF\u63A5\u6536\u9884\u8B66\u901A\u77E5\u7684\u5FAE\u4FE1\u8D26\u6237\u5217\u8868\uFF08\u9700\u5148\u5173\u6CE8\u4E1D\u8DEF\u8D5E\u5E73\u53F0\u670D\u52A1\u53F7\uFF09").option(
|
|
109133
|
+
forewarningCmd.command("notify-accounts").description("\u67E5\u8BE2\u53EF\u63A5\u6536\u9884\u8B66\u901A\u77E5\u7684\u5FAE\u4FE1\u8D26\u6237\u5217\u8868\uFF08\u9700\u5148\u5173\u6CE8\u4E1D\u8DEF\u8D5E\u5E73\u53F0\u670D\u52A1\u53F7\uFF09").option(
|
|
109178
109134
|
"--json-out <path>",
|
|
109179
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
109135
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
109180
109136
|
void 0
|
|
109181
109137
|
).option("-t, --token <token>", "Auth Token").option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
109182
109138
|
async (opts) => {
|
|
109183
109139
|
await runForewarningNotifyAccounts({
|
|
109184
109140
|
token: opts.token,
|
|
109185
|
-
json: opts.json,
|
|
109186
109141
|
jsonOut: opts.jsonOut,
|
|
109187
109142
|
verbose: opts.verbose
|
|
109188
109143
|
});
|
|
@@ -109396,9 +109351,9 @@ Meta \u7EBF\u7D22\u8868\u5355\uFF08\u8D26\u6237 ${opts.account}\uFF0C\u7B2C 1 \u
|
|
|
109396
109351
|
}
|
|
109397
109352
|
}
|
|
109398
109353
|
function register19(program2) {
|
|
109399
|
-
program2.command("clue").description("\u67E5\u8BE2\u5E7F\u544A\u7EBF\u7D22\u8868\u5355\u6570\u636E\uFF08TikTok / Meta\uFF09").option("-m, --media <type>", "\u5A92\u4F53\u7C7B\u578B\uFF1ATikTok | Meta", "TikTok").requiredOption("-a, --account <id>", "\u5E7F\u544A\u8D26\u6237 mediaCustomerId").option("--region <region>", "TikTok \u533A\u57DF\uFF1Aeu | us | other | ALL\uFF08\u9ED8\u8BA4 ALL\uFF09").option("--start <date>", "Meta \u5F00\u59CB\u65E5\u671F\uFF08YYYY-MM-DD\uFF09").option("--end <date>", "Meta \u7ED3\u675F\u65E5\u671F\uFF08YYYY-MM-DD\uFF09").option(
|
|
109354
|
+
program2.command("clue").description("\u67E5\u8BE2\u5E7F\u544A\u7EBF\u7D22\u8868\u5355\u6570\u636E\uFF08TikTok / Meta\uFF09").option("-m, --media <type>", "\u5A92\u4F53\u7C7B\u578B\uFF1ATikTok | Meta", "TikTok").requiredOption("-a, --account <id>", "\u5E7F\u544A\u8D26\u6237 mediaCustomerId").option("--region <region>", "TikTok \u533A\u57DF\uFF1Aeu | us | other | ALL\uFF08\u9ED8\u8BA4 ALL\uFF09").option("--start <date>", "Meta \u5F00\u59CB\u65E5\u671F\uFF08YYYY-MM-DD\uFF09").option("--end <date>", "Meta \u7ED3\u675F\u65E5\u671F\uFF08YYYY-MM-DD\uFF09").option(
|
|
109400
109355
|
"--json-out <path>",
|
|
109401
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
109356
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
109402
109357
|
void 0
|
|
109403
109358
|
).option("-t, --token <token>", "Auth Token").option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (opts) => {
|
|
109404
109359
|
await runClueList({
|
|
@@ -109408,7 +109363,6 @@ function register19(program2) {
|
|
|
109408
109363
|
region: opts.region,
|
|
109409
109364
|
startDate: opts.start,
|
|
109410
109365
|
endDate: opts.end,
|
|
109411
|
-
json: opts.json,
|
|
109412
109366
|
jsonOut: opts.jsonOut,
|
|
109413
109367
|
verbose: opts.verbose
|
|
109414
109368
|
});
|
|
@@ -109499,12 +109453,16 @@ init_cli_table();
|
|
|
109499
109453
|
function pushLengthViolation(violations, item) {
|
|
109500
109454
|
violations.push({ ...item, excess: item.actual - item.limit });
|
|
109501
109455
|
}
|
|
109502
|
-
function
|
|
109456
|
+
function lengthViolationAgentHint(revalidateCommand = "campaign-validate") {
|
|
109457
|
+
return `\u52FF\u81EA\u52A8\u622A\u65AD JSON\u3002\u8BFB\u53D6\u843D\u76D8 JSON \u7684 lengthViolations\uFF0C\u5C06\u5168\u90E8\u6761\u76EE\u4E0E\u4FEE\u6539\u65B9\u6848\u5217\u7ED9\u7528\u6237\uFF0C\u786E\u8BA4\u540E\u5199\u5165\u914D\u7F6E\u5E76\u91CD\u65B0 ${revalidateCommand}\u3002`;
|
|
109458
|
+
}
|
|
109459
|
+
function formatLengthViolationsReport(violations, opts) {
|
|
109503
109460
|
if (violations.length === 0) return "";
|
|
109461
|
+
const cmd = opts?.revalidateCommand ?? "campaign-validate";
|
|
109504
109462
|
const lines = [
|
|
109505
109463
|
"",
|
|
109506
109464
|
`\u{1F4CF} \u8D85\u957F\u5185\u5BB9\u6E05\u5355\uFF08\u5171 ${violations.length} \u9879\uFF09`,
|
|
109507
|
-
|
|
109465
|
+
` \u8BF7\u52FF\u5728 JSON \u4E2D\u81EA\u52A8\u622A\u65AD\uFF1B\u8BF7\u5C06\u5168\u90E8\u6761\u76EE\u4E0E\u4FEE\u6539\u65B9\u6848\u5217\u7ED9\u7528\u6237\uFF0C\u786E\u8BA4\u540E\u518D\u6539 JSON \u5E76\u91CD\u65B0 ${cmd}\u3002`,
|
|
109508
109466
|
""
|
|
109509
109467
|
];
|
|
109510
109468
|
for (let i = 0; i < violations.length; i++) {
|
|
@@ -111420,7 +111378,7 @@ async function runAdCampaignCreate(opts) {
|
|
|
111420
111378
|
` 2. \u6210\u529F\u6216\u90E8\u5206\u6210\u529F\u540E\u6BD4\u5BF9\uFF1Asiluzan-tso ad batch diff --batch-id ${String(taskId)} --config-file ${opts.configFile}`
|
|
111421
111379
|
);
|
|
111422
111380
|
console.log(
|
|
111423
|
-
` \u53EF\u52A0 --campaign-id <id>\uFF08ad campaigns -a ${cfg.account} --json\uFF09\uFF1B\u5168\u90E8\u5931\u8D25\u5219\u53EA\u770B get \u7684 reason/errors \u540E\u6539 JSON \u91CD\u63D0`
|
|
111381
|
+
` \u53EF\u52A0 --campaign-id <id>\uFF08ad campaigns -a ${cfg.account} --json-out ./snap\uFF09\uFF1B\u5168\u90E8\u5931\u8D25\u5219\u53EA\u770B get \u7684 reason/errors \u540E\u6539 JSON \u91CD\u63D0`
|
|
111424
111382
|
);
|
|
111425
111383
|
}
|
|
111426
111384
|
console.log();
|
|
@@ -111447,10 +111405,6 @@ async function runAdCampaignBiddingStrategies(opts) {
|
|
|
111447
111405
|
}
|
|
111448
111406
|
return row;
|
|
111449
111407
|
});
|
|
111450
|
-
if (opts.json) {
|
|
111451
|
-
console.log(JSON.stringify(items, null, 2));
|
|
111452
|
-
return;
|
|
111453
|
-
}
|
|
111454
111408
|
console.log("\n\u7F51\u5173\u652F\u6301\u7684\u51FA\u4EF7\u7B56\u7565\uFF08campaignmanagement/biddingStrategyList\uFF09\uFF1A\n");
|
|
111455
111409
|
for (const item of items) {
|
|
111456
111410
|
console.log(` ${String(item.strategy ?? "")} (${item.code ?? "?"})`);
|
|
@@ -113371,7 +113325,7 @@ async function runCampaignBatchDiff(opts) {
|
|
|
113371
113325
|
}
|
|
113372
113326
|
if (!campaignId) {
|
|
113373
113327
|
console.error(
|
|
113374
|
-
"\n\u274C \u7F3A\u5C11 Google \u5E7F\u544A\u7CFB\u5217 ID\uFF1A\u8BF7\u4F20 --campaign-id\uFF08\u53EF\u4ECE ad campaigns -a <account> --json \u83B7\u53D6\uFF09\n"
|
|
113328
|
+
"\n\u274C \u7F3A\u5C11 Google \u5E7F\u544A\u7CFB\u5217 ID\uFF1A\u8BF7\u4F20 --campaign-id\uFF08\u53EF\u4ECE ad campaigns -a <account> --json-out \u83B7\u53D6\uFF09\n"
|
|
113375
113329
|
);
|
|
113376
113330
|
process.exit(1);
|
|
113377
113331
|
}
|
|
@@ -113751,9 +113705,6 @@ var BUSINESS_NAME_MAX = 25;
|
|
|
113751
113705
|
function pushErr3(errors, msg) {
|
|
113752
113706
|
errors.push(msg);
|
|
113753
113707
|
}
|
|
113754
|
-
function pushWarn3(warnings, msg) {
|
|
113755
|
-
warnings.push(msg);
|
|
113756
|
-
}
|
|
113757
113708
|
function nonEmptyStrings(list) {
|
|
113758
113709
|
return (list ?? []).map((s) => s?.trim()).filter((s) => Boolean(s));
|
|
113759
113710
|
}
|
|
@@ -113784,20 +113735,28 @@ function normalizeBidding(raw) {
|
|
|
113784
113735
|
};
|
|
113785
113736
|
return byNum[n] ?? null;
|
|
113786
113737
|
}
|
|
113787
|
-
function
|
|
113738
|
+
function validateTextLengths(errors, lengthViolations, texts, arrayField, kind, limit, label) {
|
|
113788
113739
|
texts.forEach((text, i) => {
|
|
113789
113740
|
const len = calcGoogleCharLength(text);
|
|
113790
113741
|
if (len > limit) {
|
|
113791
|
-
|
|
113792
|
-
|
|
113793
|
-
|
|
113794
|
-
|
|
113742
|
+
const field = `${arrayField}[${i}]`;
|
|
113743
|
+
pushLengthViolation(lengthViolations, {
|
|
113744
|
+
path: field,
|
|
113745
|
+
field,
|
|
113746
|
+
kind,
|
|
113747
|
+
limit,
|
|
113748
|
+
actual: len,
|
|
113749
|
+
countMode: "google",
|
|
113750
|
+
text
|
|
113751
|
+
});
|
|
113752
|
+
pushErr3(errors, `${label}[${i}] \u8D85\u8FC7 ${limit} \u5B57\u7B26\uFF08\u5F53\u524D ${len}\uFF0CCJK \u8BA1 2\uFF09\uFF1A"${text}"`);
|
|
113795
113753
|
}
|
|
113796
113754
|
});
|
|
113797
113755
|
}
|
|
113798
113756
|
function runPmaxCreateValidation(cfg) {
|
|
113799
113757
|
const errors = [];
|
|
113800
113758
|
const warnings = [];
|
|
113759
|
+
const lengthViolations = [];
|
|
113801
113760
|
const account = cfg.account?.toString().trim();
|
|
113802
113761
|
if (!account) {
|
|
113803
113762
|
pushErr3(errors, "account\uFF08\u5A92\u4F53\u5BA2\u6237 ID\uFF09\u5FC5\u586B");
|
|
@@ -113893,19 +113852,53 @@ function runPmaxCreateValidation(cfg) {
|
|
|
113893
113852
|
}
|
|
113894
113853
|
}
|
|
113895
113854
|
}
|
|
113896
|
-
|
|
113897
|
-
|
|
113898
|
-
|
|
113855
|
+
validateTextLengths(
|
|
113856
|
+
errors,
|
|
113857
|
+
lengthViolations,
|
|
113858
|
+
headlines,
|
|
113859
|
+
"headlines",
|
|
113860
|
+
"pmax_headline",
|
|
113861
|
+
HEADLINE_MAX,
|
|
113862
|
+
"headlines"
|
|
113863
|
+
);
|
|
113864
|
+
validateTextLengths(
|
|
113865
|
+
errors,
|
|
113866
|
+
lengthViolations,
|
|
113867
|
+
longHeadlines,
|
|
113868
|
+
"longHeadlines",
|
|
113869
|
+
"pmax_long_headline",
|
|
113870
|
+
LONG_HEADLINE_MAX,
|
|
113871
|
+
"longHeadlines"
|
|
113872
|
+
);
|
|
113873
|
+
validateTextLengths(
|
|
113874
|
+
errors,
|
|
113875
|
+
lengthViolations,
|
|
113876
|
+
descriptions,
|
|
113877
|
+
"descriptions",
|
|
113878
|
+
"pmax_description",
|
|
113879
|
+
DESCRIPTION_MAX,
|
|
113880
|
+
"descriptions"
|
|
113881
|
+
);
|
|
113899
113882
|
if (cfg.businessName?.trim()) {
|
|
113900
|
-
const
|
|
113883
|
+
const bnText = cfg.businessName.trim();
|
|
113884
|
+
const bn = calcGoogleCharLength(bnText);
|
|
113901
113885
|
if (bn > BUSINESS_NAME_MAX) {
|
|
113902
|
-
|
|
113903
|
-
|
|
113904
|
-
|
|
113886
|
+
pushLengthViolation(lengthViolations, {
|
|
113887
|
+
path: "businessName",
|
|
113888
|
+
field: "businessName",
|
|
113889
|
+
kind: "pmax_business_name",
|
|
113890
|
+
limit: BUSINESS_NAME_MAX,
|
|
113891
|
+
actual: bn,
|
|
113892
|
+
countMode: "google",
|
|
113893
|
+
text: bnText
|
|
113894
|
+
});
|
|
113895
|
+
pushErr3(
|
|
113896
|
+
errors,
|
|
113897
|
+
`businessName \u8D85\u8FC7 ${BUSINESS_NAME_MAX} \u5B57\u7B26\uFF08\u5F53\u524D ${bn}\uFF0CCJK \u8BA1 2\uFF09\uFF1A"${bnText}"`
|
|
113905
113898
|
);
|
|
113906
113899
|
}
|
|
113907
113900
|
}
|
|
113908
|
-
return { errors, warnings };
|
|
113901
|
+
return { errors, warnings, lengthViolations };
|
|
113909
113902
|
}
|
|
113910
113903
|
|
|
113911
113904
|
// src/commands/ad/pmax-image-validate.ts
|
|
@@ -114082,6 +114075,7 @@ async function runPmaxImageValidation(configFile, cfg) {
|
|
|
114082
114075
|
}
|
|
114083
114076
|
|
|
114084
114077
|
// src/commands/ad/pmax-image-resolve.ts
|
|
114078
|
+
init_auth();
|
|
114085
114079
|
import { basename as basename4, dirname as dirname8, isAbsolute as isAbsolute3, resolve as resolve7 } from "path";
|
|
114086
114080
|
import { readFileSync as readFileSync5 } from "fs";
|
|
114087
114081
|
|
|
@@ -114167,6 +114161,7 @@ var SLOT_META = {
|
|
|
114167
114161
|
label: "Logo (LOGO)"
|
|
114168
114162
|
}
|
|
114169
114163
|
};
|
|
114164
|
+
var MAX_BASE64_UPLOAD_BYTES = 2e5;
|
|
114170
114165
|
function guessContentType(fileName) {
|
|
114171
114166
|
const lower = fileName.toLowerCase();
|
|
114172
114167
|
if (lower.endsWith(".png")) return "image/png";
|
|
@@ -114183,13 +114178,11 @@ function normalizePmaxAssetId(value) {
|
|
|
114183
114178
|
const m = s.match(/\/assets\/(\d+)\s*$/);
|
|
114184
114179
|
return m ? m[1] : s;
|
|
114185
114180
|
}
|
|
114186
|
-
async function
|
|
114181
|
+
async function uploadPmaxImageFileMultipart(config, googleApiUrl, accountId, absImagePath, assetName, fileBuffer, verbose) {
|
|
114187
114182
|
const fileName = basename4(absImagePath);
|
|
114188
|
-
const assetName = (name2 ?? fileName).trim() || fileName;
|
|
114189
|
-
const fileBuffer = readFileSync5(absImagePath);
|
|
114190
114183
|
const mimeType = guessContentType(fileName);
|
|
114191
114184
|
const form = new FormData();
|
|
114192
|
-
form.append("file", new Blob([fileBuffer], { type: mimeType }), fileName);
|
|
114185
|
+
form.append("file", new Blob([new Uint8Array(fileBuffer)], { type: mimeType }), fileName);
|
|
114193
114186
|
const url = pmaxImageAssetUrl(googleApiUrl, accountId, assetName);
|
|
114194
114187
|
const headers = {
|
|
114195
114188
|
"Accept-Language": "zh-CN",
|
|
@@ -114215,6 +114208,54 @@ async function uploadPmaxImageFile(config, googleApiUrl, accountId, absImagePath
|
|
|
114215
114208
|
}
|
|
114216
114209
|
return id;
|
|
114217
114210
|
}
|
|
114211
|
+
async function uploadPmaxImageFileBase64(config, googleApiUrl, accountId, absImagePath, assetName, fileBuffer, verbose) {
|
|
114212
|
+
const url = pmaxImageAssetUrl(googleApiUrl, accountId);
|
|
114213
|
+
let data;
|
|
114214
|
+
try {
|
|
114215
|
+
data = await apiFetch2(
|
|
114216
|
+
url,
|
|
114217
|
+
config,
|
|
114218
|
+
{
|
|
114219
|
+
method: "POST",
|
|
114220
|
+
body: JSON.stringify({ name: assetName, base64String: fileBuffer.toString("base64") })
|
|
114221
|
+
},
|
|
114222
|
+
verbose
|
|
114223
|
+
);
|
|
114224
|
+
} catch (err) {
|
|
114225
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
114226
|
+
throw new Error(`\u4E0A\u4F20\u56FE\u7247\u8D44\u4EA7\u5931\u8D25\uFF1A${msg}\uFF08${absImagePath}\uFF09`);
|
|
114227
|
+
}
|
|
114228
|
+
const id = normalizePmaxAssetId(data["id"]);
|
|
114229
|
+
if (!id) {
|
|
114230
|
+
throw new Error(`\u4E0A\u4F20\u56FE\u7247\u8D44\u4EA7\u672A\u8FD4\u56DE id\uFF08${absImagePath}\uFF09`);
|
|
114231
|
+
}
|
|
114232
|
+
return id;
|
|
114233
|
+
}
|
|
114234
|
+
async function uploadPmaxImageFile(config, googleApiUrl, accountId, absImagePath, name2, verbose) {
|
|
114235
|
+
const fileName = basename4(absImagePath);
|
|
114236
|
+
const assetName = (name2 ?? fileName).trim() || fileName;
|
|
114237
|
+
const fileBuffer = readFileSync5(absImagePath);
|
|
114238
|
+
if (fileBuffer.length <= MAX_BASE64_UPLOAD_BYTES) {
|
|
114239
|
+
return uploadPmaxImageFileBase64(
|
|
114240
|
+
config,
|
|
114241
|
+
googleApiUrl,
|
|
114242
|
+
accountId,
|
|
114243
|
+
absImagePath,
|
|
114244
|
+
assetName,
|
|
114245
|
+
fileBuffer,
|
|
114246
|
+
verbose
|
|
114247
|
+
);
|
|
114248
|
+
}
|
|
114249
|
+
return uploadPmaxImageFileMultipart(
|
|
114250
|
+
config,
|
|
114251
|
+
googleApiUrl,
|
|
114252
|
+
accountId,
|
|
114253
|
+
absImagePath,
|
|
114254
|
+
assetName,
|
|
114255
|
+
fileBuffer,
|
|
114256
|
+
verbose
|
|
114257
|
+
);
|
|
114258
|
+
}
|
|
114218
114259
|
async function resolveOneSlot(configFile, cfg, kind, accountId, config, googleApiUrl, verbose) {
|
|
114219
114260
|
const meta = SLOT_META[kind];
|
|
114220
114261
|
const presetId = String(cfg[meta.configAssetIdKey] ?? "").trim();
|
|
@@ -114340,28 +114381,14 @@ function buildPmaxCreateUrl(googleApiUrl, accountId) {
|
|
|
114340
114381
|
return `${base}/accounts/${accountId}/campaign/pmax`;
|
|
114341
114382
|
}
|
|
114342
114383
|
|
|
114343
|
-
// src/commands/ad/pmax-feature-guard.ts
|
|
114344
|
-
var ENV_KEY = "SILUZAN_PMAX_SETUP";
|
|
114345
|
-
function isPmaxSetupEnabled() {
|
|
114346
|
-
const v = process.env[ENV_KEY]?.trim();
|
|
114347
|
-
return v === "1" || v?.toLowerCase() === "true";
|
|
114348
|
-
}
|
|
114349
|
-
function assertPmaxSetupEnabled(feature) {
|
|
114350
|
-
if (isPmaxSetupEnabled()) return;
|
|
114351
|
-
console.error(
|
|
114352
|
-
`
|
|
114353
|
-
\u274C PMax\u300C${feature}\u300D\u6682\u672A\u5728\u751F\u4EA7\u73AF\u5883\u5F00\u653E\uFF08\u642D\u5EFA\u80FD\u529B\u4ECD\u5728\u6D4B\u8BD5\uFF09\u3002
|
|
114354
|
-
\u8BF7\u5728 Google Ads UI \u64CD\u4F5C\uFF0C\u6216\u672C\u5730\u8054\u8C03\u65F6\u8BBE\u7F6E ${ENV_KEY}=1 \u540E\u91CD\u8BD5\u3002
|
|
114355
|
-
`
|
|
114356
|
-
);
|
|
114357
|
-
process.exit(1);
|
|
114358
|
-
}
|
|
114359
|
-
|
|
114360
114384
|
// src/commands/ad/pmax-create.ts
|
|
114361
114385
|
async function runAdPmaxCreate(opts) {
|
|
114362
|
-
assertPmaxSetupEnabled("pmax-create");
|
|
114363
114386
|
const cfg = loadPmaxCreateConfig(opts.configFile);
|
|
114364
|
-
const {
|
|
114387
|
+
const {
|
|
114388
|
+
errors: cfgErrors,
|
|
114389
|
+
warnings: cfgWarnings,
|
|
114390
|
+
lengthViolations: cfgLengthViolations
|
|
114391
|
+
} = runPmaxCreateValidation(cfg);
|
|
114365
114392
|
const { errors: imgErrors, warnings: imgWarnings } = await runPmaxImageValidation(
|
|
114366
114393
|
opts.configFile,
|
|
114367
114394
|
cfg
|
|
@@ -114375,6 +114402,10 @@ async function runAdPmaxCreate(opts) {
|
|
|
114375
114402
|
if (errors.length > 0) {
|
|
114376
114403
|
console.error("\n\u274C PMax \u914D\u7F6E\u6821\u9A8C\u5931\u8D25\uFF1A");
|
|
114377
114404
|
for (const e of errors) console.error(` \u2022 ${e}`);
|
|
114405
|
+
const lengthReport = formatLengthViolationsReport(cfgLengthViolations, {
|
|
114406
|
+
revalidateCommand: "pmax-validate"
|
|
114407
|
+
});
|
|
114408
|
+
if (lengthReport) console.error(lengthReport);
|
|
114378
114409
|
console.error();
|
|
114379
114410
|
process.exit(1);
|
|
114380
114411
|
}
|
|
@@ -114389,7 +114420,7 @@ async function runAdPmaxCreate(opts) {
|
|
|
114389
114420
|
accountId,
|
|
114390
114421
|
config,
|
|
114391
114422
|
googleApiUrl,
|
|
114392
|
-
{ verbose: opts.verbose, logUploads: !opts.
|
|
114423
|
+
{ verbose: opts.verbose, logUploads: !opts.jsonOut }
|
|
114393
114424
|
);
|
|
114394
114425
|
} catch (err) {
|
|
114395
114426
|
console.error(`
|
|
@@ -114440,7 +114471,7 @@ async function runAdPmaxCreate(opts) {
|
|
|
114440
114471
|
if (budgetId != null) console.log(` budgetId\uFF1A${budgetId}`);
|
|
114441
114472
|
console.log(
|
|
114442
114473
|
`
|
|
114443
|
-
\u590D\u6838\uFF1Asiluzan-tso ad campaigns -a ${accountId} --json # channelTypeV2 \u5E94\u4E3A PERFORMANCE_MAX`
|
|
114474
|
+
\u590D\u6838\uFF1Asiluzan-tso ad campaigns -a ${accountId} --json-out # channelTypeV2 \u5E94\u4E3A PERFORMANCE_MAX`
|
|
114444
114475
|
);
|
|
114445
114476
|
console.log();
|
|
114446
114477
|
}
|
|
@@ -114449,15 +114480,19 @@ async function runAdPmaxCreate(opts) {
|
|
|
114449
114480
|
import { writeFileSync as writeFileSync3 } from "fs";
|
|
114450
114481
|
init_cli_json_snapshot();
|
|
114451
114482
|
async function runAdPmaxValidate(opts) {
|
|
114452
|
-
assertPmaxSetupEnabled("pmax-validate");
|
|
114453
114483
|
const cfg = loadPmaxCreateConfig(opts.configFile);
|
|
114454
|
-
const {
|
|
114484
|
+
const {
|
|
114485
|
+
errors: cfgErrors,
|
|
114486
|
+
warnings: cfgWarnings,
|
|
114487
|
+
lengthViolations: cfgLengthViolations
|
|
114488
|
+
} = runPmaxCreateValidation(cfg);
|
|
114455
114489
|
const { errors: imgErrors, warnings: imgWarnings } = await runPmaxImageValidation(
|
|
114456
114490
|
opts.configFile,
|
|
114457
114491
|
cfg
|
|
114458
114492
|
);
|
|
114459
114493
|
const errors = [...cfgErrors, ...imgErrors];
|
|
114460
114494
|
const warnings = [...cfgWarnings, ...imgWarnings];
|
|
114495
|
+
const lengthViolations = cfgLengthViolations;
|
|
114461
114496
|
if (opts.writeNormalized) {
|
|
114462
114497
|
const toWrite = stripMetaKeysForExport(cfg);
|
|
114463
114498
|
writeFileSync3(opts.writeNormalized, `${JSON.stringify(toWrite, null, 2)}
|
|
@@ -114468,7 +114503,9 @@ async function runAdPmaxValidate(opts) {
|
|
|
114468
114503
|
configFile: opts.configFile,
|
|
114469
114504
|
account: cfg.account?.toString().trim() || void 0,
|
|
114470
114505
|
errors,
|
|
114471
|
-
warnings
|
|
114506
|
+
warnings,
|
|
114507
|
+
lengthViolations,
|
|
114508
|
+
agentHint: lengthViolations.length > 0 ? lengthViolationAgentHint("pmax-validate") : void 0
|
|
114472
114509
|
};
|
|
114473
114510
|
const accountSuffix = payload.account;
|
|
114474
114511
|
if (await emitCliJsonOrSnapshot(opts, {
|
|
@@ -114488,6 +114525,10 @@ async function runAdPmaxValidate(opts) {
|
|
|
114488
114525
|
if (errors.length > 0) {
|
|
114489
114526
|
console.error("\n\u274C PMax \u914D\u7F6E\u6821\u9A8C\u5931\u8D25\uFF1A");
|
|
114490
114527
|
for (const e of errors) console.error(` \u2022 ${e}`);
|
|
114528
|
+
const lengthReport = formatLengthViolationsReport(lengthViolations, {
|
|
114529
|
+
revalidateCommand: "pmax-validate"
|
|
114530
|
+
});
|
|
114531
|
+
if (lengthReport) console.error(lengthReport);
|
|
114491
114532
|
console.error();
|
|
114492
114533
|
process.exit(1);
|
|
114493
114534
|
}
|
|
@@ -114686,12 +114727,11 @@ async function runAdPmaxGet(opts) {
|
|
|
114686
114727
|
const n = Array.isArray(groups) ? groups.length : 0;
|
|
114687
114728
|
console.log(` \u8D44\u4EA7\u7EC4\uFF1A${n} \u4E2A`);
|
|
114688
114729
|
console.log(`
|
|
114689
|
-
\u5B8C\u6574\u7ED3\u6784\u8BF7\u4F7F\u7528 --json
|
|
114730
|
+
\u5B8C\u6574\u7ED3\u6784\u8BF7\u4F7F\u7528 --json-out
|
|
114690
114731
|
`);
|
|
114691
114732
|
});
|
|
114692
114733
|
}
|
|
114693
114734
|
async function runAdPmaxEdit(opts) {
|
|
114694
|
-
assertPmaxSetupEnabled("pmax-edit");
|
|
114695
114735
|
const accountId = requireAccountId(opts.account);
|
|
114696
114736
|
const campaignId = opts.campaignId.trim();
|
|
114697
114737
|
let body;
|
|
@@ -114753,7 +114793,6 @@ async function runAdPmaxEdit(opts) {
|
|
|
114753
114793
|
});
|
|
114754
114794
|
}
|
|
114755
114795
|
async function runAdPmaxAssetGroupCreate(opts) {
|
|
114756
|
-
assertPmaxSetupEnabled("pmax-asset-group-create");
|
|
114757
114796
|
const cfg = loadPmaxJsonFile(opts.configFile);
|
|
114758
114797
|
const accountId = requireAccountId(String(cfg["account"] ?? ""));
|
|
114759
114798
|
const campaignId = String(cfg["campaignId"] ?? "").trim();
|
|
@@ -114785,7 +114824,7 @@ async function runAdPmaxAssetGroupCreate(opts) {
|
|
|
114785
114824
|
accountId,
|
|
114786
114825
|
config,
|
|
114787
114826
|
googleApiUrl,
|
|
114788
|
-
{ verbose: opts.verbose, logUploads: !opts.
|
|
114827
|
+
{ verbose: opts.verbose, logUploads: !opts.jsonOut }
|
|
114789
114828
|
);
|
|
114790
114829
|
} catch (err) {
|
|
114791
114830
|
console.error(
|
|
@@ -114839,7 +114878,6 @@ async function runAdPmaxAssetGroupCreate(opts) {
|
|
|
114839
114878
|
});
|
|
114840
114879
|
}
|
|
114841
114880
|
async function runAdPmaxAssetGroupEdit(opts) {
|
|
114842
|
-
assertPmaxSetupEnabled("pmax-asset-group-edit");
|
|
114843
114881
|
const accountId = requireAccountId(opts.account);
|
|
114844
114882
|
const assetGroupId = opts.assetGroupId.trim();
|
|
114845
114883
|
let body;
|
|
@@ -114891,7 +114929,6 @@ async function runAdPmaxAssetGroupEdit(opts) {
|
|
|
114891
114929
|
});
|
|
114892
114930
|
}
|
|
114893
114931
|
async function runAdPmaxAssetsUpdate(opts) {
|
|
114894
|
-
assertPmaxSetupEnabled("pmax-assets-update");
|
|
114895
114932
|
const cfg = loadPmaxJsonFile(opts.configFile);
|
|
114896
114933
|
const accountId = requireAccountId(String(cfg["account"] ?? ""));
|
|
114897
114934
|
const assetGroupId = String(cfg["assetGroupId"] ?? "").trim();
|
|
@@ -114952,7 +114989,6 @@ async function runAdPmaxAssetsUpdate(opts) {
|
|
|
114952
114989
|
});
|
|
114953
114990
|
}
|
|
114954
114991
|
async function runAdPmaxYoutubeLink(opts) {
|
|
114955
|
-
assertPmaxSetupEnabled("pmax-youtube-link");
|
|
114956
114992
|
const accountId = requireAccountId(opts.account);
|
|
114957
114993
|
const assetGroupId = opts.assetGroupId.trim();
|
|
114958
114994
|
let body;
|
|
@@ -115042,7 +115078,6 @@ async function runAdPmaxSignalsGet(opts) {
|
|
|
115042
115078
|
});
|
|
115043
115079
|
}
|
|
115044
115080
|
async function runAdPmaxSignalsSet(opts) {
|
|
115045
|
-
assertPmaxSetupEnabled("pmax-signals-set");
|
|
115046
115081
|
const cfg = loadPmaxJsonFile(opts.configFile);
|
|
115047
115082
|
const accountId = requireAccountId(String(cfg["account"] ?? ""));
|
|
115048
115083
|
const assetGroupId = String(cfg["assetGroupId"] ?? "").trim();
|
|
@@ -115155,14 +115190,13 @@ PMax \u53D7\u4F17\u6570\u636E\u6E90\uFF08\u8D26\u6237 ${accountId}\uFF09
|
|
|
115155
115190
|
console.log(` ${r["name"] ?? ""} ${r["resourceName"] ?? ""}`);
|
|
115156
115191
|
}
|
|
115157
115192
|
}
|
|
115158
|
-
if (arr.length > 20) console.log(` \u2026 \u5171 ${arr.length} \u6761\uFF0C\u8BF7\u7528 --json`);
|
|
115193
|
+
if (arr.length > 20) console.log(` \u2026 \u5171 ${arr.length} \u6761\uFF0C\u8BF7\u7528 --json-out`);
|
|
115159
115194
|
}
|
|
115160
115195
|
}
|
|
115161
115196
|
console.log();
|
|
115162
115197
|
});
|
|
115163
115198
|
}
|
|
115164
115199
|
async function runAdPmaxImageUpload(opts) {
|
|
115165
|
-
assertPmaxSetupEnabled("pmax-image-upload");
|
|
115166
115200
|
const accountId = requireAccountId(opts.account);
|
|
115167
115201
|
await withGoogleApi(opts, async (config, googleApiUrl) => {
|
|
115168
115202
|
let data;
|
|
@@ -115268,7 +115302,7 @@ async function runAdPmaxReportAssetGroups(opts) {
|
|
|
115268
115302
|
console.log(`
|
|
115269
115303
|
PMax \u8D44\u4EA7\u7EC4\u6548\u679C\u62A5\u8868\uFF08${query.get("startDate")} ~ ${query.get("endDate")}\uFF0C${n} \u884C\uFF09
|
|
115270
115304
|
`);
|
|
115271
|
-
console.log(" \u5B8C\u6574\u6570\u636E\u8BF7\u4F7F\u7528 --json\n");
|
|
115305
|
+
console.log(" \u5B8C\u6574\u6570\u636E\u8BF7\u4F7F\u7528 --json-out\n");
|
|
115272
115306
|
});
|
|
115273
115307
|
}
|
|
115274
115308
|
async function runAdPmaxReportGeo(opts) {
|
|
@@ -115302,14 +115336,13 @@ async function runAdPmaxReportGeo(opts) {
|
|
|
115302
115336
|
PMax \u5730\u7406\u62A5\u8868\uFF08\u6D3B\u52A8\xD7\u56FD\u5BB6\uFF0C${query.get("startDate")} ~ ${query.get("endDate")}\uFF09
|
|
115303
115337
|
`
|
|
115304
115338
|
);
|
|
115305
|
-
console.log(" \u5B8C\u6574\u6570\u636E\u8BF7\u4F7F\u7528 --json\n");
|
|
115339
|
+
console.log(" \u5B8C\u6574\u6570\u636E\u8BF7\u4F7F\u7528 --json-out\n");
|
|
115306
115340
|
});
|
|
115307
115341
|
}
|
|
115308
115342
|
|
|
115309
115343
|
// src/commands/ad/campaign-validate.ts
|
|
115310
115344
|
import { writeFileSync as writeFileSync4 } from "fs";
|
|
115311
115345
|
init_cli_json_snapshot();
|
|
115312
|
-
var LENGTH_VIOLATION_AGENT_HINT = "\u52FF\u81EA\u52A8\u622A\u65AD JSON\u3002\u8BFB\u53D6\u843D\u76D8 JSON \u7684 lengthViolations\uFF0C\u5C06\u5168\u90E8\u6761\u76EE\u4E0E\u4FEE\u6539\u65B9\u6848\u5217\u7ED9\u7528\u6237\uFF0C\u786E\u8BA4\u540E\u5199\u5165 campaign.json \u5E76\u91CD\u65B0 campaign-validate\u3002";
|
|
115313
115346
|
async function runAdCampaignValidate(opts) {
|
|
115314
115347
|
const cfg = loadCampaignCreateConfig(opts.configFile);
|
|
115315
115348
|
const { errors, warnings, lengthViolations } = runCampaignCreateValidation(cfg);
|
|
@@ -115325,7 +115358,7 @@ async function runAdCampaignValidate(opts) {
|
|
|
115325
115358
|
errors,
|
|
115326
115359
|
warnings,
|
|
115327
115360
|
lengthViolations,
|
|
115328
|
-
agentHint: lengthViolations.length > 0 ?
|
|
115361
|
+
agentHint: lengthViolations.length > 0 ? lengthViolationAgentHint("campaign-validate") : void 0
|
|
115329
115362
|
};
|
|
115330
115363
|
const accountSuffix = payload.account || void 0;
|
|
115331
115364
|
if (await emitCliJsonOrSnapshot(opts, {
|
|
@@ -115392,7 +115425,6 @@ async function convertOne(sharpFn, inputPath, outputPath, spec, quality) {
|
|
|
115392
115425
|
await pipeline.toFile(outputPath);
|
|
115393
115426
|
}
|
|
115394
115427
|
async function runAdPmaxImageConvert(opts) {
|
|
115395
|
-
assertPmaxSetupEnabled("pmax-image-convert");
|
|
115396
115428
|
const { input, inputMarketing, inputSquare, inputLogo } = opts;
|
|
115397
115429
|
if (!input && !inputMarketing && !inputSquare && !inputLogo) {
|
|
115398
115430
|
console.error("\n\u274C \u8BF7\u81F3\u5C11\u6307\u5B9A --input \u6216 --input-marketing / --input-square / --input-logo\n");
|
|
@@ -115479,9 +115511,9 @@ function register20(program2) {
|
|
|
115479
115511
|
adBatchCmd.command("list").description("\u67E5\u8BE2\u6279\u91CF\u521B\u5EFA / \u667A\u6295\u8BB0\u5F55\u5217\u8868").option(
|
|
115480
115512
|
"-s, --state <state>",
|
|
115481
115513
|
"\u72B6\u6001\uFF1ACreating | Successfully | Failed | HasFailed | Unpublished"
|
|
115482
|
-
).option("--customer-id <id>", "\u5BA2\u6237 ID").option("--customer-name <name>", "\u5BA2\u6237\u540D\u79F0").option("-k, --keyword <text>", "\u5173\u952E\u5B57\u641C\u7D22").option("--start <date>", "\u521B\u5EFA\u5F00\u59CB\u65E5\u671F YYYY-MM-DD").option("--end <date>", "\u521B\u5EFA\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("-p, --page <n>", "\u9875\u7801", parseInt).option("--page-size <n>", "\u6BCF\u9875\u6570\u91CF", parseInt).option("-t, --token <token>", "Auth Token").option(
|
|
115514
|
+
).option("--customer-id <id>", "\u5BA2\u6237 ID").option("--customer-name <name>", "\u5BA2\u6237\u540D\u79F0").option("-k, --keyword <text>", "\u5173\u952E\u5B57\u641C\u7D22").option("--start <date>", "\u521B\u5EFA\u5F00\u59CB\u65E5\u671F YYYY-MM-DD").option("--end <date>", "\u521B\u5EFA\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("-p, --page <n>", "\u9875\u7801", parseInt).option("--page-size <n>", "\u6BCF\u9875\u6570\u91CF", parseInt).option("-t, --token <token>", "Auth Token").option(
|
|
115483
115515
|
"--json-out <path>",
|
|
115484
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
115516
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
115485
115517
|
void 0
|
|
115486
115518
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
115487
115519
|
async (opts) => {
|
|
@@ -115495,17 +115527,16 @@ function register20(program2) {
|
|
|
115495
115527
|
endDate: opts.end,
|
|
115496
115528
|
page: opts.page,
|
|
115497
115529
|
pageSize: opts.pageSize,
|
|
115498
|
-
json: opts.json,
|
|
115499
115530
|
jsonOut: opts.jsonOut,
|
|
115500
115531
|
verbose: opts.verbose
|
|
115501
115532
|
});
|
|
115502
115533
|
}
|
|
115503
115534
|
);
|
|
115504
115535
|
adBatchCmd.command("get").description(
|
|
115505
|
-
"\u83B7\u53D6\u5355\u6761\u8BB0\u5F55/\u8349\u7A3F\u8BE6\u60C5\uFF08\u9ED8\u8BA4\uFF1A\u6458\u8981\u8868 + \u540E\u7AEF\u539F\u59CB reason/errors\uFF1B--json \u8F93\u51FA\u5B8C\u6574 JSON\uFF09\n \u6210\u529F\u6216\u90E8\u5206\u6210\u529F\u540E\u987B\u6267\u884C ad batch diff\uFF08\u89C1 --config-file\uFF09\uFF1BFailed \u4EC5\u770B reason/errors \u540E\u91CD\u63D0\n\n \u793A\u4F8B\uFF1A\n siluzan-tso ad batch list\n siluzan-tso ad batch get --id <taskId> --config-file ./campaign.json\n siluzan-tso ad batch get --id <taskId> --json"
|
|
115506
|
-
).requiredOption("--id <id>", "\u8BB0\u5F55 ID\uFF08\u6765\u81EA ad batch list --json \u7684 results[].id\uFF09").option("--config-file <path>", "\u672C\u6B21 campaign-create JSON\uFF08\u7ED3\u675F\u540E\u6253\u5370 batch diff \u547D\u4EE4\uFF09").option(
|
|
115536
|
+
"\u83B7\u53D6\u5355\u6761\u8BB0\u5F55/\u8349\u7A3F\u8BE6\u60C5\uFF08\u9ED8\u8BA4\uFF1A\u6458\u8981\u8868 + \u540E\u7AEF\u539F\u59CB reason/errors\uFF1B--json-out \u8F93\u51FA\u5B8C\u6574 JSON\uFF09\n \u6210\u529F\u6216\u90E8\u5206\u6210\u529F\u540E\u987B\u6267\u884C ad batch diff\uFF08\u89C1 --config-file\uFF09\uFF1BFailed \u4EC5\u770B reason/errors \u540E\u91CD\u63D0\n\n \u793A\u4F8B\uFF1A\n siluzan-tso ad batch list\n siluzan-tso ad batch get --id <taskId> --config-file ./campaign.json\n siluzan-tso ad batch get --id <taskId> --json-out"
|
|
115537
|
+
).requiredOption("--id <id>", "\u8BB0\u5F55 ID\uFF08\u6765\u81EA ad batch list --json-out \u7684 results[].id\uFF09").option("--config-file <path>", "\u672C\u6B21 campaign-create JSON\uFF08\u7ED3\u675F\u540E\u6253\u5370 batch diff \u547D\u4EE4\uFF09").option(
|
|
115507
115538
|
"--json-out <path>",
|
|
115508
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
115539
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
115509
115540
|
void 0
|
|
115510
115541
|
).option("-t, --token <token>", "Auth Token").option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
115511
115542
|
async (opts) => {
|
|
@@ -115513,7 +115544,6 @@ function register20(program2) {
|
|
|
115513
115544
|
token: opts.token,
|
|
115514
115545
|
id: opts.id,
|
|
115515
115546
|
configFile: opts.configFile,
|
|
115516
|
-
json: opts.json,
|
|
115517
115547
|
jsonOut: opts.jsonOut,
|
|
115518
115548
|
verbose: opts.verbose
|
|
115519
115549
|
});
|
|
@@ -115521,7 +115551,7 @@ function register20(program2) {
|
|
|
115521
115551
|
);
|
|
115522
115552
|
adBatchCmd.command("diff").description(
|
|
115523
115553
|
"\u6210\u529F\u6216\u90E8\u5206\u6210\u529F\uFF1A\u6309 campaign-create JSON \u4E0E\u8D26\u6237\u5B9E\u51B5\u9010\u5C42\u6BD4\u5BF9\n Failed \u4E0D\u9002\u7528\uFF08\u7CFB\u5217\u672A\u521B\u5EFA\uFF09\uFF0C\u8BF7\u7528 ad batch get \u67E5\u770B reason/errors \u540E\u6539 JSON \u91CD\u63D0\n\n \u793A\u4F8B\uFF1A\n siluzan-tso ad batch diff --campaign-id <id> --config-file ./campaign.json\n siluzan-tso ad batch diff --batch-id <taskId> --campaign-id <id> --config-file ./campaign.json"
|
|
115524
|
-
).requiredOption("--config-file <path>", "\u63D0\u4EA4\u65F6\u4F7F\u7528\u7684 campaign-create JSON").option("--campaign-id <id>", "Google \u5E7F\u544A\u7CFB\u5217 ID\uFF08\u53EF\u4ECE ad campaigns --json \u83B7\u53D6\uFF1B\u7701\u7565\u65F6\u6309\u7CFB\u5217\u540D\u5339\u914D\uFF09").option("--batch-id <id>", "\u6279\u91CF\u4EFB\u52A1 ID\uFF08\u6821\u9A8C\u975E Failed\uFF1BHasFailed \u65F6\u53EF\u7701\u7565 campaign-id\uFF09").option("-a, --account <id>", "\u5A92\u4F53\u8D26\u6237 ID\uFF08\u9ED8\u8BA4\u8BFB JSON \u7684 account\uFF09").option("--json
|
|
115554
|
+
).requiredOption("--config-file <path>", "\u63D0\u4EA4\u65F6\u4F7F\u7528\u7684 campaign-create JSON").option("--campaign-id <id>", "Google \u5E7F\u544A\u7CFB\u5217 ID\uFF08\u53EF\u4ECE ad campaigns --json-out \u83B7\u53D6\uFF1B\u7701\u7565\u65F6\u6309\u7CFB\u5217\u540D\u5339\u914D\uFF09").option("--batch-id <id>", "\u6279\u91CF\u4EFB\u52A1 ID\uFF08\u6821\u9A8C\u975E Failed\uFF1BHasFailed \u65F6\u53EF\u7701\u7565 campaign-id\uFF09").option("-a, --account <id>", "\u5A92\u4F53\u8D26\u6237 ID\uFF08\u9ED8\u8BA4\u8BFB JSON \u7684 account\uFF09").option("--json-out <path>", "\u6BD4\u5BF9\u7ED3\u679C\u843D\u76D8\u8DEF\u5F84").option("-t, --token <token>", "Auth Token").option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
115525
115555
|
async (opts) => {
|
|
115526
115556
|
await runCampaignBatchDiff({
|
|
115527
115557
|
token: opts.token,
|
|
@@ -115529,7 +115559,6 @@ function register20(program2) {
|
|
|
115529
115559
|
campaignId: opts.campaignId ?? "",
|
|
115530
115560
|
batchId: opts.batchId,
|
|
115531
115561
|
account: opts.account,
|
|
115532
|
-
json: opts.json,
|
|
115533
115562
|
jsonOut: opts.jsonOut,
|
|
115534
115563
|
verbose: opts.verbose
|
|
115535
115564
|
});
|
|
@@ -115554,9 +115583,9 @@ function register20(program2) {
|
|
|
115554
115583
|
});
|
|
115555
115584
|
}
|
|
115556
115585
|
);
|
|
115557
|
-
adCmd.command("campaigns").description("\u67E5\u8BE2\u5E7F\u544A\u7CFB\u5217\u5217\u8868\uFF08\u65E5\u671F\u9ED8\u8BA4\u8FD1 30 \u5929\uFF09").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD\uFF08\u9ED8\u8BA4 30 \u5929\u524D\uFF09").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD\uFF08\u9ED8\u8BA4\u4ECA\u5929\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
115586
|
+
adCmd.command("campaigns").description("\u67E5\u8BE2\u5E7F\u544A\u7CFB\u5217\u5217\u8868\uFF08\u65E5\u671F\u9ED8\u8BA4\u8FD1 30 \u5929\uFF09").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD\uFF08\u9ED8\u8BA4 30 \u5929\u524D\uFF09").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD\uFF08\u9ED8\u8BA4\u4ECA\u5929\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
115558
115587
|
"--json-out <path>",
|
|
115559
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
115588
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
115560
115589
|
void 0
|
|
115561
115590
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
115562
115591
|
async (opts) => {
|
|
@@ -115565,15 +115594,14 @@ function register20(program2) {
|
|
|
115565
115594
|
account: opts.account,
|
|
115566
115595
|
startDate: opts.start,
|
|
115567
115596
|
endDate: opts.end,
|
|
115568
|
-
json: opts.json,
|
|
115569
115597
|
jsonOut: opts.jsonOut,
|
|
115570
115598
|
verbose: opts.verbose
|
|
115571
115599
|
});
|
|
115572
115600
|
}
|
|
115573
115601
|
);
|
|
115574
|
-
adCmd.command("groups").description("\u67E5\u8BE2\u5E7F\u544A\u7EC4\u5217\u8868\uFF08\u65E5\u671F\u9ED8\u8BA4\u8FD1 30 \u5929\uFF09").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD\uFF08\u9ED8\u8BA4 30 \u5929\u524D\uFF09").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD\uFF08\u9ED8\u8BA4\u4ECA\u5929\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
115602
|
+
adCmd.command("groups").description("\u67E5\u8BE2\u5E7F\u544A\u7EC4\u5217\u8868\uFF08\u65E5\u671F\u9ED8\u8BA4\u8FD1 30 \u5929\uFF09").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD\uFF08\u9ED8\u8BA4 30 \u5929\u524D\uFF09").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD\uFF08\u9ED8\u8BA4\u4ECA\u5929\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
115575
115603
|
"--json-out <path>",
|
|
115576
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
115604
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
115577
115605
|
void 0
|
|
115578
115606
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
115579
115607
|
async (opts) => {
|
|
@@ -115582,15 +115610,14 @@ function register20(program2) {
|
|
|
115582
115610
|
account: opts.account,
|
|
115583
115611
|
startDate: opts.start,
|
|
115584
115612
|
endDate: opts.end,
|
|
115585
|
-
json: opts.json,
|
|
115586
115613
|
jsonOut: opts.jsonOut,
|
|
115587
115614
|
verbose: opts.verbose
|
|
115588
115615
|
});
|
|
115589
115616
|
}
|
|
115590
115617
|
);
|
|
115591
|
-
adCmd.command("list").description("\u67E5\u8BE2\u5E7F\u544A\uFF08\u521B\u610F\uFF09\u5217\u8868\uFF08\u65E5\u671F\u9ED8\u8BA4\u8FD1 30 \u5929\uFF09").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD\uFF08\u9ED8\u8BA4 30 \u5929\u524D\uFF09").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD\uFF08\u9ED8\u8BA4\u4ECA\u5929\uFF09").option("--include-deleted", "\u5305\u542B\u5DF2\u5220\u9664\u7684\u5E7F\u544A\uFF08\u7F51\u5173 readDeleted=true\uFF09", false).option("-t, --token <token>", "Auth Token").option(
|
|
115618
|
+
adCmd.command("list").description("\u67E5\u8BE2\u5E7F\u544A\uFF08\u521B\u610F\uFF09\u5217\u8868\uFF08\u65E5\u671F\u9ED8\u8BA4\u8FD1 30 \u5929\uFF09").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD\uFF08\u9ED8\u8BA4 30 \u5929\u524D\uFF09").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD\uFF08\u9ED8\u8BA4\u4ECA\u5929\uFF09").option("--include-deleted", "\u5305\u542B\u5DF2\u5220\u9664\u7684\u5E7F\u544A\uFF08\u7F51\u5173 readDeleted=true\uFF09", false).option("-t, --token <token>", "Auth Token").option(
|
|
115592
115619
|
"--json-out <path>",
|
|
115593
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
115620
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
115594
115621
|
void 0
|
|
115595
115622
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
115596
115623
|
async (opts) => {
|
|
@@ -115600,15 +115627,14 @@ function register20(program2) {
|
|
|
115600
115627
|
startDate: opts.start,
|
|
115601
115628
|
endDate: opts.end,
|
|
115602
115629
|
includeDeleted: opts.includeDeleted,
|
|
115603
|
-
json: opts.json,
|
|
115604
115630
|
jsonOut: opts.jsonOut,
|
|
115605
115631
|
verbose: opts.verbose
|
|
115606
115632
|
});
|
|
115607
115633
|
}
|
|
115608
115634
|
);
|
|
115609
|
-
adCmd.command("keywords").description("\u67E5\u8BE2\u5173\u952E\u8BCD\u5217\u8868\uFF08--negative \u67E5\u8BE2\u5426\u5B9A\u5173\u952E\u8BCD\uFF1B\u65E5\u671F\u9ED8\u8BA4\u8FD1 30 \u5929\uFF09").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").option("--negative", "\u67E5\u8BE2\u5426\u5B9A\u5173\u952E\u8BCD", false).option("--start <date>", "\u5F00\u59CB\u65E5\u671F\uFF08YYYY-MM-DD\uFF0C\u9ED8\u8BA4 30 \u5929\u524D\uFF09").option("--end <date>", "\u7ED3\u675F\u65E5\u671F\uFF08YYYY-MM-DD\uFF0C\u9ED8\u8BA4\u4ECA\u5929\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
115635
|
+
adCmd.command("keywords").description("\u67E5\u8BE2\u5173\u952E\u8BCD\u5217\u8868\uFF08--negative \u67E5\u8BE2\u5426\u5B9A\u5173\u952E\u8BCD\uFF1B\u65E5\u671F\u9ED8\u8BA4\u8FD1 30 \u5929\uFF09").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").option("--negative", "\u67E5\u8BE2\u5426\u5B9A\u5173\u952E\u8BCD", false).option("--start <date>", "\u5F00\u59CB\u65E5\u671F\uFF08YYYY-MM-DD\uFF0C\u9ED8\u8BA4 30 \u5929\u524D\uFF09").option("--end <date>", "\u7ED3\u675F\u65E5\u671F\uFF08YYYY-MM-DD\uFF0C\u9ED8\u8BA4\u4ECA\u5929\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
115610
115636
|
"--json-out <path>",
|
|
115611
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
115637
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
115612
115638
|
void 0
|
|
115613
115639
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
115614
115640
|
async (opts) => {
|
|
@@ -115618,7 +115644,6 @@ function register20(program2) {
|
|
|
115618
115644
|
negative: opts.negative,
|
|
115619
115645
|
startDate: opts.start,
|
|
115620
115646
|
endDate: opts.end,
|
|
115621
|
-
json: opts.json,
|
|
115622
115647
|
jsonOut: opts.jsonOut,
|
|
115623
115648
|
verbose: opts.verbose
|
|
115624
115649
|
});
|
|
@@ -115651,9 +115676,9 @@ function register20(program2) {
|
|
|
115651
115676
|
"--max-cpc <amount>",
|
|
115652
115677
|
"\u6700\u9AD8\u5355\u6B21\u70B9\u51FB\u8D39\u7528\uFF0C\u4E3B\u5E01\u79CD\u91D1\u989D\uFF08\u5982 1.5 \u8868\u793A \xA51.50\uFF1BCLI \u5185\u90E8 \xD7100 \u5199\u5165\u300C\u5206\u300D\uFF09",
|
|
115653
115678
|
parseFloat
|
|
115654
|
-
).option("--status <status>", "\u72B6\u6001\uFF1AENABLED | PAUSED\uFF08\u9ED8\u8BA4 ENABLED\uFF09", "ENABLED").option("-t, --token <token>", "Auth Token").option(
|
|
115679
|
+
).option("--status <status>", "\u72B6\u6001\uFF1AENABLED | PAUSED\uFF08\u9ED8\u8BA4 ENABLED\uFF09", "ENABLED").option("-t, --token <token>", "Auth Token").option(
|
|
115655
115680
|
"--json-out <path>",
|
|
115656
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
115681
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`",
|
|
115657
115682
|
void 0
|
|
115658
115683
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
115659
115684
|
async (opts) => {
|
|
@@ -115665,7 +115690,6 @@ function register20(program2) {
|
|
|
115665
115690
|
name: opts.name,
|
|
115666
115691
|
maxCpc: opts.maxCpc,
|
|
115667
115692
|
status: opts.status ?? "ENABLED",
|
|
115668
|
-
json: opts.json,
|
|
115669
115693
|
jsonOut: opts.jsonOut,
|
|
115670
115694
|
verbose: opts.verbose
|
|
115671
115695
|
});
|
|
@@ -115710,9 +115734,9 @@ function register20(program2) {
|
|
|
115710
115734
|
"--descriptions <d1,d2,...>",
|
|
115711
115735
|
"\u63CF\u8FF0\u5217\u8868\uFF0C\u9017\u53F7\u5206\u9694\uFF0C\u81F3\u5C11 2 \u4E2A\uFF08\u5FC5\u4F20\uFF0C\u6700\u591A 4 \u4E2A\uFF0C\u6BCF\u4E2A \u226490 \u5B57\u7B26\uFF09",
|
|
115712
115736
|
(v) => v.split(",").map((s) => s.trim())
|
|
115713
|
-
).option("--path1 <path>", "\u663E\u793A\u8DEF\u5F841\uFF08\u53EF\u9009\uFF0C\u226415 \u5B57\u7B26\uFF09").option("--path2 <path>", "\u663E\u793A\u8DEF\u5F842\uFF08\u53EF\u9009\uFF0C\u226415 \u5B57\u7B26\uFF0C\u9700\u4E0E path1 \u540C\u65F6\u4F7F\u7528\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
115737
|
+
).option("--path1 <path>", "\u663E\u793A\u8DEF\u5F841\uFF08\u53EF\u9009\uFF0C\u226415 \u5B57\u7B26\uFF09").option("--path2 <path>", "\u663E\u793A\u8DEF\u5F842\uFF08\u53EF\u9009\uFF0C\u226415 \u5B57\u7B26\uFF0C\u9700\u4E0E path1 \u540C\u65F6\u4F7F\u7528\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
115714
115738
|
"--json-out <path>",
|
|
115715
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json
|
|
115739
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json",
|
|
115716
115740
|
void 0
|
|
115717
115741
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
115718
115742
|
async (opts) => {
|
|
@@ -115726,7 +115750,6 @@ function register20(program2) {
|
|
|
115726
115750
|
descriptions: opts.descriptions,
|
|
115727
115751
|
path1: opts.path1,
|
|
115728
115752
|
path2: opts.path2,
|
|
115729
|
-
json: opts.json,
|
|
115730
115753
|
jsonOut: opts.jsonOut,
|
|
115731
115754
|
verbose: opts.verbose
|
|
115732
115755
|
});
|
|
@@ -115765,9 +115788,9 @@ function register20(program2) {
|
|
|
115765
115788
|
"--keywords <kw1,kw2,...>",
|
|
115766
115789
|
"\u5173\u952E\u8BCD\u5217\u8868\uFF0C\u9017\u53F7\u5206\u9694",
|
|
115767
115790
|
(v) => v.split(",").map((s) => s.trim())
|
|
115768
|
-
).option("--final-url <url>", "\u5173\u952E\u8BCD\u6700\u7EC8\u5230\u8FBE\u7F51\u5740\uFF08\u53EF\u9009\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
115791
|
+
).option("--final-url <url>", "\u5173\u952E\u8BCD\u6700\u7EC8\u5230\u8FBE\u7F51\u5740\uFF08\u53EF\u9009\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
115769
115792
|
"--json-out <path>",
|
|
115770
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json
|
|
115793
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json",
|
|
115771
115794
|
void 0
|
|
115772
115795
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
115773
115796
|
async (opts) => {
|
|
@@ -115780,7 +115803,6 @@ function register20(program2) {
|
|
|
115780
115803
|
campaignName: opts.campaignName,
|
|
115781
115804
|
keywords: opts.keywords,
|
|
115782
115805
|
finalUrl: opts.finalUrl,
|
|
115783
|
-
json: opts.json,
|
|
115784
115806
|
jsonOut: opts.jsonOut,
|
|
115785
115807
|
verbose: opts.verbose
|
|
115786
115808
|
});
|
|
@@ -115821,15 +115843,14 @@ function register20(program2) {
|
|
|
115821
115843
|
).requiredOption("--config-file <path>", "campaign-create JSON \u8DEF\u5F84").option(
|
|
115822
115844
|
"--write-normalized <path>",
|
|
115823
115845
|
"\u5C06\u89C4\u8303\u5316\u540E\u7684 JSON \u5199\u5165\u8BE5\u8DEF\u5F84\uFF08\u5173\u952E\u8BCD\u8BCD\u9762\u5DF2\u4FEE\u6B63\uFF09"
|
|
115824
|
-
).option(
|
|
115846
|
+
).option(
|
|
115825
115847
|
"--json-out <path>",
|
|
115826
|
-
"\u843D\u76D8\u6821\u9A8C\u7ED3\u679C\uFF08\u542B lengthViolations\uFF09\u5E76\u66F4\u65B0 cli-manifest
|
|
115848
|
+
"\u843D\u76D8\u6821\u9A8C\u7ED3\u679C\uFF08\u542B lengthViolations\uFF09\u5E76\u66F4\u65B0 cli-manifest"
|
|
115827
115849
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
115828
115850
|
async (opts) => {
|
|
115829
115851
|
await runAdCampaignValidate({
|
|
115830
115852
|
configFile: opts.configFile,
|
|
115831
115853
|
writeNormalized: opts.writeNormalized,
|
|
115832
|
-
json: opts.json,
|
|
115833
115854
|
jsonOut: opts.jsonOut,
|
|
115834
115855
|
verbose: opts.verbose
|
|
115835
115856
|
});
|
|
@@ -115840,16 +115861,15 @@ function register20(program2) {
|
|
|
115840
115861
|
).requiredOption(
|
|
115841
115862
|
"--config-file <path>",
|
|
115842
115863
|
"JSON \u914D\u7F6E\u6587\u4EF6\u8DEF\u5F84\uFF08\u6A21\u677F\u4E0E\u9010\u5B57\u6BB5\u8BF4\u660E\u89C1 assets/siluzan-ads/assets/campaign-create-*.json|md\uFF09"
|
|
115843
|
-
).option("-t, --token <token>", "Auth Token").option(
|
|
115864
|
+
).option("-t, --token <token>", "Auth Token").option(
|
|
115844
115865
|
"--json-out <path>",
|
|
115845
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json
|
|
115866
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json",
|
|
115846
115867
|
void 0
|
|
115847
115868
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
115848
115869
|
async (opts) => {
|
|
115849
115870
|
await runAdCampaignCreate({
|
|
115850
115871
|
configFile: opts.configFile,
|
|
115851
115872
|
token: opts.token,
|
|
115852
|
-
json: opts.json,
|
|
115853
115873
|
jsonOut: opts.jsonOut,
|
|
115854
115874
|
verbose: opts.verbose
|
|
115855
115875
|
});
|
|
@@ -115857,41 +115877,39 @@ function register20(program2) {
|
|
|
115857
115877
|
);
|
|
115858
115878
|
adCmd.command("pmax-validate").description(
|
|
115859
115879
|
"\u6821\u9A8C pmax-create JSON\uFF08PMax \u4E13\u7528\uFF1B\u4E0D\u8C03\u7528 API\uFF09\n\n \u7528\u6CD5\uFF1A\n siluzan-tso ad pmax-validate --config-file ./pmax.json --json-out ./snap-pmax\n siluzan-tso ad pmax-validate --config-file ./pmax.json --write-normalized ./pmax.normalized.json"
|
|
115860
|
-
).requiredOption("--config-file <path>", "pmax-create JSON \u8DEF\u5F84").option("--write-normalized <path>", "\u5C06 JSON \u5199\u5165\u8BE5\u8DEF\u5F84\uFF08\u4FDD\u7559 _ \u6CE8\u89E3\u952E\uFF09").option(
|
|
115880
|
+
).requiredOption("--config-file <path>", "pmax-create JSON \u8DEF\u5F84").option("--write-normalized <path>", "\u5C06 JSON \u5199\u5165\u8BE5\u8DEF\u5F84\uFF08\u4FDD\u7559 _ \u6CE8\u89E3\u952E\uFF09").option(
|
|
115861
115881
|
"--json-out <path>",
|
|
115862
|
-
"\u843D\u76D8\u6821\u9A8C\u7ED3\u679C\u5E76\u66F4\u65B0 cli-manifest
|
|
115882
|
+
"\u843D\u76D8\u6821\u9A8C\u7ED3\u679C\u5E76\u66F4\u65B0 cli-manifest"
|
|
115863
115883
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
115864
115884
|
async (opts) => {
|
|
115865
115885
|
await runAdPmaxValidate({
|
|
115866
115886
|
configFile: opts.configFile,
|
|
115867
115887
|
writeNormalized: opts.writeNormalized,
|
|
115868
|
-
json: opts.json,
|
|
115869
115888
|
jsonOut: opts.jsonOut,
|
|
115870
115889
|
verbose: opts.verbose
|
|
115871
115890
|
});
|
|
115872
115891
|
}
|
|
115873
115892
|
);
|
|
115874
115893
|
adCmd.command("pmax-create").description(
|
|
115875
|
-
'\u65B0\u5EFA Performance Max \u5E7F\u544A\u7CFB\u5217\uFF08\u540C\u6B65 API\uFF1B\u4EC5\u652F\u6301 JSON \u914D\u7F6E\u6587\u4EF6\uFF09\n\n \u7528\u6CD5\uFF1A\n 1. \u590D\u5236 pmax-create-template.json\uFF0C\u5B57\u6BB5\u8BF4\u660E\u89C1 pmax-create-template.md\n 2. siluzan-tso ad geo search -a <accountId> -q "United States"\n 3. siluzan-tso ad pmax-validate --config-file ./pmax.json\n 4. siluzan-tso ad pmax-create --config-file ./pmax.json # imagePaths \u81EA\u52A8\u4E0A\u4F20\n 5. siluzan-tso ad campaigns -a <accountId> --json # \u786E\u8BA4 PERFORMANCE_MAX'
|
|
115894
|
+
'\u65B0\u5EFA Performance Max \u5E7F\u544A\u7CFB\u5217\uFF08\u540C\u6B65 API\uFF1B\u4EC5\u652F\u6301 JSON \u914D\u7F6E\u6587\u4EF6\uFF09\n\n \u7528\u6CD5\uFF1A\n 1. \u590D\u5236 pmax-create-template.json\uFF0C\u5B57\u6BB5\u8BF4\u660E\u89C1 pmax-create-template.md\n 2. siluzan-tso ad geo search -a <accountId> -q "United States"\n 3. siluzan-tso ad pmax-validate --config-file ./pmax.json\n 4. siluzan-tso ad pmax-create --config-file ./pmax.json # imagePaths \u81EA\u52A8\u4E0A\u4F20\n 5. siluzan-tso ad campaigns -a <accountId> --json-out # \u786E\u8BA4 PERFORMANCE_MAX'
|
|
115876
115895
|
).requiredOption(
|
|
115877
115896
|
"--config-file <path>",
|
|
115878
115897
|
"JSON \u914D\u7F6E\u6587\u4EF6\uFF08\u6A21\u677F\u89C1 assets/siluzan-ads/assets/pmax-create-*.json|md\uFF09"
|
|
115879
|
-
).option("-t, --token <token>", "Auth Token").option(
|
|
115898
|
+
).option("-t, --token <token>", "Auth Token").option(
|
|
115880
115899
|
"--json-out <path>",
|
|
115881
|
-
"\u843D\u76D8\u54CD\u5E94\u5E76\u66F4\u65B0 cli-manifest
|
|
115900
|
+
"\u843D\u76D8\u54CD\u5E94\u5E76\u66F4\u65B0 cli-manifest",
|
|
115882
115901
|
void 0
|
|
115883
115902
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
115884
115903
|
async (opts) => {
|
|
115885
115904
|
await runAdPmaxCreate({
|
|
115886
115905
|
configFile: opts.configFile,
|
|
115887
115906
|
token: opts.token,
|
|
115888
|
-
json: opts.json,
|
|
115889
115907
|
jsonOut: opts.jsonOut,
|
|
115890
115908
|
verbose: opts.verbose
|
|
115891
115909
|
});
|
|
115892
115910
|
}
|
|
115893
115911
|
);
|
|
115894
|
-
const addPmaxJsonOptions = (cmd) => cmd.option("--json
|
|
115912
|
+
const addPmaxJsonOptions = (cmd) => cmd.option("--json-out <path>", "\u843D\u76D8\u54CD\u5E94\u5E76\u66F4\u65B0 cli-manifest", void 0).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false);
|
|
115895
115913
|
adCmd.command("pmax-image-convert").description(
|
|
115896
115914
|
"\u5C06\u4EFB\u610F\u56FE\u7247\u8F6C\u4E3A PMax \u4E09\u79CD\u89C4\u683C\u7D20\u6750\uFF08marketing 1200\xD7628 / square 1200\xD71200 / logo 1200\xD71200\uFF09\n\n \u7528\u6CD5\uFF1A\n # \u5355\u56FE\u81EA\u52A8\u6D3E\u751F\u4E09\u79CD\u683C\u5F0F\n siluzan-tso ad pmax-image-convert --input ./banner.jpg --output-dir ./assets --prefix my-camp\n # \u5206\u522B\u6307\u5B9A\u5404\u56FE\uFF0C\u5E76\u5C06\u8DEF\u5F84\u5199\u56DE pmax.json\n siluzan-tso ad pmax-image-convert --input-marketing ./hero.jpg --input-logo ./logo.png \\\n --output-dir ./assets --update-config ./pmax.json"
|
|
115897
115915
|
).option("--input <path>", "\u4E3B\u8F93\u5165\u56FE\uFF08\u7528\u4E8E\u6240\u6709\u672A\u5355\u72EC\u6307\u5B9A\u7684\u7C7B\u578B\uFF09").option("--input-marketing <path>", "\u6A2A\u56FE\u8F93\u5165\uFF08\u4F18\u5148\u4E8E --input\uFF09").option("--input-square <path>", "\u65B9\u56FE\u8F93\u5165\uFF08\u4F18\u5148\u4E8E --input\uFF09").option("--input-logo <path>", "Logo \u8F93\u5165\uFF08\u4F18\u5148\u4E8E --input\uFF09").option("--output-dir <dir>", "\u8F93\u51FA\u76EE\u5F55\uFF08\u9ED8\u8BA4\u4E0E\u8F93\u5165\u56FE\u540C\u76EE\u5F55\uFF09").option("--prefix <name>", "\u8F93\u51FA\u6587\u4EF6\u540D\u524D\u7F00\uFF08\u9ED8\u8BA4\u53D6\u8F93\u5165\u56FE\u6587\u4EF6\u540D\uFF09").option("--quality <n>", "JPEG \u8D28\u91CF 1\u2013100\uFF08\u9ED8\u8BA4 85\uFF09", (v) => parseInt(v, 10)).option("--logo-use-cover", "Logo \u4F7F\u7528 cover \u88C1\u5207\uFF08\u9ED8\u8BA4 contain + \u767D\u5E95\uFF09", false).option("--update-config <path>", "\u5C06\u751F\u6210\u7684 imagePaths \u5199\u56DE\u6307\u5B9A pmax.json \u914D\u7F6E\u6587\u4EF6").option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
@@ -115972,7 +115990,6 @@ function register20(program2) {
|
|
|
115972
115990
|
assetName: opts.assetName,
|
|
115973
115991
|
bodyFile: opts.bodyFile,
|
|
115974
115992
|
token: opts.token,
|
|
115975
|
-
json: opts.json,
|
|
115976
115993
|
jsonOut: opts.jsonOut,
|
|
115977
115994
|
verbose: opts.verbose
|
|
115978
115995
|
});
|
|
@@ -116014,7 +116031,6 @@ function register20(program2) {
|
|
|
116014
116031
|
source: src,
|
|
116015
116032
|
limit: opts.limit,
|
|
116016
116033
|
token: opts.token,
|
|
116017
|
-
json: opts.json,
|
|
116018
116034
|
jsonOut: opts.jsonOut,
|
|
116019
116035
|
verbose: opts.verbose
|
|
116020
116036
|
});
|
|
@@ -116034,7 +116050,6 @@ function register20(program2) {
|
|
|
116034
116050
|
name: opts.name,
|
|
116035
116051
|
bodyFile: opts.bodyFile,
|
|
116036
116052
|
token: opts.token,
|
|
116037
|
-
json: opts.json,
|
|
116038
116053
|
jsonOut: opts.jsonOut,
|
|
116039
116054
|
verbose: opts.verbose
|
|
116040
116055
|
});
|
|
@@ -116053,7 +116068,6 @@ function register20(program2) {
|
|
|
116053
116068
|
endDate: opts.end,
|
|
116054
116069
|
campaignId: opts.campaignId,
|
|
116055
116070
|
token: opts.token,
|
|
116056
|
-
json: opts.json,
|
|
116057
116071
|
jsonOut: opts.jsonOut,
|
|
116058
116072
|
verbose: opts.verbose
|
|
116059
116073
|
});
|
|
@@ -116072,16 +116086,14 @@ function register20(program2) {
|
|
|
116072
116086
|
clickGreater: opts.clickGreater,
|
|
116073
116087
|
conversionsGreater: opts.conversionsGreater,
|
|
116074
116088
|
token: opts.token,
|
|
116075
|
-
json: opts.json,
|
|
116076
116089
|
jsonOut: opts.jsonOut,
|
|
116077
116090
|
verbose: opts.verbose
|
|
116078
116091
|
});
|
|
116079
116092
|
}
|
|
116080
116093
|
);
|
|
116081
|
-
adCmd.command("campaign-bidding-strategies").description("\u5217\u51FA\u7F51\u5173\u652F\u6301\u7684\u51FA\u4EF7\u7B56\u7565\u7C7B\u578B\uFF08GET campaignmanagement/biddingStrategyList\uFF09").option("-t, --token <token>", "Auth Token").option("--
|
|
116094
|
+
adCmd.command("campaign-bidding-strategies").description("\u5217\u51FA\u7F51\u5173\u652F\u6301\u7684\u51FA\u4EF7\u7B56\u7565\u7C7B\u578B\uFF08GET campaignmanagement/biddingStrategyList\uFF09").option("-t, --token <token>", "Auth Token").option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (opts) => {
|
|
116082
116095
|
await runAdCampaignBiddingStrategies({
|
|
116083
116096
|
token: opts.token,
|
|
116084
|
-
json: opts.json,
|
|
116085
116097
|
verbose: opts.verbose
|
|
116086
116098
|
});
|
|
116087
116099
|
});
|
|
@@ -116195,9 +116207,9 @@ function register20(program2) {
|
|
|
116195
116207
|
});
|
|
116196
116208
|
}
|
|
116197
116209
|
);
|
|
116198
|
-
adCmd.command("keyword-delete").description("\u5220\u9664\u641C\u7D22\u5173\u952E\u8BCD").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").requiredOption("--id <keywordId>", "\u5173\u952E\u8BCD ID\uFF08\u6765\u81EA ad keywords --json \u2192 id\uFF09").requiredOption(
|
|
116210
|
+
adCmd.command("keyword-delete").description("\u5220\u9664\u641C\u7D22\u5173\u952E\u8BCD").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").requiredOption("--id <keywordId>", "\u5173\u952E\u8BCD ID\uFF08\u6765\u81EA ad keywords --json-out \u2192 id\uFF09").requiredOption(
|
|
116199
116211
|
"--adgroup-id <id>",
|
|
116200
|
-
"\u5173\u952E\u8BCD\u6240\u5C5E\u5E7F\u544A\u7EC4 ID\uFF08\u6765\u81EA ad keywords --json \u2192 adGroupId\uFF09"
|
|
116212
|
+
"\u5173\u952E\u8BCD\u6240\u5C5E\u5E7F\u544A\u7EC4 ID\uFF08\u6765\u81EA ad keywords --json-out \u2192 adGroupId\uFF09"
|
|
116201
116213
|
).option("-t, --token <token>", "Auth Token").option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
116202
116214
|
async (opts) => {
|
|
116203
116215
|
await runAdKeywordDelete({
|
|
@@ -116209,7 +116221,7 @@ function register20(program2) {
|
|
|
116209
116221
|
});
|
|
116210
116222
|
}
|
|
116211
116223
|
);
|
|
116212
|
-
adCmd.command("keyword-edit").description("\u7F16\u8F91\u641C\u7D22\u5173\u952E\u8BCD\uFF08\u6570\u7EC4 body\uFF0C\u5148 list \u518D\u5408\u5E76\uFF09").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").requiredOption("--id <keywordId>", "\u5173\u952E\u8BCD ID\uFF08\u6765\u81EA ad keywords --json \u2192 id\uFF09").option("--text <text>", "\u65B0\u5173\u952E\u8BCD\u6587\u672C\uFF08\u5199\u5165 keywordText \u6570\u7EC4\uFF09").option(
|
|
116224
|
+
adCmd.command("keyword-edit").description("\u7F16\u8F91\u641C\u7D22\u5173\u952E\u8BCD\uFF08\u6570\u7EC4 body\uFF0C\u5148 list \u518D\u5408\u5E76\uFF09").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").requiredOption("--id <keywordId>", "\u5173\u952E\u8BCD ID\uFF08\u6765\u81EA ad keywords --json-out \u2192 id\uFF09").option("--text <text>", "\u65B0\u5173\u952E\u8BCD\u6587\u672C\uFF08\u5199\u5165 keywordText \u6570\u7EC4\uFF09").option(
|
|
116213
116225
|
"--match-type <type>",
|
|
116214
116226
|
'\u65B0\u5339\u914D\u7C7B\u578B\uFF1ABroad | Phrase | Exact\uFF08\u5199 matchTypeV2\uFF0C\u5E76\u9ED8\u8BA4\u540C\u6B65\u6539\u5199 keywordText \u4E3A\u8BCD\u5E72/"\u8BCD"/[\u8BCD] \u4EE5\u7B26\u5408\u7F51\u5173\u63A8\u65AD\uFF09'
|
|
116215
116227
|
).option(
|
|
@@ -116248,7 +116260,7 @@ function register20(program2) {
|
|
|
116248
116260
|
});
|
|
116249
116261
|
}
|
|
116250
116262
|
);
|
|
116251
|
-
adCmd.command("keyword-status").description("\u5207\u6362\u641C\u7D22\u5173\u952E\u8BCD\u72B6\u6001\uFF08Enabled / Paused\uFF0C\u5199\u5165 userStatusV2\uFF09").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").requiredOption("--id <keywordId>", "\u5173\u952E\u8BCD ID\uFF08\u6765\u81EA ad keywords --json \u2192 id\uFF09").requiredOption("--status <status>", "\u76EE\u6807\u72B6\u6001\uFF1AEnabled | Paused").option("--start <date>", "\u5217\u8868\u67E5\u8BE2\u8D77\u59CB\u65E5\u671F YYYY-MM-DD").option("--end <date>", "\u5217\u8868\u67E5\u8BE2\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("-t, --token <token>", "Auth Token").option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
116263
|
+
adCmd.command("keyword-status").description("\u5207\u6362\u641C\u7D22\u5173\u952E\u8BCD\u72B6\u6001\uFF08Enabled / Paused\uFF0C\u5199\u5165 userStatusV2\uFF09").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").requiredOption("--id <keywordId>", "\u5173\u952E\u8BCD ID\uFF08\u6765\u81EA ad keywords --json-out \u2192 id\uFF09").requiredOption("--status <status>", "\u76EE\u6807\u72B6\u6001\uFF1AEnabled | Paused").option("--start <date>", "\u5217\u8868\u67E5\u8BE2\u8D77\u59CB\u65E5\u671F YYYY-MM-DD").option("--end <date>", "\u5217\u8868\u67E5\u8BE2\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("-t, --token <token>", "Auth Token").option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
116252
116264
|
async (opts) => {
|
|
116253
116265
|
if (opts.status !== "Enabled" && opts.status !== "Paused") {
|
|
116254
116266
|
console.error("\n\u274C --status \u53EA\u63A5\u53D7 Enabled \u6216 Paused\n");
|
|
@@ -116265,7 +116277,7 @@ function register20(program2) {
|
|
|
116265
116277
|
});
|
|
116266
116278
|
}
|
|
116267
116279
|
);
|
|
116268
|
-
adCmd.command("keyword-negative-edit").description("\u7F16\u8F91\u5426\u5B9A\u5173\u952E\u8BCD\uFF08\u6587\u672C\u6216\u5339\u914D\u7C7B\u578B\uFF0C\u81F3\u5C11\u4F20\u4E00\u4E2A\u4FEE\u6539\u9879\uFF09").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").requiredOption("--id <keywordId>", "\u5426\u5B9A\u5173\u952E\u8BCD ID\uFF08\u6765\u81EA ad keywords --negative --json \u2192 id\uFF09").option("--text <text>", "\u65B0\u5173\u952E\u8BCD\u6587\u672C").option(
|
|
116280
|
+
adCmd.command("keyword-negative-edit").description("\u7F16\u8F91\u5426\u5B9A\u5173\u952E\u8BCD\uFF08\u6587\u672C\u6216\u5339\u914D\u7C7B\u578B\uFF0C\u81F3\u5C11\u4F20\u4E00\u4E2A\u4FEE\u6539\u9879\uFF09").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").requiredOption("--id <keywordId>", "\u5426\u5B9A\u5173\u952E\u8BCD ID\uFF08\u6765\u81EA ad keywords --negative --json-out \u2192 id\uFF09").option("--text <text>", "\u65B0\u5173\u952E\u8BCD\u6587\u672C").option(
|
|
116269
116281
|
"--match-type <type>",
|
|
116270
116282
|
'\u65B0\u5339\u914D\u7C7B\u578B\uFF1ABroad | Phrase | Exact\uFF08\u5199 matchTypeV2\uFF0C\u5E76\u9ED8\u8BA4\u540C\u6B65\u6539\u5199 keywordText \u4E3A\u8BCD\u5E72/"\u8BCD"/[\u8BCD]\uFF09'
|
|
116271
116283
|
).option("--start <date>", "\u5217\u8868\u67E5\u8BE2\u8D77\u59CB\u65E5\u671F YYYY-MM-DD").option("--end <date>", "\u5217\u8868\u67E5\u8BE2\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("-t, --token <token>", "Auth Token").option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
@@ -116287,9 +116299,9 @@ function register20(program2) {
|
|
|
116287
116299
|
}
|
|
116288
116300
|
);
|
|
116289
116301
|
const extensionCmd = adCmd.command("extension").description("\u9644\u52A0\u4FE1\u606F\u7BA1\u7406\uFF08\u9644\u52A0\u94FE\u63A5/\u7535\u8BDD/\u5BA3\u4F20\u4FE1\u606F/\u7ED3\u6784\u5316\u6458\u8981\uFF09");
|
|
116290
|
-
extensionCmd.command("list").description("\u67E5\u8BE2\u9644\u52A0\u4FE1\u606F\u5217\u8868").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").option("--type <type>", "\u6309\u7C7B\u578B\u7B5B\u9009\uFF1ASITELINK | CALL | CALLOUT | STRUCTURED_SNIPPET").option("-t, --token <token>", "Auth Token").option(
|
|
116302
|
+
extensionCmd.command("list").description("\u67E5\u8BE2\u9644\u52A0\u4FE1\u606F\u5217\u8868").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").option("--type <type>", "\u6309\u7C7B\u578B\u7B5B\u9009\uFF1ASITELINK | CALL | CALLOUT | STRUCTURED_SNIPPET").option("-t, --token <token>", "Auth Token").option(
|
|
116291
116303
|
"--json-out <path>",
|
|
116292
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
116304
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
116293
116305
|
void 0
|
|
116294
116306
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
116295
116307
|
async (opts) => {
|
|
@@ -116297,15 +116309,14 @@ function register20(program2) {
|
|
|
116297
116309
|
token: opts.token,
|
|
116298
116310
|
account: opts.account,
|
|
116299
116311
|
type: opts.type,
|
|
116300
|
-
json: opts.json,
|
|
116301
116312
|
jsonOut: opts.jsonOut,
|
|
116302
116313
|
verbose: opts.verbose
|
|
116303
116314
|
});
|
|
116304
116315
|
}
|
|
116305
116316
|
);
|
|
116306
|
-
extensionCmd.command("sitelink").description("\u6DFB\u52A0\u9644\u52A0\u94FE\u63A5\uFF08SITELINK\uFF09").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").requiredOption("--text <text>", "\u94FE\u63A5\u6587\u5B57\uFF08\u663E\u793A\u6587\u672C\uFF09").requiredOption("--url <url>", "\u76EE\u6807\u94FE\u63A5 URL").option("--line2 <text>", "\u94FE\u63A5\u63CF\u8FF0\u884C1").option("--line3 <text>", "\u94FE\u63A5\u63CF\u8FF0\u884C2").option("--level <level>", "\u5C42\u7EA7\uFF1AAccount | Campaign | AdGroup\uFF08\u9ED8\u8BA4 Account\uFF09", "Account").option("--campaign-id <id>", "\u6240\u5C5E\u5E7F\u544A\u7CFB\u5217 ID\uFF08level=Campaign \u65F6\u5FC5\u4F20\uFF09").option("--adgroup-id <id>", "\u6240\u5C5E\u5E7F\u544A\u7EC4 ID\uFF08level=AdGroup \u65F6\u5FC5\u4F20\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
116317
|
+
extensionCmd.command("sitelink").description("\u6DFB\u52A0\u9644\u52A0\u94FE\u63A5\uFF08SITELINK\uFF09").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").requiredOption("--text <text>", "\u94FE\u63A5\u6587\u5B57\uFF08\u663E\u793A\u6587\u672C\uFF09").requiredOption("--url <url>", "\u76EE\u6807\u94FE\u63A5 URL").option("--line2 <text>", "\u94FE\u63A5\u63CF\u8FF0\u884C1").option("--line3 <text>", "\u94FE\u63A5\u63CF\u8FF0\u884C2").option("--level <level>", "\u5C42\u7EA7\uFF1AAccount | Campaign | AdGroup\uFF08\u9ED8\u8BA4 Account\uFF09", "Account").option("--campaign-id <id>", "\u6240\u5C5E\u5E7F\u544A\u7CFB\u5217 ID\uFF08level=Campaign \u65F6\u5FC5\u4F20\uFF09").option("--adgroup-id <id>", "\u6240\u5C5E\u5E7F\u544A\u7EC4 ID\uFF08level=AdGroup \u65F6\u5FC5\u4F20\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
116307
116318
|
"--json-out <path>",
|
|
116308
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json
|
|
116319
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json",
|
|
116309
116320
|
void 0
|
|
116310
116321
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
116311
116322
|
async (opts) => {
|
|
@@ -116320,15 +116331,14 @@ function register20(program2) {
|
|
|
116320
116331
|
url: opts.url,
|
|
116321
116332
|
line2: opts.line2,
|
|
116322
116333
|
line3: opts.line3,
|
|
116323
|
-
json: opts.json,
|
|
116324
116334
|
jsonOut: opts.jsonOut,
|
|
116325
116335
|
verbose: opts.verbose
|
|
116326
116336
|
});
|
|
116327
116337
|
}
|
|
116328
116338
|
);
|
|
116329
|
-
extensionCmd.command("call").description("\u6DFB\u52A0\u9644\u52A0\u7535\u8BDD\uFF08CALL\uFF09").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").requiredOption("--country-code <code>", "\u56FD\u5BB6\u7801\uFF0C\u5982 +86").requiredOption("--phone <phone>", "\u7535\u8BDD\u53F7\u7801").option("--level <level>", "\u5C42\u7EA7\uFF1AAccount | Campaign | AdGroup\uFF08\u9ED8\u8BA4 Account\uFF09", "Account").option("--campaign-id <id>", "\u6240\u5C5E\u5E7F\u544A\u7CFB\u5217 ID").option("--adgroup-id <id>", "\u6240\u5C5E\u5E7F\u544A\u7EC4 ID").option("-t, --token <token>", "Auth Token").option(
|
|
116339
|
+
extensionCmd.command("call").description("\u6DFB\u52A0\u9644\u52A0\u7535\u8BDD\uFF08CALL\uFF09").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").requiredOption("--country-code <code>", "\u56FD\u5BB6\u7801\uFF0C\u5982 +86").requiredOption("--phone <phone>", "\u7535\u8BDD\u53F7\u7801").option("--level <level>", "\u5C42\u7EA7\uFF1AAccount | Campaign | AdGroup\uFF08\u9ED8\u8BA4 Account\uFF09", "Account").option("--campaign-id <id>", "\u6240\u5C5E\u5E7F\u544A\u7CFB\u5217 ID").option("--adgroup-id <id>", "\u6240\u5C5E\u5E7F\u544A\u7EC4 ID").option("-t, --token <token>", "Auth Token").option(
|
|
116330
116340
|
"--json-out <path>",
|
|
116331
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json
|
|
116341
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json",
|
|
116332
116342
|
void 0
|
|
116333
116343
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
116334
116344
|
async (opts) => {
|
|
@@ -116341,15 +116351,14 @@ function register20(program2) {
|
|
|
116341
116351
|
adGroupId: opts.adgroupId,
|
|
116342
116352
|
countryCode: opts.countryCode,
|
|
116343
116353
|
phoneNumber: opts.phone,
|
|
116344
|
-
json: opts.json,
|
|
116345
116354
|
jsonOut: opts.jsonOut,
|
|
116346
116355
|
verbose: opts.verbose
|
|
116347
116356
|
});
|
|
116348
116357
|
}
|
|
116349
116358
|
);
|
|
116350
|
-
extensionCmd.command("callout").description("\u6DFB\u52A0\u9644\u52A0\u5BA3\u4F20\u4FE1\u606F\uFF08CALLOUT\uFF0C\u6700\u591A 25 \u5B57\u7B26\uFF09").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").requiredOption("--text <text>", "\u5BA3\u4F20\u6587\u5B57\uFF08\u6700\u591A 25 \u5B57\u7B26\uFF09").option("--level <level>", "\u5C42\u7EA7\uFF1AAccount | Campaign | AdGroup\uFF08\u9ED8\u8BA4 Account\uFF09", "Account").option("--campaign-id <id>", "\u6240\u5C5E\u5E7F\u544A\u7CFB\u5217 ID").option("--adgroup-id <id>", "\u6240\u5C5E\u5E7F\u544A\u7EC4 ID").option("-t, --token <token>", "Auth Token").option(
|
|
116359
|
+
extensionCmd.command("callout").description("\u6DFB\u52A0\u9644\u52A0\u5BA3\u4F20\u4FE1\u606F\uFF08CALLOUT\uFF0C\u6700\u591A 25 \u5B57\u7B26\uFF09").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").requiredOption("--text <text>", "\u5BA3\u4F20\u6587\u5B57\uFF08\u6700\u591A 25 \u5B57\u7B26\uFF09").option("--level <level>", "\u5C42\u7EA7\uFF1AAccount | Campaign | AdGroup\uFF08\u9ED8\u8BA4 Account\uFF09", "Account").option("--campaign-id <id>", "\u6240\u5C5E\u5E7F\u544A\u7CFB\u5217 ID").option("--adgroup-id <id>", "\u6240\u5C5E\u5E7F\u544A\u7EC4 ID").option("-t, --token <token>", "Auth Token").option(
|
|
116351
116360
|
"--json-out <path>",
|
|
116352
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json
|
|
116361
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json",
|
|
116353
116362
|
void 0
|
|
116354
116363
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
116355
116364
|
async (opts) => {
|
|
@@ -116361,7 +116370,6 @@ function register20(program2) {
|
|
|
116361
116370
|
campaignId: opts.campaignId,
|
|
116362
116371
|
adGroupId: opts.adgroupId,
|
|
116363
116372
|
text: opts.text,
|
|
116364
|
-
json: opts.json,
|
|
116365
116373
|
jsonOut: opts.jsonOut,
|
|
116366
116374
|
verbose: opts.verbose
|
|
116367
116375
|
});
|
|
@@ -116371,9 +116379,9 @@ function register20(program2) {
|
|
|
116371
116379
|
"--values <v1,v2,...>",
|
|
116372
116380
|
"\u6458\u8981\u503C\u5217\u8868\uFF0C\u9017\u53F7\u5206\u9694\uFF08\u81F3\u5C11 3 \u4E2A\uFF09",
|
|
116373
116381
|
(v) => v.split(",").map((s) => s.trim())
|
|
116374
|
-
).option("--level <level>", "\u5C42\u7EA7\uFF1AAccount | Campaign | AdGroup\uFF08\u9ED8\u8BA4 Account\uFF09", "Account").option("--campaign-id <id>", "\u6240\u5C5E\u5E7F\u544A\u7CFB\u5217 ID").option("--adgroup-id <id>", "\u6240\u5C5E\u5E7F\u544A\u7EC4 ID").option("-t, --token <token>", "Auth Token").option(
|
|
116382
|
+
).option("--level <level>", "\u5C42\u7EA7\uFF1AAccount | Campaign | AdGroup\uFF08\u9ED8\u8BA4 Account\uFF09", "Account").option("--campaign-id <id>", "\u6240\u5C5E\u5E7F\u544A\u7CFB\u5217 ID").option("--adgroup-id <id>", "\u6240\u5C5E\u5E7F\u544A\u7EC4 ID").option("-t, --token <token>", "Auth Token").option(
|
|
116375
116383
|
"--json-out <path>",
|
|
116376
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json
|
|
116384
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json",
|
|
116377
116385
|
void 0
|
|
116378
116386
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
116379
116387
|
async (opts) => {
|
|
@@ -116386,7 +116394,6 @@ function register20(program2) {
|
|
|
116386
116394
|
adGroupId: opts.adgroupId,
|
|
116387
116395
|
snippetHeader: opts.header,
|
|
116388
116396
|
snippetValues: opts.values,
|
|
116389
|
-
json: opts.json,
|
|
116390
116397
|
jsonOut: opts.jsonOut,
|
|
116391
116398
|
verbose: opts.verbose
|
|
116392
116399
|
});
|
|
@@ -116400,9 +116407,9 @@ function register20(program2) {
|
|
|
116400
116407
|
verbose: opts.verbose
|
|
116401
116408
|
});
|
|
116402
116409
|
});
|
|
116403
|
-
adCmd.command("search-terms").description("\u67E5\u8BE2\u641C\u7D22\u5B57\u8BCD\u62A5\u544A\uFF08\u65E5\u671F\u9ED8\u8BA4\u8FD1 30 \u5929\uFF09").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD\uFF08\u9ED8\u8BA4 30 \u5929\u524D\uFF09").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD\uFF08\u9ED8\u8BA4\u4ECA\u5929\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
116410
|
+
adCmd.command("search-terms").description("\u67E5\u8BE2\u641C\u7D22\u5B57\u8BCD\u62A5\u544A\uFF08\u65E5\u671F\u9ED8\u8BA4\u8FD1 30 \u5929\uFF09").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD\uFF08\u9ED8\u8BA4 30 \u5929\u524D\uFF09").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD\uFF08\u9ED8\u8BA4\u4ECA\u5929\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
116404
116411
|
"--json-out <path>",
|
|
116405
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
116412
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
116406
116413
|
void 0
|
|
116407
116414
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
116408
116415
|
async (opts) => {
|
|
@@ -116411,7 +116418,6 @@ function register20(program2) {
|
|
|
116411
116418
|
account: opts.account,
|
|
116412
116419
|
startDate: opts.start,
|
|
116413
116420
|
endDate: opts.end,
|
|
116414
|
-
json: opts.json,
|
|
116415
116421
|
jsonOut: opts.jsonOut,
|
|
116416
116422
|
verbose: opts.verbose
|
|
116417
116423
|
});
|
|
@@ -116428,9 +116434,9 @@ function register20(program2) {
|
|
|
116428
116434
|
});
|
|
116429
116435
|
geoCmd.command("list").description(
|
|
116430
116436
|
"\u67E5\u8BE2\u5730\u7406\u4F4D\u7F6E\u5B9A\u5411\u5217\u8868\uFF08targeted = \u5DF2\u5B9A\u4F4D\uFF1Bexcluded = \u5DF2\u6392\u9664\uFF1Breport = \u6D88\u8017\u62A5\u544A\uFF0C\u53EF\u9009\u6309\u5E7F\u544A\u7CFB\u5217\u8FC7\u6EE4\uFF09"
|
|
116431
|
-
).requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").option("--mode <mode>", "\u5217\u8868\u7C7B\u578B\uFF1Atargeted | excluded | report\uFF08\u9ED8\u8BA4 targeted\uFF09", "targeted").option("--campaign-id <id>", "\u53EF\u9009\uFF1A\u6309\u5E7F\u544A\u7CFB\u5217 ID \u8FC7\u6EE4\u7ED3\u679C\uFF08\u6765\u81EA ad campaigns\uFF09").option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD\uFF08\u9ED8\u8BA4 30 \u5929\u524D\uFF0C\u6240\u6709\u6A21\u5F0F\u751F\u6548\uFF09").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD\uFF08\u9ED8\u8BA4\u4ECA\u5929\uFF0C\u6240\u6709\u6A21\u5F0F\u751F\u6548\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
116437
|
+
).requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").option("--mode <mode>", "\u5217\u8868\u7C7B\u578B\uFF1Atargeted | excluded | report\uFF08\u9ED8\u8BA4 targeted\uFF09", "targeted").option("--campaign-id <id>", "\u53EF\u9009\uFF1A\u6309\u5E7F\u544A\u7CFB\u5217 ID \u8FC7\u6EE4\u7ED3\u679C\uFF08\u6765\u81EA ad campaigns\uFF09").option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD\uFF08\u9ED8\u8BA4 30 \u5929\u524D\uFF0C\u6240\u6709\u6A21\u5F0F\u751F\u6548\uFF09").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD\uFF08\u9ED8\u8BA4\u4ECA\u5929\uFF0C\u6240\u6709\u6A21\u5F0F\u751F\u6548\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
116432
116438
|
"--json-out <path>",
|
|
116433
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
116439
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
116434
116440
|
void 0
|
|
116435
116441
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
116436
116442
|
async (opts) => {
|
|
@@ -116445,7 +116451,6 @@ function register20(program2) {
|
|
|
116445
116451
|
campaignId: opts.campaignId,
|
|
116446
116452
|
startDate: opts.start,
|
|
116447
116453
|
endDate: opts.end,
|
|
116448
|
-
json: opts.json,
|
|
116449
116454
|
jsonOut: opts.jsonOut,
|
|
116450
116455
|
verbose: opts.verbose
|
|
116451
116456
|
});
|
|
@@ -116464,7 +116469,7 @@ function register20(program2) {
|
|
|
116464
116469
|
});
|
|
116465
116470
|
}
|
|
116466
116471
|
);
|
|
116467
|
-
geoCmd.command("remove").description("\u79FB\u9664\u5730\u7406\u4F4D\u7F6E\u5B9A\u5411\uFF08\u666E\u901A\u5B9A\u4F4D\u4E0E\u6392\u9664\u5B9A\u4F4D\u5747\u901A\u8FC7\u6B64\u547D\u4EE4\u5220\u9664\uFF09").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").requiredOption("--campaign-id <id>", "\u5E7F\u544A\u7CFB\u5217 ID").requiredOption("--location-id <id>", "\u5730\u7406\u4F4D\u7F6E ID\uFF08\u6765\u81EA geo list --json \u2192 id\uFF09").option("-t, --token <token>", "Auth Token").option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
116472
|
+
geoCmd.command("remove").description("\u79FB\u9664\u5730\u7406\u4F4D\u7F6E\u5B9A\u5411\uFF08\u666E\u901A\u5B9A\u4F4D\u4E0E\u6392\u9664\u5B9A\u4F4D\u5747\u901A\u8FC7\u6B64\u547D\u4EE4\u5220\u9664\uFF09").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").requiredOption("--campaign-id <id>", "\u5E7F\u544A\u7CFB\u5217 ID").requiredOption("--location-id <id>", "\u5730\u7406\u4F4D\u7F6E ID\uFF08\u6765\u81EA geo list --json-out \u2192 id\uFF09").option("-t, --token <token>", "Auth Token").option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
116468
116473
|
async (opts) => {
|
|
116469
116474
|
await runAdGeoRemove({
|
|
116470
116475
|
token: opts.token,
|
|
@@ -116481,7 +116486,7 @@ function register20(program2) {
|
|
|
116481
116486
|
"--bid-modifier <n>",
|
|
116482
116487
|
"Google \u51FA\u4EF7\u500D\u7387\uFF1A1.0=\u4E0D\u8C03\u6574\uFF0C1.2=+20%\uFF0C0.8=-20%",
|
|
116483
116488
|
parseFloat
|
|
116484
|
-
).option("--criterion-id <id>", "campaign_criterion id\uFF08geo list --mode targeted --json \u2192 id\uFF09").option("--location-id <id>", "\u5730\u7406\u4F4D\u7F6E ID\uFF08\u4E0E list/search \u7684 id \u76F8\u540C\uFF1B\u4E0E --criterion-id \u4E8C\u9009\u4E00\uFF09").option("-t, --token <token>", "Auth Token").option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
116489
|
+
).option("--criterion-id <id>", "campaign_criterion id\uFF08geo list --mode targeted --json-out \u2192 id\uFF09").option("--location-id <id>", "\u5730\u7406\u4F4D\u7F6E ID\uFF08\u4E0E list/search \u7684 id \u76F8\u540C\uFF1B\u4E0E --criterion-id \u4E8C\u9009\u4E00\uFF09").option("-t, --token <token>", "Auth Token").option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
116485
116490
|
async (opts) => {
|
|
116486
116491
|
if (!opts.criterionId && !opts.locationId) {
|
|
116487
116492
|
console.error("\n\u274C \u987B\u6307\u5B9A --criterion-id \u6216 --location-id\n");
|
|
@@ -116503,9 +116508,9 @@ function register20(program2) {
|
|
|
116503
116508
|
}
|
|
116504
116509
|
);
|
|
116505
116510
|
const deviceBidCmd = adCmd.command("device-bid").description("\u8BBE\u5907\u51FA\u4EF7\u8C03\u6574\uFF08\u7CFB\u5217\u7EA7 / \u5E7F\u544A\u7EC4\u7EA7\uFF1B\u4E0E\u524D\u7AEF updateDeviceAndAddress \u540C\u6E90\uFF09");
|
|
116506
|
-
deviceBidCmd.command("list").description("\u67E5\u8BE2\u8BBE\u5907\u51FA\u4EF7\u8C03\u6574\u5217\u8868\uFF08\u7CFB\u5217\u7EA7\u9ED8\u8BA4\uFF1B\u5E7F\u544A\u7EC4\u7EA7\u9700 --level adgroup\uFF09").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").option("--level <level>", "campaign | adgroup\uFF08\u9ED8\u8BA4 campaign\uFF09", "campaign").option("--campaign-id <id>", "\u53EF\u9009\uFF1A\u6309\u5E7F\u544A\u7CFB\u5217\u8FC7\u6EE4\uFF08\u7CFB\u5217\u7EA7\uFF09\u6216\u5FC5\u586B\u4E0A\u4E0B\u6587\uFF08\u5E7F\u544A\u7EC4\u7EA7\uFF09").option("--ad-group-id <id>", "\u5E7F\u544A\u7EC4 ID\uFF08--level adgroup \u65F6\u5FC5\u586B\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
116511
|
+
deviceBidCmd.command("list").description("\u67E5\u8BE2\u8BBE\u5907\u51FA\u4EF7\u8C03\u6574\u5217\u8868\uFF08\u7CFB\u5217\u7EA7\u9ED8\u8BA4\uFF1B\u5E7F\u544A\u7EC4\u7EA7\u9700 --level adgroup\uFF09").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").option("--level <level>", "campaign | adgroup\uFF08\u9ED8\u8BA4 campaign\uFF09", "campaign").option("--campaign-id <id>", "\u53EF\u9009\uFF1A\u6309\u5E7F\u544A\u7CFB\u5217\u8FC7\u6EE4\uFF08\u7CFB\u5217\u7EA7\uFF09\u6216\u5FC5\u586B\u4E0A\u4E0B\u6587\uFF08\u5E7F\u544A\u7EC4\u7EA7\uFF09").option("--ad-group-id <id>", "\u5E7F\u544A\u7EC4 ID\uFF08--level adgroup \u65F6\u5FC5\u586B\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
116507
116512
|
"--json-out <path>",
|
|
116508
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json
|
|
116513
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json",
|
|
116509
116514
|
void 0
|
|
116510
116515
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
116511
116516
|
async (opts) => {
|
|
@@ -116519,7 +116524,6 @@ function register20(program2) {
|
|
|
116519
116524
|
level: opts.level,
|
|
116520
116525
|
campaignId: opts.campaignId,
|
|
116521
116526
|
adGroupId: opts.adGroupId,
|
|
116522
|
-
json: opts.json,
|
|
116523
116527
|
jsonOut: opts.jsonOut,
|
|
116524
116528
|
verbose: opts.verbose
|
|
116525
116529
|
});
|
|
@@ -116531,7 +116535,7 @@ function register20(program2) {
|
|
|
116531
116535
|
"--bid-modifier <n>",
|
|
116532
116536
|
"\u51FA\u4EF7\u500D\u7387\uFF081.0=\u57FA\u51C6\uFF1B0.8=-20%\uFF1B1.2=+20%\uFF1B0=\u6392\u9664\u8BE5\u8BBE\u5907\uFF09",
|
|
116533
116537
|
parseFloat
|
|
116534
|
-
).option("--level <level>", "campaign | adgroup\uFF08\u9ED8\u8BA4 campaign\uFF09", "campaign").option("--ad-group-id <id>", "\u5E7F\u544A\u7EC4 ID\uFF08--level adgroup \u65F6\u5FC5\u586B\uFF09").option("--criterion-id <id>", "\u8BBE\u5907\u51FA\u4EF7 criterion id\uFF08\u6765\u81EA list --json \u2192 id\uFF09").option("--device-type <type>", "\u8BBE\u5907\u7C7B\u578B\uFF1AMobile | Desktop | Tablet\uFF08\u4E0E --criterion-id \u4E8C\u9009\u4E00\uFF09").option("-t, --token <token>", "Auth Token").option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
116538
|
+
).option("--level <level>", "campaign | adgroup\uFF08\u9ED8\u8BA4 campaign\uFF09", "campaign").option("--ad-group-id <id>", "\u5E7F\u544A\u7EC4 ID\uFF08--level adgroup \u65F6\u5FC5\u586B\uFF09").option("--criterion-id <id>", "\u8BBE\u5907\u51FA\u4EF7 criterion id\uFF08\u6765\u81EA list --json-out \u2192 id\uFF09").option("--device-type <type>", "\u8BBE\u5907\u7C7B\u578B\uFF1AMobile | Desktop | Tablet\uFF08\u4E0E --criterion-id \u4E8C\u9009\u4E00\uFF09").option("-t, --token <token>", "Auth Token").option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
116535
116539
|
async (opts) => {
|
|
116536
116540
|
if (!["campaign", "adgroup"].includes(opts.level)) {
|
|
116537
116541
|
console.error("\n\u274C --level \u53EA\u63A5\u53D7 campaign | adgroup\n");
|
|
@@ -116556,11 +116560,73 @@ function register20(program2) {
|
|
|
116556
116560
|
);
|
|
116557
116561
|
}
|
|
116558
116562
|
|
|
116563
|
+
// src/utils/cli-json-out-option.ts
|
|
116564
|
+
var JSON_OUT_DESC = "\u843D\u76D8 JSON + outline + cli-manifest[-<\u67E5\u8BE2id>].json\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF08\u542B outlineFile\uFF09";
|
|
116565
|
+
function attachJsonOutOption(cmd) {
|
|
116566
|
+
cmd.option("--json-out <path>", JSON_OUT_DESC);
|
|
116567
|
+
}
|
|
116568
|
+
|
|
116559
116569
|
// src/commands/keyword.ts
|
|
116560
116570
|
init_auth();
|
|
116561
116571
|
init_cli_json_snapshot();
|
|
116562
116572
|
init_cli_table();
|
|
116563
116573
|
|
|
116574
|
+
// src/commands/keyword-account-match.ts
|
|
116575
|
+
init_auth();
|
|
116576
|
+
function normalizeKeywordForAccountMatch(raw) {
|
|
116577
|
+
return unwrapKeywordDisplayTextForEdit(raw.trim()).toLowerCase();
|
|
116578
|
+
}
|
|
116579
|
+
function extractKeywordTextFromManagementRow(row) {
|
|
116580
|
+
const kt = row["keywordText"];
|
|
116581
|
+
if (Array.isArray(kt) && kt.length > 0 && typeof kt[0] === "string") {
|
|
116582
|
+
return kt[0];
|
|
116583
|
+
}
|
|
116584
|
+
const t = row["text"];
|
|
116585
|
+
if (typeof t === "string") return t;
|
|
116586
|
+
const kw = row["keyword"];
|
|
116587
|
+
if (typeof kw === "string") return kw;
|
|
116588
|
+
return "";
|
|
116589
|
+
}
|
|
116590
|
+
async function fetchAccountPositiveKeywordNormSet(config, googleApiUrl, accountId, opts) {
|
|
116591
|
+
const lookback = opts?.lookbackDays ?? 3650;
|
|
116592
|
+
const params = new URLSearchParams();
|
|
116593
|
+
params.set("startDate", toGoogleDate(void 0, -lookback));
|
|
116594
|
+
params.set("endDate", toGoogleDate(void 0, 0));
|
|
116595
|
+
const url = `${googleApiUrl}/keywordmanagement/v2/list/${accountId}?${params}`;
|
|
116596
|
+
const data = await apiFetch2(
|
|
116597
|
+
url,
|
|
116598
|
+
config,
|
|
116599
|
+
{},
|
|
116600
|
+
opts?.verbose
|
|
116601
|
+
);
|
|
116602
|
+
const rawItems = data.data ?? [];
|
|
116603
|
+
const seenIds = /* @__PURE__ */ new Set();
|
|
116604
|
+
const normSet = /* @__PURE__ */ new Set();
|
|
116605
|
+
for (const row of rawItems) {
|
|
116606
|
+
const id = row["id"];
|
|
116607
|
+
if (id !== void 0) {
|
|
116608
|
+
if (seenIds.has(id)) continue;
|
|
116609
|
+
seenIds.add(id);
|
|
116610
|
+
}
|
|
116611
|
+
const text = extractKeywordTextFromManagementRow(row);
|
|
116612
|
+
if (!text) continue;
|
|
116613
|
+
const norm = normalizeKeywordForAccountMatch(text);
|
|
116614
|
+
if (norm) normSet.add(norm);
|
|
116615
|
+
}
|
|
116616
|
+
return normSet;
|
|
116617
|
+
}
|
|
116618
|
+
function keywordAlreadyInAccountFlag(recommendKeyword, accountNormSet) {
|
|
116619
|
+
const norm = normalizeKeywordForAccountMatch(recommendKeyword ?? "");
|
|
116620
|
+
if (!norm) return 0;
|
|
116621
|
+
return accountNormSet.has(norm) ? 1 : 0;
|
|
116622
|
+
}
|
|
116623
|
+
function annotateKeywordSuggestWithAccountPresence(items, accountNormSet) {
|
|
116624
|
+
return items.map((item) => {
|
|
116625
|
+
const flag = keywordAlreadyInAccountFlag(item.keyword, accountNormSet);
|
|
116626
|
+
return { ...item, alreadyInAccount: flag };
|
|
116627
|
+
});
|
|
116628
|
+
}
|
|
116629
|
+
|
|
116564
116630
|
// src/commands/keyword-geo.ts
|
|
116565
116631
|
function parseGeoTargetConstantIds(raw) {
|
|
116566
116632
|
if (!raw?.trim()) return [];
|
|
@@ -116770,7 +116836,7 @@ async function runKeywordSuggest(opts) {
|
|
|
116770
116836
|
console.error(
|
|
116771
116837
|
`
|
|
116772
116838
|
\u274C \u8D26\u6237 ${accountId} \u7F3A\u5C11 currencyCode\uFF0C\u65E0\u6CD5\u6807\u6CE8\u51FA\u4EF7\u5E01\u79CD\u3002
|
|
116773
|
-
\u8BF7\u7528 list-accounts -m Google -k ` + accountId + " --json \u786E\u8BA4\u8D26\u6237\u6570\u636E\u3002\n"
|
|
116839
|
+
\u8BF7\u7528 list-accounts -m Google -k ` + accountId + " --json-out \u786E\u8BA4\u8D26\u6237\u6570\u636E\u3002\n"
|
|
116774
116840
|
);
|
|
116775
116841
|
process.exit(1);
|
|
116776
116842
|
}
|
|
@@ -116825,6 +116891,27 @@ async function runKeywordSuggest(opts) {
|
|
|
116825
116891
|
return !excludes.some((exc) => kw.includes(exc));
|
|
116826
116892
|
});
|
|
116827
116893
|
}
|
|
116894
|
+
if (accountId) {
|
|
116895
|
+
try {
|
|
116896
|
+
const accountNormSet = await fetchAccountPositiveKeywordNormSet(
|
|
116897
|
+
config,
|
|
116898
|
+
googleApiUrl,
|
|
116899
|
+
accountId,
|
|
116900
|
+
{ verbose: opts.verbose }
|
|
116901
|
+
);
|
|
116902
|
+
items = annotateKeywordSuggestWithAccountPresence(items, accountNormSet);
|
|
116903
|
+
if (opts.verbose) {
|
|
116904
|
+
const matched = items.filter((r) => r.alreadyInAccount === 1).length;
|
|
116905
|
+
console.error(
|
|
116906
|
+
` [keyword] \u8D26\u6237\u8BCD\u5E93 ${accountNormSet.size} \u4E2A\u8BCD\u5E72\uFF1B\u63A8\u8350 ${items.length} \u6761\uFF0C\u5176\u4E2D\u5DF2\u5728\u8D26\u6237 ${matched} \u6761`
|
|
116907
|
+
);
|
|
116908
|
+
}
|
|
116909
|
+
} catch (err) {
|
|
116910
|
+
console.error(
|
|
116911
|
+
` [keyword] \u8B66\u544A\uFF1A\u62C9\u53D6\u8D26\u6237\u5173\u952E\u8BCD\u5931\u8D25\uFF0C\u8DF3\u8FC7 alreadyInAccount \u6807\u6CE8\uFF1A${err instanceof Error ? err.message : String(err)}`
|
|
116912
|
+
);
|
|
116913
|
+
}
|
|
116914
|
+
}
|
|
116828
116915
|
const n = items.length;
|
|
116829
116916
|
const kwPayload = buildKeywordSuggestJsonPayload(items, { bidAmountCurrency });
|
|
116830
116917
|
const displayItems = kwPayload.items;
|
|
@@ -116846,6 +116933,7 @@ async function runKeywordSuggest(opts) {
|
|
|
116846
116933
|
const cur = bidAmountCurrency;
|
|
116847
116934
|
const cols = [
|
|
116848
116935
|
{ key: "keyword", header: "\u5173\u952E\u8BCD" },
|
|
116936
|
+
...accountId ? [{ key: "alreadyInAccount", header: "\u5DF2\u5728\u8D26\u6237\u4E2D" }] : [],
|
|
116849
116937
|
{ key: "montlySearch", header: "\u6708\u5747\u641C\u7D22" },
|
|
116850
116938
|
{ key: "cpcMain", header: `\u5E73\u5747CPC(${cur})` },
|
|
116851
116939
|
{ key: "bidRangeMain", header: `\u9875\u9996\u51FA\u4EF7(${cur})` },
|
|
@@ -116859,6 +116947,9 @@ async function runKeywordSuggest(opts) {
|
|
|
116859
116947
|
const competitionDisplay = item.competitionV2 ?? (item.competition != null ? item.competition.toFixed(2) : "\u2014");
|
|
116860
116948
|
return {
|
|
116861
116949
|
keyword: item.keyword ?? "",
|
|
116950
|
+
...accountId ? {
|
|
116951
|
+
alreadyInAccount: item.alreadyInAccount === 1 ? "1" : item.alreadyInAccount === 0 ? "0" : "\u2014"
|
|
116952
|
+
} : {},
|
|
116862
116953
|
montlySearch: String(item.montlySearch ?? "\u2014"),
|
|
116863
116954
|
cpcMain,
|
|
116864
116955
|
bidRangeMain,
|
|
@@ -116931,7 +117022,8 @@ function microsItemToBidAmounts(item) {
|
|
|
116931
117022
|
};
|
|
116932
117023
|
}
|
|
116933
117024
|
function attachBaseCliOptions(cmd) {
|
|
116934
|
-
cmd
|
|
117025
|
+
attachJsonOutOption(cmd);
|
|
117026
|
+
cmd.option("--verbose", "\u8F93\u51FA\u8BE6\u7EC6\u9519\u8BEF\u5806\u6808").option("--token <jwt>", "\u4E34\u65F6\u4F7F\u7528\u7684 JWT Token\uFF08\u8986\u76D6 ~/.siluzan/config.json\uFF09");
|
|
116935
117027
|
}
|
|
116936
117028
|
function splitKeywordSeeds(raw) {
|
|
116937
117029
|
return raw.split(",").map((s) => s.trim()).filter(Boolean);
|
|
@@ -116957,7 +117049,6 @@ function register21(program2) {
|
|
|
116957
117049
|
include: opts.include,
|
|
116958
117050
|
exclude: opts.exclude,
|
|
116959
117051
|
googleOnly: opts.googleOnly,
|
|
116960
|
-
json: opts.json,
|
|
116961
117052
|
jsonOut: opts.jsonOut,
|
|
116962
117053
|
verbose: opts.verbose
|
|
116963
117054
|
});
|
|
@@ -116971,7 +117062,6 @@ function register21(program2) {
|
|
|
116971
117062
|
token: opts.token,
|
|
116972
117063
|
countryCode: opts.countryCode,
|
|
116973
117064
|
nameContains: opts.nameContains,
|
|
116974
|
-
json: opts.json,
|
|
116975
117065
|
jsonOut: opts.jsonOut,
|
|
116976
117066
|
verbose: opts.verbose
|
|
116977
117067
|
});
|
|
@@ -116980,6 +117070,7 @@ function register21(program2) {
|
|
|
116980
117070
|
|
|
116981
117071
|
// src/commands/rag.ts
|
|
116982
117072
|
init_auth();
|
|
117073
|
+
init_cli_json_snapshot();
|
|
116983
117074
|
function splitCsv2(s) {
|
|
116984
117075
|
if (!s) return [];
|
|
116985
117076
|
return s.split(",").map((x) => x.trim()).filter(Boolean);
|
|
@@ -117244,8 +117335,8 @@ async function runRagQuery(options) {
|
|
|
117244
117335
|
process.exit(1);
|
|
117245
117336
|
}
|
|
117246
117337
|
}
|
|
117247
|
-
const
|
|
117248
|
-
const rawOutput = Array.isArray(
|
|
117338
|
+
const payload2 = unwrapQueryKnowledges(raw);
|
|
117339
|
+
const rawOutput = Array.isArray(payload2.output) ? payload2.output : [];
|
|
117249
117340
|
return normalizeRagScores(rawOutput);
|
|
117250
117341
|
}
|
|
117251
117342
|
let output;
|
|
@@ -117255,28 +117346,24 @@ async function runRagQuery(options) {
|
|
|
117255
117346
|
} else {
|
|
117256
117347
|
output = await fetchKnowledgesOne(subQueries[0]);
|
|
117257
117348
|
}
|
|
117258
|
-
if (options.json) {
|
|
117259
|
-
console.log(
|
|
117260
|
-
JSON.stringify(
|
|
117261
|
-
{
|
|
117262
|
-
query: queryTxt,
|
|
117263
|
-
...multiKeyword ? { subQueries, mergedCap } : {},
|
|
117264
|
-
belongToId,
|
|
117265
|
-
tags: tagList,
|
|
117266
|
-
topK: clamped,
|
|
117267
|
-
output,
|
|
117268
|
-
partition
|
|
117269
|
-
},
|
|
117270
|
-
null,
|
|
117271
|
-
2
|
|
117272
|
-
)
|
|
117273
|
-
);
|
|
117274
|
-
return;
|
|
117275
|
-
}
|
|
117276
117349
|
if (output.length === 0) {
|
|
117277
117350
|
console.log("\n\u672A\u68C0\u7D22\u5230\u5339\u914D\u7247\u6BB5\uFF08\u53EF\u5C1D\u8BD5\u653E\u5BBD --top-k \u6216\u8C03\u6574\u5173\u952E\u8BCD/\u8303\u56F4\uFF09\u3002\n");
|
|
117278
117351
|
return;
|
|
117279
117352
|
}
|
|
117353
|
+
const payload = {
|
|
117354
|
+
query: queryTxt,
|
|
117355
|
+
belongToId,
|
|
117356
|
+
topK: clamped,
|
|
117357
|
+
multiKeyword,
|
|
117358
|
+
subQueries: multiKeyword ? subQueries : void 0,
|
|
117359
|
+
output
|
|
117360
|
+
};
|
|
117361
|
+
if (await emitCliJsonOrSnapshot(
|
|
117362
|
+
{ jsonOut: options.jsonOut },
|
|
117363
|
+
{ section: "rag-query", commandLabel: "rag query", payload }
|
|
117364
|
+
)) {
|
|
117365
|
+
return;
|
|
117366
|
+
}
|
|
117280
117367
|
const modeHint = multiKeyword ? ` \xB7 \u5206\u8BCD\u5408\u5E76\u2264${mergedCap}\u6761` : "";
|
|
117281
117368
|
const header = `> \u77E5\u8BC6\u5E93\u68C0\u7D22 \xB7 topK=${clamped}${modeHint} \xB7 \u7528\u4E8E\u5E7F\u544A\u6295\u653E/\u8D26\u6237\u5206\u6790\u4E1A\u52A1\u53C2\u8003
|
|
117282
117369
|
>
|
|
@@ -117367,29 +117454,17 @@ async function runRagList(options) {
|
|
|
117367
117454
|
if (options.ragOnly) {
|
|
117368
117455
|
folders = folders.filter((f) => f.ragStatus === true);
|
|
117369
117456
|
}
|
|
117370
|
-
if (options.json) {
|
|
117371
|
-
console.log(
|
|
117372
|
-
JSON.stringify(
|
|
117373
|
-
{
|
|
117374
|
-
belongToId,
|
|
117375
|
-
total: folders.length,
|
|
117376
|
-
folders: folders.map((f) => ({
|
|
117377
|
-
id: f.id,
|
|
117378
|
-
name: f.name,
|
|
117379
|
-
ragStatus: f.ragStatus,
|
|
117380
|
-
createTime: f.createTime
|
|
117381
|
-
}))
|
|
117382
|
-
},
|
|
117383
|
-
null,
|
|
117384
|
-
2
|
|
117385
|
-
)
|
|
117386
|
-
);
|
|
117387
|
-
return;
|
|
117388
|
-
}
|
|
117389
117457
|
if (folders.length === 0) {
|
|
117390
117458
|
console.log(options.ragOnly ? "\n\u6682\u65E0\u5DF2\u5EFA RAG \u7D22\u5F15\u7684\u77E5\u8BC6\u5E93\u3002\n" : "\n\u6682\u65E0\u77E5\u8BC6\u5E93\u6587\u4EF6\u5939\u3002\n");
|
|
117391
117459
|
return;
|
|
117392
117460
|
}
|
|
117461
|
+
const listPayload = { belongToId, ragOnly: Boolean(options.ragOnly), folders };
|
|
117462
|
+
if (await emitCliJsonOrSnapshot(
|
|
117463
|
+
{ jsonOut: options.jsonOut },
|
|
117464
|
+
{ section: "rag-list", commandLabel: "rag list", payload: listPayload }
|
|
117465
|
+
)) {
|
|
117466
|
+
return;
|
|
117467
|
+
}
|
|
117393
117468
|
const ragTag = (s) => s === true ? "\u2705 \u5DF2\u7D22\u5F15" : "\u2014";
|
|
117394
117469
|
const rows = folders.map((f) => ({
|
|
117395
117470
|
id: f.id,
|
|
@@ -117426,13 +117501,17 @@ function register22(program2) {
|
|
|
117426
117501
|
const ragCmd = program2.command("rag").description(
|
|
117427
117502
|
"RAG \u77E5\u8BC6\u5E93\u68C0\u7D22\uFF08\u534F\u52A9\u5E7F\u544A\u6295\u653E\u3001\u62D3\u8BCD\u3001\u8D26\u6237\u8BCA\u65AD\u4E0E\u62A5\u544A\uFF1B\u9ED8\u8BA4 belongToId=account/me \u7684 companyId\uFF09"
|
|
117428
117503
|
);
|
|
117429
|
-
ragCmd.command("list").description("\u5217\u51FA\u5F53\u524D\u4F01\u4E1A\u4E0B\u6240\u6709\u77E5\u8BC6\u5E93\u6587\u4EF6\u5939\uFF0C\u4F9B\u9009\u62E9\u5BA2\u6237/\u54C1\u724C\u68C0\u7D22\u8303\u56F4").option("--belong-to-id <id>", "\u4F01\u4E1A ID\uFF1B\u4E0D\u4F20\u5219\u4ECE GET /query/account/me \u53D6 companyId").option("--rag-only", "\u4EC5\u663E\u793A\u5DF2\u5EFA RAG \u5411\u91CF\u7D22\u5F15\uFF08ragStatus=true\uFF09\u7684\u77E5\u8BC6\u5E93", false).option("-t, --token <token>", "Token\uFF08\u53EF\u9009\uFF1B\u4F18\u5148\u4E8E ~/.siluzan/config.json\uFF09").option(
|
|
117504
|
+
ragCmd.command("list").description("\u5217\u51FA\u5F53\u524D\u4F01\u4E1A\u4E0B\u6240\u6709\u77E5\u8BC6\u5E93\u6587\u4EF6\u5939\uFF0C\u4F9B\u9009\u62E9\u5BA2\u6237/\u54C1\u724C\u68C0\u7D22\u8303\u56F4").option("--belong-to-id <id>", "\u4F01\u4E1A ID\uFF1B\u4E0D\u4F20\u5219\u4ECE GET /query/account/me \u53D6 companyId").option("--rag-only", "\u4EC5\u663E\u793A\u5DF2\u5EFA RAG \u5411\u91CF\u7D22\u5F15\uFF08ragStatus=true\uFF09\u7684\u77E5\u8BC6\u5E93", false).option("-t, --token <token>", "Token\uFF08\u53EF\u9009\uFF1B\u4F18\u5148\u4E8E ~/.siluzan/config.json\uFF09").option(
|
|
117505
|
+
"--json-out <path>",
|
|
117506
|
+
"\u843D\u76D8 JSON + outline + cli-manifest\uFF1Bstdout \u4E00\u884C\u6458\u8981",
|
|
117507
|
+
void 0
|
|
117508
|
+
).option("--verbose", "\u663E\u793A\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
117430
117509
|
async (opts) => {
|
|
117431
117510
|
await runRagList({
|
|
117432
117511
|
belongToId: opts.belongToId,
|
|
117433
117512
|
ragOnly: opts.ragOnly,
|
|
117434
117513
|
token: opts.token,
|
|
117435
|
-
|
|
117514
|
+
jsonOut: opts.jsonOut,
|
|
117436
117515
|
verbose: opts.verbose
|
|
117437
117516
|
});
|
|
117438
117517
|
}
|
|
@@ -117441,7 +117520,11 @@ function register22(program2) {
|
|
|
117441
117520
|
"--partition <wiki|default>",
|
|
117442
117521
|
"\u68C0\u7D22\u5206\u533A\uFF08queryknowledges \u7684 partition\uFF0C\u9ED8\u8BA4 default\uFF09",
|
|
117443
117522
|
"default"
|
|
117444
|
-
).option("-t, --token <token>", "Token\uFF08\u53EF\u9009\uFF1B\u4F18\u5148\u4E8E ~/.siluzan/config.json\uFF09").option(
|
|
117523
|
+
).option("-t, --token <token>", "Token\uFF08\u53EF\u9009\uFF1B\u4F18\u5148\u4E8E ~/.siluzan/config.json\uFF09").option(
|
|
117524
|
+
"--json-out <path>",
|
|
117525
|
+
"\u843D\u76D8 JSON + outline + cli-manifest\uFF1Bstdout \u4E00\u884C\u6458\u8981",
|
|
117526
|
+
void 0
|
|
117527
|
+
).option("--verbose", "\u663E\u793A\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
117445
117528
|
async (opts) => {
|
|
117446
117529
|
await runRagQuery({
|
|
117447
117530
|
query: opts.query,
|
|
@@ -117454,7 +117537,7 @@ function register22(program2) {
|
|
|
117454
117537
|
category: opts.category,
|
|
117455
117538
|
partition: opts.partition,
|
|
117456
117539
|
token: opts.token,
|
|
117457
|
-
|
|
117540
|
+
jsonOut: opts.jsonOut,
|
|
117458
117541
|
verbose: opts.verbose
|
|
117459
117542
|
});
|
|
117460
117543
|
}
|
|
@@ -118615,20 +118698,19 @@ function register23(program2) {
|
|
|
118615
118698
|
});
|
|
118616
118699
|
});
|
|
118617
118700
|
accountCmd.command("share-detail").description(
|
|
118618
|
-
"\u67E5\u770B\u8D26\u6237\u7684\u5206\u4EAB\u8BE6\u60C5\uFF08\u8BE5\u8D26\u6237\u88AB\u5206\u4EAB\u7ED9\u54EA\u4E9B\u7528\u6237\uFF09\n\n \u7528\u6CD5\u793A\u4F8B\uFF1A\n # \u5148\u7528 list-accounts \u62FF\u5230 mediaCustomerId\uFF0C\u518D\u67E5\u5206\u4EAB\u8BE6\u60C5\n siluzan-tso list-accounts -m Google --json\n siluzan-tso account share-detail -c <\u4ECE\u4E0A\u65B9 ma.mediaCustomerId \u590D\u5236>\n\n \u6CE8\u610F\uFF1A-c \u4F20\u7684\u662F mediaCustomerId\uFF08\u6570\u5B57 ID\uFF09\uFF0C\u4E0D\u662F entityId\uFF08UUID\uFF09"
|
|
118701
|
+
"\u67E5\u770B\u8D26\u6237\u7684\u5206\u4EAB\u8BE6\u60C5\uFF08\u8BE5\u8D26\u6237\u88AB\u5206\u4EAB\u7ED9\u54EA\u4E9B\u7528\u6237\uFF09\n\n \u7528\u6CD5\u793A\u4F8B\uFF1A\n # \u5148\u7528 list-accounts \u62FF\u5230 mediaCustomerId\uFF0C\u518D\u67E5\u5206\u4EAB\u8BE6\u60C5\n siluzan-tso list-accounts -m Google --json-out ./snap\n siluzan-tso account share-detail -c <\u4ECE\u4E0A\u65B9 ma.mediaCustomerId \u590D\u5236>\n\n \u6CE8\u610F\uFF1A-c \u4F20\u7684\u662F mediaCustomerId\uFF08\u6570\u5B57 ID\uFF09\uFF0C\u4E0D\u662F entityId\uFF08UUID\uFF09"
|
|
118619
118702
|
).requiredOption(
|
|
118620
118703
|
"-c, --customer-id <id>",
|
|
118621
118704
|
"\u8D26\u6237 mediaCustomerId\uFF08\u5FC5\u586B\uFF0C\u6570\u5B57 ID\uFF0C\u6765\u81EA list-accounts \u7684 ma.mediaCustomerId\uFF09"
|
|
118622
|
-
).option("-t, --token <token>", "Auth Token").option(
|
|
118705
|
+
).option("-t, --token <token>", "Auth Token").option(
|
|
118623
118706
|
"--json-out <path>",
|
|
118624
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
118707
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
118625
118708
|
void 0
|
|
118626
118709
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
118627
118710
|
async (opts) => {
|
|
118628
118711
|
await runAccountShareDetail({
|
|
118629
118712
|
token: opts.token,
|
|
118630
118713
|
mediaCustomerId: opts.customerId,
|
|
118631
|
-
json: opts.json,
|
|
118632
118714
|
jsonOut: opts.jsonOut,
|
|
118633
118715
|
verbose: opts.verbose
|
|
118634
118716
|
});
|
|
@@ -118643,9 +118725,9 @@ function register23(program2) {
|
|
|
118643
118725
|
accountCmd.command("mcc-bind").description("Google\uFF1A\u5C06\u5B50\u8D26\u6237\u7ED1\u5B9A\u5230\u7ECF\u7406\u8D26\u6237\uFF08MCC\uFF09\uFF0C\u9700\u5DF2\u914D\u7F6E googleApiUrl").requiredOption(
|
|
118644
118726
|
"--customers <ids>",
|
|
118645
118727
|
"\u5B50\u8D26\u6237 mediaCustomerId\uFF0C\u591A\u4E2A\u9017\u53F7\u5206\u9694\uFF08\u6765\u81EA list-accounts \u7684 ma.mediaCustomerId\uFF09"
|
|
118646
|
-
).requiredOption("--mcc <ids>", "\u7ECF\u7406\u8D26\u6237\uFF08MCC\uFF09\u5BA2\u6237 ID\uFF0C\u591A\u4E2A\u53EF\u7528\u9017\u53F7\u3001\u4E2D\u6587\u9017\u53F7\u6216\u5206\u53F7\u5206\u9694").option("-t, --token <token>", "Auth Token").option(
|
|
118728
|
+
).requiredOption("--mcc <ids>", "\u7ECF\u7406\u8D26\u6237\uFF08MCC\uFF09\u5BA2\u6237 ID\uFF0C\u591A\u4E2A\u53EF\u7528\u9017\u53F7\u3001\u4E2D\u6587\u9017\u53F7\u6216\u5206\u53F7\u5206\u9694").option("-t, --token <token>", "Auth Token").option(
|
|
118647
118729
|
"--json-out <path>",
|
|
118648
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
118730
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
118649
118731
|
void 0
|
|
118650
118732
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
118651
118733
|
async (opts) => {
|
|
@@ -118653,15 +118735,14 @@ function register23(program2) {
|
|
|
118653
118735
|
token: opts.token,
|
|
118654
118736
|
customers: opts.customers.split(",").map((s) => s.trim()).filter(Boolean),
|
|
118655
118737
|
mcc: opts.mcc,
|
|
118656
|
-
json: opts.json,
|
|
118657
118738
|
jsonOut: opts.jsonOut,
|
|
118658
118739
|
verbose: opts.verbose
|
|
118659
118740
|
});
|
|
118660
118741
|
}
|
|
118661
118742
|
);
|
|
118662
|
-
accountCmd.command("mcc-unbind").description("Google\uFF1A\u5C06\u5B50\u8D26\u6237\u4ECE\u6307\u5B9A MCC \u4E0B\u89E3\u7ED1\uFF0C\u9700\u5DF2\u914D\u7F6E googleApiUrl").requiredOption("--customers <ids>", "\u5B50\u8D26\u6237 mediaCustomerId\uFF0C\u591A\u4E2A\u9017\u53F7\u5206\u9694").requiredOption("--mcc <ids>", "\u8981\u89E3\u7ED1\u7684 MCC \u5BA2\u6237 ID\uFF0C\u591A\u4E2A\u53EF\u7528\u9017\u53F7\u3001\u4E2D\u6587\u9017\u53F7\u6216\u5206\u53F7\u5206\u9694").option("-t, --token <token>", "Auth Token").option(
|
|
118743
|
+
accountCmd.command("mcc-unbind").description("Google\uFF1A\u5C06\u5B50\u8D26\u6237\u4ECE\u6307\u5B9A MCC \u4E0B\u89E3\u7ED1\uFF0C\u9700\u5DF2\u914D\u7F6E googleApiUrl").requiredOption("--customers <ids>", "\u5B50\u8D26\u6237 mediaCustomerId\uFF0C\u591A\u4E2A\u9017\u53F7\u5206\u9694").requiredOption("--mcc <ids>", "\u8981\u89E3\u7ED1\u7684 MCC \u5BA2\u6237 ID\uFF0C\u591A\u4E2A\u53EF\u7528\u9017\u53F7\u3001\u4E2D\u6587\u9017\u53F7\u6216\u5206\u53F7\u5206\u9694").option("-t, --token <token>", "Auth Token").option(
|
|
118663
118744
|
"--json-out <path>",
|
|
118664
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
118745
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
118665
118746
|
void 0
|
|
118666
118747
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
118667
118748
|
async (opts) => {
|
|
@@ -118669,7 +118750,6 @@ function register23(program2) {
|
|
|
118669
118750
|
token: opts.token,
|
|
118670
118751
|
customers: opts.customers.split(",").map((s) => s.trim()).filter(Boolean),
|
|
118671
118752
|
mcc: opts.mcc,
|
|
118672
|
-
json: opts.json,
|
|
118673
118753
|
jsonOut: opts.jsonOut,
|
|
118674
118754
|
verbose: opts.verbose
|
|
118675
118755
|
});
|
|
@@ -118678,24 +118758,23 @@ function register23(program2) {
|
|
|
118678
118758
|
accountCmd.command("close").description("TikTok\uFF1A\u5173\u95ED\uFF08\u505C\u7528\uFF09\u5E7F\u544A\u8D26\u6237\uFF08\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\uFF0C\u8C28\u614E\u64CD\u4F5C\uFF09").requiredOption(
|
|
118679
118759
|
"--accounts <ids>",
|
|
118680
118760
|
"TikTok \u5E7F\u544A\u4E3B ID\uFF08mediaCustomerId\uFF0C\u4E0E list-accounts -m TikTok \u5217\u300C\u8D26\u6237ID\u300D\u4E00\u81F4\uFF09\uFF0C\u9017\u53F7\u5206\u9694\uFF1BCLI \u4F1A\u89E3\u6790 entityId \u5E76\u5148\u505A\u5173\u6237\u6821\u9A8C"
|
|
118681
|
-
).option("-t, --token <token>", "Auth Token").option(
|
|
118761
|
+
).option("-t, --token <token>", "Auth Token").option(
|
|
118682
118762
|
"--json-out <path>",
|
|
118683
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
118763
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
118684
118764
|
void 0
|
|
118685
118765
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
118686
118766
|
async (opts) => {
|
|
118687
118767
|
await runAccountClose({
|
|
118688
118768
|
token: opts.token,
|
|
118689
118769
|
accountIds: opts.accounts.split(",").map((s) => s.trim()).filter(Boolean),
|
|
118690
|
-
json: opts.json,
|
|
118691
118770
|
jsonOut: opts.jsonOut,
|
|
118692
118771
|
verbose: opts.verbose
|
|
118693
118772
|
});
|
|
118694
118773
|
}
|
|
118695
118774
|
);
|
|
118696
|
-
accountCmd.command("bm-bind").description("Meta\uFF1A\u5C06\u5E7F\u544A\u8D26\u6237\u7ED1\u5B9A\u5230 Business Manager\uFF08BM\uFF09").requiredOption("--account-id <id>", "Meta \u5E7F\u544A\u8D26\u6237 mediaCustomerId\uFF08\u6765\u81EA list-accounts\uFF09").requiredOption("--bm-id <id>", "Business Manager ID").option("--action-type <type>", "\u64CD\u4F5C\u7C7B\u578B\uFF08\u9ED8\u8BA4 bind\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
118775
|
+
accountCmd.command("bm-bind").description("Meta\uFF1A\u5C06\u5E7F\u544A\u8D26\u6237\u7ED1\u5B9A\u5230 Business Manager\uFF08BM\uFF09").requiredOption("--account-id <id>", "Meta \u5E7F\u544A\u8D26\u6237 mediaCustomerId\uFF08\u6765\u81EA list-accounts\uFF09").requiredOption("--bm-id <id>", "Business Manager ID").option("--action-type <type>", "\u64CD\u4F5C\u7C7B\u578B\uFF08\u9ED8\u8BA4 bind\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
118697
118776
|
"--json-out <path>",
|
|
118698
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
118777
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
118699
118778
|
void 0
|
|
118700
118779
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
118701
118780
|
async (opts) => {
|
|
@@ -118704,21 +118783,19 @@ function register23(program2) {
|
|
|
118704
118783
|
accountId: opts.accountId,
|
|
118705
118784
|
bmId: opts.bmId,
|
|
118706
118785
|
actionType: opts.actionType,
|
|
118707
|
-
json: opts.json,
|
|
118708
118786
|
jsonOut: opts.jsonOut,
|
|
118709
118787
|
verbose: opts.verbose
|
|
118710
118788
|
});
|
|
118711
118789
|
}
|
|
118712
118790
|
);
|
|
118713
|
-
accountCmd.command("withdraw-list").description("Google\uFF1A\u67E5\u8BE2\u88AB\u5C01\uFF08Suspended\uFF09\u5E7F\u544A\u8D26\u6237\u5217\u8868\uFF08\u53EF\u63D0\u73B0\u8D26\u6237\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
118791
|
+
accountCmd.command("withdraw-list").description("Google\uFF1A\u67E5\u8BE2\u88AB\u5C01\uFF08Suspended\uFF09\u5E7F\u544A\u8D26\u6237\u5217\u8868\uFF08\u53EF\u63D0\u73B0\u8D26\u6237\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
118714
118792
|
"--json-out <path>",
|
|
118715
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
118793
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
118716
118794
|
void 0
|
|
118717
118795
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
118718
118796
|
async (opts) => {
|
|
118719
118797
|
await runAccountWithdrawList({
|
|
118720
118798
|
token: opts.token,
|
|
118721
|
-
json: opts.json,
|
|
118722
118799
|
jsonOut: opts.jsonOut,
|
|
118723
118800
|
verbose: opts.verbose
|
|
118724
118801
|
});
|
|
@@ -118727,16 +118804,15 @@ function register23(program2) {
|
|
|
118727
118804
|
accountCmd.command("withdraw-submit").description("Google\uFF1A\u63D0\u4EA4\u88AB\u5C01\u8D26\u6237\u63D0\u73B0\u7533\u8BF7\uFF08\u81EA\u52A8\u67E5\u8BE2\u4F59\u989D\u548C\u7BA1\u7406\u8D39\uFF0C\u8BA1\u7B97\u63D0\u73B0\u91D1\u989D\uFF09").requiredOption(
|
|
118728
118805
|
"--accounts <entityIds>",
|
|
118729
118806
|
"\u8981\u63D0\u73B0\u7684\u8D26\u6237 entityId\uFF0C\u9017\u53F7\u5206\u9694\uFF08\u6765\u81EA account withdraw-list\uFF09"
|
|
118730
|
-
).option("-t, --token <token>", "Auth Token").option(
|
|
118807
|
+
).option("-t, --token <token>", "Auth Token").option(
|
|
118731
118808
|
"--json-out <path>",
|
|
118732
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
118809
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
118733
118810
|
void 0
|
|
118734
118811
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
118735
118812
|
async (opts) => {
|
|
118736
118813
|
await runAccountWithdrawSubmit({
|
|
118737
118814
|
token: opts.token,
|
|
118738
118815
|
accounts: opts.accounts.split(",").map((s) => s.trim()).filter(Boolean),
|
|
118739
|
-
json: opts.json,
|
|
118740
118816
|
jsonOut: opts.jsonOut,
|
|
118741
118817
|
verbose: opts.verbose
|
|
118742
118818
|
});
|
|
@@ -118745,9 +118821,9 @@ function register23(program2) {
|
|
|
118745
118821
|
accountCmd.command("bc-bind").description("TikTok\uFF1A\u5C06\u5E7F\u544A\u8D26\u6237\u7ED1\u5B9A\u5230 Business Center\uFF08BC\uFF09").requiredOption(
|
|
118746
118822
|
"--customers <ids>",
|
|
118747
118823
|
"TikTok \u5E7F\u544A\u8D26\u6237 mediaCustomerId\uFF0C\u591A\u4E2A\u9017\u53F7\u5206\u9694\uFF08\u6765\u81EA list-accounts -m TikTok\uFF09"
|
|
118748
|
-
).requiredOption("--bc-ids <ids>", "Business Center ID\uFF0C\u591A\u4E2A\u9017\u53F7\u5206\u9694").option("-t, --token <token>", "Auth Token").option(
|
|
118824
|
+
).requiredOption("--bc-ids <ids>", "Business Center ID\uFF0C\u591A\u4E2A\u9017\u53F7\u5206\u9694").option("-t, --token <token>", "Auth Token").option(
|
|
118749
118825
|
"--json-out <path>",
|
|
118750
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
118826
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
118751
118827
|
void 0
|
|
118752
118828
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
118753
118829
|
async (opts) => {
|
|
@@ -118755,15 +118831,14 @@ function register23(program2) {
|
|
|
118755
118831
|
token: opts.token,
|
|
118756
118832
|
customers: opts.customers.split(",").map((s) => s.trim()).filter(Boolean),
|
|
118757
118833
|
bcIds: opts.bcIds.split(",").map((s) => s.trim()).filter(Boolean),
|
|
118758
|
-
json: opts.json,
|
|
118759
118834
|
jsonOut: opts.jsonOut,
|
|
118760
118835
|
verbose: opts.verbose
|
|
118761
118836
|
});
|
|
118762
118837
|
}
|
|
118763
118838
|
);
|
|
118764
|
-
accountCmd.command("bc-unbind").description("TikTok\uFF1A\u5C06\u5E7F\u544A\u8D26\u6237\u4ECE Business Center\uFF08BC\uFF09\u4E0B\u89E3\u7ED1").requiredOption("--customers <ids>", "TikTok \u5E7F\u544A\u8D26\u6237 mediaCustomerId\uFF0C\u591A\u4E2A\u9017\u53F7\u5206\u9694").requiredOption("--bc-id <id>", "Business Center ID\uFF08\u4E00\u6B21\u53EA\u80FD\u89E3\u7ED1\u4E00\u4E2A BC\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
118839
|
+
accountCmd.command("bc-unbind").description("TikTok\uFF1A\u5C06\u5E7F\u544A\u8D26\u6237\u4ECE Business Center\uFF08BC\uFF09\u4E0B\u89E3\u7ED1").requiredOption("--customers <ids>", "TikTok \u5E7F\u544A\u8D26\u6237 mediaCustomerId\uFF0C\u591A\u4E2A\u9017\u53F7\u5206\u9694").requiredOption("--bc-id <id>", "Business Center ID\uFF08\u4E00\u6B21\u53EA\u80FD\u89E3\u7ED1\u4E00\u4E2A BC\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
118765
118840
|
"--json-out <path>",
|
|
118766
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
118841
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
118767
118842
|
void 0
|
|
118768
118843
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
118769
118844
|
async (opts) => {
|
|
@@ -118771,7 +118846,6 @@ function register23(program2) {
|
|
|
118771
118846
|
token: opts.token,
|
|
118772
118847
|
customers: opts.customers.split(",").map((s) => s.trim()).filter(Boolean),
|
|
118773
118848
|
bcId: opts.bcId,
|
|
118774
|
-
json: opts.json,
|
|
118775
118849
|
jsonOut: opts.jsonOut,
|
|
118776
118850
|
verbose: opts.verbose
|
|
118777
118851
|
});
|
|
@@ -118785,9 +118859,9 @@ function register23(program2) {
|
|
|
118785
118859
|
).option(
|
|
118786
118860
|
"--agent-type <type>",
|
|
118787
118861
|
"\u53EF\u9009\uFF0C\u90E8\u5206\u7F51\u5173\u9700\u8981\u65F6\u4F20\u5165\uFF08\u4E0E list-accounts \u4E2D ma.accountType \u4E00\u81F4\uFF09"
|
|
118788
|
-
).option("-t, --token <token>", "Auth Token").option(
|
|
118862
|
+
).option("-t, --token <token>", "Auth Token").option(
|
|
118789
118863
|
"--json-out <path>",
|
|
118790
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
118864
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
118791
118865
|
void 0
|
|
118792
118866
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
118793
118867
|
async (opts) => {
|
|
@@ -118795,7 +118869,6 @@ function register23(program2) {
|
|
|
118795
118869
|
token: opts.token,
|
|
118796
118870
|
customerId: opts.customerId,
|
|
118797
118871
|
agentType: opts.agentType,
|
|
118798
|
-
json: opts.json,
|
|
118799
118872
|
jsonOut: opts.jsonOut,
|
|
118800
118873
|
verbose: opts.verbose
|
|
118801
118874
|
});
|
|
@@ -118806,9 +118879,9 @@ function register23(program2) {
|
|
|
118806
118879
|
).requiredOption("-c, --customer-id <id>", "Google \u5E7F\u544A\u8D26\u6237 mediaCustomerId").requiredOption("--email <email>", "\u88AB\u6388\u6743\u7528\u6237\u7684\u90AE\u7BB1\u5730\u5740").requiredOption(
|
|
118807
118880
|
"--agent-type <type>",
|
|
118808
118881
|
"\u8D26\u6237\u4EE3\u7406\u7C7B\u578B\uFF08\u6765\u81EA list-accounts JSON \u4E2D ma.accountType \u5B57\u6BB5\uFF09"
|
|
118809
|
-
).option("--access-role <role>", "\u6743\u9650\u7C7B\u578B\uFF1AReadOnly | Standard\uFF08\u9ED8\u8BA4 Standard\uFF09", "Standard").option("-t, --token <token>", "Auth Token").option(
|
|
118882
|
+
).option("--access-role <role>", "\u6743\u9650\u7C7B\u578B\uFF1AReadOnly | Standard\uFF08\u9ED8\u8BA4 Standard\uFF09", "Standard").option("-t, --token <token>", "Auth Token").option(
|
|
118810
118883
|
"--json-out <path>",
|
|
118811
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
118884
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
118812
118885
|
void 0
|
|
118813
118886
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
118814
118887
|
async (opts) => {
|
|
@@ -118818,7 +118891,6 @@ function register23(program2) {
|
|
|
118818
118891
|
email: opts.email,
|
|
118819
118892
|
agentType: opts.agentType,
|
|
118820
118893
|
accessRole: opts.accessRole,
|
|
118821
|
-
json: opts.json,
|
|
118822
118894
|
jsonOut: opts.jsonOut,
|
|
118823
118895
|
verbose: opts.verbose
|
|
118824
118896
|
});
|
|
@@ -118826,14 +118898,14 @@ function register23(program2) {
|
|
|
118826
118898
|
);
|
|
118827
118899
|
accountCmd.command("email-deauth").description("Google\uFF1A\u89E3\u9664\u90AE\u7BB1\u6388\u6743\uFF08\u64A4\u9500\u5DF2\u53D1\u51FA\u7684\u6388\u6743\u9080\u8BF7\uFF09").requiredOption("-c, --customer-id <id>", "Google \u5E7F\u544A\u8D26\u6237 mediaCustomerId").requiredOption("--invitation-id <id>", "\u9080\u8BF7 ID\uFF08\u6765\u81EA account email-auth-list\uFF09").requiredOption("--agent-type <type>", "\u8D26\u6237\u4EE3\u7406\u7C7B\u578B").requiredOption(
|
|
118828
118900
|
"--resource-name <name>",
|
|
118829
|
-
"\u8D44\u6E90\u540D\u79F0\uFF08\u6765\u81EA account email-auth-list --json \u7684 resourceName \u5B57\u6BB5\uFF09"
|
|
118901
|
+
"\u8D44\u6E90\u540D\u79F0\uFF08\u6765\u81EA account email-auth-list --json-out \u7684 resourceName \u5B57\u6BB5\uFF09"
|
|
118830
118902
|
).option(
|
|
118831
118903
|
"--pending",
|
|
118832
118904
|
"\u9080\u8BF7\u4E3A\u5F85\u63A5\u53D7\uFF08Pending\uFF09\u65F6\u5FC5\u52A0\uFF1A\u8D70 RemoveCustomerUserAccessInvitation\uFF1B\u5DF2\u63A5\u53D7\uFF08Invited\uFF09\u65F6\u4E0D\u8981\u52A0",
|
|
118833
118905
|
false
|
|
118834
|
-
).option("-t, --token <token>", "Auth Token").option(
|
|
118906
|
+
).option("-t, --token <token>", "Auth Token").option(
|
|
118835
118907
|
"--json-out <path>",
|
|
118836
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
118908
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
118837
118909
|
void 0
|
|
118838
118910
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
118839
118911
|
async (opts) => {
|
|
@@ -118844,7 +118916,6 @@ function register23(program2) {
|
|
|
118844
118916
|
agentType: opts.agentType,
|
|
118845
118917
|
resourceName: opts.resourceName,
|
|
118846
118918
|
accepted: !opts.pending,
|
|
118847
|
-
json: opts.json,
|
|
118848
118919
|
jsonOut: opts.jsonOut,
|
|
118849
118920
|
verbose: opts.verbose
|
|
118850
118921
|
});
|
|
@@ -119342,21 +119413,43 @@ async function runOpenAccountKwai(opts) {
|
|
|
119342
119413
|
`);
|
|
119343
119414
|
process.exit(1);
|
|
119344
119415
|
}
|
|
119345
|
-
console.log(" \u6B63\u5728\u4E0A\u4F20\u8425\u4E1A\u6267\u7167\u5230
|
|
119416
|
+
console.log(" [1/3] \u6B63\u5728\u4E0A\u4F20\u8425\u4E1A\u6267\u7167\u5230 Siluzan \u5B58\u6863...");
|
|
119417
|
+
let imageId;
|
|
119418
|
+
let storageProvider;
|
|
119419
|
+
try {
|
|
119420
|
+
const uploaded = await uploadAttachment(
|
|
119421
|
+
opts.licenseFile,
|
|
119422
|
+
config.apiBaseUrl,
|
|
119423
|
+
config,
|
|
119424
|
+
opts.verbose
|
|
119425
|
+
);
|
|
119426
|
+
imageId = uploaded.id;
|
|
119427
|
+
storageProvider = uploaded.storageProvider;
|
|
119428
|
+
console.log(` Siluzan imageId: ${imageId}`);
|
|
119429
|
+
} catch (err) {
|
|
119430
|
+
console.error(
|
|
119431
|
+
`
|
|
119432
|
+
\u274C Siluzan \u5B58\u6863\u4E0A\u4F20\u5931\u8D25\uFF1A${err instanceof Error ? err.message : String(err)}
|
|
119433
|
+
`
|
|
119434
|
+
);
|
|
119435
|
+
process.exit(1);
|
|
119436
|
+
}
|
|
119437
|
+
console.log(" [2/3] \u6B63\u5728\u4E0A\u4F20\u8425\u4E1A\u6267\u7167\u5230 Kwai...");
|
|
119346
119438
|
let blobstoreKey;
|
|
119347
119439
|
try {
|
|
119348
119440
|
blobstoreKey = await uploadToKwai(opts.licenseFile, config.apiBaseUrl, config, opts.verbose);
|
|
119349
119441
|
} catch (err) {
|
|
119350
119442
|
console.error(`
|
|
119351
|
-
\u274C \u8425\u4E1A\u6267\u7167\u4E0A\u4F20\u5931\u8D25\uFF1A${err instanceof Error ? err.message : String(err)}
|
|
119443
|
+
\u274C Kwai \u8425\u4E1A\u6267\u7167\u4E0A\u4F20\u5931\u8D25\uFF1A${err instanceof Error ? err.message : String(err)}
|
|
119352
119444
|
`);
|
|
119353
119445
|
process.exit(1);
|
|
119354
119446
|
}
|
|
119355
|
-
console.log(`
|
|
119447
|
+
console.log(` Kwai blobstoreKey: ${blobstoreKey}`);
|
|
119448
|
+
console.log(" [3/3] \u6B63\u5728\u5173\u8054\u5E7F\u544A\u4E3B\u7EC4...");
|
|
119356
119449
|
const magKey = await resolveGenericMagKey(
|
|
119357
119450
|
config,
|
|
119358
119451
|
opts.companyName,
|
|
119359
|
-
{ ImageId:
|
|
119452
|
+
{ ImageId: imageId, StorageProvider: storageProvider },
|
|
119360
119453
|
opts.verbose,
|
|
119361
119454
|
opts.advertiserId
|
|
119362
119455
|
);
|
|
@@ -120024,15 +120117,14 @@ TikTok \u6CE8\u518C\u5730\u5217\u8868\uFF08\u7B2C 1 \u9875\uFF0C\u672C\u9875 ${r
|
|
|
120024
120117
|
// src/commands/open-account-register.ts
|
|
120025
120118
|
function register24(program2) {
|
|
120026
120119
|
const openAccountCmd = program2.command("open-account").description("\u5F00\u6237\u7533\u8BF7\uFF08Google / TikTok / Yandex / Bing / Kwai\uFF09");
|
|
120027
|
-
openAccountCmd.command("list-groups").description("\u67E5\u8BE2\u5E7F\u544A\u4E3B\u7EC4\u5217\u8868\uFF08\u83B7\u53D6\u5F00\u6237\u6240\u9700\u7684 --advertiser-id\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
120120
|
+
openAccountCmd.command("list-groups").description("\u67E5\u8BE2\u5E7F\u544A\u4E3B\u7EC4\u5217\u8868\uFF08\u83B7\u53D6\u5F00\u6237\u6240\u9700\u7684 --advertiser-id\uFF09").option("-t, --token <token>", "Auth Token").option(
|
|
120028
120121
|
"--json-out <path>",
|
|
120029
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
120122
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
120030
120123
|
void 0
|
|
120031
120124
|
).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
120032
120125
|
async (opts) => {
|
|
120033
120126
|
await runListAdvertiserGroups({
|
|
120034
120127
|
token: opts.token,
|
|
120035
|
-
json: opts.json,
|
|
120036
120128
|
jsonOut: opts.jsonOut,
|
|
120037
120129
|
verbose: opts.verbose
|
|
120038
120130
|
});
|
|
@@ -120073,76 +120165,71 @@ function register24(program2) {
|
|
|
120073
120165
|
});
|
|
120074
120166
|
}
|
|
120075
120167
|
);
|
|
120076
|
-
openAccountCmd.command("tiktok-timezones").description("\u5217\u51FA TikTok \u5F00\u6237\u53EF\u9009\u65F6\u533A\uFF08\u4E0E\u7F51\u9875 /openAnAccount TikTok \u65F6\u533A\u4E0B\u62C9\u540C\u4E00\u6570\u636E\u6E90\uFF09").option("-k, --keyword <text>", "\u6309 Code / \u540D\u79F0 / UTC \u504F\u79FB\u8FC7\u6EE4").option(
|
|
120168
|
+
openAccountCmd.command("tiktok-timezones").description("\u5217\u51FA TikTok \u5F00\u6237\u53EF\u9009\u65F6\u533A\uFF08\u4E0E\u7F51\u9875 /openAnAccount TikTok \u65F6\u533A\u4E0B\u62C9\u540C\u4E00\u6570\u636E\u6E90\uFF09").option("-k, --keyword <text>", "\u6309 Code / \u540D\u79F0 / UTC \u504F\u79FB\u8FC7\u6EE4").option(
|
|
120077
120169
|
"--json-out <path>",
|
|
120078
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
120170
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
120079
120171
|
void 0
|
|
120080
120172
|
).option("-t, --token <token>", "Auth Token").option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
120081
120173
|
async (opts) => {
|
|
120082
120174
|
await runOpenAccountTikTokTimezones({
|
|
120083
120175
|
token: opts.token,
|
|
120084
120176
|
keyword: opts.keyword,
|
|
120085
|
-
json: opts.json,
|
|
120086
120177
|
jsonOut: opts.jsonOut,
|
|
120087
120178
|
verbose: opts.verbose
|
|
120088
120179
|
});
|
|
120089
120180
|
}
|
|
120090
120181
|
);
|
|
120091
|
-
openAccountCmd.command("tiktok-industries").description("\u5217\u51FA TikTok \u884C\u4E1A\u5206\u7C7B\uFF08\u4E24\u7EA7\u7ED3\u6784\uFF0C--industry-id \u4F20\u53F6\u5B50\u8282\u70B9 ID\uFF09").option("-k, --keyword <text>", "\u6309\u884C\u4E1A\u540D\u79F0\u8FC7\u6EE4").option(
|
|
120182
|
+
openAccountCmd.command("tiktok-industries").description("\u5217\u51FA TikTok \u884C\u4E1A\u5206\u7C7B\uFF08\u4E24\u7EA7\u7ED3\u6784\uFF0C--industry-id \u4F20\u53F6\u5B50\u8282\u70B9 ID\uFF09").option("-k, --keyword <text>", "\u6309\u884C\u4E1A\u540D\u79F0\u8FC7\u6EE4").option(
|
|
120092
120183
|
"--json-out <path>",
|
|
120093
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
120184
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
120094
120185
|
void 0
|
|
120095
120186
|
).option("-t, --token <token>", "Auth Token").option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
120096
120187
|
async (opts) => {
|
|
120097
120188
|
await runOpenAccountTikTokIndustries({
|
|
120098
120189
|
token: opts.token,
|
|
120099
120190
|
keyword: opts.keyword,
|
|
120100
|
-
json: opts.json,
|
|
120101
120191
|
jsonOut: opts.jsonOut,
|
|
120102
120192
|
verbose: opts.verbose
|
|
120103
120193
|
});
|
|
120104
120194
|
}
|
|
120105
120195
|
);
|
|
120106
|
-
openAccountCmd.command("tiktok-areas").description("\u5217\u51FA TikTok \u6CE8\u518C\u5730\u4EE3\u7801\uFF08--registered-area \u4F20 Key \u503C\uFF0C\u5982 CN\uFF09").option("-k, --keyword <text>", "\u6309\u4EE3\u7801\u6216\u540D\u79F0\u8FC7\u6EE4").option(
|
|
120196
|
+
openAccountCmd.command("tiktok-areas").description("\u5217\u51FA TikTok \u6CE8\u518C\u5730\u4EE3\u7801\uFF08--registered-area \u4F20 Key \u503C\uFF0C\u5982 CN\uFF09").option("-k, --keyword <text>", "\u6309\u4EE3\u7801\u6216\u540D\u79F0\u8FC7\u6EE4").option(
|
|
120107
120197
|
"--json-out <path>",
|
|
120108
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
120198
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
120109
120199
|
void 0
|
|
120110
120200
|
).option("-t, --token <token>", "Auth Token").option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
120111
120201
|
async (opts) => {
|
|
120112
120202
|
await runOpenAccountTikTokAreas({
|
|
120113
120203
|
token: opts.token,
|
|
120114
120204
|
keyword: opts.keyword,
|
|
120115
|
-
json: opts.json,
|
|
120116
120205
|
jsonOut: opts.jsonOut,
|
|
120117
120206
|
verbose: opts.verbose
|
|
120118
120207
|
});
|
|
120119
120208
|
}
|
|
120120
120209
|
);
|
|
120121
|
-
openAccountCmd.command("bing-industries").description("\u5217\u51FA BingV2 \u884C\u4E1A\u5206\u7C7B\uFF08\u5C06 name \u503C\u4F20\u7ED9 open-account bing \u7684 --trade-id\uFF09").option("-k, --keyword <text>", "\u6309\u4E2D\u6587\u540D\u6216\u82F1\u6587\u540D\u8FC7\u6EE4").option(
|
|
120210
|
+
openAccountCmd.command("bing-industries").description("\u5217\u51FA BingV2 \u884C\u4E1A\u5206\u7C7B\uFF08\u5C06 name \u503C\u4F20\u7ED9 open-account bing \u7684 --trade-id\uFF09").option("-k, --keyword <text>", "\u6309\u4E2D\u6587\u540D\u6216\u82F1\u6587\u540D\u8FC7\u6EE4").option(
|
|
120122
120211
|
"--json-out <path>",
|
|
120123
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
120212
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
120124
120213
|
void 0
|
|
120125
120214
|
).option("-t, --token <token>", "Auth Token").option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
120126
120215
|
async (opts) => {
|
|
120127
120216
|
await runOpenAccountBingIndustries({
|
|
120128
120217
|
token: opts.token,
|
|
120129
120218
|
keyword: opts.keyword,
|
|
120130
|
-
json: opts.json,
|
|
120131
120219
|
jsonOut: opts.jsonOut,
|
|
120132
120220
|
verbose: opts.verbose
|
|
120133
120221
|
});
|
|
120134
120222
|
}
|
|
120135
120223
|
);
|
|
120136
|
-
openAccountCmd.command("google-timezones").description("\u5217\u51FA Google \u5F00\u6237\u53EF\u9009\u65F6\u533A\uFF08\u4E0E\u7F51\u9875 /openAnAccount \u7B2C\u4E8C\u6B65\u4E0B\u62C9\u91CC\u6570\u636E\u6E90\u4E00\u81F4\uFF09").option("-k, --keyword <text>", "\u6309 Code / \u540D\u79F0 / UTC \u8BF4\u660E\u8FC7\u6EE4").option(
|
|
120224
|
+
openAccountCmd.command("google-timezones").description("\u5217\u51FA Google \u5F00\u6237\u53EF\u9009\u65F6\u533A\uFF08\u4E0E\u7F51\u9875 /openAnAccount \u7B2C\u4E8C\u6B65\u4E0B\u62C9\u91CC\u6570\u636E\u6E90\u4E00\u81F4\uFF09").option("-k, --keyword <text>", "\u6309 Code / \u540D\u79F0 / UTC \u8BF4\u660E\u8FC7\u6EE4").option(
|
|
120137
120225
|
"--json-out <path>",
|
|
120138
|
-
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\
|
|
120226
|
+
"\u843D\u76D8\uFF08\u76EE\u5F55\u6216 *.json \u6587\u4EF6\u8DEF\u5F84\uFF09\u5E76\u66F4\u65B0 cli-manifest[-<\u67E5\u8BE2id>].json\uFF1B\u76EE\u5F55\u6A21\u5F0F\u6587\u4EF6\u540D\u4E3A `<section>[-<\u67E5\u8BE2id>].json`\uFF1Bstdout \u4E00\u884C\u6458\u8981 JSON\uFF0C\u542B outlineFile\uFF08TS \u5F0F\u7C7B\u578B\u5728 `*.outline.txt`\uFF09",
|
|
120139
120227
|
void 0
|
|
120140
120228
|
).option("-t, --token <token>", "Auth Token").option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
|
|
120141
120229
|
async (opts) => {
|
|
120142
120230
|
await runOpenAccountGoogleTimezones({
|
|
120143
120231
|
token: opts.token,
|
|
120144
120232
|
keyword: opts.keyword,
|
|
120145
|
-
json: opts.json,
|
|
120146
120233
|
jsonOut: opts.jsonOut,
|
|
120147
120234
|
verbose: opts.verbose
|
|
120148
120235
|
});
|
|
@@ -120247,6 +120334,7 @@ function register25(program2) {
|
|
|
120247
120334
|
init_google_analysis3();
|
|
120248
120335
|
init_google_analysis_batch();
|
|
120249
120336
|
init_version();
|
|
120337
|
+
init_cli_json_snapshot();
|
|
120250
120338
|
installProcessHandlers();
|
|
120251
120339
|
function getVersion() {
|
|
120252
120340
|
try {
|
|
@@ -120264,6 +120352,9 @@ program.name("siluzan-tso").description(
|
|
|
120264
120352
|
).version(getVersion());
|
|
120265
120353
|
program.option("--commit <text>", "\u5199\u64CD\u4F5C\u8BF4\u660E\uFF1B\u8BB0\u5165\u672C\u673A\u5199\u5BA1\u8BA1 JSONL");
|
|
120266
120354
|
program.hook("preAction", async () => {
|
|
120355
|
+
if (process.argv.includes("--json")) {
|
|
120356
|
+
rejectDeprecatedJsonFlag(true, process.argv[2] ?? "siluzan-tso");
|
|
120357
|
+
}
|
|
120267
120358
|
setWriteAuditCliCommit(extractCommitFromArgv(process.argv.slice(2)));
|
|
120268
120359
|
setCliInvocationForAudit(process.argv.slice(2));
|
|
120269
120360
|
const activeCmd = process.argv[2];
|
|
@@ -120302,4 +120393,10 @@ var REGISTRARS = [
|
|
|
120302
120393
|
register25
|
|
120303
120394
|
];
|
|
120304
120395
|
for (const reg of REGISTRARS) reg(program);
|
|
120396
|
+
function argvHasDeprecatedJsonFlag(argv) {
|
|
120397
|
+
return argv.some((a) => a === "--json" || a.startsWith("--json="));
|
|
120398
|
+
}
|
|
120399
|
+
if (argvHasDeprecatedJsonFlag(process.argv)) {
|
|
120400
|
+
rejectDeprecatedJsonFlag(true, process.argv[2] ?? "siluzan-tso");
|
|
120401
|
+
}
|
|
120305
120402
|
program.parseAsync();
|