@superwall/cli 1.6.1 → 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 (65) hide show
  1. package/README.md +116 -3
  2. package/dist/{actions-BdZ-7BJd.js → actions-B7ym3oVS.js} +2 -2
  3. package/dist/{api-FjrCPu6r.js → api-CZzirVMj.js} +8 -8
  4. package/dist/{app-YeJj35Ia.js → app-DH6U8yuI.js} +11 -10
  5. package/dist/{asa-4nk7HHy8.js → asa-C-sQzPPn.js} +10 -10
  6. package/dist/{asc-2TZOQuK1.js → asc-1ZBJ6DwS.js} +282 -43
  7. package/dist/asc-Bf7zBbyS.js +65 -0
  8. package/dist/{asc-products-1e1DoGeL.js → asc-products-9JXtDxI4.js} +2 -35
  9. package/dist/{auth-QUYfKdwk.js → auth-YRhlV3DE.js} +11 -10
  10. package/dist/auth.js +2 -2
  11. package/dist/{billing-BK7bpv1t.js → billing-CCYHdApx.js} +1 -1
  12. package/dist/{bind-Ch4VR2EY.js → bind-YrJvuRF9.js} +3 -3
  13. package/dist/build-DLoCW5Ri.js +87 -0
  14. package/dist/bundle-id-CKxl_026.js +121 -0
  15. package/dist/{command-BJ_6850A.js → command-CMIz81Da.js} +5 -5
  16. package/dist/{create-vSQxQlEP.js → create-pkANt1Gs.js} +22 -21
  17. package/dist/dev-DZy6pOnB.js +22 -0
  18. package/dist/{dev-DEss5dwo.js → dev-DmB3XqaJ.js} +16 -8
  19. package/dist/{doctor-BYTfekBr.js → doctor-H-hf-Yww.js} +10 -10
  20. package/dist/{drivers-DGml3OlF.js → drivers-Qx9LxmRN.js} +2 -2
  21. package/dist/entry.js +453 -43
  22. package/dist/{existing-DgSo639M.js → existing-AVEfZu2A.js} +2 -2
  23. package/dist/feedback-CKf-rpBW.js +152 -0
  24. package/dist/{hosted-DqGp6oV2.js → hosted-CXe9TrWx.js} +2 -2
  25. package/dist/{integrate-Cl9eKHoF.js → integrate-brmhPG-S.js} +23 -22
  26. package/dist/{login-DS3MPeW2.js → login-Do4wFuLv.js} +31 -16
  27. package/dist/{migrate-WiTO71PE.js → migrate-C9ERDR6y.js} +24 -23
  28. package/dist/notification-url-DuKF2659.js +1273 -0
  29. package/dist/{open-studio-CbMUL5Va.js → open-studio-DOw-6ydc.js} +17 -14
  30. package/dist/{org-CV8c849b.js → org-sj7uyvp-.js} +2 -2
  31. package/dist/{output-XKuoEEjP.js → output-C4o2gJ1K.js} +12 -2
  32. package/dist/{pipeline-J9-nENTS.js → pipeline-BqzqZhX1.js} +10 -495
  33. package/dist/{print-skill-BOGm5Szi.js → print-skill-ZojRSybs.js} +7 -7
  34. package/dist/{promote-Ci085QxU.js → promote-BG8X4Nv_.js} +17 -16
  35. package/dist/publish-sxLh-G4G.js +35 -0
  36. package/dist/push-bQ6Vxtg8.js +35 -0
  37. package/dist/{query-BZStoGLM.js → query-_FbybaH-.js} +9 -9
  38. package/dist/{resource-ClLHSXi6.js → resource-CGIwSd29.js} +17 -177
  39. package/dist/revenue-provider-ebsRINY8.js +100 -0
  40. package/dist/{run-CiaWn78U.js → run-DsVZ5snL.js} +2 -2
  41. package/dist/{scan-DEgX5HxV.js → scan-zKsddO72.js} +1 -1
  42. package/dist/scope-BvzD-kO4.js +223 -0
  43. package/dist/selection-CxZoX4NT.js +496 -0
  44. package/dist/setup-Bxj22rYi.js +189 -0
  45. package/dist/skills/superwall-framework/SKILL.md +109 -36
  46. package/dist/skills/superwall-framework/references/cli.md +45 -5
  47. package/dist/skills/superwall-framework/references/mobile-design.md +60 -181
  48. package/dist/{skills-DsBAVRTE.js → skills-DPzlnfCK.js} +78 -9
  49. package/dist/{skills-DjPCmUMU.js → skills-D_R-lEsK.js} +8 -8
  50. package/dist/{spinner-DFctF_Jw.js → spinner-TWa0hia6.js} +1 -1
  51. package/dist/{telemetry-EzV7cA7s.js → telemetry-DeA1mvnT.js} +1 -1
  52. package/dist/{token-r5g876aI.js → token-C0it-Xh7.js} +1 -1
  53. package/dist/{ui-4gLyfrgl.js → ui-Dy0b-9L8.js} +4 -3
  54. package/dist/{update-Cz3Q3MFj.js → update-B2fWIc4q.js} +2 -2
  55. package/dist/{upgrade-BA_4sdnh.js → upgrade-BmzkTKrh.js} +6 -6
  56. package/package.json +2 -2
  57. package/dist/dev-B9qmPH1W.js +0 -21
  58. package/dist/feedback-4LsBpZZx.js +0 -73
  59. package/dist/publish--TV-j8Zd.js +0 -34
  60. package/dist/push-CpGetsJF.js +0 -34
  61. package/dist/skills/superwall-framework/references/responsive.md +0 -162
  62. /package/dist/{api-output-CEhN-U_N.js → api-output-aJNw7Syy.js} +0 -0
  63. /package/dist/{params-BxgTuCzr.js → params-l3CrvRtR.js} +0 -0
  64. /package/dist/{reports-C0xHCLnt.js → reports-CfJqoava.js} +0 -0
  65. /package/dist/{storekit-Dlpbq5Wv.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-XKuoEEjP.js";
2
- import { t as flushTelemetry } from "./telemetry-EzV7cA7s.js";
3
- import { n as flushUpdateCheck } from "./update-Cz3Q3MFj.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-QUYfKdwk.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-QUYfKdwk.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-QUYfKdwk.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,16 +81,58 @@ const registerAccountCommands = (cli) => cli.command("login", "Log in to Superwa
81
81
  hidden: true
82
82
  }
