preflightlaunch 0.2.2 → 0.2.3

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.
Files changed (2) hide show
  1. package/dist/index.js +45 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5897,6 +5897,45 @@ async function ascStatusCommand() {
5897
5897
  log.error(`Error: ${err instanceof Error ? err.message : "Unknown error"}`);
5898
5898
  }
5899
5899
  }
5900
+ async function ascRefreshCommand() {
5901
+ const s = spinner();
5902
+ s.start("Checking App Store Connect...");
5903
+ try {
5904
+ const statusRes = await apiRequest("/api/asc/connect");
5905
+ const statusData = await statusRes.json();
5906
+ if (!statusRes.ok || !statusData.connected) {
5907
+ s.stop("Not connected");
5908
+ log.warning("App Store Connect is not connected.");
5909
+ console.log(subtext(` Run ${brand("preflight asc connect")} to set up.`));
5910
+ console.log();
5911
+ return;
5912
+ }
5913
+ s.message = "Pulling latest data from App Store Connect...";
5914
+ const res = await apiRequest("/api/asc/autofill", {
5915
+ method: "POST",
5916
+ body: JSON.stringify({ appId: statusData.appId })
5917
+ });
5918
+ const data = await res.json();
5919
+ if (!res.ok) {
5920
+ s.stop("Refresh failed");
5921
+ log.error(data.message || "Could not refresh data from App Store Connect");
5922
+ return;
5923
+ }
5924
+ s.stop("Data refreshed!");
5925
+ console.log();
5926
+ if (data.app_name) console.log(` App: ${brand(data.app_name)}`);
5927
+ if (data.description) console.log(` Description: ${subtext(data.description.slice(0, 60) + (data.description.length > 60 ? "..." : ""))}`);
5928
+ if (data.keywords) console.log(` Keywords: ${subtext(data.keywords.slice(0, 60) + (data.keywords.length > 60 ? "..." : ""))}`);
5929
+ if (data.category) console.log(` Category: ${subtext(data.category)}`);
5930
+ if (data.support_url) console.log(` Support URL: ${subtext(data.support_url)}`);
5931
+ console.log();
5932
+ log.success("This data will autofill your next submission.");
5933
+ console.log();
5934
+ } catch (err) {
5935
+ s.stop("Refresh failed");
5936
+ log.error(`Error: ${err instanceof Error ? err.message : "Unknown error"}`);
5937
+ }
5938
+ }
5900
5939
  async function ascDisconnectCommand() {
5901
5940
  const confirmed = await confirm("Disconnect from App Store Connect?", false);
5902
5941
  if (confirmed === null || !confirmed) return;
@@ -5925,6 +5964,7 @@ async function ascInteractiveMenu() {
5925
5964
  message: "App Store Connect",
5926
5965
  options: [
5927
5966
  { value: "connect", label: "Connect", hint: "Set up API key" },
5967
+ { value: "refresh", label: "Refresh", hint: "Pull latest data from ASC" },
5928
5968
  { value: "status", label: "View Status", hint: "Check connection" },
5929
5969
  { value: "disconnect", label: "Disconnect", hint: "Remove API key" },
5930
5970
  { value: "back", label: "Back to menu" }
@@ -5935,6 +5975,9 @@ async function ascInteractiveMenu() {
5935
5975
  case "connect":
5936
5976
  await ascConnectCommand();
5937
5977
  break;
5978
+ case "refresh":
5979
+ await ascRefreshCommand();
5980
+ break;
5938
5981
  case "status":
5939
5982
  await ascStatusCommand();
5940
5983
  break;
@@ -5947,7 +5990,7 @@ async function ascInteractiveMenu() {
5947
5990
 
5948
5991
  // src/index.ts
5949
5992
  var program2 = new Command();
5950
- program2.name("preflight").description("Preflight - App Store Review Scanner").version("0.2.2");
5993
+ program2.name("preflight").description("Preflight - App Store Review Scanner").version("0.2.3");
5951
5994
  program2.command("login").description("Log in to Preflight (opens browser)").action(loginCommand);
5952
5995
  program2.command("logout").description("Log out and clear stored credentials").action(logoutCommand);
5953
5996
  program2.command("whoami").description("Show current user and credit balance").action(whoamiCommand);
@@ -5961,6 +6004,7 @@ program2.command("setup").description("Run guided setup (can be re-run anytime)"
5961
6004
  var ascCmd = program2.command("asc").description("App Store Connect integration");
5962
6005
  ascCmd.command("connect").description("Connect your App Store Connect account").action(ascConnectCommand);
5963
6006
  ascCmd.command("status").description("Check App Store Connect connection status").action(ascStatusCommand);
6007
+ ascCmd.command("refresh").description("Pull latest metadata from App Store Connect").action(ascRefreshCommand);
5964
6008
  ascCmd.command("disconnect").description("Disconnect from App Store Connect").action(ascDisconnectCommand);
5965
6009
  program2.on("command:*", (operands) => {
5966
6010
  handleUnknownCommand(operands[0]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "preflightlaunch",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "type": "module",
5
5
  "description": "Preflight CLI - App Store Review Scanner from your terminal",
6
6
  "bin": {