@superwall/cli 1.6.2 → 1.7.0

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 (58) hide show
  1. package/README.md +110 -3
  2. package/dist/{actions-H7f6knyY.js → actions-B7ym3oVS.js} +2 -2
  3. package/dist/{api-Dv3LyZ5m.js → api-CZzirVMj.js} +6 -6
  4. package/dist/{app-mJC5NDtW.js → app-DH6U8yuI.js} +11 -10
  5. package/dist/{asa-D6H7Pjae.js → asa-C-sQzPPn.js} +8 -8
  6. package/dist/{asc-xCin0akG.js → asc-1ZBJ6DwS.js} +280 -41
  7. package/dist/asc-Bf7zBbyS.js +65 -0
  8. package/dist/{asc-products-Dvcyef3_.js → asc-products-9JXtDxI4.js} +2 -35
  9. package/dist/{auth-ZlLL-Gko.js → auth-YRhlV3DE.js} +11 -10
  10. package/dist/auth.js +2 -2
  11. package/dist/{billing-C8kBge_S.js → billing-CCYHdApx.js} +1 -1
  12. package/dist/{bind-BIzaGq8K.js → bind-YrJvuRF9.js} +3 -3
  13. package/dist/{build-B7BS1rF2.js → build-DLoCW5Ri.js} +7 -7
  14. package/dist/bundle-id-CKxl_026.js +121 -0
  15. package/dist/{command-3fGYyC8r.js → command-CMIz81Da.js} +5 -5
  16. package/dist/{create-CwnnNqv4.js → create-pkANt1Gs.js} +22 -22
  17. package/dist/dev-DZy6pOnB.js +22 -0
  18. package/dist/{dev-CgGAb5Al.js → dev-DmB3XqaJ.js} +12 -7
  19. package/dist/{doctor-CyUvut31.js → doctor-H-hf-Yww.js} +10 -10
  20. package/dist/{drivers-6RMOPIdn.js → drivers-Qx9LxmRN.js} +2 -2
  21. package/dist/entry.js +382 -39
  22. package/dist/{existing-DHpPn1y6.js → existing-AVEfZu2A.js} +2 -2
  23. package/dist/{feedback-RKyGuQ8_.js → feedback-CKf-rpBW.js} +6 -6
  24. package/dist/{hosted-BeGVAntr.js → hosted-CXe9TrWx.js} +2 -2
  25. package/dist/{integrate-BR2LR-EK.js → integrate-brmhPG-S.js} +23 -22
  26. package/dist/{login-Bhxgqwtm.js → login-Do4wFuLv.js} +31 -16
  27. package/dist/{migrate-C-4ISELN.js → migrate-C9ERDR6y.js} +24 -24
  28. package/dist/notification-url-DuKF2659.js +1273 -0
  29. package/dist/{open-studio-BnVD6tJ9.js → open-studio-DOw-6ydc.js} +10 -10
  30. package/dist/{org-CQduIOic.js → org-sj7uyvp-.js} +2 -2
  31. package/dist/{output-C-4UKMot.js → output-C4o2gJ1K.js} +12 -2
  32. package/dist/{pipeline-CHX0Syre.js → pipeline-BqzqZhX1.js} +6 -6
  33. package/dist/{print-skill-BiZLdCKv.js → print-skill-ZojRSybs.js} +7 -7
  34. package/dist/{promote-Pgpz-3xl.js → promote-BG8X4Nv_.js} +17 -17
  35. package/dist/publish-sxLh-G4G.js +35 -0
  36. package/dist/push-bQ6Vxtg8.js +35 -0
  37. package/dist/{query-CWLaZkdm.js → query-_FbybaH-.js} +8 -8
  38. package/dist/{resource-jwASPCrw.js → resource-CGIwSd29.js} +16 -176
  39. package/dist/revenue-provider-ebsRINY8.js +100 -0
  40. package/dist/{run-D-NbZLpj.js → run-DsVZ5snL.js} +2 -2
  41. package/dist/{scan-BmAW413l.js → scan-zKsddO72.js} +1 -1
  42. package/dist/scope-BvzD-kO4.js +223 -0
  43. package/dist/{selection-BGi6GyxC.js → selection-CxZoX4NT.js} +2 -2
  44. package/dist/setup-Bxj22rYi.js +189 -0
  45. package/dist/{skills-AxAf7bDB.js → skills-DPzlnfCK.js} +3 -3
  46. package/dist/{skills-FK5aDuNV.js → skills-D_R-lEsK.js} +8 -8
  47. package/dist/{spinner-DFctF_Jw.js → spinner-TWa0hia6.js} +1 -1
  48. package/dist/{telemetry-Ch9cCTI-.js → telemetry-DeA1mvnT.js} +1 -1
  49. package/dist/{token-BGAVPSQc.js → token-C0it-Xh7.js} +1 -1
  50. package/dist/{ui-4gLyfrgl.js → ui-Dy0b-9L8.js} +4 -3
  51. package/dist/{update-DIXbL-H9.js → update-B2fWIc4q.js} +2 -2
  52. package/dist/{upgrade-De7JMI1g.js → upgrade-BmzkTKrh.js} +6 -6
  53. package/package.json +2 -2
  54. package/dist/dev-Dx99K183.js +0 -22
  55. package/dist/publish-BPeuc3lq.js +0 -35
  56. package/dist/push-DcSQ4odB.js +0 -35
  57. /package/dist/{reports-DqMs9xNR.js → reports-CfJqoava.js} +0 -0
  58. /package/dist/{storekit-CC4gnTI6.js → storekit-Cj9Cpjcz.js} +0 -0