83
83
  }), (argv) => {
84
- return import("./skills-DjPCmUMU.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-BYTfekBr.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-BA_4sdnh.js").then((m) => m.runUpgrade(argv));
89
- }).command("feedback [message]", "Send feedback about the CLI to the Superwall team", (y) => y.positional("message", {
88
+ return import("./upgrade-BmzkTKrh.js").then((m) => m.runUpgrade(argv));
89
+ }).command("feedback [message]", "Report a bug or send feedback to the Superwall team", (y) => y.positional("message", {
90
90
  type: "string",
91
- describe: "Your feedback (omit to be prompted)"
92
- }).example("$0 feedback \"migrate crashed on Expo\"", "Send feedback").example("$0 feedback \"...\" --json", "For agents / automation"), (argv) => {
93
- return import("./feedback-4LsBpZZx.js").then((m) => m.runFeedback(argv));
91
+ describe: "What happened: what you ran, what you expected, what you got (omit to be prompted)"
92
+ }).options({
93
+ title: {
94
+ type: "string",
95
+ describe: "One-line summary"
96
+ },
97
+ kind: {
98
+ type: "string",
99
+ choices: [
100
+ "bug",
101
+ "docs",
102
+ "idea",
103
+ "praise",
104
+ "other"
105
+ ],
106
+ describe: "What this is (default: other)"
107
+ },
108
+ command: {
109
+ type: "string",
110
+ describe: "The command or call that misbehaved"
111
+ },
112
+ project: {
113
+ type: "string",
114
+ describe: "Project id it happened in (defaults to this directory's linked app)"
115
+ },
116
+ app: {
117
+ type: "string",
118
+ describe: "App id it happened in (defaults to this directory's linked app)"
119
+ },
120
+ context: {
121
+ type: "string",
122
+ array: true,
123
+ describe: "Repro context as key=value, repeatable (paywall=…, placement=…, sdk=ios@4.5.0, device=…)"
124
+ },
125
+ file: {
126
+ type: "string",
127
+ array: true,
128
+ describe: "Attach a log or snippet (repeatable, max 5; '-' reads stdin; long files keep the last 20k chars)"
129
+ },
130
+ agent: {
131
+ type: "string",
132
+ describe: "The agent sending it (auto-detected when possible)"
133
+ }
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-CKf-rpBW.js").then((m) => m.runFeedback(argv));
94
136
  });
95
137
 
96
138
  //#endregion
@@ -117,21 +159,23 @@ function printHelp() {
117
159
  head("Paywalls & funnels"),
118
160
  row("create [dir]", "Set up paywalls in your app - creates superwall/ inside it"),
119
161
  row("dev [dir..]", "Host the studio: browse and preview your paywalls and funnels"),
162
+ row("build [dir]", "Build the snapshot documents a push would version, without pushing"),
120
163
  row("push [dir]", "Build and push your paywalls and funnels as immutable versions"),
121
164
  row("promote [dir]", "Point production at a pushed version"),
122
165
  row("publish [dir]", "Push and promote in one step"),
123
166
  pc.dim(" push and publish take -m <note> to record why, in the source commit."),
124
- pc.dim(" All three take --platform <p> when the project pushes to several platforms."),
167
+ pc.dim(" All four take --platform <p> when the project pushes to several platforms."),
125
168
  ""
126
169
  ] : [],
127
170
  head("Resource commands"),
128
171
  row("bootstrap", "Complete account tree: projects, apps, campaigns, and products"),
129
- row("apps", "Projects and platform apps (list, create, use)"),
172
+ row("apps", "Projects and platform apps (list, create, use, bundle-id)"),
130
173
  row("products", "Products (list, create, storekit)"),
131
174
  row("entitlements", "Entitlements (list, create)"),
132
175
  row("campaigns", "Campaigns (list, create, placement)"),
133
176
  row("paywalls", "Paywalls (list)"),
134
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)"),
135
179
  row("orgs", "Organizations (list, use) - only needed with multiple orgs"),
