@superwall/cli 1.7.0 → 2.1.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 (229) hide show
  1. package/README.md +192 -52
  2. package/dist/{setup-Bxj22rYi.js → apple-CSzNTGHM.js} +82 -76
  3. package/dist/auth.d.ts +4 -19
  4. package/dist/auth.js +4 -2
  5. package/dist/{actions-B7ym3oVS.js → billing-C3Q8DBU2.js} +98 -28
  6. package/dist/{bind-YrJvuRF9.js → bind-BumHTi9O.js} +38 -33
  7. package/dist/{build-DLoCW5Ri.js → build-Bpviiclc.js} +20 -26
  8. package/dist/client-BL0f_yGf.js +176 -0
  9. package/dist/{asc-Bf7zBbyS.js → client-BZ1UbpXz.js} +16 -15
  10. package/dist/config-BO1Y87kV.js +105 -0
  11. package/dist/create-BSfvpWoD.js +19 -0
  12. package/dist/{create-pkANt1Gs.js → create-BUcVG4Ab.js} +195 -169
  13. package/dist/{notification-url-DuKF2659.js → create-CfK3PeKA.js} +235 -539
  14. package/dist/doctor-BWqIYcMn.js +83 -0
  15. package/dist/{drivers-Qx9LxmRN.js → drivers-CPhdPkW5.js} +185 -172
  16. package/dist/entry.d.ts +0 -5
  17. package/dist/entry.js +28072 -1134
  18. package/dist/environment-eBXjELoN.js +58 -0
  19. package/dist/{existing-AVEfZu2A.js → existing-BltvQiX5.js} +12 -6
  20. package/dist/held-CPve03KJ.js +16 -0
  21. package/dist/held-DgnTFMl3.js +1112 -0
  22. package/dist/input-vi0bou04.js +42 -0
  23. package/dist/{integrate-brmhPG-S.js → integrate-BRsqoe01.js} +277 -254
  24. package/dist/log-NVhVe_oe.js +62 -0
  25. package/dist/login-BCEH5q0U.js +53 -0
  26. package/dist/login-BPOONe7n.js +16 -0
  27. package/dist/{login-Do4wFuLv.js → login-BbTIrCFT.js} +118 -55
  28. package/dist/lookup-rr1AkCJA.js +71 -0
  29. package/dist/migrate-C9X2Vz81.js +274 -0
  30. package/dist/notification-url-CV86qiKP.js +100 -0
  31. package/dist/{open-studio-DOw-6ydc.js → open-CcpXotHG.js} +34 -43
  32. package/dist/org-BQQDo7wm.js +35 -0
  33. package/dist/output-Ggzq5_-t.js +122 -0
  34. package/dist/paths-CRlU72cq.js +29 -0
  35. package/dist/playbook-DVMXN7fh.js +53 -0
  36. package/dist/{asc-products-9JXtDxI4.js → products-DH_fK9tY.js} +6 -6
  37. package/dist/promote-Da8xctzy.js +91 -0
  38. package/dist/push-BV-grvQg.js +22 -0
  39. package/dist/push-D6R9icWN.js +495 -0
  40. package/dist/registry-BYVD-_h6.js +10385 -0
  41. package/dist/{reports-CfJqoava.js → reports-D_qbl7_u.js} +7 -6
  42. package/dist/{resources-Bf9O1JNM.js → resources-DLON3-61.js} +162 -55
  43. package/dist/{run-DsVZ5snL.js → run-Co-BwhOg.js} +16 -22
  44. package/dist/scan-B88OlWOt.js +4 -0
  45. package/dist/{scan-zKsddO72.js → scan-CKuk-_6W.js} +48 -37
  46. package/dist/scope-DV22_Ufm.js +198 -0
  47. package/dist/screenshot-file-tVBfUEIi.js +16 -0
  48. package/dist/{selection-CxZoX4NT.js → selection-C2_KbLuo.js} +100 -51
  49. package/dist/server-C4f6ccUr.js +22 -0
  50. package/dist/{dev-DmB3XqaJ.js → server-D0d2oP-5.js} +86 -94
  51. package/dist/session-B-Uz0cQ7.js +40 -0
  52. package/dist/session-BuvArt1j.js +6 -0
  53. package/dist/session-C4rbE3VS.js +796 -0
  54. package/dist/skills/animate-onboarding/SKILL.md +467 -0
  55. package/dist/skills/animate-onboarding/references/engine.md +494 -0
  56. package/dist/skills/animate-onboarding/references/framework/Question.tsx +71 -0
  57. package/dist/skills/animate-onboarding/references/framework/README.md +40 -0
  58. package/dist/skills/animate-onboarding/references/framework/answers.ts +19 -0
  59. package/dist/skills/animate-onboarding/references/framework/flow.ts +80 -0
  60. package/dist/skills/animate-onboarding/references/framework/handoffs.ts +869 -0
  61. package/dist/skills/animate-onboarding/references/framework/layout.tsx +113 -0
  62. package/dist/skills/animate-onboarding/references/framework/motion.css +559 -0
  63. package/dist/skills/animate-onboarding/references/framework/useStoryRouter.ts +48 -0
  64. package/dist/skills/animate-onboarding/references/handoffs.md +375 -0
  65. package/dist/skills/animate-onboarding/references/imageReady.ts +92 -0
  66. package/dist/skills/animate-onboarding/references/morphFrame.ts +356 -0
  67. package/dist/skills/animate-onboarding/references/performance.md +41 -0
  68. package/dist/skills/animate-onboarding/references/web-runtime/README.md +17 -0
  69. package/dist/skills/animate-onboarding/references/web-runtime/handoffs.ts +858 -0
  70. package/dist/skills/animate-onboarding/references/web-runtime/story-motion.css +301 -0
  71. package/dist/skills/index.json +37 -0
  72. package/dist/skills/mobile-design/SKILL.md +447 -0
  73. package/dist/skills/mobile-design/references/responsive.md +162 -0
  74. package/dist/skills/onboarding-questions/SKILL.md +231 -0
  75. package/dist/skills/onboarding-questions/references/arpu-questions.md +139 -0
  76. package/dist/skills/onboarding-questions/references/craft.md +142 -0
  77. package/dist/skills/onboarding-questions/references/example-reflective.md +117 -0
  78. package/dist/skills/superwall/SKILL.md +82 -9
  79. package/dist/skills/superwall/references/api.md +153 -37
  80. package/dist/skills/superwall/references/apple-setup.md +316 -0
  81. package/dist/skills/superwall/references/asc.md +74 -38
  82. package/dist/skills/superwall/references/data-analytics.md +55 -21
  83. package/dist/skills/superwall/workflows/dashboard/playbook.md +3 -3
  84. package/dist/skills/superwall/workflows/dashboard/setup.md +8 -8
  85. package/dist/skills/superwall/workflows/migrate/adapty.md +6 -6
  86. package/dist/skills/superwall/workflows/migrate/playbook.md +4 -4
  87. package/dist/skills/superwall/workflows/migrate/qonversion.md +5 -5
  88. package/dist/skills/superwall/workflows/migrate/revenuecat.md +6 -6
  89. package/dist/skills/superwall/workflows/placements/android.md +2 -2
  90. package/dist/skills/superwall/workflows/placements/expo.md +2 -2
  91. package/dist/skills/superwall/workflows/placements/flutter.md +2 -2
  92. package/dist/skills/superwall/workflows/placements/ios.md +2 -2
  93. package/dist/skills/superwall/workflows/placements/playbook.md +2 -2
  94. package/dist/skills/superwall/workflows/placements/react-native.md +2 -2
  95. package/dist/skills/superwall/workflows/placements/strategy.md +2 -2
  96. package/dist/skills/superwall/workflows/review/playbook.md +1 -1
  97. package/dist/skills/superwall-editor/SKILL.md +61 -0
  98. package/dist/skills/superwall-editor/references/cli.md +135 -0
  99. package/dist/skills/superwall-editor/references/design.md +51 -0
  100. package/dist/skills/superwall-editor/references/native-elements.md +171 -0
  101. package/dist/skills/superwall-editor/references/workflow.md +65 -0
  102. package/dist/skills/superwall-editor/scripts/sw-editor.sh +662 -0
  103. package/dist/skills/superwall-framework/SKILL.md +85 -31
  104. package/dist/skills/superwall-framework/references/cli.md +58 -27
  105. package/dist/skills/superwall-framework/references/examples.md +4 -3
  106. package/dist/skills/superwall-framework/references/layout.md +64 -9
  107. package/dist/skills/superwall-framework/references/migrate-from-editor.md +1 -1
  108. package/dist/skills/superwall-framework/references/onboarding-state.md +245 -0
  109. package/dist/skills/wwdc/SKILL.md +22 -0
  110. package/dist/skills/wwdc/references/docs.md +52 -0
  111. package/dist/skills/wwdc/scripts/wwdc.sh +266 -0
  112. package/dist/skills-CLGJuMnF.js +14 -0
  113. package/dist/{skills-DPzlnfCK.js → skills-CZcpnEnG.js} +100 -122
  114. package/dist/{spawn-DSoTXy_j.js → spawn-DmmmHIP-.js} +14 -12
  115. package/dist/spinner-C2U6QBJ9.js +294 -0
  116. package/dist/storage-6h9vyiAz.js +31 -0
  117. package/dist/storage-CerJ5KLP.d.ts +16 -0
  118. package/dist/storekit-CK9JmM2D.js +16 -0
  119. package/dist/storekit-CinJra3V.js +47 -0
  120. package/dist/telemetry-DKyDhURo.js +56 -0
  121. package/dist/theme-DUsCh-Vd.js +25 -0
  122. package/dist/timing-BVxPrYq3.js +5 -0
  123. package/dist/{token-C0it-Xh7.js → token-DaxQgQkv.js} +6 -38
  124. package/dist/tools-skills/animate-onboarding/SKILL.md +467 -0
  125. package/dist/tools-skills/animate-onboarding/references/engine.md +494 -0
  126. package/dist/tools-skills/animate-onboarding/references/framework/Question.tsx +71 -0
  127. package/dist/tools-skills/animate-onboarding/references/framework/README.md +40 -0
  128. package/dist/tools-skills/animate-onboarding/references/framework/answers.ts +19 -0
  129. package/dist/tools-skills/animate-onboarding/references/framework/flow.ts +80 -0
  130. package/dist/tools-skills/animate-onboarding/references/framework/handoffs.ts +869 -0
  131. package/dist/tools-skills/animate-onboarding/references/framework/layout.tsx +113 -0
  132. package/dist/tools-skills/animate-onboarding/references/framework/motion.css +559 -0
  133. package/dist/tools-skills/animate-onboarding/references/framework/useStoryRouter.ts +48 -0
  134. package/dist/tools-skills/animate-onboarding/references/handoffs.md +375 -0
  135. package/dist/tools-skills/animate-onboarding/references/imageReady.ts +92 -0
  136. package/dist/tools-skills/animate-onboarding/references/morphFrame.ts +356 -0
  137. package/dist/tools-skills/animate-onboarding/references/performance.md +41 -0
  138. package/dist/tools-skills/animate-onboarding/references/web-runtime/README.md +17 -0
  139. package/dist/tools-skills/animate-onboarding/references/web-runtime/handoffs.ts +858 -0
  140. package/dist/tools-skills/animate-onboarding/references/web-runtime/story-motion.css +301 -0
  141. package/dist/tools-skills/mobile-design/SKILL.md +447 -0
  142. package/dist/tools-skills/mobile-design/references/responsive.md +162 -0
  143. package/dist/tools-skills/onboarding-questions/SKILL.md +231 -0
  144. package/dist/tools-skills/onboarding-questions/references/arpu-questions.md +139 -0
  145. package/dist/tools-skills/onboarding-questions/references/craft.md +142 -0
  146. package/dist/tools-skills/onboarding-questions/references/example-reflective.md +117 -0
  147. package/dist/tools-skills/superwall/SKILL.md +263 -0
  148. package/dist/tools-skills/superwall/references/api.md +303 -0
  149. package/dist/tools-skills/superwall/references/asa.md +166 -0
  150. package/dist/tools-skills/superwall/references/asc.md +95 -0
  151. package/dist/tools-skills/superwall/references/dashboard-links.md +57 -0
  152. package/dist/tools-skills/superwall/references/data-analytics.md +896 -0
  153. package/dist/tools-skills/superwall/references/docs.md +51 -0
  154. package/dist/tools-skills/superwall/references/sdk-integration.md +104 -0
  155. package/dist/tools-skills/superwall/references/sdk-source.md +18 -0
  156. package/dist/tools-skills/superwall/workflows/dashboard/playbook.md +76 -0
  157. package/dist/tools-skills/superwall/workflows/dashboard/setup.md +100 -0
  158. package/dist/tools-skills/superwall/workflows/integrate/android.md +292 -0
  159. package/dist/tools-skills/superwall/workflows/integrate/expo.md +272 -0
  160. package/dist/tools-skills/superwall/workflows/integrate/flutter.md +285 -0
  161. package/dist/tools-skills/superwall/workflows/integrate/ios.md +314 -0
  162. package/dist/tools-skills/superwall/workflows/integrate/playbook.md +83 -0
  163. package/dist/tools-skills/superwall/workflows/integrate/react-native.md +246 -0
  164. package/dist/tools-skills/superwall/workflows/migrate/adapty.md +229 -0
  165. package/dist/tools-skills/superwall/workflows/migrate/playbook.md +78 -0
  166. package/dist/tools-skills/superwall/workflows/migrate/qonversion.md +227 -0
  167. package/dist/tools-skills/superwall/workflows/migrate/revenuecat.md +414 -0
  168. package/dist/tools-skills/superwall/workflows/placements/android.md +175 -0
  169. package/dist/tools-skills/superwall/workflows/placements/expo.md +161 -0
  170. package/dist/tools-skills/superwall/workflows/placements/flutter.md +139 -0
  171. package/dist/tools-skills/superwall/workflows/placements/ios.md +165 -0
  172. package/dist/tools-skills/superwall/workflows/placements/playbook.md +69 -0
  173. package/dist/tools-skills/superwall/workflows/placements/react-native.md +145 -0
  174. package/dist/tools-skills/superwall/workflows/placements/strategy.md +222 -0
  175. package/dist/tools-skills/superwall/workflows/review/android.md +120 -0
  176. package/dist/tools-skills/superwall/workflows/review/expo.md +100 -0
  177. package/dist/tools-skills/superwall/workflows/review/flutter.md +99 -0
  178. package/dist/tools-skills/superwall/workflows/review/ios.md +108 -0
  179. package/dist/tools-skills/superwall/workflows/review/playbook.md +70 -0
  180. package/dist/tools-skills/superwall/workflows/review/react-native.md +100 -0
  181. package/dist/tools-skills/superwall-editor/SKILL.md +113 -0
  182. package/dist/tools-skills/superwall-editor/references/cli.md +135 -0
  183. package/dist/tools-skills/superwall-editor/references/design.md +51 -0
  184. package/dist/tools-skills/superwall-editor/references/native-elements.md +171 -0
  185. package/dist/tools-skills/superwall-editor/references/workflow.md +65 -0
  186. package/dist/tools-skills/superwall-editor/scripts/sw-editor.sh +662 -0
  187. package/dist/tools-skills/wwdc/SKILL.md +22 -0
  188. package/dist/tools-skills/wwdc/references/docs.md +52 -0
  189. package/dist/tools-skills/wwdc/scripts/wwdc.sh +266 -0
  190. package/dist/tools.d.ts +96 -0
  191. package/dist/tools.js +11360 -0
  192. package/dist/ui-D_qf3Gvw.js +53 -0
  193. package/dist/upgrade-DPo0a4Es.js +117 -0
  194. package/dist/upgrade-ffseQDMx.js +7 -0
  195. package/package.json +10 -5
  196. package/dist/api-CZzirVMj.js +0 -151
  197. package/dist/api-output-aJNw7Syy.js +0 -20
  198. package/dist/app-DH6U8yuI.js +0 -190
  199. package/dist/asa-C-sQzPPn.js +0 -1194
  200. package/dist/asc-1ZBJ6DwS.js +0 -778
  201. package/dist/auth-YRhlV3DE.js +0 -140
  202. package/dist/billing-CCYHdApx.js +0 -80
  203. package/dist/bundle-id-CKxl_026.js +0 -121
  204. package/dist/command-CMIz81Da.js +0 -301
  205. package/dist/dev-DZy6pOnB.js +0 -22
  206. package/dist/doctor-H-hf-Yww.js +0 -88
  207. package/dist/feedback-CKf-rpBW.js +0 -152
  208. package/dist/hosted-CXe9TrWx.js +0 -32
  209. package/dist/migrate-C9ERDR6y.js +0 -284
  210. package/dist/org-sj7uyvp-.js +0 -40
  211. package/dist/output-C4o2gJ1K.js +0 -146
  212. package/dist/params-l3CrvRtR.js +0 -51
  213. package/dist/pipeline-BqzqZhX1.js +0 -977
  214. package/dist/print-skill-ZojRSybs.js +0 -74
  215. package/dist/promote-BG8X4Nv_.js +0 -88
  216. package/dist/publish-sxLh-G4G.js +0 -35
  217. package/dist/push-bQ6Vxtg8.js +0 -35
  218. package/dist/query-_FbybaH-.js +0 -53
  219. package/dist/resource-CGIwSd29.js +0 -323
  220. package/dist/revenue-provider-ebsRINY8.js +0 -100
  221. package/dist/scope-BvzD-kO4.js +0 -223
  222. package/dist/skills-D_R-lEsK.js +0 -64
  223. package/dist/spinner-TWa0hia6.js +0 -18
  224. package/dist/storekit-Cj9Cpjcz.js +0 -29
  225. package/dist/telemetry-DeA1mvnT.js +0 -169
  226. package/dist/ui-Dy0b-9L8.js +0 -27738
  227. package/dist/update-B2fWIc4q.js +0 -59
  228. package/dist/upgrade-BmzkTKrh.js +0 -72
  229. /package/dist/{devtools-8EgLo86w.js → devtools-pBl_vt03.js} +0 -0