package/dist/entry.js CHANGED
@@ -1,6 +1,6 @@
1
- import { i as writeJson, l as CHANNEL, p as ENV_API_KEY, y as VERSION } from "./output-C-4UKMot.js";
2
- import { t as flushTelemetry } from "./telemetry-Ch9cCTI-.js";
3
- import { n as flushUpdateCheck } from "./update-DIXbL-H9.js";
1
+ import { i as writeJson, l as CHANNEL, p as ENV_API_KEY, x as VERSION } from "./output-C4o2gJ1K.js";
2
+ import { t as flushTelemetry } from "./telemetry-DeA1mvnT.js";
3
+ import { n as flushUpdateCheck } from "./update-B2fWIc4q.js";
4
4
  import yargs from "yargs";
5
5
  import { hideBin } from "yargs/helpers";
6
6
  import pc from "picocolors";
@@ -56,11 +56,11 @@ const registerAccountCommands = (cli) => cli.command("login", "Log in to Superwa
56
56
  hidden: true
57
57
  }
58
58
  }), (argv) => {
59
- return import("./auth-ZlLL-Gko.js").then((m) => m.runLogin(argv));
59
+ return import("./auth-YRhlV3DE.js").then((m) => m.runLogin(argv));
60
60
  }).command("logout", "Log out of Superwall", (y) => y, (argv) => {
61
- return import("./auth-ZlLL-Gko.js").then((m) => m.runLogout(argv));
61
+ return import("./auth-YRhlV3DE.js").then((m) => m.runLogout(argv));
62
62
  }).command("whoami", "Show the logged-in Superwall account", (y) => y, (argv) => {
63
- return import("./auth-ZlLL-Gko.js").then((m) => m.runWhoami(argv));
63
+ return import("./auth-YRhlV3DE.js").then((m) => m.runWhoami(argv));
64
64
  }).command("skills", "Install or update the Superwall agent skills for your coding agent", (y) => y.options({
65
65
  skill: {
66
66
  type: "array",
@@ -81,11 +81,11 @@ const registerAccountCommands = (cli) => cli.command("login", "Log in to Superwa
81
81
  hidden: true
82
82
  }
83
83
  }), (argv) => {
84
- return import("./skills-FK5aDuNV.js").then((m) => m.runSkills(argv));
84
+ return import("./skills-D_R-lEsK.js").then((m) => m.runSkills(argv));
85
85
  }).command("doctor", "Check the health of your Superwall integration", (y) => y.options({ ...installDirOption }), (argv) => {
86
- return import("./doctor-CyUvut31.js").then((m) => m.runDoctor(argv));
86
+ return import("./doctor-H-hf-Yww.js").then((m) => m.runDoctor(argv));
87
87
  }).command("upgrade", "Update the CLI to the latest version", (y) => y, (argv) => {
88
- return import("./upgrade-De7JMI1g.js").then((m) => m.runUpgrade(argv));
88
+ return import("./upgrade-BmzkTKrh.js").then((m) => m.runUpgrade(argv));
89
89
  }).command("feedback [message]", "Report a bug or send feedback to the Superwall team", (y) => y.positional("message", {
90
90
  type: "string",
91
91
  describe: "What happened: what you ran, what you expected, what you got (omit to be prompted)"
@@ -132,7 +132,7 @@ const registerAccountCommands = (cli) => cli.command("login", "Log in to Superwa
132
132
  describe: "The agent sending it (auto-detected when possible)"
133
133
  }
134
134
  }).example("$0 feedback \"migrate crashed on Expo\"", "Send feedback").example("$0 feedback \"push fails with 413 on a 2MB asset; expected upload\" --title \"push 413 on large asset\" --kind bug --command \"superwall push\" --app 123 --context paywall=pw_abc --file push.log --json", "For agents: a full bug report"), (argv) => {
135
- return import("./feedback-RKyGuQ8_.js").then((m) => m.runFeedback(argv));
135
+ return import("./feedback-CKf-rpBW.js").then((m) => m.runFeedback(argv));
136
136
  });
137
137
 
138
138
  //#endregion
@@ -169,12 +169,13 @@ function printHelp() {
169
169
  ] : [],
170
170
  head("Resource commands"),
171
171
  row("bootstrap", "Complete account tree: projects, apps, campaigns, and products"),
172
- row("apps", "Projects and platform apps (list, create, use)"),
172
+ row("apps", "Projects and platform apps (list, create, use, bundle-id)"),
173
173
  row("products", "Products (list, create, storekit)"),
174
174
  row("entitlements", "Entitlements (list, create)"),
175
175
  row("campaigns", "Campaigns (list, create, placement)"),
176
176
  row("paywalls", "Paywalls (list)"),
177
177
  row("query [sql]", "Run SQL against your ClickHouse analytics data"),
178
+ row("revenue-provider", "Which revenue source an app's figures count (get, set)"),
178
179
  row("orgs", "Organizations (list, use) - only needed with multiple orgs"),
179
180
  "",
180
181
  head("API commands"),
@@ -183,7 +184,10 @@ function printHelp() {
183
184
  head("App Store Connect commands"),
184
185
  row("asc", "The ASC API via Superwall's signed proxy (no .p8 / JWT)"),
185
186
  row("asc docs", "Exact ASC request schema, from Apple's spec (path or search)"),
186
- row("asc keys", "Manage App Store Connect API keys (list, set, rm)"),
187
+ row("asc keys", "Apple keys for the organization, or an app with --app"),
188
+ pc.dim(" list, set, rm, create, sources, copy, import"),
189
+ row("asc notification-url", "An app's server notification URL (get, check, set)"),
190
+ row("setup apple", "One sign-in: create the keys an app is missing, set the URL"),
187
191
  "",
188
192
  head("Apple Search Ads commands"),
189
193
  row("asa", "The Apple Ads API via Superwall's proxy (campaigns, keywords, reports, ...)"),
@@ -242,7 +246,7 @@ const registerPaywallCommands = (cli) => cli.command("create [dir]", "Set up pay
242
246
  describe: "Connect a Superwall app when possible (--no-connect to skip)"
243
247
  }
244
248
  }).example("$0 create", "Set up superwall/ in the current app").example("$0 create --example with-rive", "Start from an example").example("$0 create --from 65920", "Rebuild dashboard paywall 65920 as code").example("$0 create --app 52518", "Connect a specific Superwall app"), (argv) => {
245
- return import("./create-CwnnNqv4.js").then((m) => m.runCreate(argv));
249
+ return import("./create-pkANt1Gs.js").then((m) => m.runCreate(argv));
246
250
  }).command("dev [dir..]", "Host the studio: browse and preview your paywalls and funnels", (y) => y.positional("dir", {
247
251
  type: "string",
248
252
  array: true,
@@ -265,7 +269,7 @@ const registerPaywallCommands = (cli) => cli.command("create [dir]", "Set up pay
265
269
  describe: "Open the browser at this studio path once the server is up"
266
270
  }
267
271
  }), (argv) => {
268
- return import("./dev-Dx99K183.js").then((m) => m.runDev(argv));
272
+ return import("./dev-DZy6pOnB.js").then((m) => m.runDev(argv));
269
273
  }).command("build [dir]", "Build your paywalls into the snapshot documents a push would version, without pushing", (y) => y.positional("dir", {
270
274
  type: "string",
271
275
  describe: "Project directory (default: cwd)"
@@ -289,7 +293,7 @@ const registerPaywallCommands = (cli) => cli.command("create [dir]", "Set up pay
289
293
  describe: "Print the built files as JSON"
290
294
  }
291
295
  }).example("$0 build --id plus-upgrade --platform ios", "Build one paywall for iOS").example("$0 build --json", "Build everything and list the files as JSON"), (argv) => {
292
- return import("./build-B7BS1rF2.js").then((m) => m.runBuild(argv));
296
+ return import("./build-DLoCW5Ri.js").then((m) => m.runBuild(argv));
293
297
  }).command("push [dir]", "Build and push your paywalls as immutable versions (production untouched)", (y) => y.positional("dir", {
294
298
  type: "string",
295
299
  describe: "Project directory (default: cwd)"
@@ -315,7 +319,7 @@ const registerPaywallCommands = (cli) => cli.command("create [dir]", "Set up pay
315
319
  describe: "Publish note recorded in the source commit (only lands when this publish creates a new source commit — unchanged source reuses the existing commit)"
316
320
  }
317
321
  }), (argv) => {
318
- return import("./push-DcSQ4odB.js").then((m) => m.runPush(argv));
322
+ return import("./push-bQ6Vxtg8.js").then((m) => m.runPush(argv));
319
323
  }).command("promote [dir]", "Point production at a pushed version (the latest by default)", (y) => y.version(false).positional("dir", {
320
324
  type: "string",
321
325
  describe: "Project directory (default: cwd)"
@@ -336,7 +340,7 @@ const registerPaywallCommands = (cli) => cli.command("create [dir]", "Set up pay
336
340
  describe: "Pushed version number to promote (requires a single --id)"
337
341
  }
338
342
  }), (argv) => {
339
- return import("./promote-Pgpz-3xl.js").then((m) => m.runPromote(argv));
343
+ return import("./promote-BG8X4Nv_.js").then((m) => m.runPromote(argv));
340
344
  }).command("publish [dir]", "Push and promote in one step - build, version, and ship to production", (y) => y.positional("dir", {
341
345
  type: "string",
342
346
  describe: "Project directory (default: cwd)"
@@ -362,9 +366,195 @@ const registerPaywallCommands = (cli) => cli.command("create [dir]", "Set up pay
362
366
  describe: "Publish note recorded in the source commit (only lands when this publish creates a new source commit — unchanged source reuses the existing commit)"
363
367
  }
364
368
  }), (argv) => {
365
- return import("./publish-BPeuc3lq.js").then((m) => m.runPublish(argv));
369
+ return import("./publish-sxLh-G4G.js").then((m) => m.runPublish(argv));
366
370
  });