136
180
  "",
137
181
  head("API commands"),
@@ -140,7 +184,10 @@ function printHelp() {
140
184
  head("App Store Connect commands"),
141
185
  row("asc", "The ASC API via Superwall's signed proxy (no .p8 / JWT)"),
142
186
  row("asc docs", "Exact ASC request schema, from Apple's spec (path or search)"),
143
- 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"),
144
191
  "",
145
192
  head("Apple Search Ads commands"),
146
193
  row("asa", "The Apple Ads API via Superwall's proxy (campaigns, keywords, reports, ...)"),
@@ -152,7 +199,7 @@ function printHelp() {
152
199
  row("skills", "Install or update the Superwall agent skills"),
153
200
  row("doctor", "Check the health of your integration"),
154
201
  row("upgrade", "Update the CLI to the latest version"),
155
- row("feedback", "Send feedback about the CLI to the Superwall team"),
202
+ row("feedback", "Report a bug or send feedback to the Superwall team"),
156
203
  "",
157
204
  pc.bold("Flags:"),
158
205
  row("--json", "Machine-readable output"),
@@ -199,7 +246,7 @@ const registerPaywallCommands = (cli) => cli.command("create [dir]", "Set up pay
199
246
  describe: "Connect a Superwall app when possible (--no-connect to skip)"
200
247
  }
201
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) => {
202
- return import("./create-vSQxQlEP.js").then((m) => m.runCreate(argv));
249
+ return import("./create-pkANt1Gs.js").then((m) => m.runCreate(argv));
203
250
  }).command("dev [dir..]", "Host the studio: browse and preview your paywalls and funnels", (y) => y.positional("dir", {
204
251
  type: "string",
205
252
  array: true,
@@ -222,7 +269,31 @@ const registerPaywallCommands = (cli) => cli.command("create [dir]", "Set up pay
222
269
  describe: "Open the browser at this studio path once the server is up"
223
270
  }
224
271
  }), (argv) => {
225
- return import("./dev-B9qmPH1W.js").then((m) => m.runDev(argv));
272
+ return import("./dev-DZy6pOnB.js").then((m) => m.runDev(argv));
273
+ }).command("build [dir]", "Build your paywalls into the snapshot documents a push would version, without pushing", (y) => y.positional("dir", {
274
+ type: "string",
275
+ describe: "Project directory (default: cwd)"
276
+ }).options({
277
+ id: {
278
+ type: "array",
279
+ string: true,
280
+ describe: "Limit to these paywalls or funnels by id (repeatable, or comma-separated)"
281
+ },
282
+ platform: {
283
+ type: "array",
284
+ string: true,
285
+ describe: "Build for these platforms (repeatable, or comma-separated) - ios, android, web. Default: one platform-neutral document"
286
+ },
287
+ out: {
288
+ type: "string",
289
+ describe: "Directory to write into (default: superwall/.superwall/build)"
290
+ },
291
+ json: {
292
+ type: "boolean",
293
+ describe: "Print the built files as JSON"
294
+ }
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) => {
296
+ return import("./build-DLoCW5Ri.js").then((m) => m.runBuild(argv));
226
297
  }).command("push [dir]", "Build and push your paywalls as immutable versions (production untouched)", (y) => y.positional("dir", {
227
298
  type: "string",
228
299
  describe: "Project directory (default: cwd)"
@@ -248,7 +319,7 @@ const registerPaywallCommands = (cli) => cli.command("create [dir]", "Set up pay
248
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)"
249
320
  }
250
321
  }), (argv) => {
251
- return import("./push-CpGetsJF.js").then((m) => m.runPush(argv));
322
+ return import("./push-bQ6Vxtg8.js").then((m) => m.runPush(argv));
252
323
  }).command("promote [dir]", "Point production at a pushed version (the latest by default)", (y) => y.version(false).positional("dir", {
253
324
  type: "string",
254
325
  describe: "Project directory (default: cwd)"
@@ -269,7 +340,7 @@ const registerPaywallCommands = (cli) => cli.command("create [dir]", "Set up pay
269
340
  describe: "Pushed version number to promote (requires a single --id)"
270
341
  }
271
342
  }), (argv) => {
272
- return import("./promote-Ci085QxU.js").then((m) => m.runPromote(argv));
343
+ return import("./promote-BG8X4Nv_.js").then((m) => m.runPromote(argv));
273
344
  }).command("publish [dir]", "Push and promote in one step - build, version, and ship to production", (y) => y.positional("dir", {
274
345
  type: "string",
275
346
  describe: "Project directory (default: cwd)"
@@ -295,9 +366,195 @@ const registerPaywallCommands = (cli) => cli.command("create [dir]", "Set up pay
295
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)"
296
367
  }
297
368
  }), (argv) => {
298
- return import("./publish--TV-j8Zd.js").then((m) => m.runPublish(argv));
369
+ return import("./publish-sxLh-G4G.js").then((m) => m.runPublish(argv));
299
370
  });
