@superwall/cli 1.1.1 → 1.3.0-beta.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 (52) hide show
  1. package/README.md +37 -4
  2. package/dist/{actions-I5gVO5jN.js → actions-DvHycH3X.js} +2 -2
  3. package/dist/{api-emImQnVy.js → api-B50i89j0.js} +9 -9
  4. package/dist/{api-output-B5hh0q4V.js → api-output-D9ggXQIr.js} +1 -1
  5. package/dist/{app-DE9lxNNV.js → app-FiC9SQVp.js} +11 -11
  6. package/dist/asa-B5hrBL3t.js +1194 -0
  7. package/dist/{asc-DYc_Yo9e.js → asc-CRtRYv17.js} +13 -13
  8. package/dist/{auth-Bir_Un8l.js → auth-CYognaF4.js} +10 -10
  9. package/dist/auth.js +2 -2
  10. package/dist/{billing-CW0diI2X.js → billing-CSOUhWso.js} +1 -1
  11. package/dist/{bind-DO11eXrR.js → bind-BbzBenoP.js} +4 -4
  12. package/dist/{command-CmJMNVVz.js → command-B7Te31wp.js} +96 -101
  13. package/dist/{create-CwDgWW16.js → create--Q8nPgoa.js} +18 -18
  14. package/dist/{dev-OnmMOsgK.js → dev-Dr6gXH-o.js} +37 -19
  15. package/dist/{doctor-CpYkDfdC.js → doctor-Cf0qNjbq.js} +10 -10
  16. package/dist/{drivers-Cweb9bWA.js → drivers-ItOmKzrw.js} +2 -2
  17. package/dist/entry.js +531 -279
  18. package/dist/{existing-p-hX-Nxc.js → existing-B-e22WOr.js} +2 -2
  19. package/dist/{feedback-CV4JnRuk.js → feedback-C3UtAxye.js} +9 -9
  20. package/dist/{git-BrTxQ7ui.js → git-2wRxiwOc.js} +10 -10
  21. package/dist/{hosted-CbNJSJAC.js → hosted-vk05ZF6w.js} +3 -3
  22. package/dist/{integrate-DOLvHr1D.js → integrate-Cv8r_i2l.js} +30 -29
  23. package/dist/{login-B7fSpJKc.js → login-DOES7Kup.js} +8 -7
  24. package/dist/{migrate-Bn5btm_H.js → migrate-C7R29RPH.js} +20 -20
  25. package/dist/{org-B2gy9Pmu.js → org-Cg25bcsj.js} +3 -3
  26. package/dist/output-D2Ax_hHL.js +123 -0
  27. package/dist/{params-Bvq0iqQK.js → params-B1zeElGa.js} +1 -2
  28. package/dist/{pipeline-COr4sB6U.js → pipeline-BVeUA6Ig.js} +106 -173
  29. package/dist/{print-skill-D0j2D6tw.js → print-skill-D-R81bno.js} +7 -7
  30. package/dist/{promote-UmKZySRx.js → promote-CV_Lsmqd.js} +18 -18
  31. package/dist/publish-CSnNvHHi.js +35 -0
  32. package/dist/push-sjnRI6iL.js +35 -0
  33. package/dist/{query-CbGfXmKu.js → query-CdcWSinl.js} +10 -10
  34. package/dist/{resource-m6yz1jwE.js → resource-PVg0uzSK.js} +14 -14
  35. package/dist/{resources-CVrWwA1K.js → resources-s64mBHaC.js} +1 -0
  36. package/dist/{run-BTLaOoKK.js → run-XIkrFIgw.js} +2 -2
  37. package/dist/{scan-BfoeYW1v.js → scan-Dk0ZlCY6.js} +2 -2
  38. package/dist/{skills-HlIKA9xR.js → skills-B-mR2CqM.js} +4 -3
  39. package/dist/{skills-C4Yzl64N.js → skills-CoEIW0mE.js} +8 -8
  40. package/dist/{spinner-gOxIMz-V.js → spinner-B9dT3DBY.js} +1 -1
  41. package/dist/{telemetry-CLi7mjDP.js → telemetry-yJs7t0rt.js} +6 -41
  42. package/dist/{token-DHRH8cxi.js → token-GcbyH6G8.js} +2 -2
  43. package/dist/{ui-C4ncRJqd.js → ui-Lqt_zFOr.js} +5 -1
  44. package/dist/update-B4hoLAN-.js +59 -0
  45. package/dist/{upgrade-Cbh-7q_o.js → upgrade-ByCYDXgb.js} +6 -6
  46. package/package.json +4 -3
  47. package/dist/json-C3hPIMkI.js +0 -7
  48. package/dist/publish-BVnG2UOU.js +0 -35
  49. package/dist/push-hHtVTZ1m.js +0 -35
  50. package/dist/update-CxP4fmMe.js +0 -137
  51. /package/dist/{asc-products-YQ6Oc6YO.js → asc-products-C6MvSy8H.js} +0 -0
  52. /package/dist/{storekit-Ddvs4Ynw.js → storekit-DPonXSwe.js} +0 -0