package/README.md CHANGED
@@ -29,8 +29,8 @@ package; everything below is what you get.
29
29
  session. Where it can't open one (a server, or over SSH), it says so: open the
30
30
  URL it prints on any device and approve the code there. In CI, log in without
31
31
  a browser: `superwall login --api-key <key>`.
32
- If your account belongs to more than one organization, pick one with
33
- `superwall orgs use` (you'll otherwise be asked the first time it matters).
32
+ There are no organizations to pick: `superwall apps list` shows every app you
33
+ can open, grouped by organization, and commands take `--app <id|dashboard link>`.
34
34
  Upgrade any time with `superwall upgrade` - the CLI also tells you when a new
35
35
  version is out.
36
36
 
@@ -209,50 +209,87 @@ records a note in the source commit that rides along with every version, and
209
209
  Renames are resolved, never guessed — interactively, or with
210
210
  `push --rename old=new` in CI.
211
211
 
212
+ A push also saves the project's source to the app's repo. It applies your
213
+ changes on top of whatever teammates have published since your last push
214
+ (the commit it last synced to is in `superwall.lock`, so commit it), so two
215
+ people working on different paywalls never undo each other. If you both
216
+ changed the same file, or the repo has changes this project never synced
217
+ with, the push stops and names the files rather than overwriting their work;
218
+ `--overwrite-source` replaces the remote source with yours when you mean to.
219
+
212
220
  The full reference — assets, localization, trials, transitions, web
213
221
  checkout, troubleshooting — lives at
214
222
  [superwall.com/docs/framework](https://superwall.com/docs/framework).
215
223
 
216
224
  ## Manage your account
217
225
 
218
- Everything in the dashboard, from the terminal:
226
+ Everything in the dashboard, from the terminal. Commands follow the API,
227
+ Stripe-style: `superwall <resource> <operation> [ids] [--field value]`.
219
228
 
220
229
  ```bash
221
- superwall apps list
222
- superwall products create pro_monthly --price 9.99 --period month
230
+ superwall apps get <app> # everything about one app: bundle ID, Apple team, keys
231
+ superwall apps <app> # the same: an id where the operation goes means get
232
+ superwall apps update <app> --team-id <team-id>
233
+ superwall products create --identifier pro_monthly --price 9.99 --period month
223
234
  superwall products storekit # generate a local .storekit file
224
- superwall entitlements create pro
225
- superwall campaigns create "Onboarding upsell" onboarding_complete
226
- superwall campaigns placement <campaign-id> onboarding_complete
227
- superwall paywalls list
228
- superwall whoami
235
+ superwall entitlements create --identifier pro
236
+ superwall campaigns create --description "Onboarding upsell" --placement onboarding_complete
237
+ superwall campaigns placements create <campaign-id> --event-name onboarding_complete
238
+ superwall campaigns audiences readout <campaign-id> <audience-id>
239
+ superwall users subscriptions <app-user-id> --app <app>
240
+ superwall webhooks list --app <app>
229
241
  superwall bootstrap # the whole account tree at a glance
230
242
  ```
231
243
 
232
- `list` is the default action, so `superwall products` means
233
- `superwall products list`. Add `--json` for machine-readable output, and
234
- `--project <id>` / `--app <id>` to scope when you have more than one. Run
235
- `superwall <command> --help` for every action and flag.
244
+ Resources: `apps`, `products`, `entitlements` (+ `grants`),
245
+ `campaigns` (+ `placements`, `audiences`, `variants`), `paywalls`, `users`,
246
+ `webhooks`, `events`. Each has `list`, `get`, `create`, `update`, `delete` where
247
+ the API does, plus its own actions (`archive`, `publish`, `duplicate`, ...).
248
+
249
+ - Every command, and every subcommand of `asc`, `asa`, `setup` and `api`,
250
+ has its own `--help` page with only the flags
251
+ it takes. A group on its own (`superwall asc`) shows that page.
252
+ - `superwall <resource> --help` lists its operations;
253
+ `superwall <resource> <operation> --help` lists that operation's flags, read
254
+ from the live API reference, so new API fields work without a CLI update.
255
+ - A flag is a request field: `--event-name x` sends `event_name`. Anything else
256
+ goes in with `-d key=value` (`key:=json` for numbers and objects). A flag the
257
+ endpoint doesn't take is refused before anything is sent.
258
+ - `--app <id|name|link>` fills in the project, app and organization ids, so
259
+ nobody types `/v2/projects/{id}/applications/{application_id}`.
260
+ - `--dry-run` prints the request instead of sending it. Deleting, archiving and
261
+ other changes that can't be undone ask first, and need `--yes` outside a
262
+ terminal.
263
+ - Creating takes flags too (`--identifier`, `--name`, `--description`,
264
+ `--placement`), never positionals. One way to change a thing: an app's bundle
265
+ ID and revenue provider are `apps update` fields like any other.
266
+ - `list` is the default, so `superwall products` means `superwall products list`.
267
+ `--json` returns the API's response unformatted.
236
268
 
237
269
  An app's bundle ID (package name on Android) decides which builds the SDK
238
- treats as that app; any other build runs in test mode. Read it, and the IDs
239
- the app's SDK reported in the last 30 days, then save one:
270
+ treats as that app; any other build runs in test mode. `apps get` shows the one
271
+ saved and the IDs the app's SDK reported in the last 30 days, each marked live
272
+ or test mode. Change it like any other field:
240
273
 
241
274
  ```bash
242
- superwall apps bundle-id --app <id> # what is saved, and what the SDK reported
243
- superwall apps bundle-id com.acme.app --app <id> # save it
275
+ superwall apps get <app> # saved, and what the SDK reported
276
+ superwall apps update <app> --bundle-id com.acme.app # save it
244
277
  ```
245
278
 
246
- When other IDs had production devices that the new one wouldn't cover, it
247
- says how many would run in test mode and asks first (`--yes` outside a
248
- terminal). An ID that is already saved is only replaced with `--replace`.
279
+ When builds the SDK reported would run in test mode under the new ID, it says
280
+ how many and asks first (`--yes` outside a terminal).
249
281
 
250
- `setup apple`, `asc keys create purchase_key` and `asc keys set purchase_key`
282
+ `setup apple` and `asc keys create purchase_key`
251
283
  keep the In-App Purchase key and the app on one bundle ID. An app with none
252
284
  gets the Apple app's (or the one `--bundle-id` names) saved with the key, both
253
285
  or neither, and they say so and how many reported builds would run in test
254
286
  mode. An app with a different bundle ID stops before anything is created or
255
- saved, and points at `apps bundle-id <id> --replace`.
287
+ saved, and points at `apps update <app> --bundle-id <id>`.
288
+
289
+ Lists stay usable on big accounts: `--search <text>` matches ids, names and
290
+ identifiers, `--limit <n>` caps the rows, and a terminal shows the first 50 with
291
+ a count of the rest (`--json` returns everything unless `--limit` caps it).
292
+ `bootstrap --app <id>` loads one project instead of the whole account.
256
293
 
257
294
  ## Query your data
258
295
 
@@ -269,9 +306,35 @@ Use it for anything you'd build on raw data: ad hoc analysis, custom
269
306
  dashboards, scheduled reports, agent workflows. `--json` returns ClickHouse's
270
307
  native JSON envelope. Your session needs `data:read` access.
271
308
 
309
+ Many apps receive revenue from both the store and RevenueCat, so the same
310
+ purchase can arrive twice, and each app's revenue provider decides which one
311
+ its figures count. `--app <app>` passes that to the query as ClickHouse
312
+ parameters, so SQL counts revenue the way the dashboard does:
313
+
314
+ ```sql
315
+ -- superwall query --file revenue.sql --app <app>
316
+ SELECT sum(price)
317
+ FROM open_revenue.attributed_events_by_ts_rep FINAL
318
+ WHERE applicationId = {app:UInt64}
319
+ AND (integration IN {revenue_integrations:Array(String)} OR source = 'sdk')
320
+ AND NOT (coalesce(integration, '') = 'revenue_cat' AND store = 'STRIPE')
321
+ ```
322
+
323
+ `{revenue_provider:String}` holds the provider itself, and `--param name=value`
324
+ adds any other parameter.
325
+
272
326
  ## Call the API
273
327
 
274
- Any Superwall API endpoint, authenticated with your session:
328
+ `superwall api docs` searches the live API reference, so you can find any
329
+ endpoint and its exact body before calling it (no login needed):
330
+
331
+ ```bash
332
+ superwall api docs variant # search by keyword
333
+ superwall api docs /v2/campaigns/123/audiences/9/variants post # one endpoint in full
334
+ ```
335
+
336
+ Any Superwall API endpoint, authenticated with your session. A request that
337
+ fails names the reference entry to read:
275
338
 
276
339
  ```bash
277
340
  superwall get /v2/products
@@ -332,16 +395,15 @@ superwall asc keys list --app <id> # which of the two keys th
332
395
  superwall asc keys import --app <id> # reuse a key your organization already has
333
396
  superwall asc keys create api_key --app <id> # sign in to Apple and create just this key
334
397
  superwall asc keys create purchase_key --app <id>
335
- superwall asc notification-url --app <id> # this app's Superwall URL
336
398
  superwall asc notification-url check --app <id> # what Apple has, and whose it is
337
399
  superwall asc notification-url set --app <id> # set it where Apple has none
338
400
  ```
339
401
 
340
402
  `asc keys import` saves a key only when Apple confirms it for the app's bundle
341
403
  ID. `asc keys create` does nothing when the app already has that key; pass
342
- `--replace` to create another. `asc keys sources` and `asc keys copy <kind>
343
- --from <app id>` copy one named key from another of your apps, and `asc keys rm
344
- <kind> --app <id>` removes one from an app. `superwall asc --help` says what
404
+ `--replace` to create another. `asc keys sources` lists the keys on your other
405
+ apps, `asc keys import <kind> --from <app>` reuses one of them, and
406
+ `asc keys delete <kind> --app <id>` removes one from an app. `superwall asc --help` says what
345
407
  each command changes, what it never does, and its exit codes.
346
408
 
347
409
  `asc notification-url check` says for production and sandbox whose URL Apple
@@ -349,17 +411,18 @@ has: this app's, another Superwall app's (named when you can read that app),
349
411
  someone else's, or none. `asc notification-url set` never replaces a URL
350
412
  another server holds. If RevenueCat or your own server receives Apple's
351
413
  notifications today, keep it there and have it forward them to the URL
352
- `asc notification-url` prints. Both work with a `superwall login` session or
414
+ `apps get` shows. Both work with a `superwall login` session or
353
415
  an API key.
354
416
 
355
417
  Receiving Apple's notifications and choosing which revenue source your
356
418
  dashboard counts are separate decisions. The second one is the revenue
357
- provider:
419
+ provider, and `superwall query --app <app>` hands it to your SQL (see Query
420
+ your data):
358
421
 
359
422
  ```bash
360
- superwall revenue-provider --app <id> # what is counted, and what each source sent
361
- superwall revenue-provider set open_revenue --app <id> # count the store's own events
362
- superwall revenue-provider set revenue_cat --app <id> # count RevenueCat's events
423
+ superwall apps get <app> # what is counted, and how many events each source sent
424
+ superwall apps update <app> --revenue-provider open_revenue # count the store's own events
425
+ superwall apps update <app> --revenue-provider revenue_cat # count RevenueCat's events
363
426
  ```
364
427
 
365
428
  A change asks first in a terminal and needs `--yes` outside one.
@@ -368,12 +431,12 @@ Already have a key file? Save it on an app, or on your organization for the
368
431
  signed proxy:
369
432
 
370
433
  ```bash
371
- superwall asc keys set api_key --app <id> --key-id <id> --issuer <id> --key-file AuthKey.p8
372
- superwall asc keys set --key-id <id> --issuer <id> --key-file AuthKey.p8
434
+ superwall asc keys create api_key --app <id> --key-id <id> --issuer <id> --key-file AuthKey.p8
435
+ superwall asc keys create --key-id <id> --issuer <id> --key-file AuthKey.p8
373
436
  ```
374
437
 
375
438
  Saving an API key on an app also gives the organization a key for that Apple
376
- team when it has none. `asc keys set --team <team id>` replaces the
439
+ team when it has none. `asc keys update --team <team id>` replaces the
377
440
  organization's key for a team, and is refused unless Apple confirms the new key
378
441
  belongs to the same team.
379
442
 
@@ -405,12 +468,79 @@ superwall asc post /v1/subscriptions \
405
468
  • subscriptionPeriod "MONTHLY" not allowed — use ONE_WEEK|ONE_MONTH|…|ONE_YEAR
406
469
  ```
407
470
 
408
- Fix the value and it goes through. Shortcuts cover the common reads
409
- (`asc apps`, `asc products <bundle-id>`, `asc subscriptions <bundle-id>`);
410
- everything else is `asc get|post|patch|delete /v1/…`. Between the schema lookup
411
- and the validation, an agent can build and manage your whole ASC catalog —
412
- groups, subscriptions, prices, introductory offers — without ever memorizing the
413
- API or eating a silent rejection.
471
+ Fix the value and it goes through. Anything the commands below don't cover is
472
+ `asc get|post|patch|delete /v1/…`.
473
+
474
+ ### Subscriptions and in-app purchases
475
+
476
+ What an app sells has its own commands, each with `list`, `get`, `create`,
477
+ `update` and `delete`. They take the App Store app as an id or a bundle ID, and
478
+ flags named after Apple's own fields:
479
+
480
+ ```bash
481
+ superwall asc apps # your apps at Apple
482
+ superwall asc products com.acme.app # everything the app sells
483
+ superwall asc subscription-groups create --asc-app com.acme.app \
484
+ --reference-name Pro --display-name "Acme Pro"
485
+ superwall asc subscriptions list com.acme.app
486
+ superwall asc subscriptions get <id> # localizations, prices, offers, availability, what's missing
487
+ superwall asc iaps create --asc-app com.acme.app --product-id coins.100 --name "100 Coins" \
488
+ --in-app-purchase-type consumable --price 0.99 --display-name "100 Coins"
489
+ ```
490
+
491
+ `asc subscriptions create` does everything Apple asks for before review, in
492
+ order: the subscription, its localization, where it's sold, its price in one
493
+ territory equalized to every other, and a free trial if you want one. It ends by
494
+ reading the subscription back and saying what's still missing:
495
+
496
+ ```bash
497
+ superwall asc subscriptions create --group Pro --asc-app com.acme.app \
498
+ --product-id com.acme.pro.monthly --name "Pro Monthly" --subscription-period ONE_MONTH \
499
+ --price 9.99 --display-name "Pro" --description "Everything, monthly" --trial ONE_WEEK
500
+ ```
501
+
502
+ The details have commands of their own:
503
+
504
+ ```bash
505
+ superwall asc localizations add --subscription <id> --locale de-DE --name "Pro"
506
+ superwall asc prices points --subscription <id> --territory USA --price 9.99
507
+ superwall asc prices set --subscription <id> --price 12.99 --preserve-current-price
508
+ superwall asc offers create --subscription <id> --offer-mode FREE_TRIAL --duration TWO_WEEKS
509
+ superwall asc availability set --iap <id> --available-territories USA,CAN
510
+ superwall asc screenshots upload --subscription <id> paywall.png
511
+ superwall asc submit --asc-app com.acme.app --group <id> --subscription <id>
512
+ ```
513
+
514
+ Every change takes `--dry-run`: it prints each request it would send, bodies
515
+ included, and changes nothing. Deletes ask first (`--yes` in scripts).
516
+
517
+ ### Releases
518
+
519
+ The steps of an App Store release have commands too. A version is its id, or
520
+ its version string with `--asc-app` (and `--platform` off iOS):
521
+
522
+ ```bash
523
+ superwall asc versions create --asc-app com.acme.app --version-string 1.3.0 --release-type MANUAL
524
+ superwall asc builds list com.acme.app --version-string 1.3.0 --processing-state VALID
525
+ superwall asc builds attach <build> 1.3.0 --asc-app com.acme.app
526
+ superwall asc metadata update 1.3.0 --asc-app com.acme.app --locale en-US --whats-new "Faster sync"
527
+ superwall asc release submit 1.3.0 --asc-app com.acme.app --subscription <id>
528
+ superwall asc release status 1.3.0 --asc-app com.acme.app # state, build, review submission, phased release
529
+ superwall asc release release 1.3.0 --asc-app com.acme.app # once it's pending developer release
530
+ superwall asc release phased pause 1.3.0 --asc-app com.acme.app
531
+ ```
532
+
533
+ `asc release submit` puts the version in the app's review submission, with any
534
+ `--subscription`, `--iap` or `--group` alongside: Apple reviews an app's first
535
+ in-app purchases only together with a version. `asc versions delete` works only
536
+ while a version is still editable; it, `asc builds expire` and `asc release
537
+ release` ask first.
538
+
539
+ `asc get`, `asc post`, `asc patch`, `asc delete` and `asc docs` warn when an
540
+ endpoint is one Apple has replaced (the v1 subscription and in-app purchase
541
+ localizations, the v1 product submissions, `subscriptionAvailabilities`, the old
542
+ in-app purchase and version-submission endpoints, screenshot and preview sets),
543
+ and name the replacement.
414
544
 
415
545
  ## Apple Search Ads
416
546
 
@@ -456,6 +586,12 @@ asking. The framework itself is built to be written by agents: a plain npm
456
586
  project, file-based routes, ordinary React state — conventions an agent
457
587
  already knows, so it gets a paywall right on the first try.
458
588
 
589
+ ## Upgrading to 2.0
590
+
591
+ 2.0 renamed several commands; the old names are unknown commands now.
592
+ [The CLI guide](https://superwall.com/docs/agents/cli#upgrading-from-1x)
593
+ maps each one to its replacement.
594
+
459
595
  ## Channels
460
596
 
461
597
  Set `SUPERWALL_CHANNEL=next` to opt into experimental and beta features:
@@ -479,16 +615,20 @@ linked to your account. Opt out with `SUPERWALL_TELEMETRY_DISABLED=1` or
479
615
  packages/cli/
480
616
  ├── bin.ts the entry the `superwall` launcher runs
481
617
  ├── src/
482
- │ ├── cli.ts every command, flag, and help line (yargs)
483
- │ ├── commands/
484
- │ │ ├── account/ login, whoami, orgs, doctor, feedback, skills, upgrade
485
- │ │ ├── resource/ apps, products, entitlements, campaigns, paywalls, bootstrap
486
- │ │ ├── workflow/ integrate, migrate, review
487
- │ │ ├── platform/ get/post/patch/delete, query, asc, asc keys, asc notification-url, setup apple, revenue-provider
488
- │ │ └── paywalls/ create, dev, push, promote, publish
489
- │ ├── core/ api client, auth, project detection, paywall
490
- │ │ binding + lock, agent runners, telemetry, skills sync
491
- │ └── ui/ the renderer: human output, --json envelopes, prompts
618
+ │ ├── entry.ts main(): run the program, flush telemetry
619
+ │ ├── program/ the command system: defineCommand, parser, help, lifecycle
620
+ │ ├── commands/ registry.ts + one directory per section of `superwall --help`
621
+ │ │ ├── workflows/ integrate, review, migrate
622
+ │ │ ├── paywalls/ create, dev, build, push, promote, publish
623
+ │ │ ├── main/ bootstrap, apps, products, entitlements, campaigns, paywalls, users, webhooks, events
624
+ │ │ ├── analytics/ query
625
+ │ │ ├── api/ docs, get, post, patch, delete
626
+ │ │ ├── app-store-connect/ setup/, keys/, notification-url/, store/ (apps, products, …), api/ (get, post, …, docs)
627
+ │ │ ├── apple-search-ads/ asa (the catalog), keys, api/ (get, post, put, delete, docs)
628
+ │ │ ├── account/ login, logout, whoami
629
+ │ │ └── support/ doctor, feedback, skills, upgrade
630
+ │ ├── core/ the logic behind every command, by domain
631
+ │ └── ui/ the renderer: human output, --json envelopes, prompts, help layout
492
632
  ├── dist/skills/ the playbooks integrate/migrate/review run, bundled from superwall/skills at build
493
633
  └── tests/ mirrors src/
494
634
  ```
@@ -1,21 +1,23 @@
1
- import { t as blocks } from "./output-C4o2gJ1K.js";
2
- import "./telemetry-DeA1mvnT.js";
3
- import "./update-B2fWIc4q.js";
4
- import "./token-C0it-Xh7.js";
5
- import { r as ApiError, t as defineCommand } from "./command-CMIz81Da.js";
6
- import "./ui-Dy0b-9L8.js";
7
- import "./scan-zKsddO72.js";
8
- import "./existing-AVEfZu2A.js";
9
- import "./spinner-TWa0hia6.js";
10
- import "./resources-Bf9O1JNM.js";
11
- import { t as requireOrg } from "./org-sj7uyvp-.js";
12
- import { n as emitJson, t as apiCall } from "./api-output-aJNw7Syy.js";
13
- import "./asc-Bf7zBbyS.js";
14
- import { S as appleDeps, _ as chooseAppIntent, a as KEY_KINDS, b as resolveApp, c as chooseTeam, d as keyAccess, g as text, h as signIn, l as createAndSaveKey, m as savedKey, n as ensureNotificationUrl, o as KEY_LABEL, p as keyRole, r as environmentLines, s as appFlags, t as describeNotificationUrl } from "./notification-url-DuKF2659.js";
15
- import { c as getIntegrations, f as saveBundleId, i as RefusedByApi } from "./scope-BvzD-kO4.js";
16
- import { n as testModeWarning } from "./bundle-id-CKxl_026.js";
1
+ import "./token-DaxQgQkv.js";
2
+ import { t as blocks } from "./output-Ggzq5_-t.js";
3
+ import "./environment-eBXjELoN.js";
4
+ import "./storage-6h9vyiAz.js";
5
+ import { t as ApiError } from "./client-BL0f_yGf.js";
6
+ import { E as updateBundleId, a as chooseAppIntent, g as RefusedByApi, i as savedKey, m as KEY_LABEL, n as testModeWarning, p as KEY_KINDS, s as resolveApp, y as findIntegrations } from "./held-DgnTFMl3.js";
7
+ import "./config-BO1Y87kV.js";
8
+ import { t as apiCall } from "./spinner-C2U6QBJ9.js";
9
+ import "./ui-D_qf3Gvw.js";
10
+ import "./paths-CRlU72cq.js";
11
+ import "./resources-DLON3-61.js";
12
+ import "./org-BQQDo7wm.js";
13
+ import "./lookup-rr1AkCJA.js";
14
+ import "./scope-DV22_Ufm.js";
15
+ import "./client-BZ1UbpXz.js";
16
+ import "./timing-BVxPrYq3.js";
17
+ import { n as ensureNotificationUrl, r as environmentLines, t as describeNotificationUrl } from "./notification-url-CV86qiKP.js";
18
+ import { a as chooseTeam, n as keyAccess, o as signIn, r as keyRole, s as appleDeps, t as createAndSaveKey } from "./create-CfK3PeKA.js";
17
19
 
18
- //#region src/commands/platform/apple.ts
20
+ //#region src/core/app-store-connect/setup/apple.ts
19
21
  const STEPS = [
20
22
  ...KEY_KINDS,
21
23
  "bundle_id",
@@ -26,12 +28,14 @@ const STEP_LABEL = {
26
28
  bundle_id: "Bundle ID",
27
29
  notification_url: "Server notification URL"
28
30
  };
29
- async function saveAppBundleId(ctx, app) {
31
+ async function saveAppBundleId(ctx, resolved) {
30
32
  try {
31
- await apiCall(ctx, `Saving the bundle ID on ${app.name}`, () => saveBundleId(ctx.api, app.applicationId, {
32
- bundleId: app.bundleId,
33
- replace: false
34
- }));
33
+ await apiCall(ctx, `Saving the bundle ID on ${resolved.name}`, () => {
34
+ return updateBundleId(ctx.api, resolved.applicationId, {
35
+ bundleId: resolved.bundleId,
36
+ replace: false
37
+ });
38
+ });
35
39
  } catch (error) {
36
40
  if (!(error instanceof ApiError) && !(error instanceof RefusedByApi)) throw error;
37
41
  ctx.output.render(blocks.warning(`${STEP_LABEL.bundle_id}: ${error.message}`));
@@ -40,80 +44,95 @@ async function saveAppBundleId(ctx, app) {
40
44
  detail: error.message
41
45
  };
42
46
  }
43
- ctx.output.render(blocks.info(`Saved the bundle ID ${app.bundleId} on \`${app.name}\``));
47
+ ctx.output.render(blocks.info(`Saved the bundle ID ${resolved.bundleId} on \`${resolved.name}\``));
44
48
  return {
45
49
  status: "done",
46
- detail: `${app.bundleId} (saved)`
50
+ detail: `${resolved.bundleId} (saved)`
47
51
  };
48
52
  }
49
- async function setupApple(ctx, deps) {
53
+ async function runSetupApple(ctx, { flags }) {
50
54
  const { api } = ctx;
51
- const role = keyRole(ctx);
55
+ const deps = appleDeps;
56
+ const role = keyRole(flags.keyRole);
52
57
  const skip = {
53
- api_key: ctx.argv["skip-api-key"] === true,
54
- purchase_key: ctx.argv["skip-purchase-key"] === true,
58
+ api_key: flags.skipApiKey,
59
+ purchase_key: flags.skipPurchaseKey,
55
60
  bundle_id: false,
56
- notification_url: ctx.argv["skip-notification-url"] === true
61
+ notification_url: flags.skipNotificationUrl
62
+ };
63
+ const appFlags = {
64
+ app: flags.app,
65
+ project: flags.project,
66
+ bundleId: flags.bundleId
57
67
  };
58
- const flags = appFlags(ctx);
59
68
  ctx.output.render(blocks.intro("Set up Apple"));
60
- await requireOrg(api, ctx.interactive);
61
- const intent = ctx.dryRun ? void 0 : await chooseAppIntent(ctx, api, flags);
62
- const session = await signIn(ctx, deps, "setup apple");
69
+ let intent;
70
+ if (!ctx.dryRun) intent = await chooseAppIntent(ctx, api, appFlags);
71
+ const session = await signIn(ctx, deps, "setup apple", {
72
+ appleId: flags.appleId,
73
+ password: flags.applePassword,
74
+ code: flags.code,
75
+ sms: flags.sms,
76
+ phone: flags.phone
77
+ });
63
78
  if (!session) return;
64
- const team = await chooseTeam(ctx, session, text(ctx, "team"));
65
- ctx.output.render(blocks.info(`Apple team \`${team.name}\``));
79
+ const appleTeam = await chooseTeam(ctx, session, flags.team);
80
+ ctx.output.render(blocks.info(`Apple team \`${appleTeam.name}\``));
66
81
  if (ctx.dryRun || !intent) {
67
82
  const access = {
68
83
  api_key: await keyAccess(ctx, session, "api_key"),
69
84
  purchase_key: await keyAccess(ctx, session, "purchase_key")
70
85
  };
71
- if (ctx.json) return emitJson(ctx, {
86
+ if (ctx.json) return ctx.output.data({
72
87
  dryRun: true,
73
- team,
88
+ team: appleTeam,
74
89
  access
75
90
  });
76
91
  ctx.ui.report(KEY_KINDS.map((kind) => `${access[kind] === "ok" ? "✓" : "✗"} ${KEY_LABEL[kind]} ${access[kind]}`).join("\n"));
77
92
  ctx.ui.info("[dry-run] nothing was created or changed.");
78
93
  return;
79
94
  }
80
- const app = await resolveApp(ctx, api, session, intent, flags);
95
+ const resolved = await resolveApp(ctx, api, session, intent, appFlags);
81
96
  const appRef = {
82
- projectId: app.projectId,
83
- applicationId: app.applicationId
97
+ projectId: resolved.projectId,
98
+ applicationId: resolved.applicationId
84
99
  };
85
- ctx.output.render(blocks.info(`${app.created ? "Created" : "Using"} \`${app.name}\` ${app.bundleId}`));
100
+ ctx.output.render(blocks.info(`${resolved.created ? "Created" : "Using"} \`${resolved.name}\` ${resolved.bundleId}`));
86
101
  const results = {
87
102
  api_key: { status: "skipped" },
88
103
  purchase_key: { status: "skipped" },
89
104
  bundle_id: {
90
105
  status: "done",
91
- detail: app.bundleId
106
+ detail: resolved.bundleId
92
107
  },
93
108
  notification_url: { status: "skipped" }
94
109
  };
95
- if (app.savedBundleId === null) {
96
- const warning = await testModeWarning(ctx, api, app.applicationId, app.bundleId);
110
+ if (resolved.savedBundleId === null) {
111
+ const warning = await testModeWarning(ctx, api, resolved.applicationId, resolved.bundleId);
97
112
  if (warning) ctx.output.render(blocks.warning(warning));
98
113
  }
99
- const saved = await getIntegrations(api, app.applicationId);
100
- let bundleIdSaved = app.savedBundleId !== null;
114
+ const saved = await findIntegrations(api, resolved.applicationId);
115
+ let bundleIdSaved = resolved.savedBundleId !== null;
101
116
  for (const kind of KEY_KINDS) {
102
117
  if (skip[kind]) continue;
103
118
  const existing = savedKey(saved, kind);
104
- results[kind] = existing ? {
105
- status: "done",
106
- detail: `${existing.key_id} (already saved)`
107
- } : await createAndSaveKey(ctx, deps, api, session, app, kind, role);
108
- if (kind === "purchase_key" && !existing && results[kind].status === "done" && !bundleIdSaved) {
119
+ if (existing) {
120
+ results[kind] = {
121
+ status: "done",
122
+ detail: `${existing.key_id} (already saved)`
123
+ };
124
+ continue;
125
+ }
126
+ results[kind] = await createAndSaveKey(ctx, deps, api, session, resolved, kind, role);
127
+ if (kind === "purchase_key" && results[kind].status === "done" && !bundleIdSaved) {
109
128
  bundleIdSaved = true;
110
129
  results.bundle_id = {
111
130
  status: "done",
112
- detail: `${app.bundleId} (saved with the key)`
131
+ detail: `${resolved.bundleId} (saved with the key)`
113
132
  };
114
133
  }
115
134
  }
116
- if (!bundleIdSaved) results.bundle_id = await saveAppBundleId(ctx, app);
135
+ if (!bundleIdSaved) results.bundle_id = await saveAppBundleId(ctx, resolved);
117
136
  let notificationUrl;
118
137
  if (!skip.notification_url) try {
119
138
  const outcome = await ensureNotificationUrl(ctx, deps.sleep, api, appRef, { setRevenueProvider: false });
@@ -141,15 +160,15 @@ async function setupApple(ctx, deps) {
141
160
  ctx.output.render(blocks.warning(`${STEP_LABEL.notification_url}: ${error.message}`));
142
161
  }
143
162
  const failed = STEPS.filter((step) => results[step].status === "failed");
144
- if (ctx.json) emitJson(ctx, {
163
+ if (ctx.json) ctx.output.data({
145
164
  status: failed.length === 0 ? "ok" : "partial",
146
- team,
165
+ team: appleTeam,
147
166
  app: {
148
- id: app.applicationId,
149
- project_id: app.projectId,
150
- name: app.name,
151
- bundle_id: app.bundleId,
152
- created: app.created
167
+ id: resolved.applicationId,
168
+ project_id: resolved.projectId,
169
+ name: resolved.name,
170
+ bundle_id: resolved.bundleId,
171
+ created: resolved.created
153
172
  },
154
173
  steps: results,
155
174
  notification_url: notificationUrl ?? null,
@@ -166,24 +185,11 @@ async function setupApple(ctx, deps) {
166
185
  const value = result.status === "failed" ? "not done" : result.detail ?? result.status;
167
186
  return `${mark[result.status]} ${STEP_LABEL[step]} ${value}`;
168
187
  }).join("\n"));
169
- if (failed.length === 0) ctx.ui.success(`Apple is connected for \`${app.name}\`.`);
188
+ if (failed.length === 0) ctx.ui.success(`Apple is connected for \`${resolved.name}\`.`);
170
189
  else ctx.ui.warn("Partly done. What succeeded was saved; fix the items above and run it again.");
171
190
  }
172
- if (failed.length > 0) process.exitCode = 1;
191
+ if (failed.length > 0) ctx.fail();
173
192
  }
174
193
 
175
194
  //#endregion
176
- //#region src/commands/platform/setup.ts
177
- const runSetup = defineCommand({
178
- name: "setup",
179
- auth: "required",
180
- output: "both",
181
- async run(ctx) {
182
- const target = String(ctx.argv.target ?? "");
183
- if (target === "apple") return setupApple(ctx, appleDeps);
184
- throw new Error(`Unknown "setup ${target}". Use: setup apple`);
185
- }
186
- });
187
-
188
- //#endregion
189
- export { runSetup };
195
+ export { runSetupApple };
package/dist/auth.d.ts CHANGED
@@ -1,26 +1,11 @@
1
- //#region src/core/auth/storage.d.ts
2
- interface Session {
3
- authMethod?: "oauth" | "api_key";
4
- apiKey?: string;
5
- orgId?: string;
6
- orgName?: string;
7
- orgCount?: number;
8
- userEmail?: string;
9
- host: string;
10
- createdAt: string;
11
- accessToken?: string;
12
- refreshToken?: string;
13
- accessTokenExpiresAt?: number;
14
- tokenEndpoint?: string;
15
- oauthClientId?: string;
16
- }
17
- //#endregion
18
- //#region src/core/auth/errors.d.ts
1
+ import { t as Session } from "./storage-CerJ5KLP.js";
2
+
3
+ //#region src/core/account/errors.d.ts
19
4
  declare class NotLoggedInError extends Error {
20
5
  constructor();
21
6
  }
22
7
  //#endregion
23
- //#region src/core/auth/token.d.ts
8
+ //#region src/core/account/token.d.ts
24
9
  declare function getOAuthAccessToken(): Promise<string | null>;
25
10
  declare function resolveAuthToken(session: Session): Promise<{
26
11
  token: string;
package/dist/auth.js CHANGED
@@ -1,4 +1,6 @@
1
- import "./output-C4o2gJ1K.js";
2
- import { n as resolveAuthToken, o as NotLoggedInError, t as getOAuthAccessToken } from "./token-C0it-Xh7.js";
1
+ import { n as resolveAuthToken, r as NotLoggedInError, t as getOAuthAccessToken } from "./token-DaxQgQkv.js";
2
+ import "./output-Ggzq5_-t.js";
3
+ import "./environment-eBXjELoN.js";
4
+ import "./storage-6h9vyiAz.js";
3
5
 
4
6
  export { NotLoggedInError, getOAuthAccessToken, resolveAuthToken };