300
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
+
301
558
  //#endregion
302
559
  //#region src/cli/platform.ts
303
560
  const registerPlatformCommands = (cli) => cli.command("query [sql]", "Run SQL against your ClickHouse analytics data", (y) => y.positional("sql", {
@@ -307,16 +564,16 @@ const registerPlatformCommands = (cli) => cli.command("query [sql]", "Run SQL ag
307
564
  type: "string",
308
565
  describe: "Read SQL from a .sql file"
309
566
  } }).example("$0 query \"SHOW TABLES FROM sw\"", "Run an inline query").example("$0 query --file report.sql --json", "Run a saved query"), (argv) => {
310
- return import("./query-BZStoGLM.js").then((m) => m.runQuery(argv));
311
- }).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", {
312
569
  type: "string",
313
- 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"
314
571
  }).positional("value", {
315
572
  type: "string",
316
- 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)"
317
574
  }).positional("value2", {
318
575
  type: "string",
319
- describe: "Team id (keys rm)"
576
+ describe: "Team id (keys rm), or api_key | purchase_key (keys with --app)"
320
577
  }).options({
321
578
  d: {
322
579
  type: "array",
@@ -324,7 +581,7 @@ const registerPlatformCommands = (cli) => cli.command("query [sql]", "Run SQL ag
324
581
  },
325
582
  team: {
326
583
  type: "string",
327
- 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)"
328
585
  },
329
586
  force: {
330
587
  type: "boolean",
@@ -351,13 +608,153 @@ const registerPlatformCommands = (cli) => cli.command("query [sql]", "Run SQL ag
351
608
  type: "string",
352
609
  describe: "Account name (keys set)"
353
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
+ },
354
663
  "dry-run": {
355
664
  type: "boolean",
356
665
  hidden: true,
357
666
  describe: "Plan without writing"
358
667
  }
359
- }), (argv) => {
360
- return import("./asc-2TZOQuK1.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));
361
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", {
362
759
  type: "string",
363
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"
@@ -569,7 +966,7 @@ const registerPlatformCommands = (cli) => cli.command("query [sql]", "Run SQL ag
569
966
  describe: "product-pages: include deleted assets"
570
967
  }
571
968
  }), (argv) => {
572
- return import("./asa-4nk7HHy8.js").then((m) => m.runAsa(argv));
969
+ return import("./asa-C-sQzPPn.js").then((m) => m.runAsa(argv));
573
970
  });