package/dist/entry.js CHANGED
@@ -1,11 +1,11 @@
1
- import { k as VERSION, t as flushTelemetry, w as ENV_API_KEY } from "./telemetry-CLi7mjDP.js";
2
- import "./json-C3hPIMkI.js";
3
- import { c as writeJson, n as flushUpdateCheck } from "./update-CxP4fmMe.js";
1
+ import { g as VERSION, i as writeJson, u as ENV_API_KEY } from "./output-D2Ax_hHL.js";
2
+ import { t as flushTelemetry } from "./telemetry-yJs7t0rt.js";
3
+ import { n as flushUpdateCheck } from "./update-B4hoLAN-.js";
4
4
  import yargs from "yargs";
5
5
  import { hideBin } from "yargs/helpers";
6
6
  import pc from "picocolors";
7
7
 
8
- //#region src/cli.ts
8
+ //#region src/cli/options.ts
9
9
  const installDirOption = { "install-dir": {
10
10
  describe: "Directory to set up Superwall in (default: cwd)",
11
11
  type: "string"
@@ -37,6 +37,64 @@ const API_VERBS = [
37
37
  "patch",
38
38
  "delete"
39
39
  ];
40
+
41
+ //#endregion
42
+ //#region src/cli/account.ts
43
+ const registerAccountCommands = (cli) => cli.command("login", "Log in to Superwall (opens your browser)", (y) => y.options({
44
+ "api-key": {
45
+ type: "string",
46
+ describe: "Log in headlessly with an API key (for CI) instead of the browser"
47
+ },
48
+ host: {
49
+ type: "string",
50
+ describe: "OAuth issuer override",
51
+ hidden: true
52
+ },
53
+ "client-id": {
54
+ type: "string",
55
+ describe: "OAuth client id override",
56
+ hidden: true
57
+ }
58
+ }), (argv) => {
59
+ return import("./auth-CYognaF4.js").then((m) => m.runLogin(argv));
60
+ }).command("logout", "Log out of Superwall", (y) => y, (argv) => {
61
+ return import("./auth-CYognaF4.js").then((m) => m.runLogout(argv));
62
+ }).command("whoami", "Show the logged-in Superwall account", (y) => y, (argv) => {
63
+ return import("./auth-CYognaF4.js").then((m) => m.runWhoami(argv));
64
+ }).command("skills", "Install or update the Superwall agent skills for your coding agent", (y) => y.options({
65
+ skill: {
66
+ type: "array",
67
+ describe: "Install specific skills by name (default: all)"
68
+ },
69
+ force: {
70
+ type: "boolean",
71
+ describe: "Reinstall even if skills are already up to date"
72
+ },
73
+ yes: {
74
+ type: "boolean",
75
+ alias: "y",
76
+ describe: "Install all skills without asking"
77
+ },
78
+ "dry-run": {
79
+ type: "boolean",
80
+ describe: "Print the install command without running it",
81
+ hidden: true
82
+ }
83
+ }), (argv) => {
84
+ return import("./skills-CoEIW0mE.js").then((m) => m.runSkills(argv));
85
+ }).command("doctor", "Check the health of your Superwall integration", (y) => y.options({ ...installDirOption }), (argv) => {
86
+ return import("./doctor-Cf0qNjbq.js").then((m) => m.runDoctor(argv));
87
+ }).command("upgrade", "Update the CLI to the latest version", (y) => y, (argv) => {
88
+ return import("./upgrade-ByCYDXgb.js").then((m) => m.runUpgrade(argv));
89
+ }).command("feedback [message]", "Send feedback about the CLI to the Superwall team", (y) => y.positional("message", {
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-C3UtAxye.js").then((m) => m.runFeedback(argv));
94
+ });
95
+
96
+ //#endregion
97
+ //#region src/cli/help.ts
40
98
  function printHelp() {
41
99
  const pad = (cmd) => ` ${cmd.padEnd(30)}`;
42
100
  const row = (cmd, desc) => `${pad(cmd)}${desc}`;
@@ -80,6 +138,11 @@ function printHelp() {
80
138
  row("asc docs", "Exact ASC request schema, from Apple's spec (path or search)"),
81
139
  row("asc keys", "Manage App Store Connect API keys (list, set, rm)"),
82
140
  "",
141
+ head("Apple Search Ads commands"),
142
+ row("asa", "The Apple Ads API via Superwall's proxy (campaigns, keywords, reports, ...)"),
143
+ row("asa docs", "Every endpoint, with Apple's own schema (group, group action, or search)"),
144
+ row("asa keys", "Which apps have Apple Search Ads connected"),
145
+ "",
83
146
  head("Other commands"),
84
147
  row("login, logout, whoami", "Authenticate the CLI"),
85
148
  row("skills", "Install or update the Superwall agent skills"),
@@ -97,169 +160,405 @@ function printHelp() {
97
160
  ""
98
161
  ].join("\n"));
99
162
  }
100
- async function run() {
101
- const args = hideBin(process.argv);
102
- if (args.length === 0 || args[0] === "help" || (args[0] === "-h" || args[0] === "--help") && args.length === 1) {
103
- printHelp();
104
- return;
105
- }
106
- let cli = yargs(args).scriptName("superwall").usage("Superwall CLI\n\n$0 [command]").option("interactive", {
163
+
164
+ //#endregion
165
+ //#region src/cli/paywalls.ts
166
+ const registerPaywallCommands = (cli) => cli.command("create [dir]", "Set up paywalls in your app - creates a superwall/ directory inside it", (y) => y.positional("dir", {
167
+ type: "string",
168
+ describe: "Your app's root (default: cwd) - paywalls land in superwall/ inside it"
169
+ }).options({
170
+ example: {
171
+ type: "string",
172
+ describe: "Start from a public example by name, e.g. --example with-rive"
173
+ },
174
+ yes: {
175
+ type: "boolean",
176
+ alias: "y",
177
+ describe: "Accept defaults and skip the optional prompts"
178
+ },
179
+ install: {
107
180
  type: "boolean",
108
181
  default: true,
182
+ describe: "Install dependencies after scaffolding (--no-install to skip)"
183
+ },
184
+ connect: {
185
+ type: "boolean",
186
+ default: true,
187
+ describe: "Connect a Superwall app when possible (--no-connect to skip)"
188
+ }
189
+ }).example("$0 create", "Set up superwall/ in the current app").example("$0 create --example with-rive", "Start from an example"), (argv) => {
190
+ return import("./create--Q8nPgoa.js").then((m) => m.runCreate(argv));
191
+ }).command("dev [dir..]", "Host the studio: browse and preview your paywalls and funnels", (y) => y.positional("dir", {
192
+ type: "string",
193
+ array: true,
194
+ describe: "Project directories to serve (default: cwd)"
195
+ }).options({
196
+ port: {
197
+ type: "number",
198
+ default: 6100,
199
+ alias: "p",
200
+ describe: "Preferred port (falls back to the next free one)"
201
+ },
202
+ host: {
203
+ type: "string",
204
+ default: "0.0.0.0",
205
+ describe: "Host to bind"
206
+ }
207
+ }), (argv) => {
208
+ return import("./dev-Dr6gXH-o.js").then((m) => m.runDev(argv));
209
+ }).command("push [dir]", "Build and push your paywalls as immutable versions (production untouched)", (y) => y.positional("dir", {
210
+ type: "string",
211
+ describe: "Project directory (default: cwd)"
212
+ }).options({
213
+ id: {
214
+ type: "array",
215
+ string: true,
216
+ describe: "Limit to these paywalls or funnels by id (repeatable, or comma-separated)"
217
+ },
218
+ platform: {
219
+ type: "array",
220
+ string: true,
221
+ describe: "Limit to these platforms (repeatable, or comma-separated) - ios, android, web, flutter, react_native"
222
+ },
223
+ rename: {
224
+ type: "array",
225
+ string: true,
226
+ describe: "Declare a renamed directory as <old>=<new> (repeatable) - required in CI, where the resolver cannot prompt"
227
+ },
228
+ message: {
229
+ type: "string",
230
+ alias: "m",
231
+ describe: "Publish note recorded in the source commit (only lands when this publish creates a new source commit — unchanged source reuses the existing commit)"
232
+ }
233
+ }), (argv) => {
234
+ return import("./push-sjnRI6iL.js").then((m) => m.runPush(argv));
235
+ }).command("promote [dir]", "Point production at a pushed version (the latest by default)", (y) => y.version(false).positional("dir", {
236
+ type: "string",
237
+ describe: "Project directory (default: cwd)"
238
+ }).options({
239
+ id: {
240
+ type: "array",
241
+ string: true,
242
+ describe: "Limit to these paywalls or funnels by id (repeatable, or comma-separated)"
243
+ },
244
+ platform: {
245
+ type: "array",
246
+ string: true,
247
+ describe: "Limit to these platforms (repeatable, or comma-separated) - ios, android, web, flutter, react_native"
248
+ },
249
+ version: {
250
+ type: "number",
251
+ alias: "v",
252
+ describe: "Pushed version number to promote (requires a single --id)"
253
+ }
254
+ }), (argv) => {
255
+ return import("./promote-CV_Lsmqd.js").then((m) => m.runPromote(argv));
256
+ }).command("publish [dir]", "Push and promote in one step - build, version, and ship to production", (y) => y.positional("dir", {
257
+ type: "string",
258
+ describe: "Project directory (default: cwd)"
259
+ }).options({
260
+ id: {
261
+ type: "array",
262
+ string: true,
263
+ describe: "Limit to these paywalls or funnels by id (repeatable, or comma-separated)"
264
+ },
265
+ platform: {
266
+ type: "array",
267
+ string: true,
268
+ describe: "Limit to these platforms (repeatable, or comma-separated) - ios, android, web, flutter, react_native"
269
+ },
270
+ rename: {
271
+ type: "array",
272
+ string: true,
273
+ describe: "Declare a renamed directory as <old>=<new> (repeatable) - required in CI, where the resolver cannot prompt"
274
+ },
275
+ message: {
276
+ type: "string",
277
+ alias: "m",
278
+ describe: "Publish note recorded in the source commit (only lands when this publish creates a new source commit — unchanged source reuses the existing commit)"
279
+ }
280
+ }), (argv) => {
281
+ return import("./publish-CSnNvHHi.js").then((m) => m.runPublish(argv));
282
+ });
283
+
284
+ //#endregion
285
+ //#region src/cli/platform.ts
286
+ const registerPlatformCommands = (cli) => cli.command("query [sql]", "Run SQL against your ClickHouse analytics data", (y) => y.positional("sql", {
287
+ type: "string",
288
+ describe: "SQL query (or pass it with --file / stdin)"
289
+ }).options({ file: {
290
+ type: "string",
291
+ describe: "Read SQL from a .sql file"
292
+ } }).example("$0 query \"SHOW TABLES FROM sw\"", "Run an inline query").example("$0 query --file report.sql --json", "Run a saved query"), (argv) => {
293
+ return import("./query-CdcWSinl.js").then((m) => m.runQuery(argv));
294
+ }).command("asc <target> [value] [value2]", "Call the App Store Connect API through Superwall's signed proxy (no .p8 / JWT needed)", (y) => y.positional("target", {
295
+ type: "string",
296
+ describe: "get|post|patch|delete, a raw path (/v1/...), or: apps | products | subscriptions | iaps | docs | keys"
297
+ }).positional("value", {
298
+ type: "string",
299
+ describe: "Path (for a verb), app bundle id / ASC app id (shortcuts), docs path or search, or list|set|rm (keys)"
300
+ }).positional("value2", {
301
+ type: "string",
302
+ describe: "Team id (keys rm)"
303
+ }).options({
304
+ d: {
305
+ type: "array",
306
+ describe: "Request param, Stripe-style: -d key=value (string) or key:=value (number/bool/json); nesting via key[sub]"
307
+ },
308
+ team: {
309
+ type: "string",
310
+ describe: "ASC team id (if the org has more than one connected)"
311
+ },
312
+ force: {
313
+ type: "boolean",
314
+ describe: "Skip request-body schema validation and send as-is (post/patch)"
315
+ },
316
+ quiet: {
317
+ type: "boolean",
109
318
  hidden: true,
110
- describe: "Allow prompts (use --no-interactive for automation)"
111
- }).option("json", {
319
+ describe: "Suppress progress output"
320
+ },
321
+ "key-id": {
322
+ type: "string",
323
+ describe: "ASC key id (keys set)"
324
+ },
325
+ issuer: {
326
+ type: "string",
327
+ describe: "ASC issuer id (keys set)"
328
+ },
329
+ "key-file": {
330
+ type: "string",
331
+ describe: "Path to the .p8 key file (keys set)"
332
+ },
333
+ name: {
334
+ type: "string",
335
+ describe: "Account name (keys set)"
336
+ },
337
+ "dry-run": {
112
338
  type: "boolean",
113
- default: false,
114
- describe: "Machine-readable output"
115
- }).command("integrate", "Set up the SDK, placements, and dashboard in your app", (y) => y.options({
116
- ...installDirOption,
117
- ...apiKeyOption,
118
- ...dryRunOption,
119
- ...skillOption,
120
- driver: {
121
- type: "string",
122
- choices: [
123
- "claude",
124
- "codex",
125
- "superwall"
126
- ],
127
- describe: "Force a coding-agent backend (default: first detected)",
128
- hidden: true
129
- }
130
- }), (argv) => {
131
- if (argv.skill) return import("./print-skill-D0j2D6tw.js").then((m) => m.runPrintSkill("integrate")(argv));
132
- return import("./integrate-DOLvHr1D.js").then((m) => m.runIntegrate(argv));
133
- }).command("review", "Review an existing Superwall setup end to end", (y) => y.options({
134
- ...installDirOption,
135
- ...dryRunOption,
136
- ...skillOption,
137
- fix: {
138
- type: "boolean",
139
- describe: "Apply verified, safe fixes from the latest review"
140
- }
141
- }), (argv) => {
142
- const id = argv.fix ? "review-fix" : "review";
143
- if (argv.skill) return import("./print-skill-D0j2D6tw.js").then((m) => m.runPrintSkill(id)(argv));
144
- return import("./integrate-DOLvHr1D.js").then((m) => m.runActionCommand(id)(argv));
145
- }).command("migrate", "Migrate from RevenueCat / Adapty / Qonversion to Superwall", (y) => y.options({
146
- ...installDirOption,
147
- "dry-run": {
148
- type: "boolean",
149
- describe: "Plan without changes"
150
- },
151
- ...skillOption
152
- }), (argv) => {
153
- if (argv.skill) return import("./print-skill-D0j2D6tw.js").then((m) => m.runPrintSkill("migrate")(argv));
154
- return import("./migrate-Bn5btm_H.js").then((m) => m.runMigrate(argv));
155
- }).command("login", "Log in to Superwall (opens your browser)", (y) => y.options({
156
- "api-key": {
157
- type: "string",
158
- describe: "Log in headlessly with an API key (for CI) instead of the browser"
159
- },
160
- host: {
161
- type: "string",
162
- describe: "OAuth issuer override",
163
- hidden: true
164
- },
165
- "client-id": {
166
- type: "string",
167
- describe: "OAuth client id override",
168
- hidden: true
169
- }
170
- }), (argv) => {
171
- return import("./auth-Bir_Un8l.js").then((m) => m.runLogin(argv));
172
- }).command("logout", "Log out of Superwall", (y) => y, (argv) => {
173
- return import("./auth-Bir_Un8l.js").then((m) => m.runLogout(argv));
174
- }).command("whoami", "Show the logged-in Superwall account", (y) => y, (argv) => {
175
- return import("./auth-Bir_Un8l.js").then((m) => m.runWhoami(argv));
176
- }).command("skills", "Install or update the Superwall agent skills for your coding agent", (y) => y.options({
177
- skill: {
178
- type: "array",
179
- describe: "Install specific skills by name (default: all)"
180
- },
181
- force: {
182
- type: "boolean",
183
- describe: "Reinstall even if skills are already up to date"
184
- },
185
- yes: {
186
- type: "boolean",
187
- alias: "y",
188
- describe: "Install all skills without asking"
189
- },
190
- "dry-run": {
191
- type: "boolean",
192
- describe: "Print the install command without running it",
193
- hidden: true
194
- }
195
- }), (argv) => {
196
- return import("./skills-C4Yzl64N.js").then((m) => m.runSkills(argv));
197
- }).command("doctor", "Check the health of your Superwall integration", (y) => y.options({ ...installDirOption }), (argv) => {
198
- return import("./doctor-CpYkDfdC.js").then((m) => m.runDoctor(argv));
199
- }).command("upgrade", "Update the CLI to the latest version", (y) => y, (argv) => {
200
- return import("./upgrade-Cbh-7q_o.js").then((m) => m.runUpgrade(argv));
201
- }).command("feedback [message]", "Send feedback about the CLI to the Superwall team", (y) => y.positional("message", {
202
- type: "string",
203
- describe: "Your feedback (omit to be prompted)"
204
- }).example("$0 feedback \"migrate crashed on Expo\"", "Send feedback").example("$0 feedback \"...\" --json", "For agents / automation"), (argv) => {
205
- return import("./feedback-CV4JnRuk.js").then((m) => m.runFeedback(argv));
206
- }).command("query [sql]", "Run SQL against your ClickHouse analytics data", (y) => y.positional("sql", {
207
- type: "string",
208
- describe: "SQL query (or pass it with --file / stdin)"
209
- }).options({ file: {
210
- type: "string",
211
- describe: "Read SQL from a .sql file"
212
- } }).example("$0 query \"SHOW TABLES FROM sw\"", "Run an inline query").example("$0 query --file report.sql --json", "Run a saved query"), (argv) => {
213
- return import("./query-CbGfXmKu.js").then((m) => m.runQuery(argv));
214
- }).command("asc <target> [value] [value2]", "Call the App Store Connect API through Superwall's signed proxy (no .p8 / JWT needed)", (y) => y.positional("target", {
215
- type: "string",
216
- describe: "get|post|patch|delete, a raw path (/v1/...), or: apps | products | subscriptions | iaps | docs | keys"
217
- }).positional("value", {
339
+ hidden: true,
340
+ describe: "Plan without writing"
341
+ }
342
+ }), (argv) => {
343
+ return import("./asc-CRtRYv17.js").then((m) => m.runAsc(argv));
344
+ }).command("asa <target> [action] [value]", "Call the Apple Search Ads API through Superwall's proxy (no key or token handling)", (y) => y.positional("target", {
345
+ type: "string",
346
+ 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"
347
+ }).positional("action", {
348
+ type: "string",
349
+ describe: "list | get | find | create | update | delete | ... (see asa docs <resource>), or the path for a verb"
350
+ }).positional("value", {
351
+ type: "string",
352
+ describe: "Id (comma-separated for bulk), search query, or App Store app id"
353
+ }).options({
354
+ app: {
218
355
  type: "string",
219
- describe: "Path (for a verb), app bundle id / ASC app id (shortcuts), docs path or search, or list|set|rm (keys)"
220
- }).positional("value2", {
356
+ describe: "Superwall app id or name (if several have Apple Search Ads connected)"
357
+ },
358
+ "org-id": {
221
359
  type: "string",
222
- describe: "Team id (keys rm)"
223
- }).options({
224
- d: {
225
- type: "array",
226
- describe: "Request param, Stripe-style: -d key=value (string) or key:=value (number/bool/json); nesting via key[sub]"
227
- },
228
- team: {
229
- type: "string",
230
- describe: "ASC team id (if the org has more than one connected)"
231
- },
232
- force: {
233
- type: "boolean",
234
- describe: "Skip request-body schema validation and send as-is (post/patch)"
235
- },
236
- quiet: {
237
- type: "boolean",
238
- hidden: true
239
- },
240
- "key-id": {
241
- type: "string",
242
- describe: "ASC key id (keys set)"
243
- },
244
- issuer: {
245
- type: "string",
246
- describe: "ASC issuer id (keys set)"
247
- },
248
- "key-file": {
249
- type: "string",
250
- describe: "Path to the .p8 key file (keys set)"
251
- },
252
- name: {
253
- type: "string",
254
- describe: "Account name (keys set)"
255
- },
256
- "dry-run": {
257
- type: "boolean",
258
- hidden: true
259
- }
260
- }), (argv) => {
261
- return import("./asc-DYc_Yo9e.js").then((m) => m.runAsc(argv));
262
- });
360
+ describe: "Apple Search Ads org id (X-AP-Context), if the API user spans several"
361
+ },
362
+ campaign: {
363
+ type: "string",
364
+ describe: "Campaign id"
365
+ },
366
+ adgroup: {
367
+ type: "string",
368
+ describe: "Ad group id"
369
+ },
370
+ "adam-id": {
371
+ type: "string",
372
+ describe: "App Store app id (adamId)"
373
+ },
374
+ d: {
375
+ type: "array",
376
+ describe: "Body field, Stripe-style: -d key=value (string) or key:=value (number/bool/json); nesting via key[sub]. Query params on get/delete"
377
+ },
378
+ body: {
379
+ type: "string",
380
+ describe: "Request body as JSON: inline, @file, or @- for stdin"
381
+ },
382
+ selector: {
383
+ type: "string",
384
+ describe: "Apple selector as JSON (find, reports): inline, @file, or @-"
385
+ },
386
+ field: {
387
+ type: "string",
388
+ describe: "Selector shorthand: field name (with --op and --values)"
389
+ },
390
+ op: {
391
+ type: "string",
392
+ describe: "Selector shorthand: EQUALS, IN, CONTAINS, STARTSWITH, ..."
393
+ },
394
+ values: {
395
+ type: "string",
396
+ describe: "Selector shorthand: comma-separated values"
397
+ },
398
+ "order-by": {
399
+ type: "string",
400
+ describe: "Selector sort: field[:asc|desc]"
401
+ },
402
+ fields: {
403
+ type: "string",
404
+ describe: "Comma-separated fields to return (partial fetch)"
405
+ },
406
+ limit: {
407
+ type: "number",
408
+ describe: "Page size"
409
+ },
410
+ offset: {
411
+ type: "number",
412
+ describe: "Page offset"
413
+ },
414
+ all: {
415
+ type: "boolean",
416
+ describe: "Walk every page"
417
+ },
418
+ currency: {
419
+ type: "string",
420
+ describe: "Currency for money flags (defaults to the account's)"
421
+ },
422
+ name: {
423
+ type: "string",
424
+ describe: "Name for the created or updated entity"
425
+ },
426
+ status: {
427
+ type: "string",
428
+ describe: "ENABLED, PAUSED (keywords: ACTIVE, PAUSED)"
429
+ },
430
+ countries: {
431
+ type: "string",
432
+ describe: "Comma-separated country codes"
433
+ },
434
+ budget: {
435
+ type: "string",
436
+ describe: "Lifetime budget amount"
437
+ },
438
+ "daily-budget": {
439
+ type: "string",
440
+ describe: "Daily budget amount"
441
+ },
442
+ "supply-sources": {
443
+ type: "string",
444
+ describe: "Comma-separated supply sources"
445
+ },
446
+ "ad-channel-type": {
447
+ type: "string",
448
+ describe: "SEARCH or DISPLAY"
449
+ },
450
+ "billing-event": {
451
+ type: "string",
452
+ describe: "TAPS or IMPRESSIONS"
453
+ },
454
+ "default-bid": {
455
+ type: "string",
456
+ describe: "Ad group default bid"
457
+ },
458
+ "cpa-goal": {
459
+ type: "string",
460
+ describe: "Ad group CPA goal"
461
+ },
462
+ "search-match": {
463
+ type: "boolean",
464
+ describe: "Ad group Search Match"
465
+ },
466
+ text: {
467
+ type: "string",
468
+ describe: "Keyword text"
469
+ },
470
+ "match-type": {
471
+ type: "string",
472
+ describe: "BROAD or EXACT"
473
+ },
474
+ bid: {
475
+ type: "string",
476
+ describe: "Keyword bid amount"
477
+ },
478
+ "creative-id": {
479
+ type: "string",
480
+ describe: "Creative id (ads create)"
481
+ },
482
+ type: {
483
+ type: "string",
484
+ describe: "Creative type"
485
+ },
486
+ "product-page-id": {
487
+ type: "string",
488
+ describe: "Custom product page id"
489
+ },
490
+ start: {
491
+ type: "string",
492
+ describe: "Start date (YYYY-MM-DD)"
493
+ },
494
+ end: {
495
+ type: "string",
496
+ describe: "End date (YYYY-MM-DD)"
497
+ },
498
+ granularity: {
499
+ type: "string",
500
+ describe: "HOURLY, DAILY, WEEKLY, or MONTHLY"
501
+ },
502
+ "group-by": {
503
+ type: "string",
504
+ describe: "Report dimension (e.g. countryOrRegion)"
505
+ },
506
+ "time-zone": {
507
+ type: "string",
508
+ describe: "Report time zone: UTC or ORTZ"
509
+ },
510
+ dimensions: {
511
+ type: "string",
512
+ describe: "Impression share dimensions"
513
+ },
514
+ metrics: {
515
+ type: "string",
516
+ describe: "Impression share metrics"
517
+ },
518
+ owned: {
519
+ type: "boolean",
520
+ describe: "apps search: only apps this org owns"
521
+ },
522
+ country: {
523
+ type: "string",
524
+ describe: "geo search: country code"
525
+ },
526
+ entity: {
527
+ type: "string",
528
+ describe: "geo: Country, AdminArea, or Locality"
529
+ },
530
+ "adgroup-level": {
531
+ type: "boolean",
532
+ describe: "negative-keywords find: search ad group negatives"
533
+ },
534
+ states: {
535
+ type: "string",
536
+ describe: "product-pages list: comma-separated states"
537
+ },
538
+ "device-classes": {
539
+ type: "string",
540
+ describe: "product-pages: comma-separated device classes"
541
+ },
542
+ "language-codes": {
543
+ type: "string",
544
+ describe: "product-pages: comma-separated language codes"
545
+ },
546
+ expand: {
547
+ type: "boolean",
548
+ describe: "product-pages: include nested versions"
549
+ },
550
+ "include-deleted-assets": {
551
+ type: "boolean",
552
+ describe: "product-pages: include deleted assets"
553
+ }
554
+ }), (argv) => {
555
+ return import("./asa-B5hrBL3t.js").then((m) => m.runAsa(argv));
556
+ });
557
+
558
+ //#endregion
559
+ //#region src/cli/resources.ts
560
+ const registerResourceCommands = (input) => {
561
+ let cli = input;
263
562
  const RESOURCE_HELP = {
264
563
  orgs: "Your Superwall organizations (list, use <id|name>)",
265
564
  apps: "Your apps, grouped by project (list, create <name> --platform ios, use <id>)"
@@ -333,10 +632,10 @@ async function run() {
333
632
  describe: "Plan without writing"
334
633
  }
335
634
  }), (argv) => {
336
- return import("./resource-m6yz1jwE.js").then((m) => m.runResource(resource)(argv));
635
+ return import("./resource-PVg0uzSK.js").then((m) => m.runResource(resource)(argv));
337
636
  });
338
637
  cli = cli.command("bootstrap", "Complete account tree: orgs, projects, apps, campaigns, placements, and products", (y) => y, (argv) => {
339
- return import("./api-emImQnVy.js").then((m) => m.runBootstrap(argv));
638
+ return import("./api-B50i89j0.js").then((m) => m.runBootstrap(argv));
340
639
  });
341
640
  for (const verb of API_VERBS) cli = cli.command(`${verb} <path>`, `Make ${verb.toUpperCase()} requests to the Superwall API`, (y) => y.positional("path", {
342
641
  type: "string",
@@ -345,125 +644,78 @@ async function run() {
345
644
  type: "array",
346
645
  describe: "Param, Stripe-style: -d key=value (string) or key:=value (number/bool/json); nesting via key[sub]"
347
646
  } }), (argv) => {
348
- return import("./api-emImQnVy.js").then((m) => m.runApi(verb)(argv));
647
+ return import("./api-B50i89j0.js").then((m) => m.runApi(verb)(argv));
349
648
  });
350
- cli = cli.command("create [dir]", "Set up paywalls in your app - creates a superwall/ directory inside it", (y) => y.positional("dir", {
351
- type: "string",
352
- describe: "Your app's root (default: cwd) - paywalls land in superwall/ inside it"
353
- }).options({
354
- example: {
355
- type: "string",
356
- describe: "Start from a public example by name, e.g. --example with-rive"
357
- },
358
- yes: {
359
- type: "boolean",
360
- alias: "y",
361
- describe: "Accept defaults and skip the optional prompts"
362
- },
363
- install: {
364
- type: "boolean",
365
- default: true,
366
- describe: "Install dependencies after scaffolding (--no-install to skip)"
367
- },
368
- connect: {
369
- type: "boolean",
370
- default: true,
371
- describe: "Connect a Superwall app when possible (--no-connect to skip)"
372
- }
373
- }).example("$0 create", "Set up superwall/ in the current app").example("$0 create --example with-rive", "Start from an example"), (argv) => {
374
- return import("./create-CwDgWW16.js").then((m) => m.runCreate(argv));
375
- }).command("dev [dir..]", "Host the studio: browse and preview your paywalls and funnels", (y) => y.positional("dir", {
376
- type: "string",
377
- array: true,
378
- describe: "Project directories to serve (default: cwd)"
379
- }).options({
380
- port: {
381
- type: "number",
382
- default: 6100,
383
- alias: "p",
384
- describe: "Preferred port (falls back to the next free one)"
385
- },
386
- host: {
387
- type: "string",
388
- default: "0.0.0.0",
389
- describe: "Host to bind"
390
- }
391
- }), (argv) => {
392
- return import("./dev-OnmMOsgK.js").then((m) => m.runDev(argv));
393
- }).command("push [dir]", "Build and push your paywalls as immutable versions (production untouched)", (y) => y.positional("dir", {
394
- type: "string",
395
- describe: "Project directory (default: cwd)"
396
- }).options({
397
- id: {
398
- type: "array",
399
- string: true,
400
- describe: "Limit to these paywalls or funnels by id (repeatable, or comma-separated)"
401
- },
402
- platform: {
403
- type: "array",
404
- string: true,
405
- describe: "Limit to these platforms (repeatable, or comma-separated) - ios, android, web, flutter, react_native"
406
- },
407
- rename: {
408
- type: "array",
409
- string: true,
410
- describe: "Declare a renamed directory as <old>=<new> (repeatable) - required in CI, where the resolver cannot prompt"
411
- },
412
- message: {
413
- type: "string",
414
- alias: "m",
415
- describe: "Publish note recorded in the source commit (only lands when this publish creates a new source commit — unchanged source reuses the existing commit)"
416
- }
417
- }), (argv) => {
418
- return import("./push-hHtVTZ1m.js").then((m) => m.runPush(argv));
419
- }).command("promote [dir]", "Point production at a pushed version (the latest by default)", (y) => y.version(false).positional("dir", {
420
- type: "string",
421
- describe: "Project directory (default: cwd)"
422
- }).options({
423
- id: {
424
- type: "array",
425
- string: true,
426
- describe: "Limit to these paywalls or funnels by id (repeatable, or comma-separated)"
427
- },
428
- platform: {
429
- type: "array",
430
- string: true,
431
- describe: "Limit to these platforms (repeatable, or comma-separated) - ios, android, web, flutter, react_native"
432
- },
433
- version: {
434
- type: "number",
435
- alias: "v",
436
- describe: "Pushed version number to promote (requires a single --id)"
437
- }
438
- }), (argv) => {
439
- return import("./promote-UmKZySRx.js").then((m) => m.runPromote(argv));
440
- }).command("publish [dir]", "Push and promote in one step - build, version, and ship to production", (y) => y.positional("dir", {
649
+ return cli;
650
+ };
651
+
652
+ //#endregion
653
+ //#region src/cli/workflow.ts
654
+ const registerWorkflowCommands = (cli) => cli.command("integrate", "Set up the SDK, placements, and dashboard in your app", (y) => y.options({
655
+ ...installDirOption,
656
+ ...apiKeyOption,
657
+ ...dryRunOption,
658
+ ...skillOption,
659
+ driver: {
441
660
  type: "string",
442
- describe: "Project directory (default: cwd)"
443
- }).options({
444
- id: {
445
- type: "array",
446
- string: true,
447
- describe: "Limit to these paywalls or funnels by id (repeatable, or comma-separated)"
448
- },
449
- platform: {
450
- type: "array",
451
- string: true,
452
- describe: "Limit to these platforms (repeatable, or comma-separated) - ios, android, web, flutter, react_native"
453
- },
454
- rename: {
455
- type: "array",
456
- string: true,
457
- describe: "Declare a renamed directory as <old>=<new> (repeatable) - required in CI, where the resolver cannot prompt"
458
- },
459
- message: {
460
- type: "string",
461
- alias: "m",
462
- describe: "Publish note recorded in the source commit (only lands when this publish creates a new source commit — unchanged source reuses the existing commit)"
463
- }
464
- }), (argv) => {
465
- return import("./publish-BVnG2UOU.js").then((m) => m.runPublish(argv));
661
+ choices: [
662
+ "claude",
663
+ "codex",
664
+ "superwall"
665
+ ],
666
+ describe: "Force a coding-agent backend (default: first detected)",
667
+ hidden: true
668
+ }
669
+ }), (argv) => {
670
+ if (argv.skill) return import("./print-skill-D-R81bno.js").then((m) => m.runPrintSkill("integrate")(argv));
671
+ return import("./integrate-Cv8r_i2l.js").then((m) => m.runIntegrate(argv));
672
+ }).command("review", "Review an existing Superwall setup end to end", (y) => y.options({
673
+ ...installDirOption,
674
+ ...dryRunOption,
675
+ ...skillOption,
676
+ fix: {
677
+ type: "boolean",
678
+ describe: "Apply verified, safe fixes from the latest review"
679
+ }
680
+ }), (argv) => {
681
+ const id = argv.fix ? "review-fix" : "review";
682
+ if (argv.skill) return import("./print-skill-D-R81bno.js").then((m) => m.runPrintSkill(id)(argv));
683
+ return import("./integrate-Cv8r_i2l.js").then((m) => m.runActionCommand(id)(argv));
684
+ }).command("migrate", "Migrate from RevenueCat / Adapty / Qonversion to Superwall", (y) => y.options({
685
+ ...installDirOption,
686
+ "dry-run": {
687
+ type: "boolean",
688
+ describe: "Plan without changes"
689
+ },
690
+ ...skillOption
691
+ }), (argv) => {
692
+ if (argv.skill) return import("./print-skill-D-R81bno.js").then((m) => m.runPrintSkill("migrate")(argv));
693
+ return import("./migrate-C7R29RPH.js").then((m) => m.runMigrate(argv));
694
+ });
695
+
696
+ //#endregion
697
+ //#region src/cli.ts
698
+ async function run() {
699
+ const args = hideBin(process.argv);
700
+ if (args.length === 0 || args[0] === "help" || (args[0] === "-h" || args[0] === "--help") && args.length === 1) {
701
+ printHelp();
702
+ return;
703
+ }
704
+ let cli = yargs(args).scriptName("superwall").usage("Superwall CLI\n\n$0 [command]").option("interactive", {
705
+ type: "boolean",
706
+ default: true,
707
+ hidden: true,
708
+ describe: "Allow prompts (use --no-interactive for automation)"
709
+ }).option("json", {
710
+ type: "boolean",
711
+ default: false,
712
+ describe: "Machine-readable output"
466
713
  });
714
+ cli = registerWorkflowCommands(cli);
715
+ cli = registerAccountCommands(cli);
716
+ cli = registerPlatformCommands(cli);
717
+ cli = registerResourceCommands(cli);
718
+ cli = registerPaywallCommands(cli);
467
719
  await cli.command("$0", false, (y) => y, () => printHelp()).version(VERSION).alias("v", "version").help().alias("h", "help").recommendCommands().showHelpOnFail(false).fail((msg, err) => {
468
720
  if (err) throw err;
469
721
  const friendly = msg.replace(/^Unknown arguments?:/, "Unknown command:").replace(/^Not enough non-option arguments.*$/, "Missing a required argument.");