@gpc-cli/cli 0.1.3 → 0.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -21
- package/dist/{apps-BBYNHB2H.js → apps-TZG5GEDW.js} +9 -7
- package/dist/apps-TZG5GEDW.js.map +1 -0
- package/dist/{auth-T7IDSMVX.js → auth-CIITFC3C.js} +4 -2
- package/dist/auth-CIITFC3C.js.map +1 -0
- package/dist/bin.js +1 -1
- package/dist/bin.js.map +1 -1
- package/dist/{chunk-IVVT73IP.js → chunk-22DW4R5W.js} +31 -26
- package/dist/chunk-22DW4R5W.js.map +1 -0
- package/dist/{chunk-4QV4WD3F.js → chunk-Q7KVGI46.js} +9 -7
- package/dist/chunk-Q7KVGI46.js.map +1 -0
- package/dist/{chunk-QMKZYXDJ.js → chunk-Y3QZDAKS.js} +2 -2
- package/dist/chunk-Y3QZDAKS.js.map +1 -0
- package/dist/{completion-U44CGHRH.js → completion-IHVLP7OK.js} +1 -1
- package/dist/completion-IHVLP7OK.js.map +1 -0
- package/dist/{config-K7UJKIXT.js → config-7QKUVNZZ.js} +8 -4
- package/dist/config-7QKUVNZZ.js.map +1 -0
- package/dist/{doctor-VDDUPTIM.js → doctor-KVP7PGZU.js} +5 -3
- package/dist/doctor-KVP7PGZU.js.map +1 -0
- package/dist/{iap-QIV4CXKZ.js → iap-Z365AMDD.js} +37 -25
- package/dist/iap-Z365AMDD.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/{listings-PF5FDXKQ.js → listings-U3T6NFVH.js} +128 -68
- package/dist/listings-U3T6NFVH.js.map +1 -0
- package/dist/{pricing-S4SB5FXJ.js → pricing-LXIRB4R7.js} +21 -15
- package/dist/pricing-LXIRB4R7.js.map +1 -0
- package/dist/{prompt-VP5LURRP.js → prompt-ASDQX6LZ.js} +2 -2
- package/dist/{publish-3BAIN4NQ.js → publish-HKOJVZ23.js} +27 -16
- package/dist/publish-HKOJVZ23.js.map +1 -0
- package/dist/{purchases-E6A2T5WQ.js → purchases-ZQ7FXEZQ.js} +84 -49
- package/dist/purchases-ZQ7FXEZQ.js.map +1 -0
- package/dist/{releases-464IMEEF.js → releases-IZJJYTNZ.js} +103 -51
- package/dist/releases-IZJJYTNZ.js.map +1 -0
- package/dist/{reports-3YAD4U4F.js → reports-43OVCCU3.js} +83 -29
- package/dist/reports-43OVCCU3.js.map +1 -0
- package/dist/{reviews-2CLM53E3.js → reviews-T3SRAZLW.js} +25 -16
- package/dist/reviews-T3SRAZLW.js.map +1 -0
- package/dist/{status-M7U3YNMU.js → status-TBPVS7YR.js} +5 -3
- package/dist/status-TBPVS7YR.js.map +1 -0
- package/dist/{subscriptions-PUHH4FBB.js → subscriptions-UJUX3ELS.js} +201 -130
- package/dist/subscriptions-UJUX3ELS.js.map +1 -0
- package/dist/{testers-WWZMLB7J.js → testers-YNOGFHUR.js} +81 -44
- package/dist/testers-YNOGFHUR.js.map +1 -0
- package/dist/{tracks-427E34S3.js → tracks-HMJ3F55N.js} +5 -3
- package/dist/tracks-HMJ3F55N.js.map +1 -0
- package/dist/{users-E5Y5HI6K.js → users-GRQTY6HY.js} +48 -28
- package/dist/users-GRQTY6HY.js.map +1 -0
- package/dist/{vitals-YMZMUPNA.js → vitals-VP2GKG3G.js} +23 -9
- package/dist/vitals-VP2GKG3G.js.map +1 -0
- package/package.json +6 -6
- package/dist/apps-BBYNHB2H.js.map +0 -1
- package/dist/auth-T7IDSMVX.js.map +0 -1
- package/dist/chunk-4QV4WD3F.js.map +0 -1
- package/dist/chunk-IVVT73IP.js.map +0 -1
- package/dist/chunk-QMKZYXDJ.js.map +0 -1
- package/dist/completion-U44CGHRH.js.map +0 -1
- package/dist/config-K7UJKIXT.js.map +0 -1
- package/dist/doctor-VDDUPTIM.js.map +0 -1
- package/dist/iap-QIV4CXKZ.js.map +0 -1
- package/dist/listings-PF5FDXKQ.js.map +0 -1
- package/dist/pricing-S4SB5FXJ.js.map +0 -1
- package/dist/publish-3BAIN4NQ.js.map +0 -1
- package/dist/purchases-E6A2T5WQ.js.map +0 -1
- package/dist/releases-464IMEEF.js.map +0 -1
- package/dist/reports-3YAD4U4F.js.map +0 -1
- package/dist/reviews-2CLM53E3.js.map +0 -1
- package/dist/status-M7U3YNMU.js.map +0 -1
- package/dist/subscriptions-PUHH4FBB.js.map +0 -1
- package/dist/testers-WWZMLB7J.js.map +0 -1
- package/dist/tracks-427E34S3.js.map +0 -1
- package/dist/users-E5Y5HI6K.js.map +0 -1
- package/dist/vitals-YMZMUPNA.js.map +0 -1
- /package/dist/{prompt-VP5LURRP.js.map → prompt-ASDQX6LZ.js.map} +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
isInteractive,
|
|
4
4
|
requireOption
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-Q7KVGI46.js";
|
|
6
6
|
|
|
7
7
|
// src/commands/reports.ts
|
|
8
8
|
import { loadConfig } from "@gpc-cli/config";
|
|
@@ -37,21 +37,34 @@ function registerReportsCommands(program) {
|
|
|
37
37
|
const interactive = isInteractive(program);
|
|
38
38
|
const now = /* @__PURE__ */ new Date();
|
|
39
39
|
const defaultMonth = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}`;
|
|
40
|
-
options.month = await requireOption(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
options.month = await requireOption(
|
|
41
|
+
"month",
|
|
42
|
+
options.month,
|
|
43
|
+
{
|
|
44
|
+
message: "Report month (YYYY-MM):",
|
|
45
|
+
default: defaultMonth
|
|
46
|
+
},
|
|
47
|
+
interactive
|
|
48
|
+
);
|
|
44
49
|
if (!isValidReportType(reportType)) {
|
|
45
|
-
console.error(
|
|
50
|
+
console.error(
|
|
51
|
+
`Error: Invalid report type "${reportType}". Valid types: earnings, sales, estimated_sales, installs, crashes, ratings, reviews, store_performance, subscriptions, play_balance`
|
|
52
|
+
);
|
|
46
53
|
process.exit(2);
|
|
47
54
|
}
|
|
48
55
|
const config = await loadConfig();
|
|
49
|
-
const packageName = resolvePackageName(program.opts()
|
|
56
|
+
const packageName = resolvePackageName(program.opts()["app"], config);
|
|
50
57
|
const client = await getClient(config);
|
|
51
58
|
const format = detectOutputFormat();
|
|
52
59
|
try {
|
|
53
60
|
const { year, month } = parseMonth(options.month);
|
|
54
|
-
const result = await listReports(
|
|
61
|
+
const result = await listReports(
|
|
62
|
+
client,
|
|
63
|
+
packageName,
|
|
64
|
+
reportType,
|
|
65
|
+
year,
|
|
66
|
+
month
|
|
67
|
+
);
|
|
55
68
|
console.log(formatOutput(result, format));
|
|
56
69
|
} catch (error) {
|
|
57
70
|
console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
@@ -63,20 +76,33 @@ function registerReportsCommands(program) {
|
|
|
63
76
|
const interactive = isInteractive(program);
|
|
64
77
|
const now = /* @__PURE__ */ new Date();
|
|
65
78
|
const defaultMonth = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}`;
|
|
66
|
-
options.month = await requireOption(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
79
|
+
options.month = await requireOption(
|
|
80
|
+
"month",
|
|
81
|
+
options.month,
|
|
82
|
+
{
|
|
83
|
+
message: "Report month (YYYY-MM):",
|
|
84
|
+
default: defaultMonth
|
|
85
|
+
},
|
|
86
|
+
interactive
|
|
87
|
+
);
|
|
70
88
|
if (!isFinancialReportType(options.type)) {
|
|
71
|
-
console.error(
|
|
89
|
+
console.error(
|
|
90
|
+
`Error: Invalid financial report type "${options.type}". Valid types: earnings, sales, estimated_sales, play_balance`
|
|
91
|
+
);
|
|
72
92
|
process.exit(2);
|
|
73
93
|
}
|
|
74
94
|
const config = await loadConfig();
|
|
75
|
-
const packageName = resolvePackageName(program.opts()
|
|
95
|
+
const packageName = resolvePackageName(program.opts()["app"], config);
|
|
76
96
|
const client = await getClient(config);
|
|
77
97
|
try {
|
|
78
98
|
const { year, month } = parseMonth(options.month);
|
|
79
|
-
const csv = await downloadReport(
|
|
99
|
+
const csv = await downloadReport(
|
|
100
|
+
client,
|
|
101
|
+
packageName,
|
|
102
|
+
options.type,
|
|
103
|
+
year,
|
|
104
|
+
month
|
|
105
|
+
);
|
|
80
106
|
if (options.outputFile) {
|
|
81
107
|
await writeFile(options.outputFile, csv, "utf-8");
|
|
82
108
|
console.log(`Report saved to ${options.outputFile}`);
|
|
@@ -88,29 +114,57 @@ function registerReportsCommands(program) {
|
|
|
88
114
|
process.exit(4);
|
|
89
115
|
}
|
|
90
116
|
});
|
|
91
|
-
download.command("stats").description("Download a stats report").option("--month <YYYY-MM>", "Report month (e.g., 2026-03)").option(
|
|
117
|
+
download.command("stats").description("Download a stats report").option("--month <YYYY-MM>", "Report month (e.g., 2026-03)").option(
|
|
118
|
+
"--type <report-type>",
|
|
119
|
+
"Report type (installs, crashes, ratings, reviews, store_performance, subscriptions)"
|
|
120
|
+
).option("--output-file <path>", "Save to file instead of stdout").action(async (options) => {
|
|
92
121
|
const interactive = isInteractive(program);
|
|
93
122
|
const now = /* @__PURE__ */ new Date();
|
|
94
123
|
const defaultMonth = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}`;
|
|
95
|
-
const statsTypes = [
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
124
|
+
const statsTypes = [
|
|
125
|
+
"installs",
|
|
126
|
+
"crashes",
|
|
127
|
+
"ratings",
|
|
128
|
+
"reviews",
|
|
129
|
+
"store_performance",
|
|
130
|
+
"subscriptions"
|
|
131
|
+
];
|
|
132
|
+
options.month = await requireOption(
|
|
133
|
+
"month",
|
|
134
|
+
options.month,
|
|
135
|
+
{
|
|
136
|
+
message: "Report month (YYYY-MM):",
|
|
137
|
+
default: defaultMonth
|
|
138
|
+
},
|
|
139
|
+
interactive
|
|
140
|
+
);
|
|
141
|
+
options.type = await requireOption(
|
|
142
|
+
"type",
|
|
143
|
+
options.type,
|
|
144
|
+
{
|
|
145
|
+
message: "Stats report type:",
|
|
146
|
+
choices: statsTypes
|
|
147
|
+
},
|
|
148
|
+
interactive
|
|
149
|
+
);
|
|
104
150
|
if (!isStatsReportType(options.type)) {
|
|
105
|
-
console.error(
|
|
151
|
+
console.error(
|
|
152
|
+
`Error: Invalid stats report type "${options.type}". Valid types: installs, crashes, ratings, reviews, store_performance, subscriptions`
|
|
153
|
+
);
|
|
106
154
|
process.exit(2);
|
|
107
155
|
}
|
|
108
156
|
const config = await loadConfig();
|
|
109
|
-
const packageName = resolvePackageName(program.opts()
|
|
157
|
+
const packageName = resolvePackageName(program.opts()["app"], config);
|
|
110
158
|
const client = await getClient(config);
|
|
111
159
|
try {
|
|
112
160
|
const { year, month } = parseMonth(options.month);
|
|
113
|
-
const csv = await downloadReport(
|
|
161
|
+
const csv = await downloadReport(
|
|
162
|
+
client,
|
|
163
|
+
packageName,
|
|
164
|
+
options.type,
|
|
165
|
+
year,
|
|
166
|
+
month
|
|
167
|
+
);
|
|
114
168
|
if (options.outputFile) {
|
|
115
169
|
await writeFile(options.outputFile, csv, "utf-8");
|
|
116
170
|
console.log(`Report saved to ${options.outputFile}`);
|
|
@@ -126,4 +180,4 @@ function registerReportsCommands(program) {
|
|
|
126
180
|
export {
|
|
127
181
|
registerReportsCommands
|
|
128
182
|
};
|
|
129
|
-
//# sourceMappingURL=reports-
|
|
183
|
+
//# sourceMappingURL=reports-43OVCCU3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/reports.ts"],"sourcesContent":["import type { Command } from \"commander\";\nimport type { GpcConfig } from \"@gpc-cli/config\";\nimport { loadConfig } from \"@gpc-cli/config\";\nimport { resolveAuth } from \"@gpc-cli/auth\";\nimport { createApiClient } from \"@gpc-cli/api\";\nimport {\n listReports,\n downloadReport,\n parseMonth,\n isValidReportType,\n isFinancialReportType,\n isStatsReportType,\n detectOutputFormat,\n formatOutput,\n} from \"@gpc-cli/core\";\nimport type { ReportType } from \"@gpc-cli/api\";\nimport { writeFile } from \"node:fs/promises\";\nimport { isInteractive, requireOption } from \"../prompt.js\";\n\nfunction resolvePackageName(packageArg: string | undefined, config: GpcConfig): string {\n const name = packageArg || config.app;\n if (!name) {\n console.error(\"Error: No package name. Use --app <package> or gpc config set app <package>\");\n process.exit(2);\n }\n return name;\n}\n\nasync function getClient(config: GpcConfig) {\n const auth = await resolveAuth({ serviceAccountPath: config.auth?.serviceAccount });\n return createApiClient({ auth });\n}\n\nexport function registerReportsCommands(program: Command): void {\n const reports = program.command(\"reports\").description(\"Download financial and stats reports\");\n\n reports\n .command(\"list <report-type>\")\n .description(\"List available report buckets\")\n .option(\"--month <YYYY-MM>\", \"Report month (e.g., 2026-03)\")\n .action(async (reportType: string, options) => {\n const interactive = isInteractive(program);\n const now = new Date();\n const defaultMonth = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, \"0\")}`;\n\n options.month = await requireOption(\n \"month\",\n options.month,\n {\n message: \"Report month (YYYY-MM):\",\n default: defaultMonth,\n },\n interactive,\n );\n\n if (!isValidReportType(reportType)) {\n console.error(\n `Error: Invalid report type \"${reportType}\". Valid types: earnings, sales, estimated_sales, installs, crashes, ratings, reviews, store_performance, subscriptions, play_balance`,\n );\n process.exit(2);\n }\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n const format = detectOutputFormat();\n\n try {\n const { year, month } = parseMonth(options.month);\n const result = await listReports(\n client,\n packageName,\n reportType as ReportType,\n year,\n month,\n );\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n const download = reports.command(\"download\").description(\"Download a report\");\n\n download\n .command(\"financial\")\n .description(\"Download a financial report\")\n .option(\"--month <YYYY-MM>\", \"Report month (e.g., 2026-03)\")\n .option(\"--type <report-type>\", \"Report type\", \"earnings\")\n .option(\"--output-file <path>\", \"Save to file instead of stdout\")\n .action(async (options) => {\n const interactive = isInteractive(program);\n const now = new Date();\n const defaultMonth = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, \"0\")}`;\n\n options.month = await requireOption(\n \"month\",\n options.month,\n {\n message: \"Report month (YYYY-MM):\",\n default: defaultMonth,\n },\n interactive,\n );\n\n if (!isFinancialReportType(options.type)) {\n console.error(\n `Error: Invalid financial report type \"${options.type}\". Valid types: earnings, sales, estimated_sales, play_balance`,\n );\n process.exit(2);\n }\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n\n try {\n const { year, month } = parseMonth(options.month);\n const csv = await downloadReport(\n client,\n packageName,\n options.type as ReportType,\n year,\n month,\n );\n if (options.outputFile) {\n await writeFile(options.outputFile, csv, \"utf-8\");\n console.log(`Report saved to ${options.outputFile}`);\n } else {\n console.log(csv);\n }\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n download\n .command(\"stats\")\n .description(\"Download a stats report\")\n .option(\"--month <YYYY-MM>\", \"Report month (e.g., 2026-03)\")\n .option(\n \"--type <report-type>\",\n \"Report type (installs, crashes, ratings, reviews, store_performance, subscriptions)\",\n )\n .option(\"--output-file <path>\", \"Save to file instead of stdout\")\n .action(async (options) => {\n const interactive = isInteractive(program);\n const now = new Date();\n const defaultMonth = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, \"0\")}`;\n const statsTypes = [\n \"installs\",\n \"crashes\",\n \"ratings\",\n \"reviews\",\n \"store_performance\",\n \"subscriptions\",\n ];\n\n options.month = await requireOption(\n \"month\",\n options.month,\n {\n message: \"Report month (YYYY-MM):\",\n default: defaultMonth,\n },\n interactive,\n );\n\n options.type = await requireOption(\n \"type\",\n options.type,\n {\n message: \"Stats report type:\",\n choices: statsTypes,\n },\n interactive,\n );\n\n if (!isStatsReportType(options.type)) {\n console.error(\n `Error: Invalid stats report type \"${options.type}\". Valid types: installs, crashes, ratings, reviews, store_performance, subscriptions`,\n );\n process.exit(2);\n }\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n\n try {\n const { year, month } = parseMonth(options.month);\n const csv = await downloadReport(\n client,\n packageName,\n options.type as ReportType,\n year,\n month,\n );\n if (options.outputFile) {\n await writeFile(options.outputFile, csv, \"utf-8\");\n console.log(`Report saved to ${options.outputFile}`);\n } else {\n console.log(csv);\n }\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n}\n"],"mappings":";;;;;;;AAEA,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,iBAAiB;AAG1B,SAAS,mBAAmB,YAAgC,QAA2B;AACrF,QAAM,OAAO,cAAc,OAAO;AAClC,MAAI,CAAC,MAAM;AACT,YAAQ,MAAM,6EAA6E;AAC3F,YAAQ,KAAK,CAAC;AAAA,EAChB;AACA,SAAO;AACT;AAEA,eAAe,UAAU,QAAmB;AAC1C,QAAM,OAAO,MAAM,YAAY,EAAE,oBAAoB,OAAO,MAAM,eAAe,CAAC;AAClF,SAAO,gBAAgB,EAAE,KAAK,CAAC;AACjC;AAEO,SAAS,wBAAwB,SAAwB;AAC9D,QAAM,UAAU,QAAQ,QAAQ,SAAS,EAAE,YAAY,sCAAsC;AAE7F,UACG,QAAQ,oBAAoB,EAC5B,YAAY,+BAA+B,EAC3C,OAAO,qBAAqB,8BAA8B,EAC1D,OAAO,OAAO,YAAoB,YAAY;AAC7C,UAAM,cAAc,cAAc,OAAO;AACzC,UAAM,MAAM,oBAAI,KAAK;AACrB,UAAM,eAAe,GAAG,IAAI,YAAY,CAAC,IAAI,OAAO,IAAI,SAAS,IAAI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|
6
6
|
import {
|
|
7
7
|
isInteractive,
|
|
8
8
|
requireOption
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-Q7KVGI46.js";
|
|
10
10
|
|
|
11
11
|
// src/commands/reviews.ts
|
|
12
12
|
import { loadConfig } from "@gpc-cli/config";
|
|
@@ -36,7 +36,7 @@ function registerReviewsCommands(program) {
|
|
|
36
36
|
const reviews = program.command("reviews").description("Manage user reviews and ratings");
|
|
37
37
|
reviews.command("list").description("List user reviews").option("--stars <n>", "Filter by star rating (1-5)", parseInt).option("--lang <code>", "Filter by reviewer language").option("--since <date>", "Filter reviews after date (ISO 8601)").option("--translate-to <lang>", "Translate reviews to language").option("--max <n>", "Maximum number of reviews per page", parseInt).option("--limit <n>", "Maximum total results", parseInt).option("--next-page <token>", "Resume from page token").action(async (options) => {
|
|
38
38
|
const config = await loadConfig();
|
|
39
|
-
const packageName = resolvePackageName(program.opts()
|
|
39
|
+
const packageName = resolvePackageName(program.opts()["app"], config);
|
|
40
40
|
const client = await getClient(config);
|
|
41
41
|
const format = detectOutputFormat();
|
|
42
42
|
try {
|
|
@@ -57,7 +57,7 @@ function registerReviewsCommands(program) {
|
|
|
57
57
|
});
|
|
58
58
|
reviews.command("get <review-id>").description("Get a single review").option("--translate-to <lang>", "Translate review to language").action(async (reviewId, options) => {
|
|
59
59
|
const config = await loadConfig();
|
|
60
|
-
const packageName = resolvePackageName(program.opts()
|
|
60
|
+
const packageName = resolvePackageName(program.opts()["app"], config);
|
|
61
61
|
const client = await getClient(config);
|
|
62
62
|
const format = detectOutputFormat();
|
|
63
63
|
try {
|
|
@@ -70,19 +70,28 @@ function registerReviewsCommands(program) {
|
|
|
70
70
|
});
|
|
71
71
|
reviews.command("reply <review-id>").description("Reply to a review").option("--text <text>", "Reply text (max 350 chars)").action(async (reviewId, options) => {
|
|
72
72
|
const config = await loadConfig();
|
|
73
|
-
const packageName = resolvePackageName(program.opts()
|
|
73
|
+
const packageName = resolvePackageName(program.opts()["app"], config);
|
|
74
74
|
const format = detectOutputFormat();
|
|
75
75
|
const interactive = isInteractive(program);
|
|
76
|
-
options.text = await requireOption(
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
options.text = await requireOption(
|
|
77
|
+
"text",
|
|
78
|
+
options.text,
|
|
79
|
+
{
|
|
80
|
+
message: "Reply text (max 350 chars):"
|
|
81
|
+
},
|
|
82
|
+
interactive
|
|
83
|
+
);
|
|
79
84
|
if (isDryRun(program)) {
|
|
80
|
-
printDryRun(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
printDryRun(
|
|
86
|
+
{
|
|
87
|
+
command: "reviews reply",
|
|
88
|
+
action: "reply to",
|
|
89
|
+
target: reviewId,
|
|
90
|
+
details: { text: options.text }
|
|
91
|
+
},
|
|
92
|
+
format,
|
|
93
|
+
formatOutput
|
|
94
|
+
);
|
|
86
95
|
return;
|
|
87
96
|
}
|
|
88
97
|
const client = await getClient(config);
|
|
@@ -96,7 +105,7 @@ function registerReviewsCommands(program) {
|
|
|
96
105
|
});
|
|
97
106
|
reviews.command("export").description("Export reviews to JSON or CSV").option("--format <type>", "Output format: json or csv", "json").option("--stars <n>", "Filter by star rating (1-5)", parseInt).option("--lang <code>", "Filter by reviewer language").option("--since <date>", "Filter reviews after date (ISO 8601)").option("--translate-to <lang>", "Translate reviews to language").option("--output <file>", "Write output to file instead of stdout").action(async (options) => {
|
|
98
107
|
const config = await loadConfig();
|
|
99
|
-
const packageName = resolvePackageName(program.opts()
|
|
108
|
+
const packageName = resolvePackageName(program.opts()["app"], config);
|
|
100
109
|
const client = await getClient(config);
|
|
101
110
|
try {
|
|
102
111
|
const result = await exportReviews(client, packageName, {
|
|
@@ -122,4 +131,4 @@ function registerReviewsCommands(program) {
|
|
|
122
131
|
export {
|
|
123
132
|
registerReviewsCommands
|
|
124
133
|
};
|
|
125
|
-
//# sourceMappingURL=reviews-
|
|
134
|
+
//# sourceMappingURL=reviews-T3SRAZLW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/reviews.ts"],"sourcesContent":["import type { Command } from \"commander\";\nimport type { GpcConfig } from \"@gpc-cli/config\";\nimport { loadConfig } from \"@gpc-cli/config\";\nimport { resolveAuth } from \"@gpc-cli/auth\";\nimport { createApiClient } from \"@gpc-cli/api\";\nimport {\n listReviews,\n getReview,\n replyToReview,\n exportReviews,\n detectOutputFormat,\n formatOutput,\n} from \"@gpc-cli/core\";\nimport { isDryRun, printDryRun } from \"../dry-run.js\";\nimport { isInteractive, requireOption } from \"../prompt.js\";\n\nfunction resolvePackageName(packageArg: string | undefined, config: GpcConfig): string {\n const name = packageArg || config.app;\n if (!name) {\n console.error(\"Error: No package name. Use --app <package> or gpc config set app <package>\");\n process.exit(2);\n }\n return name;\n}\n\nasync function getClient(config: GpcConfig) {\n const auth = await resolveAuth({ serviceAccountPath: config.auth?.serviceAccount });\n return createApiClient({ auth });\n}\n\nexport function registerReviewsCommands(program: Command): void {\n const reviews = program.command(\"reviews\").description(\"Manage user reviews and ratings\");\n\n reviews\n .command(\"list\")\n .description(\"List user reviews\")\n .option(\"--stars <n>\", \"Filter by star rating (1-5)\", parseInt)\n .option(\"--lang <code>\", \"Filter by reviewer language\")\n .option(\"--since <date>\", \"Filter reviews after date (ISO 8601)\")\n .option(\"--translate-to <lang>\", \"Translate reviews to language\")\n .option(\"--max <n>\", \"Maximum number of reviews per page\", parseInt)\n .option(\"--limit <n>\", \"Maximum total results\", parseInt)\n .option(\"--next-page <token>\", \"Resume from page token\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n const format = detectOutputFormat();\n\n try {\n const result = await listReviews(client, packageName, {\n stars: options.stars,\n language: options.lang,\n since: options.since,\n translationLanguage: options.translateTo,\n maxResults: options.max,\n limit: options.limit,\n nextPage: options.nextPage,\n });\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n reviews\n .command(\"get <review-id>\")\n .description(\"Get a single review\")\n .option(\"--translate-to <lang>\", \"Translate review to language\")\n .action(async (reviewId: string, options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n const format = detectOutputFormat();\n\n try {\n const result = await getReview(client, packageName, reviewId, options.translateTo);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n reviews\n .command(\"reply <review-id>\")\n .description(\"Reply to a review\")\n .option(\"--text <text>\", \"Reply text (max 350 chars)\")\n .action(async (reviewId: string, options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = detectOutputFormat();\n const interactive = isInteractive(program);\n\n options.text = await requireOption(\n \"text\",\n options.text,\n {\n message: \"Reply text (max 350 chars):\",\n },\n interactive,\n );\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"reviews reply\",\n action: \"reply to\",\n target: reviewId,\n details: { text: options.text },\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const result = await replyToReview(client, packageName, reviewId, options.text);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n reviews\n .command(\"export\")\n .description(\"Export reviews to JSON or CSV\")\n .option(\"--format <type>\", \"Output format: json or csv\", \"json\")\n .option(\"--stars <n>\", \"Filter by star rating (1-5)\", parseInt)\n .option(\"--lang <code>\", \"Filter by reviewer language\")\n .option(\"--since <date>\", \"Filter reviews after date (ISO 8601)\")\n .option(\"--translate-to <lang>\", \"Translate reviews to language\")\n .option(\"--output <file>\", \"Write output to file instead of stdout\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n\n try {\n const result = await exportReviews(client, packageName, {\n format: options.format as \"json\" | \"csv\",\n stars: options.stars,\n language: options.lang,\n since: options.since,\n translationLanguage: options.translateTo,\n });\n\n if (options.output) {\n const { writeFile } = await import(\"node:fs/promises\");\n await writeFile(options.output, result, \"utf-8\");\n console.log(`Reviews exported to ${options.output}`);\n } else {\n console.log(result);\n }\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n}\n"],"mappings":";;;;;;;;;;;AAEA,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAIP,SAAS,mBAAmB,YAAgC,QAA2B;AACrF,QAAM,OAAO,cAAc,OAAO;AAClC,MAAI,CAAC,MAAM;AACT,YAAQ,MAAM,6EAA6E;AAC3F,YAAQ,KAAK,CAAC;AAAA,EAChB;AACA,SAAO;AACT;AAEA,eAAe,UAAU,QAAmB;AAC1C,QAAM,OAAO,MAAM,YAAY,EAAE,oBAAoB,OAAO,MAAM,eAAe,CAAC;AAClF,SAAO,gBAAgB,EAAE,KAAK,CAAC;AACjC;AAEO,SAAS,wBAAwB,SAAwB;AAC9D,QAAM,UAAU,QAAQ,QAAQ,SAAS,EAAE,YAAY,iCAAiC;AAExF,UACG,QAAQ,MAAM,EACd,YAAY,mBAAmB,EAC/B,OAAO,eAAe,+BAA+B,QAAQ,EAC7D,OAAO,iBAAiB,6BAA6B,EACrD,OAAO,kBAAkB,sCAAsC,EAC/D,OAAO,yBAAyB,+BAA+B,EAC/D,OAAO,aAAa,sCAAsC,QAAQ,EAClE,OAAO,eAAe,yBAAyB,QAAQ,EACvD,OAAO,uBAAuB,wBAAwB,EACtD,OAAO,OAAO,YAAY;AACzB,UAAM,SAAS,MAAM,WAAW;AAChC,UAAM,cAAc,mBAAmB,QAAQ,KAAK,EAAE,KAAK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,QAAQ;AAAA,QAClB,OAAO,QAAQ;AAAA,QACf,qBAAqB,QAAQ;AAAA,MAC/B,CAAC;AAED,UAAI,QAAQ,QAAQ;AAClB,cAAM,EAAE,UAAU,IAAI,MAAM,OAAO,aAAkB;AACrD,cAAM,UAAU,QAAQ,QAAQ,QAAQ,OAAO;AAC/C,gBAAQ,IAAI,uBAAuB,QAAQ,MAAM,EAAE;AAAA,MACrD,OAAO;AACL,gBAAQ,IAAI,MAAM;AAAA,MACpB;AAAA,IACF,SAAS,OAAO;AACd,cAAQ,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC,EAAE;AAChF,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF,CAAC;AACL;","names":[]}
|
|
@@ -9,9 +9,11 @@ import { detectOutputFormat, formatOutput } from "@gpc-cli/core";
|
|
|
9
9
|
function registerStatusCommand(program) {
|
|
10
10
|
program.command("status").description("Cross-track release overview").action(async () => {
|
|
11
11
|
const config = await loadConfig();
|
|
12
|
-
const packageName = program.opts()
|
|
12
|
+
const packageName = program.opts()["app"] || config.app;
|
|
13
13
|
if (!packageName) {
|
|
14
|
-
console.error(
|
|
14
|
+
console.error(
|
|
15
|
+
"Error: No package name. Use --app <package> or gpc config set app <package>"
|
|
16
|
+
);
|
|
15
17
|
process.exit(2);
|
|
16
18
|
}
|
|
17
19
|
try {
|
|
@@ -29,4 +31,4 @@ function registerStatusCommand(program) {
|
|
|
29
31
|
export {
|
|
30
32
|
registerStatusCommand
|
|
31
33
|
};
|
|
32
|
-
//# sourceMappingURL=status-
|
|
34
|
+
//# sourceMappingURL=status-TBPVS7YR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/status.ts"],"sourcesContent":["import type { Command } from \"commander\";\nimport { loadConfig } from \"@gpc-cli/config\";\nimport { resolveAuth } from \"@gpc-cli/auth\";\nimport { createApiClient } from \"@gpc-cli/api\";\nimport { getReleasesStatus } from \"@gpc-cli/core\";\nimport { detectOutputFormat, formatOutput } from \"@gpc-cli/core\";\n\nexport function registerStatusCommand(program: Command): void {\n program\n .command(\"status\")\n .description(\"Cross-track release overview\")\n .action(async () => {\n const config = await loadConfig();\n const packageName = program.opts()[\"app\"] || config.app;\n if (!packageName) {\n console.error(\n \"Error: No package name. Use --app <package> or gpc config set app <package>\",\n );\n process.exit(2);\n }\n\n try {\n const auth = await resolveAuth({ serviceAccountPath: config.auth?.serviceAccount });\n const client = createApiClient({ auth });\n const statuses = await getReleasesStatus(client, packageName);\n const format = detectOutputFormat();\n console.log(formatOutput(statuses, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n}\n"],"mappings":";;;AACA,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAChC,SAAS,yBAAyB;AAClC,SAAS,oBAAoB,oBAAoB;AAE1C,SAAS,sBAAsB,SAAwB;AAC5D,UACG,QAAQ,QAAQ,EAChB,YAAY,8BAA8B,EAC1C,OAAO,YAAY;AAClB,UAAM,SAAS,MAAM,WAAW;AAChC,UAAM,cAAc,QAAQ,KAAK,EAAE,KAAK,KAAK,OAAO;AACpD,QAAI,CAAC,aAAa;AAChB,cAAQ;AAAA,QACN;AAAA,MACF;AACA,cAAQ,KAAK,CAAC;AAAA,IAChB;AAEA,QAAI;AACF,YAAM,OAAO,MAAM,YAAY,EAAE,oBAAoB,OAAO,MAAM,eAAe,CAAC;AAClF,YAAM,SAAS,gBAAgB,EAAE,KAAK,CAAC;AACvC,YAAM,WAAW,MAAM,kBAAkB,QAAQ,WAAW;AAC5D,YAAM,SAAS,mBAAmB;AAClC,cAAQ,IAAI,aAAa,UAAU,MAAM,CAAC;AAAA,IAC5C,SAAS,OAAO;AACd,cAAQ,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC,EAAE;AAChF,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF,CAAC;AACL;","names":[]}
|