367
371
 
372
+ //#endregion
373
+ //#region src/cli/platform-help.ts
374
+ const ASC_HELP = `An app's Apple keys: asc keys <action> --app <id>
375
+ Each iOS app keeps two keys in Superwall:
376
+ api_key App Store Connect API key. Reads the app's products and
377
+ sets its server notification URL.
378
+ purchase_key In-App Purchase key. Reads transactions for one bundle ID.
379
+ Without --app, keys list | set | rm act on the organization's keys, the
380
+ ones the signed proxy uses. No command prints a private key, and none
381
+ revokes a key at Apple.
382
+
383
+ asc keys list --app <id>
384
+ Which of the two keys the app has (key id, issuer id).
385
+ Changes nothing. Exit 0.
386
+
387
+ asc keys import [api_key | purchase_key] --app <id>
388
+ Tries the keys your organization already has and saves the first one
389
+ Apple confirms for this app's bundle ID. Both kinds when none is named.
390
+ Never saves an unconfirmed key, never replaces a key the app has, and
391
+ creates nothing at Apple.
392
+ Exit 0 when every kind asked for is saved (imported or already_saved),
393
+ 1 when one is not_found.
394
+
395
+ asc keys sources --app <id>
396
+ Keys saved on the organization's other iOS apps, one row per distinct
397
+ key. Changes nothing. Exit 0.
398
+
399
+ asc keys copy <api_key | purchase_key> --app <id> --from <app id>
400
+ Copies that app's key. Apple is asked whether it still works and
401
+ whether its team owns this app. A key that no longer works is not
402
+ saved. An api_key whose team shows no app with this bundle ID is not
403
+ saved either (unconfirmed) unless --allow-unconfirmed is passed, which
404
+ is a person's decision. A purchase_key Apple won't accept for this
405
+ bundle ID is never saved.
406
+ Exit 0 when saved, 1 when nothing was saved.
407
+
408
+ asc keys create <api_key | purchase_key> --app <id>
409
+ Signs in to Apple from this computer, creates one key named
410
+ "Superwall" on the team that owns the app's bundle ID, and saves it on
411
+ the app. Saving an api_key also gives the organization a key for that
412
+ Apple team when it has none.
413
+ When the app already has a key of that kind it does not sign in and
414
+ creates nothing (already_saved, exit 0). --replace creates another and
415
+ saves it; the old key stays valid at Apple.
416
+ The bundle ID is checked on the signed-in team before anything is
417
+ created. An app with no bundle ID gets that one, saved with the
418
+ purchase_key; one with a different bundle ID than --bundle-id is
419
+ refused before anything is created.
420
+ The Apple password comes from a masked prompt, SUPERWALL_APPLE_PASSWORD
421
+ or --apple-password. It goes only to Apple and is not saved. Without
422
+ prompts, the first run stops for Apple's verification code
423
+ (verification_required, exit 1): run it again with --code within 10
424
+ minutes.
425
+ Needs an Apple Account that is an Admin or the Account Holder, on a
426
+ team with its agreements signed.
427
+ Exit 0 when created or already_saved, 1 otherwise. A key Apple created
428
+ that Superwall couldn't save is written to ./AuthKey_<id>.p8 or
429
+ ./SubscriptionKey_<id>.p8, because Apple releases it only once.
430
+
431
+ asc keys set [api_key | purchase_key] --app <id> --key-id <id>
432
+ --issuer <id> --key-file <path.p8>
433
+ Saves a key you hold as a file on the app (api_key when no kind is
434
+ named). Apple is asked first: a key it rejects is not saved. Replaces
435
+ the app's saved key of that kind. Exit 0 saved, 1 rejected.
436
+ A purchase_key is for the app's bundle ID. When the app has none,
437
+ --bundle-id <id> is saved on the app with the key, both or neither.
438
+ A --bundle-id other than the app's is refused: change the app's first
439
+ with apps bundle-id <id> --replace.
440
+
441
+ asc keys rm <api_key | purchase_key> --app <id>
442
+ Removes the app's saved key. Nothing is revoked at Apple and the
443
+ organization's copy is kept. Exit 0.
444
+
445
+ asc keys set --team <team id> --key-id <id> --issuer <id>
446
+ --key-file <path.p8>
447
+ Replaces the organization's key for that Apple team. Refused unless
448
+ Apple confirms the new key belongs to the same team.
449
+
450
+ The server notification URL: asc notification-url <action> --app <id>
451
+ Apple sends an app's purchase events to one URL per environment
452
+ (production, sandbox).
453
+
454
+ asc notification-url [get] --app <id>
455
+ Prints this app's Superwall URL. Asks Apple nothing, changes nothing.
456
+ Works with an API key. Exit 0.
457
+
458
+ asc notification-url check --app <id>
459
+ Asks Apple what it has, with the app's saved api_key, and says for
460
+ production and sandbox whose URL it is:
461
+ this_app this app's Superwall URL, in either form Superwall has
462
+ issued
463
+ superwall_app another Superwall app's. Named, with its URL, when you
464
+ can read that app; otherwise its token reads REDACTED
465
+ other someone else's, such as RevenueCat or your own server
466
+ none Apple has no URL
467
+ status is already_set, not_set, conflict, skipped (no api_key or no
468
+ bundle ID saved) or failed (the message says why).
469
+ Changes nothing. Exit 0 unless skipped or failed (1).
470
+
471
+ asc notification-url set --app <id>
472
+ Writes this app's Superwall URL into whichever environment is empty.
473
+ Never replaces another server's or another Superwall app's URL: a
474
+ conflict is reported and left alone (exit 1). To switch, a person clears
475
+ it in App Store Connect, or forwards from that server to the URL above.
476
+ Does not change the revenue provider unless --set-revenue-provider is
477
+ passed. Receiving Apple's notifications and choosing which revenue
478
+ source the dashboard counts are separate decisions.
479
+ Exit 0 for set or already_set, 1 otherwise.
480
+
481
+ check and set work with a \`superwall login\` session or an API key with
482
+ applications:write.`;
483
+ const SETUP_APPLE_HELP = `What it does
484
+ One Apple sign-in, then for one iOS app: creates the App Store Connect
485
+ API key and the In-App Purchase key the app does not already have, saves
486
+ them on the app, and sets the server notification URL where Apple has
487
+ none. It can also create the Superwall app from an App Store Connect
488
+ app. Each step is one of the single commands in \`superwall asc --help\`.
489
+
490
+ Bundle ID
491
+ An app with no bundle ID gets the App Store Connect app's: saved with the
492
+ In-App Purchase key, both or neither, or on its own before the
493
+ notification URL when that key isn't created. It says how many reported
494
+ builds would run in test mode.
495
+
496
+ What it never does
497
+ It never creates a second key of a kind the app already has (reported as
498
+ already saved), never replaces a server notification URL another server
499
+ holds, never revokes a key, never replaces an app's different bundle ID (it
500
+ stops before anything is created and points at apps bundle-id --replace),
501
+ and never changes the revenue provider (see
502
+ \`superwall revenue-provider --help\`).
503
+
504
+ Sign-in
505
+ The Apple password comes from a masked prompt, SUPERWALL_APPLE_PASSWORD
506
+ or --apple-password. It goes only to Apple and is not saved. Without
507
+ prompts, the first run stops for Apple's verification code
508
+ (verification_required): run it again with --code within 10 minutes.
509
+
510
+ Exit codes
511
+ 0 when every step is done or skipped. 1 when a step failed or a
512
+ verification code is needed. --json lists each step under steps and the
513
+ failed ones under failed.`;
514
+ const REVENUE_PROVIDER_HELP = `What it is
515
+ An app can receive purchase events from its store (App Store Connect or
516
+ Google Play, sent straight to Superwall) and from RevenueCat. Both keep
517
+ arriving and being stored. The revenue provider only decides which of
518
+ them every revenue figure in the dashboard counts:
519
+ open_revenue the store's own events
520
+ revenue_cat RevenueCat's events
521
+ With none chosen, events from every source are counted.
522
+
523
+ revenue-provider [get] --app <id>
524
+ The provider, and how many events each source sent in the last 30
525
+ days when the API reports it. Changes nothing. Exit 0.
526
+
527
+ revenue-provider set <open_revenue | revenue_cat> --app <id>
528
+ Changes which source is counted. It changes no key, no URL and no
529
+ stored event, and it can be changed back. Setting the value it already
530
+ has does nothing (exit 0).
531
+ A change is confirmed first: a prompt in a terminal, --yes outside
532
+ one. Without --yes outside a terminal it changes nothing, says what
533
+ would change, and exits 1. --dry-run does the same and exits 0.
534
+ Works for an app on any platform.`;
535
+ const APPS_HELP = `An app's bundle ID: apps bundle-id [value] --app <id>
536
+ The bundle ID (iOS) or package name (Android) decides which builds the SDK
537
+ treats as this app. A build whose ID is neither it nor starts with it
538
+ followed by a dot runs in test mode.
539
+
540
+ apps bundle-id --app <id>
541
+ The ID the app has, and the ones its SDK reported in the last 30 days,
542
+ each with production and sandbox devices, when it was last seen and its
543
+ most common country. Changes nothing. Exit 0.
544
+
545
+ apps bundle-id <value> --app <id>
546
+ Saves it. Superwall checks the format for the app's platform. When the
547
+ SDK reported production devices on other IDs that neither equal <value>
548
+ nor start with "<value>.", it says how many would run in test mode and
549
+ asks first: a prompt in a terminal, --yes outside one. Without --yes
550
+ outside a terminal it changes nothing and exits 1.
551
+ An app that already has a different ID keeps it unless --replace is
552
+ passed, and replacing also asks first. --app-store-id saves the App
553
+ Store ID too, only when the app has none. Saving the ID it already has
554
+ does nothing. --dry-run says what would change.
555
+ Never guesses an ID and never writes one the person didn't give.
556
+ Exit 0 when saved or unchanged, 1 otherwise.`;
557
+
368
558
  //#endregion