574
971
 
575
972
  //#endregion
@@ -578,12 +975,12 @@ const registerResourceCommands = (input) => {
578
975
  let cli = input;
579
976
  const RESOURCE_HELP = {
580
977
  orgs: "Your Superwall organizations (list, use <id|name>)",
581
- 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])"
582
979
  };
583
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", {
584
981
  type: "string",
585
982
  default: "list",
586
- describe: "list | create | placement | use | storekit"
983
+ describe: "list | create | placement | use | storekit | bundle-id (apps)"
587
984
  }).positional("value", {
588
985
  type: "string",
589
986
  describe: "identifier / description / campaign id"
@@ -644,15 +1041,28 @@ const registerResourceCommands = (input) => {
644
1041
  type: "array",
645
1042
  describe: "Entitlement id(s) to grant (products create)"
646
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
+ },
647
1057
  "dry-run": {
648
1058
  type: "boolean",
649
1059
  describe: "Plan without writing"
650
1060
  }
651
- }), (argv) => {
652
- return import("./resource-ClLHSXi6.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));
653
1063
  });
654
1064
  cli = cli.command("bootstrap", "Complete account tree: orgs, projects, apps, campaigns, placements, and products", (y) => y, (argv) => {
655
- return import("./api-FjrCPu6r.js").then((m) => m.runBootstrap(argv));
1065
+ return import("./api-CZzirVMj.js").then((m) => m.runBootstrap(argv));
656
1066
  });
657
1067
  for (const verb of API_VERBS) cli = cli.command(`${verb} <path>`, `Make ${verb.toUpperCase()} requests to the Superwall API`, (y) => y.positional("path", {
658
1068
  type: "string",
@@ -661,7 +1071,7 @@ const registerResourceCommands = (input) => {
661
1071
  type: "array",
662
1072
  describe: "Param, Stripe-style: -d key=value (string) or key:=value (number/bool/json); nesting via key[sub]"
663
1073
  } }), (argv) => {
664
- return import("./api-FjrCPu6r.js").then((m) => m.runApi(verb)(argv));
1074
+ return import("./api-CZzirVMj.js").then((m) => m.runApi(verb)(argv));
665
1075
  });
666
1076
  return cli;
667
1077
  };
@@ -694,8 +1104,8 @@ const registerWorkflowCommands = (cli) => cli.command("integrate", "Set up the S
694
1104
  hidden: true
695
1105
  }
696
1106
  }), (argv) => {
697
- if (argv.skill) return import("./print-skill-BOGm5Szi.js").then((m) => m.runPrintSkill("integrate")(argv));
698
- return import("./integrate-Cl9eKHoF.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));
699
1109
  }).command("review", "Review an existing Superwall setup end to end", (y) => y.options({
700
1110
  ...installDirOption,
701
1111
  ...dryRunOption,
@@ -706,8 +1116,8 @@ const registerWorkflowCommands = (cli) => cli.command("integrate", "Set up the S
706
1116
  }
707
1117
  }), (argv) => {
708
1118
  const id = argv.fix ? "review-fix" : "review";
709
- if (argv.skill) return import("./print-skill-BOGm5Szi.js").then((m) => m.runPrintSkill(id)(argv));
710
- return import("./integrate-Cl9eKHoF.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));
711
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) => {
712
1122
  const base = y.options({
713
1123
  ...installDirOption,
@@ -723,8 +1133,8 @@ const registerWorkflowCommands = (cli) => cli.command("integrate", "Set up the S
723
1133
  describe: "A dashboard paywall id: scaffold it as code (if not already) and rebuild its pages with your agent, or copy the prompt"
724
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");
725
1135
  }, (argv) => {
726
- if (argv.skill && argv.paywall === void 0 && argv.screen === void 0) return import("./print-skill-BOGm5Szi.js").then((m) => m.runPrintSkill("migrate")(argv));
727
- return import("./migrate-WiTO71PE.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));
728
1138
  });
729
1139
 
730
1140
  //#endregion