@superwall/cli 1.2.0 → 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.
- package/README.md +6 -4
- package/dist/{actions-DYQTxMXS.js → actions-DvHycH3X.js} +2 -2
- package/dist/{api-B2Zsf08U.js → api-B50i89j0.js} +9 -9
- package/dist/{api-output-B5hh0q4V.js → api-output-D9ggXQIr.js} +1 -1
- package/dist/{app-rYAP19Jo.js → app-FiC9SQVp.js} +11 -11
- package/dist/{asa-DlM6dlPD.js → asa-B5hrBL3t.js} +11 -11
- package/dist/{asc-D6qBCfuj.js → asc-CRtRYv17.js} +12 -12
- package/dist/{auth-BEnVvJlK.js → auth-CYognaF4.js} +10 -10
- package/dist/auth.js +2 -2
- package/dist/{billing-DO-gNWvW.js → billing-CSOUhWso.js} +1 -1
- package/dist/{bind-KZhPLTdC.js → bind-BbzBenoP.js} +4 -4
- package/dist/{command-B12qooZb.js → command-B7Te31wp.js} +93 -102
- package/dist/{create-BTEvRC1X.js → create--Q8nPgoa.js} +18 -18
- package/dist/{dev-CwfCGm36.js → dev-Dr6gXH-o.js} +37 -19
- package/dist/{doctor-DIxs8i8A.js → doctor-Cf0qNjbq.js} +10 -10
- package/dist/{drivers-D6Ka26e2.js → drivers-ItOmKzrw.js} +2 -2
- package/dist/entry.js +523 -467
- package/dist/{existing-CECenoHS.js → existing-B-e22WOr.js} +2 -2
- package/dist/{feedback-CV2coV73.js → feedback-C3UtAxye.js} +9 -9
- package/dist/{git-CCJwXufi.js → git-2wRxiwOc.js} +10 -10
- package/dist/{hosted-BCwzTTEw.js → hosted-vk05ZF6w.js} +3 -3
- package/dist/{integrate-Bhq0wkU0.js → integrate-Cv8r_i2l.js} +28 -27
- package/dist/{login-D5TjqsXJ.js → login-DOES7Kup.js} +8 -7
- package/dist/{migrate-Cz7VqQNj.js → migrate-C7R29RPH.js} +20 -20
- package/dist/{org-B2gy9Pmu.js → org-Cg25bcsj.js} +3 -3
- package/dist/output-D2Ax_hHL.js +123 -0
- package/dist/{params-Bvq0iqQK.js → params-B1zeElGa.js} +1 -2
- package/dist/{pipeline-ChRDxU9b.js → pipeline-BVeUA6Ig.js} +105 -98
- package/dist/{print-skill-BPePCjy4.js → print-skill-D-R81bno.js} +7 -7
- package/dist/{promote-C54bfsg3.js → promote-CV_Lsmqd.js} +18 -18
- package/dist/publish-CSnNvHHi.js +35 -0
- package/dist/push-sjnRI6iL.js +35 -0
- package/dist/{query-CXjrBFow.js → query-CdcWSinl.js} +10 -10
- package/dist/{resource-CM2bIB5v.js → resource-PVg0uzSK.js} +13 -13
- package/dist/{resources-CVrWwA1K.js → resources-s64mBHaC.js} +1 -0
- package/dist/{run-CAIDPbwe.js → run-XIkrFIgw.js} +2 -2
- package/dist/{scan-BrikLKx5.js → scan-Dk0ZlCY6.js} +2 -2
- package/dist/{skills-BwXcAVIf.js → skills-B-mR2CqM.js} +4 -3
- package/dist/{skills-_TULXe09.js → skills-CoEIW0mE.js} +8 -8
- package/dist/{spinner-gOxIMz-V.js → spinner-B9dT3DBY.js} +1 -1
- package/dist/{telemetry-CpIXSAbQ.js → telemetry-yJs7t0rt.js} +6 -41
- package/dist/{token-DHRH8cxi.js → token-GcbyH6G8.js} +2 -2
- package/dist/{ui-C4ncRJqd.js → ui-Lqt_zFOr.js} +5 -1
- package/dist/update-B4hoLAN-.js +59 -0
- package/dist/{upgrade-BNPbzr5V.js → upgrade-ByCYDXgb.js} +6 -6
- package/package.json +4 -4
- package/dist/json-C3hPIMkI.js +0 -7
- package/dist/publish-NUNSIKri.js +0 -35
- package/dist/push-BjEpY9-h.js +0 -35
- package/dist/update-BdcpwRu_.js +0 -137
package/dist/entry.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
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}`;
|
|
@@ -102,360 +160,405 @@ function printHelp() {
|
|
|
102
160
|
""
|
|
103
161
|
].join("\n"));
|
|
104
162
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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: {
|
|
180
|
+
type: "boolean",
|
|
181
|
+
default: true,
|
|
182
|
+
describe: "Install dependencies after scaffolding (--no-install to skip)"
|
|
183
|
+
},
|
|
184
|
+
connect: {
|
|
112
185
|
type: "boolean",
|
|
113
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",
|
|
114
318
|
hidden: true,
|
|
115
|
-
describe: "
|
|
116
|
-
}
|
|
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": {
|
|
117
338
|
type: "boolean",
|
|
118
|
-
|
|
119
|
-
describe: "
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
}), (argv) => {
|
|
136
|
-
if (argv.skill) return import("./print-skill-BPePCjy4.js").then((m) => m.runPrintSkill("integrate")(argv));
|
|
137
|
-
return import("./integrate-Bhq0wkU0.js").then((m) => m.runIntegrate(argv));
|
|
138
|
-
}).command("review", "Review an existing Superwall setup end to end", (y) => y.options({
|
|
139
|
-
...installDirOption,
|
|
140
|
-
...dryRunOption,
|
|
141
|
-
...skillOption,
|
|
142
|
-
fix: {
|
|
143
|
-
type: "boolean",
|
|
144
|
-
describe: "Apply verified, safe fixes from the latest review"
|
|
145
|
-
}
|
|
146
|
-
}), (argv) => {
|
|
147
|
-
const id = argv.fix ? "review-fix" : "review";
|
|
148
|
-
if (argv.skill) return import("./print-skill-BPePCjy4.js").then((m) => m.runPrintSkill(id)(argv));
|
|
149
|
-
return import("./integrate-Bhq0wkU0.js").then((m) => m.runActionCommand(id)(argv));
|
|
150
|
-
}).command("migrate", "Migrate from RevenueCat / Adapty / Qonversion to Superwall", (y) => y.options({
|
|
151
|
-
...installDirOption,
|
|
152
|
-
"dry-run": {
|
|
153
|
-
type: "boolean",
|
|
154
|
-
describe: "Plan without changes"
|
|
155
|
-
},
|
|
156
|
-
...skillOption
|
|
157
|
-
}), (argv) => {
|
|
158
|
-
if (argv.skill) return import("./print-skill-BPePCjy4.js").then((m) => m.runPrintSkill("migrate")(argv));
|
|
159
|
-
return import("./migrate-Cz7VqQNj.js").then((m) => m.runMigrate(argv));
|
|
160
|
-
}).command("login", "Log in to Superwall (opens your browser)", (y) => y.options({
|
|
161
|
-
"api-key": {
|
|
162
|
-
type: "string",
|
|
163
|
-
describe: "Log in headlessly with an API key (for CI) instead of the browser"
|
|
164
|
-
},
|
|
165
|
-
host: {
|
|
166
|
-
type: "string",
|
|
167
|
-
describe: "OAuth issuer override",
|
|
168
|
-
hidden: true
|
|
169
|
-
},
|
|
170
|
-
"client-id": {
|
|
171
|
-
type: "string",
|
|
172
|
-
describe: "OAuth client id override",
|
|
173
|
-
hidden: true
|
|
174
|
-
}
|
|
175
|
-
}), (argv) => {
|
|
176
|
-
return import("./auth-BEnVvJlK.js").then((m) => m.runLogin(argv));
|
|
177
|
-
}).command("logout", "Log out of Superwall", (y) => y, (argv) => {
|
|
178
|
-
return import("./auth-BEnVvJlK.js").then((m) => m.runLogout(argv));
|
|
179
|
-
}).command("whoami", "Show the logged-in Superwall account", (y) => y, (argv) => {
|
|
180
|
-
return import("./auth-BEnVvJlK.js").then((m) => m.runWhoami(argv));
|
|
181
|
-
}).command("skills", "Install or update the Superwall agent skills for your coding agent", (y) => y.options({
|
|
182
|
-
skill: {
|
|
183
|
-
type: "array",
|
|
184
|
-
describe: "Install specific skills by name (default: all)"
|
|
185
|
-
},
|
|
186
|
-
force: {
|
|
187
|
-
type: "boolean",
|
|
188
|
-
describe: "Reinstall even if skills are already up to date"
|
|
189
|
-
},
|
|
190
|
-
yes: {
|
|
191
|
-
type: "boolean",
|
|
192
|
-
alias: "y",
|
|
193
|
-
describe: "Install all skills without asking"
|
|
194
|
-
},
|
|
195
|
-
"dry-run": {
|
|
196
|
-
type: "boolean",
|
|
197
|
-
describe: "Print the install command without running it",
|
|
198
|
-
hidden: true
|
|
199
|
-
}
|
|
200
|
-
}), (argv) => {
|
|
201
|
-
return import("./skills-_TULXe09.js").then((m) => m.runSkills(argv));
|
|
202
|
-
}).command("doctor", "Check the health of your Superwall integration", (y) => y.options({ ...installDirOption }), (argv) => {
|
|
203
|
-
return import("./doctor-DIxs8i8A.js").then((m) => m.runDoctor(argv));
|
|
204
|
-
}).command("upgrade", "Update the CLI to the latest version", (y) => y, (argv) => {
|
|
205
|
-
return import("./upgrade-BNPbzr5V.js").then((m) => m.runUpgrade(argv));
|
|
206
|
-
}).command("feedback [message]", "Send feedback about the CLI to the Superwall team", (y) => y.positional("message", {
|
|
207
|
-
type: "string",
|
|
208
|
-
describe: "Your feedback (omit to be prompted)"
|
|
209
|
-
}).example("$0 feedback \"migrate crashed on Expo\"", "Send feedback").example("$0 feedback \"...\" --json", "For agents / automation"), (argv) => {
|
|
210
|
-
return import("./feedback-CV2coV73.js").then((m) => m.runFeedback(argv));
|
|
211
|
-
}).command("query [sql]", "Run SQL against your ClickHouse analytics data", (y) => y.positional("sql", {
|
|
212
|
-
type: "string",
|
|
213
|
-
describe: "SQL query (or pass it with --file / stdin)"
|
|
214
|
-
}).options({ file: {
|
|
215
|
-
type: "string",
|
|
216
|
-
describe: "Read SQL from a .sql file"
|
|
217
|
-
} }).example("$0 query \"SHOW TABLES FROM sw\"", "Run an inline query").example("$0 query --file report.sql --json", "Run a saved query"), (argv) => {
|
|
218
|
-
return import("./query-CXjrBFow.js").then((m) => m.runQuery(argv));
|
|
219
|
-
}).command("asc <target> [value] [value2]", "Call the App Store Connect API through Superwall's signed proxy (no .p8 / JWT needed)", (y) => y.positional("target", {
|
|
220
|
-
type: "string",
|
|
221
|
-
describe: "get|post|patch|delete, a raw path (/v1/...), or: apps | products | subscriptions | iaps | docs | keys"
|
|
222
|
-
}).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: {
|
|
223
355
|
type: "string",
|
|
224
|
-
describe: "
|
|
225
|
-
}
|
|
356
|
+
describe: "Superwall app id or name (if several have Apple Search Ads connected)"
|
|
357
|
+
},
|
|
358
|
+
"org-id": {
|
|
226
359
|
type: "string",
|
|
227
|
-
describe: "
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
type: "array",
|
|
231
|
-
describe: "Request param, Stripe-style: -d key=value (string) or key:=value (number/bool/json); nesting via key[sub]"
|
|
232
|
-
},
|
|
233
|
-
team: {
|
|
234
|
-
type: "string",
|
|
235
|
-
describe: "ASC team id (if the org has more than one connected)"
|
|
236
|
-
},
|
|
237
|
-
force: {
|
|
238
|
-
type: "boolean",
|
|
239
|
-
describe: "Skip request-body schema validation and send as-is (post/patch)"
|
|
240
|
-
},
|
|
241
|
-
quiet: {
|
|
242
|
-
type: "boolean",
|
|
243
|
-
hidden: true
|
|
244
|
-
},
|
|
245
|
-
"key-id": {
|
|
246
|
-
type: "string",
|
|
247
|
-
describe: "ASC key id (keys set)"
|
|
248
|
-
},
|
|
249
|
-
issuer: {
|
|
250
|
-
type: "string",
|
|
251
|
-
describe: "ASC issuer id (keys set)"
|
|
252
|
-
},
|
|
253
|
-
"key-file": {
|
|
254
|
-
type: "string",
|
|
255
|
-
describe: "Path to the .p8 key file (keys set)"
|
|
256
|
-
},
|
|
257
|
-
name: {
|
|
258
|
-
type: "string",
|
|
259
|
-
describe: "Account name (keys set)"
|
|
260
|
-
},
|
|
261
|
-
"dry-run": {
|
|
262
|
-
type: "boolean",
|
|
263
|
-
hidden: true
|
|
264
|
-
}
|
|
265
|
-
}), (argv) => {
|
|
266
|
-
return import("./asc-D6qBCfuj.js").then((m) => m.runAsc(argv));
|
|
267
|
-
}).command("asa <target> [action] [value]", "Call the Apple Search Ads API through Superwall's proxy (no key or token handling)", (y) => y.positional("target", {
|
|
360
|
+
describe: "Apple Search Ads org id (X-AP-Context), if the API user spans several"
|
|
361
|
+
},
|
|
362
|
+
campaign: {
|
|
268
363
|
type: "string",
|
|
269
|
-
describe: "
|
|
270
|
-
}
|
|
364
|
+
describe: "Campaign id"
|
|
365
|
+
},
|
|
366
|
+
adgroup: {
|
|
271
367
|
type: "string",
|
|
272
|
-
describe: "
|
|
273
|
-
}
|
|
368
|
+
describe: "Ad group id"
|
|
369
|
+
},
|
|
370
|
+
"adam-id": {
|
|
274
371
|
type: "string",
|
|
275
|
-
describe: "
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
"
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
"
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
"
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
"
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
"
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
"
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
"
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
|
|
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;
|
|
459
562
|
const RESOURCE_HELP = {
|
|
460
563
|
orgs: "Your Superwall organizations (list, use <id|name>)",
|
|
461
564
|
apps: "Your apps, grouped by project (list, create <name> --platform ios, use <id>)"
|
|
@@ -529,10 +632,10 @@ async function run() {
|
|
|
529
632
|
describe: "Plan without writing"
|
|
530
633
|
}
|
|
531
634
|
}), (argv) => {
|
|
532
|
-
return import("./resource-
|
|
635
|
+
return import("./resource-PVg0uzSK.js").then((m) => m.runResource(resource)(argv));
|
|
533
636
|
});
|
|
534
637
|
cli = cli.command("bootstrap", "Complete account tree: orgs, projects, apps, campaigns, placements, and products", (y) => y, (argv) => {
|
|
535
|
-
return import("./api-
|
|
638
|
+
return import("./api-B50i89j0.js").then((m) => m.runBootstrap(argv));
|
|
536
639
|
});
|
|
537
640
|
for (const verb of API_VERBS) cli = cli.command(`${verb} <path>`, `Make ${verb.toUpperCase()} requests to the Superwall API`, (y) => y.positional("path", {
|
|
538
641
|
type: "string",
|
|
@@ -541,125 +644,78 @@ async function run() {
|
|
|
541
644
|
type: "array",
|
|
542
645
|
describe: "Param, Stripe-style: -d key=value (string) or key:=value (number/bool/json); nesting via key[sub]"
|
|
543
646
|
} }), (argv) => {
|
|
544
|
-
return import("./api-
|
|
647
|
+
return import("./api-B50i89j0.js").then((m) => m.runApi(verb)(argv));
|
|
545
648
|
});
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
describe: "Accept defaults and skip the optional prompts"
|
|
558
|
-
},
|
|
559
|
-
install: {
|
|
560
|
-
type: "boolean",
|
|
561
|
-
default: true,
|
|
562
|
-
describe: "Install dependencies after scaffolding (--no-install to skip)"
|
|
563
|
-
},
|
|
564
|
-
connect: {
|
|
565
|
-
type: "boolean",
|
|
566
|
-
default: true,
|
|
567
|
-
describe: "Connect a Superwall app when possible (--no-connect to skip)"
|
|
568
|
-
}
|
|
569
|
-
}).example("$0 create", "Set up superwall/ in the current app").example("$0 create --example with-rive", "Start from an example"), (argv) => {
|
|
570
|
-
return import("./create-BTEvRC1X.js").then((m) => m.runCreate(argv));
|
|
571
|
-
}).command("dev [dir..]", "Host the studio: browse and preview your paywalls and funnels", (y) => y.positional("dir", {
|
|
572
|
-
type: "string",
|
|
573
|
-
array: true,
|
|
574
|
-
describe: "Project directories to serve (default: cwd)"
|
|
575
|
-
}).options({
|
|
576
|
-
port: {
|
|
577
|
-
type: "number",
|
|
578
|
-
default: 6100,
|
|
579
|
-
alias: "p",
|
|
580
|
-
describe: "Preferred port (falls back to the next free one)"
|
|
581
|
-
},
|
|
582
|
-
host: {
|
|
583
|
-
type: "string",
|
|
584
|
-
default: "0.0.0.0",
|
|
585
|
-
describe: "Host to bind"
|
|
586
|
-
}
|
|
587
|
-
}), (argv) => {
|
|
588
|
-
return import("./dev-CwfCGm36.js").then((m) => m.runDev(argv));
|
|
589
|
-
}).command("push [dir]", "Build and push your paywalls as immutable versions (production untouched)", (y) => y.positional("dir", {
|
|
590
|
-
type: "string",
|
|
591
|
-
describe: "Project directory (default: cwd)"
|
|
592
|
-
}).options({
|
|
593
|
-
id: {
|
|
594
|
-
type: "array",
|
|
595
|
-
string: true,
|
|
596
|
-
describe: "Limit to these paywalls or funnels by id (repeatable, or comma-separated)"
|
|
597
|
-
},
|
|
598
|
-
platform: {
|
|
599
|
-
type: "array",
|
|
600
|
-
string: true,
|
|
601
|
-
describe: "Limit to these platforms (repeatable, or comma-separated) - ios, android, web, flutter, react_native"
|
|
602
|
-
},
|
|
603
|
-
rename: {
|
|
604
|
-
type: "array",
|
|
605
|
-
string: true,
|
|
606
|
-
describe: "Declare a renamed directory as <old>=<new> (repeatable) - required in CI, where the resolver cannot prompt"
|
|
607
|
-
},
|
|
608
|
-
message: {
|
|
609
|
-
type: "string",
|
|
610
|
-
alias: "m",
|
|
611
|
-
describe: "Publish note recorded in the source commit (only lands when this publish creates a new source commit — unchanged source reuses the existing commit)"
|
|
612
|
-
}
|
|
613
|
-
}), (argv) => {
|
|
614
|
-
return import("./push-BjEpY9-h.js").then((m) => m.runPush(argv));
|
|
615
|
-
}).command("promote [dir]", "Point production at a pushed version (the latest by default)", (y) => y.version(false).positional("dir", {
|
|
616
|
-
type: "string",
|
|
617
|
-
describe: "Project directory (default: cwd)"
|
|
618
|
-
}).options({
|
|
619
|
-
id: {
|
|
620
|
-
type: "array",
|
|
621
|
-
string: true,
|
|
622
|
-
describe: "Limit to these paywalls or funnels by id (repeatable, or comma-separated)"
|
|
623
|
-
},
|
|
624
|
-
platform: {
|
|
625
|
-
type: "array",
|
|
626
|
-
string: true,
|
|
627
|
-
describe: "Limit to these platforms (repeatable, or comma-separated) - ios, android, web, flutter, react_native"
|
|
628
|
-
},
|
|
629
|
-
version: {
|
|
630
|
-
type: "number",
|
|
631
|
-
alias: "v",
|
|
632
|
-
describe: "Pushed version number to promote (requires a single --id)"
|
|
633
|
-
}
|
|
634
|
-
}), (argv) => {
|
|
635
|
-
return import("./promote-C54bfsg3.js").then((m) => m.runPromote(argv));
|
|
636
|
-
}).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: {
|
|
637
660
|
type: "string",
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
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"
|
|
662
713
|
});
|
|
714
|
+
cli = registerWorkflowCommands(cli);
|
|
715
|
+
cli = registerAccountCommands(cli);
|
|
716
|
+
cli = registerPlatformCommands(cli);
|
|
717
|
+
cli = registerResourceCommands(cli);
|
|
718
|
+
cli = registerPaywallCommands(cli);
|
|
663
719
|
await cli.command("$0", false, (y) => y, () => printHelp()).version(VERSION).alias("v", "version").help().alias("h", "help").recommendCommands().showHelpOnFail(false).fail((msg, err) => {
|
|
664
720
|
if (err) throw err;
|
|
665
721
|
const friendly = msg.replace(/^Unknown arguments?:/, "Unknown command:").replace(/^Not enough non-option arguments.*$/, "Missing a required argument.");
|