369
559
  //#region src/cli/platform.ts
370
560
  const registerPlatformCommands = (cli) => cli.command("query [sql]", "Run SQL against your ClickHouse analytics data", (y) => y.positional("sql", {
@@ -374,16 +564,16 @@ const registerPlatformCommands = (cli) => cli.command("query [sql]", "Run SQL ag
374
564
  type: "string",
375
565
  describe: "Read SQL from a .sql file"
376
566
  } }).example("$0 query \"SHOW TABLES FROM sw\"", "Run an inline query").example("$0 query --file report.sql --json", "Run a saved query"), (argv) => {
377
- return import("./query-CWLaZkdm.js").then((m) => m.runQuery(argv));
378
- }).command("asc <target> [value] [value2]", "Call the App Store Connect API through Superwall's signed proxy (no .p8 / JWT needed)", (y) => y.positional("target", {
567
+ return import("./query-_FbybaH-.js").then((m) => m.runQuery(argv));
568
+ }).command("asc <target> [value] [value2]", "The App Store Connect API, an app's Apple keys, and its notification URL", (y) => y.positional("target", {
379
569
  type: "string",
380
- describe: "get|post|patch|delete, a raw path (/v1/...), or: apps | products | subscriptions | iaps | docs | keys"
570
+ describe: "get|post|patch|delete, a raw path (/v1/...), or: apps | products | subscriptions | iaps | docs | keys | notification-url"
381
571
  }).positional("value", {
382
572
  type: "string",
383
- describe: "Path (for a verb), app bundle id / ASC app id (shortcuts), docs path or search, or list|set|rm (keys)"
573
+ describe: "Path (for a verb), app bundle id / ASC app id (shortcuts), docs path or search, list|set|rm|create|sources|copy|import (keys), or get|check|set (notification-url)"
384
574
  }).positional("value2", {
385
575
  type: "string",
386
- describe: "Team id (keys rm)"
576
+ describe: "Team id (keys rm), or api_key | purchase_key (keys with --app)"
387
577
  }).options({
388
578
  d: {
389
579
  type: "array",
@@ -391,7 +581,7 @@ const registerPlatformCommands = (cli) => cli.command("query [sql]", "Run SQL ag
391
581
  },
392
582
  team: {
393
583
  type: "string",
394
- describe: "ASC team id (if the org has more than one connected)"
584
+ describe: "Apple team id. Proxy calls: which connected team. keys set: replace that team's organization key. keys create: which team to create the key on (id or name)"
395
585
  },
396
586
  force: {
397
587
  type: "boolean",
@@ -418,13 +608,153 @@ const registerPlatformCommands = (cli) => cli.command("query [sql]", "Run SQL ag
418
608
  type: "string",
419
609
  describe: "Account name (keys set)"
420
610
  },
611
+ app: {
612
+ type: "string",
613
+ describe: "Superwall iOS app id or name. With keys list|set|rm it selects that app's keys instead of the organization's"
614
+ },
615
+ project: {
616
+ type: "string",
617
+ describe: "Superwall project id, to narrow --app"
618
+ },
619
+ "bundle-id": {
620
+ type: "string",
621
+ describe: "Bundle ID to use at Apple when it differs from the one Superwall has (keys create, keys set purchase_key)"
622
+ },
623
+ from: {
624
+ type: "string",
625
+ describe: "Superwall app id to copy a key from (keys copy)"
626
+ },
627
+ "allow-unconfirmed": {
628
+ type: "boolean",
629
+ describe: "keys copy: save an API key although Apple couldn't confirm its team owns this app. A person's decision"
630
+ },
631
+ replace: {
632
+ type: "boolean",
633
+ describe: "keys create: create a key although the app already has one of that kind, and save the new one"
634
+ },
635
+ "set-revenue-provider": {
636
+ type: "boolean",
637
+ describe: "notification-url set: also make the store the app's revenue provider. Left out, the provider is not touched"
638
+ },
639
+ "apple-id": {
640
+ type: "string",
641
+ describe: "Apple Account email (keys create), or set SUPERWALL_APPLE_ID"
642
+ },
643
+ "apple-password": {
644
+ type: "string",
645
+ describe: "Apple Account password (keys create); prefer the masked prompt or SUPERWALL_APPLE_PASSWORD to keep it out of shell history and the process list"
646
+ },
647
+ code: {
648
+ type: "string",
649
+ describe: "Apple verification code, to continue a sign-in started without prompts (keys create)"
650
+ },
651
+ sms: {
652
+ type: "boolean",
653
+ describe: "Text the verification code instead of pushing it to trusted devices (keys create)"
654
+ },
655
+ phone: {
656
+ type: "string",
657
+ describe: "Trusted phone number to text, if the account has several (keys create)"
658
+ },
659
+ "key-role": {
660
+ type: "string",
661
+ describe: "Role for a new App Store Connect API key: app_manager (default) or admin (keys create api_key)"
662
+ },
421
663
  "dry-run": {
422
664
  type: "boolean",
423
665
  hidden: true,
424
666
  describe: "Plan without writing"
425
667
  }
426
- }), (argv) => {
427
- return import("./asc-xCin0akG.js").then((m) => m.runAsc(argv));
668
+ }).epilogue(ASC_HELP), (argv) => {
669
+ return import("./asc-1ZBJ6DwS.js").then((m) => m.runAsc(argv));
670
+ }).command("setup <target>", "One Apple sign-in: create the keys an app is missing and set its URL", (y) => y.positional("target", {
671
+ type: "string",
672
+ describe: "apple"
673
+ }).options({
674
+ "apple-id": {
675
+ type: "string",
676
+ describe: "Apple Account email (or set SUPERWALL_APPLE_ID)"
677
+ },
678
+ "apple-password": {
679
+ type: "string",
680
+ describe: "Apple Account password; prefer the masked prompt or SUPERWALL_APPLE_PASSWORD to keep it out of shell history and the process list"
681
+ },
682
+ code: {
683
+ type: "string",
684
+ describe: "Apple verification code, to continue a sign-in started without prompts"
685
+ },
686
+ sms: {
687
+ type: "boolean",
688
+ describe: "Text the verification code instead of pushing it to trusted devices"
689
+ },
690
+ phone: {
691
+ type: "string",
692
+ describe: "Trusted phone number to text, if the account has several"
693
+ },
694
+ team: {
695
+ type: "string",
696
+ describe: "Apple team id or name, if the account is on several"
697
+ },
698
+ app: {
699
+ type: "string",
700
+ describe: "Superwall app id or name"
701
+ },
702
+ project: {
703
+ type: "string",
704
+ describe: "Superwall project id"
705
+ },
706
+ "bundle-id": {
707
+ type: "string",
708
+ describe: "Bundle ID of the App Store Connect app"
709
+ },
710
+ "key-role": {
711
+ type: "string",
712
+ describe: "Role for the new App Store Connect API key: app_manager (default) or admin"
713
+ },
714
+ "skip-api-key": {
715
+ type: "boolean",
716
+ describe: "Don't create an App Store Connect API key"
717
+ },
718
+ "skip-purchase-key": {
719
+ type: "boolean",
720
+ describe: "Don't create an In-App Purchase key"
721
+ },
722
+ "skip-notification-url": {
723
+ type: "boolean",
724
+ describe: "Don't set the server notification URL"
725
+ },
726
+ "dry-run": {
727
+ type: "boolean",
728
+ describe: "Sign in and check key access without creating or changing anything"
729
+ }
730
+ }).example("$0 setup apple", "Sign in and connect an app, with prompts").example("$0 setup apple --dry-run", "Sign in and check key access; change nothing").example("$0 setup apple --apple-id you@example.com --app 123 --no-interactive", "Without prompts: reads SUPERWALL_APPLE_PASSWORD, then stops for Apple's code").example("$0 setup apple --code 123456 --app 123 --no-interactive", "Continue with the code").epilogue(SETUP_APPLE_HELP), (argv) => {
731
+ return import("./setup-Bxj22rYi.js").then((m) => m.runSetup(argv));
732
+ }).command("revenue-provider [action] [value]", "Read or set which revenue source an app's dashboard figures count", (y) => y.positional("action", {
733
+ type: "string",
734
+ describe: "get (default) | set"
735
+ }).positional("value", {
736
+ type: "string",
737
+ describe: "open_revenue | revenue_cat (set)"
738
+ }).options({
739
+ app: {
740
+ type: "string",
741
+ describe: "Superwall app id or name"
742
+ },
743
+ project: {
744
+ type: "string",
745
+ describe: "Superwall project id"
746
+ },
747
+ yes: {
748
+ type: "boolean",
749
+ alias: "y",
750
+ describe: "Change the provider without asking. Outside a terminal a change is refused without it"
751
+ },
752
+ "dry-run": {
753
+ type: "boolean",
754
+ describe: "Say what would change; change nothing"
755
+ }
756
+ }).epilogue(REVENUE_PROVIDER_HELP), (argv) => {
757
+ return import("./revenue-provider-ebsRINY8.js").then((m) => m.runRevenueProvider(argv));
428
758
  }).command("asa <target> [action] [value]", "Call the Apple Search Ads API through Superwall's proxy (no key or token handling)", (y) => y.positional("target", {
429
759
  type: "string",
430
760
  describe: "A resource (campaigns, adgroups, keywords, negative-keywords, ads, creatives, product-pages, ad-rejections, reports, impression-share, apps, geo, budget-orders, acls, me), get|post|put|delete, a raw path (/campaigns), docs, or keys"
@@ -636,7 +966,7 @@ const registerPlatformCommands = (cli) => cli.command("query [sql]", "Run SQL ag
636
966
  describe: "product-pages: include deleted assets"
637
967
  }
638
968
  }), (argv) => {
639
- return import("./asa-D6H7Pjae.js").then((m) => m.runAsa(argv));
969
+ return import("./asa-C-sQzPPn.js").then((m) => m.runAsa(argv));
640
970
  });
641
971
 
642
972
  //#endregion
@@ -645,12 +975,12 @@ const registerResourceCommands = (input) => {
645
975
  let cli = input;
646
976
  const RESOURCE_HELP = {
647
977
  orgs: "Your Superwall organizations (list, use <id|name>)",
648
- apps: "Your apps, grouped by project (list, create <name> --platform ios, use <id>)"
978
+ apps: "Your apps, grouped by project (list, create <name> --platform ios, use <id>, bundle-id [value])"
649
979
  };
650
980
  for (const resource of RESOURCES) cli = cli.command(`${resource} [action] [value] [value2]`, RESOURCE_HELP[resource] ?? `Manage Superwall ${resource} (list, create)`, (y) => y.positional("action", {
651
981
  type: "string",
652
982
  default: "list",
653
- describe: "list | create | placement | use | storekit"
983
+ describe: "list | create | placement | use | storekit | bundle-id (apps)"
654
984
  }).positional("value", {
655
985
  type: "string",
656
986
  describe: "identifier / description / campaign id"
@@ -711,15 +1041,28 @@ const registerResourceCommands = (input) => {
711
1041
  type: "array",
712
1042
  describe: "Entitlement id(s) to grant (products create)"
713
1043
  },
1044
+ replace: {
1045
+ type: "boolean",
1046
+ describe: "apps bundle-id: replace a bundle ID the app already has"
1047
+ },
1048
+ yes: {
1049
+ type: "boolean",
1050
+ alias: "y",
1051
+ describe: "apps bundle-id: go ahead without asking when builds would run in test mode"
1052
+ },
1053
+ "app-store-id": {
1054
+ type: "string",
1055
+ describe: "apps bundle-id: the App Store ID too, saved only when the app has none (iOS)"
1056
+ },
714
1057
  "dry-run": {
715
1058
  type: "boolean",
716
1059
  describe: "Plan without writing"
717
1060
  }
718
- }), (argv) => {
719
- return import("./resource-jwASPCrw.js").then((m) => m.runResource(resource)(argv));
1061
+ }).epilogue(resource === "apps" ? APPS_HELP : ""), (argv) => {
1062
+ return import("./resource-CGIwSd29.js").then((m) => m.runResource(resource)(argv));
720
1063
  });
721
1064
  cli = cli.command("bootstrap", "Complete account tree: orgs, projects, apps, campaigns, placements, and products", (y) => y, (argv) => {
722
- return import("./api-Dv3LyZ5m.js").then((m) => m.runBootstrap(argv));
1065
+ return import("./api-CZzirVMj.js").then((m) => m.runBootstrap(argv));
723
1066
  });
724
1067
  for (const verb of API_VERBS) cli = cli.command(`${verb} <path>`, `Make ${verb.toUpperCase()} requests to the Superwall API`, (y) => y.positional("path", {
725
1068
  type: "string",
@@ -728,7 +1071,7 @@ const registerResourceCommands = (input) => {
728
1071
  type: "array",
729
1072
  describe: "Param, Stripe-style: -d key=value (string) or key:=value (number/bool/json); nesting via key[sub]"
730
1073
  } }), (argv) => {
731
- return import("./api-Dv3LyZ5m.js").then((m) => m.runApi(verb)(argv));
1074
+ return import("./api-CZzirVMj.js").then((m) => m.runApi(verb)(argv));
732
1075
  });
733
1076
  return cli;
734
1077
  };
@@ -761,8 +1104,8 @@ const registerWorkflowCommands = (cli) => cli.command("integrate", "Set up the S
761
1104
  hidden: true
762
1105
  }
763
1106
  }), (argv) => {
764
- if (argv.skill) return import("./print-skill-BiZLdCKv.js").then((m) => m.runPrintSkill("integrate")(argv));
765
- return import("./integrate-BR2LR-EK.js").then((m) => m.runIntegrate(argv));
1107
+ if (argv.skill) return import("./print-skill-ZojRSybs.js").then((m) => m.runPrintSkill("integrate")(argv));
1108
+ return import("./integrate-brmhPG-S.js").then((m) => m.runIntegrate(argv));
766
1109
  }).command("review", "Review an existing Superwall setup end to end", (y) => y.options({
767
1110
  ...installDirOption,
768
1111
  ...dryRunOption,
@@ -773,8 +1116,8 @@ const registerWorkflowCommands = (cli) => cli.command("integrate", "Set up the S
773
1116
  }
774
1117
  }), (argv) => {
775
1118
  const id = argv.fix ? "review-fix" : "review";
776
- if (argv.skill) return import("./print-skill-BiZLdCKv.js").then((m) => m.runPrintSkill(id)(argv));
777
- return import("./integrate-BR2LR-EK.js").then((m) => m.runActionCommand(id)(argv));
1119
+ if (argv.skill) return import("./print-skill-ZojRSybs.js").then((m) => m.runPrintSkill(id)(argv));
1120
+ return import("./integrate-brmhPG-S.js").then((m) => m.runActionCommand(id)(argv));
778
1121
  }).command(CHANNEL() === "next" ? "migrate [paywall]" : "migrate", CHANNEL() === "next" ? "Migrate from RevenueCat / Adapty / Qonversion, or rebuild a dashboard paywall or a native screen as code" : "Migrate from RevenueCat / Adapty / Qonversion", (y) => {
779
1122
  const base = y.options({
780
1123
  ...installDirOption,
@@ -790,8 +1133,8 @@ const registerWorkflowCommands = (cli) => cli.command("integrate", "Set up the S
790
1133
  describe: "A dashboard paywall id: scaffold it as code (if not already) and rebuild its pages with your agent, or copy the prompt"
791
1134
  }).options(migrateNextOptions).example("$0 migrate 65920", "Rebuild dashboard paywall 65920 as code").example("$0 migrate --screen App/UpdateRequiredView.swift", "Rebuild a native screen as a Superwall surface");
792
1135
  }, (argv) => {
793
- if (argv.skill && argv.paywall === void 0 && argv.screen === void 0) return import("./print-skill-BiZLdCKv.js").then((m) => m.runPrintSkill("migrate")(argv));
794
- return import("./migrate-C-4ISELN.js").then((m) => m.runMigrate(argv));
1136
+ if (argv.skill && argv.paywall === void 0 && argv.screen === void 0) return import("./print-skill-ZojRSybs.js").then((m) => m.runPrintSkill("migrate")(argv));
1137
+ return import("./migrate-C9ERDR6y.js").then((m) => m.runMigrate(argv));
795
1138
  });
796
1139
 
797
1140
  //#endregion
@@ -1,5 +1,5 @@
1
- import { m as Integration } from "./output-C-4UKMot.js";
2
- import { n as allDeps, r as readPackageJson } from "./scan-BmAW413l.js";
1
+ import { g as Integration } from "./output-C4o2gJ1K.js";
2
+ import { n as allDeps, r as readPackageJson } from "./scan-zKsddO72.js";
3
3
  import { readFileSync } from "node:fs";
4
4
  import fg from "fast-glob";
5
5
 
@@ -1,9 +1,9 @@
1
- import { _ as TELEMETRY_HOST, v as TELEMETRY_KEY, y as VERSION } from "./output-C-4UKMot.js";
2
- import { a as getAnonymousId, s as getOnboardedApp } from "./telemetry-Ch9cCTI-.js";
3
- import "./update-DIXbL-H9.js";
4
- import { i as loadSession } from "./token-BGAVPSQc.js";
5
- import { t as defineCommand } from "./command-3fGYyC8r.js";
6
- import "./ui-4gLyfrgl.js";
1
+ import { b as TELEMETRY_KEY, x as VERSION, y as TELEMETRY_HOST } from "./output-C4o2gJ1K.js";
2
+ import { a as getAnonymousId, s as getOnboardedApp } from "./telemetry-DeA1mvnT.js";
3
+ import "./update-B2fWIc4q.js";
4
+ import { i as loadSession } from "./token-C0it-Xh7.js";
5
+ import { t as defineCommand } from "./command-CMIz81Da.js";
6
+ import "./ui-Dy0b-9L8.js";
7
7
  import { basename } from "node:path";
8
8
  import { arch, release } from "node:os";
9
9
  import { readFileSync } from "node:fs";
@@ -1,5 +1,5 @@
1
- import { o as API_HOST } from "./output-C-4UKMot.js";
2
- import { i as loadSession, t as getOAuthAccessToken } from "./token-BGAVPSQc.js";
1
+ import { o as API_HOST } from "./output-C4o2gJ1K.js";
2
+ import { i as loadSession, t as getOAuthAccessToken } from "./token-C0it-Xh7.js";
3
3
 
4
4
  //#region src/core/agent/hosted.ts
5
5
  const STATUS_PATH = "/v2/cli-agent/status";