@superwall/cli 2.6.0-beta.2 → 2.6.1

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 (152) hide show
  1. package/README.md +47 -16
  2. package/dist/{apple-Dc5pOPms.js → apple-BE1GBJFP.js} +17 -19
  3. package/dist/{approve-BSbdmOez.js → approve-yRZmvkCj.js} +9 -11
  4. package/dist/{assets-C_RjojkK.js → assets-DTAgbWw0.js} +3 -3
  5. package/dist/auth.d.ts +11 -4
  6. package/dist/auth.js +4 -5
  7. package/dist/base-zc1wl_9b.js +82 -0
  8. package/dist/{billing-B6HK-F_a.js → billing-C1LV4-BN.js} +3 -3
  9. package/dist/{build-DK88pTMW.js → build-CQd-pf7O.js} +35 -16
  10. package/dist/{client-x08fpvay.js → config-DCqRQTJ4.js} +162 -15
  11. package/dist/create-CSHGZDfB.js +18 -0
  12. package/dist/{create-kpqEhqkk.js → create-Costu6UT.js} +9 -9
  13. package/dist/{create-B6-Dr3GZ.js → create-wlCp83IH.js} +41 -41
  14. package/dist/{doctor-DYbm8IKQ.js → doctor-Bd9ffg51.js} +50 -10
  15. package/dist/entry.js +45 -40
  16. package/dist/{environment-BFNzLLPN.js → environment-Dn7irhZr.js} +1 -1
  17. package/dist/{drivers-Dyi-y9Jn.js → existing-BQMB_2AG.js} +305 -8
  18. package/dist/framework-DW5fqjh4.js +65 -0
  19. package/dist/{source-BccdO4aL.js → git-Hf9Wc7Hp.js} +34 -92
  20. package/dist/{held-sKq3xrsT.js → held-D5wSX2Mf.js} +9 -9
  21. package/dist/held-Dmf5SR3p.js +15 -0
  22. package/dist/{install-DsIsif39.js → install-CxyqfKFe.js} +15 -17
  23. package/dist/{integrate-B8eA676b.js → integrate-MkyDDzI5.js} +33 -38
  24. package/dist/{login-BlpfYapG.js → login-B7IqDafm.js} +3 -3
  25. package/dist/{login-Blhxi20A.js → login-BMHDhxAx.js} +8 -9
  26. package/dist/login-Cp0-BgDZ.js +13 -0
  27. package/dist/{lookup-Dg55W9S7.js → lookup-DkcT4E-5.js} +28 -4
  28. package/dist/{migrate-DoRb9jmA.js → migrate-CdFoZipj.js} +66 -45
  29. package/dist/{notification-url-D82msWF5.js → notification-url-D6KKeXnk.js} +4 -4
  30. package/dist/{open-BAqLpTSI.js → open-COJE6ryI.js} +2 -2
  31. package/dist/{org-C4G7WjTV.js → org-BV8wwxwc.js} +4 -4
  32. package/dist/{organization-CmuQwcKN.js → organization-9R_1PJKk.js} +4 -4
  33. package/dist/{orgs-1OzwUtpT.js → orgs-ltP8H0Nl.js} +1 -2
  34. package/dist/{paths-gBbqgkS7.js → paths-Cb1RfjaX.js} +1 -1
  35. package/dist/{playbook-BKqlv77S.js → playbook-CVGolez9.js} +10 -14
  36. package/dist/{products-Cqq59DBQ.js → products-CJq_iXv5.js} +1 -1
  37. package/dist/{promote-D0i8A0CO.js → promote-B_HnFEbX.js} +27 -28
  38. package/dist/{pull-DgQ_UmGv.js → pull-DF4KYVcP.js} +72 -26
  39. package/dist/pull-JxiMyRwY.js +30 -0
  40. package/dist/{pull-CiIrJ5ik.js → pull-lYRULo4v.js} +33 -39
  41. package/dist/push-B5py7h5y.js +29 -0
  42. package/dist/{push-7N4XIVtg.js → push-BZN1Qpkq.js} +23 -12
  43. package/dist/{push-BWsXO7FN.js → push-BnllH2Rd.js} +8 -7
  44. package/dist/push-DHlUMkbf.js +21 -0
  45. package/dist/registry-BGEYCWyD.js +22 -0
  46. package/dist/{registry-aAR_8VOw.js → registry-CqePfigB.js} +1287 -902
  47. package/dist/{resolve-CcOpO_5s.js → resolve-B4bd3Qjl.js} +4 -4
  48. package/dist/{resources-DNwvf8rg.js → resources-BaURbSpY.js} +15 -2
  49. package/dist/{run-tVYJ3V5j.js → run-Bme4Egyl.js} +15 -17
  50. package/dist/{scan-dv0rrY4C.js → scan-DugxddUU.js} +1 -1
  51. package/dist/scan-J2DILUNE.js +4 -0
  52. package/dist/{scope-ehZ7L1nj.js → scope-Cg1AdAfO.js} +33 -3
  53. package/dist/{scope-BXoQo30_.js → scope-DDYLQeZw.js} +24 -18
  54. package/dist/screenshot-file-Dix2Qynm.js +127 -0
  55. package/dist/{sdk-DEfQttek.js → sdk-BFunw4Hc.js} +1 -1
  56. package/dist/{framework-JFLjmD5Y.js → selection-C439nEhn.js} +4 -54
  57. package/dist/{series-D2ZpZ8cx.js → series-B8NJK4yS.js} +1 -1
  58. package/dist/{server-CcZGdYjE.js → server-C_aMxzvS.js} +40 -18
  59. package/dist/server-Cif9w5lM.js +33 -0
  60. package/dist/{session-dHBtgSN0.js → session-B7frlXXQ.js} +1 -1
  61. package/dist/{base-83ZTv6up.js → session-CfG3gzko.js} +8 -83
  62. package/dist/session-DvaPyOuH.js +5 -0
  63. package/dist/{migration-BUedsREQ.js → setup-DQEasPhx.js} +290 -28
  64. package/dist/skills/index.json +5 -0
  65. package/dist/skills/superwall/SKILL.md +37 -10
  66. package/dist/skills/superwall/references/api.md +66 -21
  67. package/dist/skills/superwall/references/asa.md +109 -64
  68. package/dist/skills/superwall/references/dashboard-links.md +65 -28
  69. package/dist/skills/superwall/references/data-analytics.md +1 -1
  70. package/dist/skills/superwall/workflows/dashboard/setup.md +15 -5
  71. package/dist/skills/superwall/workflows/integrate/flutter.md +9 -7
  72. package/dist/skills/superwall-framework/SKILL.md +248 -36
  73. package/dist/skills/superwall-framework/references/cli.md +98 -7
  74. package/dist/skills/superwall-framework/references/examples.md +2 -2
  75. package/dist/skills/superwall-framework/references/layout.md +30 -2
  76. package/dist/skills/superwall-framework/references/migrate-from-editor.md +5 -0
  77. package/dist/skills/superwall-framework/references/migrate-from-native.md +5 -0
  78. package/dist/skills/teleport/SKILL.md +154 -0
  79. package/dist/skills/teleport/references/experiments.md +328 -0
  80. package/dist/skills/teleport/references/setup.md +157 -0
  81. package/dist/{skills-Q7xB784d.js → skills-DnegE1A6.js} +139 -9
  82. package/dist/{skills-Bqz2l_bx.js → skills-MmF7IyTg.js} +8 -12
  83. package/dist/source-DQs6iLtC.js +82 -0
  84. package/dist/{source-push-CG948HrX.js → source-push-MbJjh4Ki.js} +38 -14
  85. package/dist/{spinner-IA6hV8nI.js → spinner-Dcr-Dqdi.js} +7 -5
  86. package/dist/{starter-BtUUQWhd.js → starter-BlJ_InZJ.js} +2 -2
  87. package/dist/{status-CB_MrFu5.js → status-DHRxg1ZA.js} +9 -11
  88. package/dist/{output-Ggzq5_-t.js → storage-DdIAHolY.js} +40 -1
  89. package/dist/storekit-De998QOt.js +203 -0
  90. package/dist/storekit-iBCWmeKn.js +15 -0
  91. package/dist/{bind-DcWIIPgk.js → theme-BrUrye-c.js} +29 -6
  92. package/dist/token-CKCBQ4I8.js +100 -0
  93. package/dist/tools-skills/animate-onboarding/SKILL.md +1 -1
  94. package/dist/tools-skills/mobile-design/SKILL.md +1 -1
  95. package/dist/tools-skills/onboarding-questions/SKILL.md +1 -1
  96. package/dist/tools-skills/superwall/SKILL.md +43 -17
  97. package/dist/tools-skills/superwall/references/api.md +74 -24
  98. package/dist/tools-skills/superwall/references/asa.md +109 -64
  99. package/dist/tools-skills/superwall/references/dashboard-links.md +65 -28
  100. package/dist/tools-skills/superwall/references/data-analytics.md +1 -1
  101. package/dist/tools-skills/superwall/workflows/dashboard/playbook.md +4 -3
  102. package/dist/tools-skills/superwall/workflows/dashboard/setup.md +21 -8
  103. package/dist/tools-skills/superwall/workflows/integrate/flutter.md +9 -7
  104. package/dist/tools-skills/superwall/workflows/migrate/adapty.md +4 -3
  105. package/dist/tools-skills/superwall/workflows/migrate/playbook.md +2 -2
  106. package/dist/tools-skills/superwall/workflows/migrate/qonversion.md +4 -3
  107. package/dist/tools-skills/superwall/workflows/migrate/revenuecat.md +4 -3
  108. package/dist/tools-skills/superwall-editor/SKILL.md +2 -3
  109. package/dist/tools-skills/teleport/SKILL.md +154 -0
  110. package/dist/tools-skills/teleport/references/experiments.md +328 -0
  111. package/dist/tools-skills/teleport/references/setup.md +157 -0
  112. package/dist/tools.d.ts +1 -1
  113. package/dist/tools.js +1232 -746
  114. package/dist/{try-CS3jLyoP.js → try-C8QQbG0b.js} +17 -19
  115. package/dist/{lock-DgSx-p8Y.js → types-Dc9U_4kp.js} +86 -80
  116. package/dist/upgrade-CYFdpVpi.js +27 -0
  117. package/dist/upgrade-D0thxCA4.js +348 -0
  118. package/package.json +11 -3
  119. package/dist/config-CGcG7GOt.js +0 -113
  120. package/dist/create-Du8Fx7W5.js +0 -20
  121. package/dist/existing-WQ3pz94o.js +0 -97
  122. package/dist/held-DmOhszHR.js +0 -17
  123. package/dist/log-C0MDCfA2.js +0 -62
  124. package/dist/login-D9jfRO8w.js +0 -17
  125. package/dist/pull-CO5HlqBe.js +0 -36
  126. package/dist/push-BIhGDNpL.js +0 -30
  127. package/dist/push-BgqTddLA.js +0 -22
  128. package/dist/run-B-YoyB-a.js +0 -100
  129. package/dist/scan-BU41gcQY.js +0 -4
  130. package/dist/screenshot-file-XAS0Xy0e.js +0 -16
  131. package/dist/server-BemmM1FV.js +0 -29
  132. package/dist/session-4aITGsF1.js +0 -6
  133. package/dist/setup-m94dpT3t.js +0 -217
  134. package/dist/spawn-DmmmHIP-.js +0 -71
  135. package/dist/storage-pR0Wb0d9.js +0 -41
  136. package/dist/storekit-BMxyYAHj.js +0 -17
  137. package/dist/storekit-CQnwlpKV.js +0 -47
  138. package/dist/telemetry-DU56L7Cy.js +0 -56
  139. package/dist/theme-DUsCh-Vd.js +0 -25
  140. package/dist/token-BbUeExGJ.js +0 -70
  141. package/dist/upgrade-CKn88PZD.js +0 -206
  142. package/dist/upgrade-DfD3-ClG.js +0 -7
  143. /package/dist/{browser-Bp3yRKlU.js → browser-BVjaf98V.js} +0 -0
  144. /package/dist/{client-BJQXl62Q.js → client-BwYhzITp.js} +0 -0
  145. /package/dist/{design-lint-CiFc78aM.js → design-lint-mgO-2SGS.js} +0 -0
  146. /package/dist/{devtools-ByZ6XYnn.js → devtools-B6Vp6HMy.js} +0 -0
  147. /package/dist/{input-MDd67UIp.js → input-DOT_2Zvb.js} +0 -0
  148. /package/dist/{project-NoMtbMyl.js → project-BomArwSj.js} +0 -0
  149. /package/dist/{reports-HYVp169R.js → reports-hbxsd3Zo.js} +0 -0
  150. /package/dist/{storage-Bdz5AmqS.d.ts → storage-Bh3wT1Rn.d.ts} +0 -0
  151. /package/dist/{timing-Ca0TXY-A.js → timing-BKEEIBij.js} +0 -0
  152. /package/dist/{ui-D_qf3Gvw.js → ui-hFgji1e8.js} +0 -0
@@ -1,20 +1,18 @@
1
- import "./token-BbUeExGJ.js";
2
- import "./output-Ggzq5_-t.js";
3
- import "./environment-BFNzLLPN.js";
4
- import "./storage-pR0Wb0d9.js";
5
- import "./client-x08fpvay.js";
6
- import "./config-CGcG7GOt.js";
7
- import "./spinner-IA6hV8nI.js";
8
- import "./ui-D_qf3Gvw.js";
9
- import "./orgs-1OzwUtpT.js";
10
- import "./resources-DNwvf8rg.js";
11
- import "./lookup-Dg55W9S7.js";
12
- import { n as openBrowser } from "./browser-Bp3yRKlU.js";
13
- import { C as listInstallations, O as setInstallation, S as listArtifacts, T as listVersions, a as latestManifest, c as openLink, d as resolveArtifact, m as readBinding, t as appEntrypointUrl, u as projectRoot, y as deleteInstallation } from "./resolve-CcOpO_5s.js";
14
- import { t as ArtifactError } from "./project-NoMtbMyl.js";
15
- import "./lock-DgSx-p8Y.js";
16
- import "./scope-ehZ7L1nj.js";
17
- import { n as resolveOrganization, t as resolveAppScope } from "./organization-CmuQwcKN.js";
1
+ import "./token-CKCBQ4I8.js";
2
+ import "./storage-DdIAHolY.js";
3
+ import "./environment-Dn7irhZr.js";
4
+ import "./config-DCqRQTJ4.js";
5
+ import "./resources-BaURbSpY.js";
6
+ import "./orgs-ltP8H0Nl.js";
7
+ import "./ui-hFgji1e8.js";
8
+ import "./spinner-Dcr-Dqdi.js";
9
+ import "./lookup-DkcT4E-5.js";
10
+ import "./types-Dc9U_4kp.js";
11
+ import { n as openBrowser } from "./browser-BVjaf98V.js";
12
+ import "./scope-Cg1AdAfO.js";
13
+ import { C as listInstallations, O as setInstallation, S as listArtifacts, T as listVersions, a as latestManifest, c as openLink, d as resolveArtifact, m as readBinding, t as appEntrypointUrl, u as projectRoot, y as deleteInstallation } from "./resolve-B4bd3Qjl.js";
14
+ import { t as ArtifactError } from "./project-BomArwSj.js";
15
+ import { n as resolveOrganization, t as resolveAppScope } from "./organization-9R_1PJKk.js";
18
16
 
19
17
  //#region src/core/artifacts/install.ts
20
18
  const whereLabel = (application) => application === null || application === void 0 ? "the whole organization" : `app ${application}`;
@@ -1,36 +1,28 @@
1
- import "./token-BbUeExGJ.js";
2
- import { r as formatJson, t as blocks } from "./output-Ggzq5_-t.js";
3
- import { d as DASHBOARD_URL, x as VERSION } from "./environment-BFNzLLPN.js";
4
- import { i as removeSession, n as readSession, s as sessionOrgName } from "./storage-pR0Wb0d9.js";
5
- import { i as superwallApi } from "./client-x08fpvay.js";
6
- import { i as readOnboardedApp } from "./config-CGcG7GOt.js";
7
- import { i as updateTelemetryTags } from "./telemetry-DU56L7Cy.js";
8
- import "./spawn-DmmmHIP-.js";
9
- import { n as withSpinner } from "./spinner-IA6hV8nI.js";
10
- import { n as ui } from "./ui-D_qf3Gvw.js";
11
- import "./theme-DUsCh-Vd.js";
12
- import { t as stripReport } from "./log-C0MDCfA2.js";
13
- import { n as SUPPORTED_LABEL, t as scanProject } from "./scan-dv0rrY4C.js";
14
- import { t as detectExisting } from "./existing-WQ3pz94o.js";
15
- import { r as expandHome } from "./paths-gBbqgkS7.js";
16
- import "./orgs-1OzwUtpT.js";
17
- import { A as listField, O as field, T as rowName, h as listResource, p as listApplications, s as createProduct, y as platformLabel } from "./resources-DNwvf8rg.js";
18
- import "./org-C4G7WjTV.js";
19
- import "./lookup-Dg55W9S7.js";
20
- import "./scope-BXoQo30_.js";
21
- import { a as listAscConfigs, r as createAscConfig } from "./client-BJQXl62Q.js";
22
- import { i as listUnimportedAscProducts, n as findAscAppId, r as listAscApps, t as ascTypeDisplay } from "./products-Cqq59DBQ.js";
23
- import "./input-MDd67UIp.js";
24
- import { n as resolveAppBinding, r as resolveScopeFromKey, t as platformForIntegration } from "./bind-DcWIIPgk.js";
25
- import "./login-Blhxi20A.js";
26
- import { s as ensureSkillsCurrent } from "./skills-Q7xB784d.js";
27
- import "./browser-Bp3yRKlU.js";
28
- import { a as copyToClipboard, r as buildCopyPrompt, t as runAction } from "./run-B-YoyB-a.js";
29
- import { n as selectHostedStatus, t as detectDrivers } from "./drivers-Dyi-y9Jn.js";
30
- import { n as performLoginWithUi, t as createLoginGate } from "./login-BlpfYapG.js";
31
- import { t as generateStoreKit } from "./storekit-CQnwlpKV.js";
32
- import { r as actionById, t as detectBilling } from "./billing-B6HK-F_a.js";
33
- import { n as writeReport, t as readReport } from "./reports-HYVp169R.js";
1
+ import "./token-CKCBQ4I8.js";
2
+ import { f as formatJson, i as removeSession, n as readSession, s as sessionOrgName, u as blocks } from "./storage-DdIAHolY.js";
3
+ import { d as DASHBOARD_URL, x as VERSION } from "./environment-Dn7irhZr.js";
4
+ import { S as superwallApi, i as readOnboardedApp } from "./config-DCqRQTJ4.js";
5
+ import { S as updateTelemetryTags, s as ensureSkillsCurrent } from "./skills-DnegE1A6.js";
6
+ import { n as SUPPORTED_LABEL, t as scanProject } from "./scan-DugxddUU.js";
7
+ import { A as listField, O as field, T as rowName, h as listResource, p as listApplications, s as createProduct, y as platformLabel } from "./resources-BaURbSpY.js";
8
+ import "./orgs-ltP8H0Nl.js";
9
+ import { n as ui } from "./ui-hFgji1e8.js";
10
+ import { n as withSpinner } from "./spinner-Dcr-Dqdi.js";
11
+ import "./org-BV8wwxwc.js";
12
+ import { a as resolveScopeFromKey, i as resolveAppBinding, r as platformForIntegration } from "./theme-BrUrye-c.js";
13
+ import "./lookup-DkcT4E-5.js";
14
+ import { a as runAction, d as superwallDriver, f as selectHostedStatus, l as detectDrivers, n as stripReport, p as copyToClipboard, s as buildCopyPrompt, t as detectExisting, u as AGENT_SDK_INSTALL_MESSAGE } from "./existing-BQMB_2AG.js";
15
+ import { r as expandHome } from "./paths-Cb1RfjaX.js";
16
+ import "./login-BMHDhxAx.js";
17
+ import "./browser-BVjaf98V.js";
18
+ import { n as performLoginWithUi, t as createLoginGate } from "./login-B7IqDafm.js";
19
+ import "./scope-DDYLQeZw.js";
20
+ import { a as listAscConfigs, r as createAscConfig } from "./client-BwYhzITp.js";
21
+ import { i as listUnimportedAscProducts, n as findAscAppId, r as listAscApps, t as ascTypeDisplay } from "./products-CJq_iXv5.js";
22
+ import "./input-DOT_2Zvb.js";
23
+ import { n as generateStoreKit, t as describeSkipped } from "./storekit-De998QOt.js";
24
+ import { r as actionById, t as detectBilling } from "./billing-C1LV4-BN.js";
25
+ import { n as writeReport, t as readReport } from "./reports-hbxsd3Zo.js";
34
26
  import { readFileSync, writeFileSync } from "node:fs";
35
27
  import { basename } from "node:path";
36
28
  import fg from "fast-glob";
@@ -131,7 +123,7 @@ async function runProductsStage(ctx) {
131
123
  let result = "done";
132
124
  if (how === "asc") result = await ascFlow(ctx, products, teamId);
133
125
  else if (how === "storekit") result = await importFromStoreKit(ctx, products, storeKitFiles);
134
- else if (how === "export") writeStoreKit(products);
126
+ else if (how === "export") writeStoreKit(products, teamId);
135
127
  if (result === "back") continue;
136
128
  return;
137
129
  }
@@ -383,10 +375,12 @@ function renderCheck(ok, text) {
383
375
  if (ok) ui.success(text);
384
376
  else ui.warn(text);
385
377
  }
386
- function writeStoreKit(products) {
378
+ function writeStoreKit(products, teamId) {
387
379
  const out = "Superwall.storekit";
388
- writeFileSync(out, `${formatJson(generateStoreKit(products))}\n`);
389
- ui.success(`Wrote \`${out}\` with ${formatCount(products.length, "product")}.`);
380
+ const { file, written, skipped } = generateStoreKit(products, { teamId: teamId || void 0 });
381
+ writeFileSync(out, `${formatJson(file)}\n`);
382
+ ui.success(`Wrote \`${out}\` with ${formatCount(written, "product")}.`);
383
+ for (const line of describeSkipped(skipped)) ui.warn(`${line}.`);
390
384
  }
391
385
 
392
386
  //#endregion
@@ -608,12 +602,13 @@ async function runIntegrate(ctx) {
608
602
  ui.intro(`Superwall v${VERSION}`);
609
603
  const drivers = await withSpinner("Checking your setup", () => detectDrivers());
610
604
  const [first] = drivers;
605
+ const wanted = ctx.driver;
606
+ if (wanted === superwallDriver.id && !drivers.some((d) => d.driver.id === wanted)) throw new Error(AGENT_SDK_INSTALL_MESSAGE);
611
607
  if (!first) {
612
608
  ui.warn("No coding agent found.");
613
609
  await runFallback(installDir);
614
610
  return;
615
611
  }
616
- const wanted = ctx.driver;
617
612
  const picked = wanted ? drivers.find((d) => d.driver.id === wanted) : first;
618
613
  if (!picked) throw new Error(`Driver "${wanted}" not available. Detected: ${drivers.map((d) => d.driver.id).join(", ")}.`);
619
614
  const driver = picked.driver;
@@ -1,6 +1,6 @@
1
- import { n as ui } from "./ui-D_qf3Gvw.js";
2
- import { a as onboardingHooks, t as performLogin } from "./login-Blhxi20A.js";
3
- import { t as BROWSER_UNAVAILABLE } from "./browser-Bp3yRKlU.js";
1
+ import { n as ui } from "./ui-hFgji1e8.js";
2
+ import { a as onboardingHooks, t as performLogin } from "./login-BMHDhxAx.js";
3
+ import { t as BROWSER_UNAVAILABLE } from "./browser-BVjaf98V.js";
4
4
 
5
5
  //#region src/core/workflows/login.ts
6
6
  async function performLoginWithUi(app, onProvisioned) {
@@ -1,12 +1,11 @@
1
- import { g as OAUTH_SCOPE, h as Integration, i as AUTH_HOST, l as CLI_CLIENT_ID, t as API_HOST } from "./environment-BFNzLLPN.js";
2
- import { c as writePendingLogin, l as writeSession, o as serializeSession, r as removePendingLogin, t as readPendingLogin } from "./storage-pR0Wb0d9.js";
3
- import { a as readOnboardedOrg, m as writeOnboardedOrg, o as readOnboardingIdempotencyKey, p as writeOnboardedApp } from "./config-CGcG7GOt.js";
4
- import { r as track } from "./telemetry-DU56L7Cy.js";
5
- import { r as UsageError } from "./spinner-IA6hV8nI.js";
6
- import { n as ui } from "./ui-D_qf3Gvw.js";
7
- import { t as scanProject } from "./scan-dv0rrY4C.js";
8
- import { s as ensureSkillsCurrent } from "./skills-Q7xB784d.js";
9
- import { n as openBrowser, t as BROWSER_UNAVAILABLE } from "./browser-Bp3yRKlU.js";
1
+ import { c as writePendingLogin, l as writeSession, o as serializeSession, r as removePendingLogin, t as readPendingLogin } from "./storage-DdIAHolY.js";
2
+ import { g as OAUTH_SCOPE, h as Integration, i as AUTH_HOST, l as CLI_CLIENT_ID, t as API_HOST } from "./environment-Dn7irhZr.js";
3
+ import { a as readOnboardedOrg, m as writeOnboardedOrg, o as readOnboardingIdempotencyKey, p as writeOnboardedApp } from "./config-DCqRQTJ4.js";
4
+ import { s as ensureSkillsCurrent, x as track } from "./skills-DnegE1A6.js";
5
+ import { t as scanProject } from "./scan-DugxddUU.js";
6
+ import { n as ui } from "./ui-hFgji1e8.js";
7
+ import { r as UsageError } from "./spinner-Dcr-Dqdi.js";
8
+ import { n as openBrowser, t as BROWSER_UNAVAILABLE } from "./browser-BVjaf98V.js";
10
9
  import { setTimeout } from "node:timers/promises";
11
10
 
12
11
  //#region src/core/account/onboarding.ts
@@ -0,0 +1,13 @@
1
+ import "./token-CKCBQ4I8.js";
2
+ import "./storage-DdIAHolY.js";
3
+ import "./environment-Dn7irhZr.js";
4
+ import "./config-DCqRQTJ4.js";
5
+ import "./skills-DnegE1A6.js";
6
+ import "./scan-DugxddUU.js";
7
+ import "./ui-hFgji1e8.js";
8
+ import "./spinner-Dcr-Dqdi.js";
9
+ import "./paths-Cb1RfjaX.js";
10
+ import { i as startLogin, n as pollLogin, r as runLogin, t as performLogin } from "./login-BMHDhxAx.js";
11
+ import "./browser-BVjaf98V.js";
12
+
13
+ export { performLogin, pollLogin, runLogin, startLogin };
@@ -1,6 +1,6 @@
1
- import { t as ApiError } from "./client-x08fpvay.js";
2
- import { a as orgProjects, s as rememberOrg } from "./orgs-1OzwUtpT.js";
3
- import { m as listProjects } from "./resources-DNwvf8rg.js";
1
+ import { y as ApiError } from "./config-DCqRQTJ4.js";
2
+ import { m as listProjects } from "./resources-BaURbSpY.js";
3
+ import { a as orgProjects, s as rememberOrg } from "./orgs-ltP8H0Nl.js";
4
4
 
5
5
  //#region src/core/api/lookup.ts
6
6
  const DASHBOARD_PATH = /^\/(\d+)(?:\/(\d+))?(?:\/|$)/;
@@ -64,9 +64,33 @@ async function findApplication(api, ref, known) {
64
64
  if (found) rememberOrg(found.project);
65
65
  return found;
66
66
  }
67
+ /**
68
+ * A custom store is a CUSTOM application that `/v2/projects` leaves out of `applications`, so
69
+ * `findApplication` never sees one. This finds it by id, name or dashboard link among the
70
+ * projects' custom stores, as an application of platform `custom`.
71
+ */
72
+ async function findCustomStore(api, ref, projects) {
73
+ const id = parseDashboardUrl(ref)?.applicationId ?? ref;
74
+ const perProject = await Promise.all(projects.map((project) => api.list(`/v2/projects/${encodeURIComponent(String(project.id))}/custom-stores`).catch((error) => {
75
+ if (notFound(error)) return [];
76
+ throw error;
77
+ })));
78
+ for (const [index, stores] of perProject.entries()) {
79
+ const project = projects[index];
80
+ const store = stores.find((candidate) => String(candidate.id) === id || candidate.name === ref);
81
+ if (project && store) return {
82
+ project,
83
+ app: {
84
+ id: String(store.id),
85
+ name: store.name,
86
+ platform: "custom"
87
+ }
88
+ };
89
+ }
90
+ }
67
91
  function appNotFound(ref) {
68
92
  return /* @__PURE__ */ new Error(`No app ${ref} that this account can open. Pass its dashboard link instead — https://app.superwall.com/<org>/<app>/… names the organization, which finds apps that have no paywalls yet.`);
69
93
  }
70
94
 
71
95
  //#endregion
72
- export { parseDashboardUrl as i, findApplication as n, findProject as r, appNotFound as t };
96
+ export { parseDashboardUrl as a, findProject as i, findApplication as n, findCustomStore as r, appNotFound as t };
@@ -1,39 +1,37 @@
1
- import "./token-BbUeExGJ.js";
2
- import { t as blocks } from "./output-Ggzq5_-t.js";
3
- import { d as DASHBOARD_URL, x as VERSION } from "./environment-BFNzLLPN.js";
4
- import { n as readSession, s as sessionOrgName } from "./storage-pR0Wb0d9.js";
5
- import "./client-x08fpvay.js";
6
- import "./config-CGcG7GOt.js";
7
- import "./telemetry-DU56L7Cy.js";
8
- import "./spawn-DmmmHIP-.js";
9
- import "./spinner-IA6hV8nI.js";
10
- import { n as ui } from "./ui-D_qf3Gvw.js";
11
- import "./theme-DUsCh-Vd.js";
12
- import { t as stripReport } from "./log-C0MDCfA2.js";
13
- import { t as scanProject } from "./scan-dv0rrY4C.js";
14
- import { t as detectExisting } from "./existing-WQ3pz94o.js";
15
- import "./paths-gBbqgkS7.js";
16
- import "./orgs-1OzwUtpT.js";
17
- import "./resources-DNwvf8rg.js";
18
- import "./lookup-Dg55W9S7.js";
19
- import "./login-Blhxi20A.js";
20
- import "./skills-Q7xB784d.js";
21
- import "./browser-Bp3yRKlU.js";
22
- import "./lock-DgSx-p8Y.js";
23
- import "./scope-ehZ7L1nj.js";
24
- import { i as requireApi } from "./base-83ZTv6up.js";
25
- import "./framework-JFLjmD5Y.js";
26
- import { t as runAction } from "./run-B-YoyB-a.js";
27
- import { t as detectDrivers } from "./drivers-Dyi-y9Jn.js";
28
- import { a as migrationSource, c as scaffoldFromPaywall, d as findScreenCandidates, f as placementOfName, i as migrationFor, l as scaffoldFromScreen, n as hasOriginal, o as offerMigration, p as screenNameOf, s as projectDirOf, t as buildMigrationCopyPrompt, u as screenMigrationFor } from "./migration-BUedsREQ.js";
29
- import { n as performLoginWithUi } from "./login-BlpfYapG.js";
30
- import "./source-BccdO4aL.js";
31
- import "./assets-C_RjojkK.js";
32
- import "./source-push-CG948HrX.js";
33
- import "./server-CcZGdYjE.js";
34
- import { i as startStudio, n as migrationNextSteps, r as screenNextSteps, t as askStudio } from "./open-BAqLpTSI.js";
35
- import { r as actionById, t as detectBilling } from "./billing-B6HK-F_a.js";
36
- import { n as writeReport } from "./reports-HYVp169R.js";
1
+ import "./token-CKCBQ4I8.js";
2
+ import { n as readSession, s as sessionOrgName, u as blocks } from "./storage-DdIAHolY.js";
3
+ import { d as DASHBOARD_URL, x as VERSION } from "./environment-Dn7irhZr.js";
4
+ import "./config-DCqRQTJ4.js";
5
+ import "./skills-DnegE1A6.js";
6
+ import { t as scanProject } from "./scan-DugxddUU.js";
7
+ import "./resources-BaURbSpY.js";
8
+ import "./orgs-ltP8H0Nl.js";
9
+ import { n as ui } from "./ui-hFgji1e8.js";
10
+ import "./spinner-Dcr-Dqdi.js";
11
+ import "./org-BV8wwxwc.js";
12
+ import "./theme-BrUrye-c.js";
13
+ import "./lookup-DkcT4E-5.js";
14
+ import "./types-Dc9U_4kp.js";
15
+ import { n as requireApi } from "./session-CfG3gzko.js";
16
+ import { a as runAction, l as detectDrivers, n as stripReport, t as detectExisting } from "./existing-BQMB_2AG.js";
17
+ import "./paths-Cb1RfjaX.js";
18
+ import { S as screenNameOf, _ as scaffoldFromPaywall, b as findScreenCandidates, d as buildMigrationCopyPrompt, f as hasOriginal, g as projectDirOf, h as offerMigration, m as migrationSource, p as migrationFor, v as scaffoldFromScreen, x as placementOfName, y as screenMigrationFor } from "./setup-DQEasPhx.js";
19
+ import "./framework-DW5fqjh4.js";
20
+ import "./login-BMHDhxAx.js";
21
+ import "./browser-BVjaf98V.js";
22
+ import { n as performLoginWithUi } from "./login-B7IqDafm.js";
23
+ import "./git-Hf9Wc7Hp.js";
24
+ import "./scope-Cg1AdAfO.js";
25
+ import "./upgrade-D0thxCA4.js";
26
+ import "./base-zc1wl_9b.js";
27
+ import "./selection-C439nEhn.js";
28
+ import "./source-DQs6iLtC.js";
29
+ import "./assets-DTAgbWw0.js";
30
+ import "./source-push-MbJjh4Ki.js";
31
+ import "./server-C_aMxzvS.js";
32
+ import { i as startStudio, n as migrationNextSteps, r as screenNextSteps, t as askStudio } from "./open-COJE6ryI.js";
33
+ import { r as actionById, t as detectBilling } from "./billing-C1LV4-BN.js";
34
+ import { n as writeReport } from "./reports-hbxsd3Zo.js";
37
35
  import { execFile } from "node:child_process";
38
36
  import * as fs from "node:fs";
39
37
  import * as os$1 from "node:os";
@@ -99,7 +97,7 @@ async function askForScreenshot(ui$1, runtime = createSimulator()) {
99
97
  //#endregion
100
98
  //#region src/core/workflows/migrate.ts
101
99
  async function runPaywallMigration(ctx, paywallId, skill) {
102
- const { installDir, interactive } = ctx;
100
+ const { installDir, interactive, dryRun } = ctx;
103
101
  if (!skill) ui.intro(`Superwall migrate v${VERSION}`);
104
102
  const existingDir = projectDirOf(installDir);
105
103
  let migration = existingDir === void 0 ? void 0 : migrationFor(existingDir, paywallId);
@@ -112,14 +110,26 @@ async function runPaywallMigration(ctx, paywallId, skill) {
112
110
  const api = await requireApi(interactive);
113
111
  const target = existingDir ?? path.join(installDir, "superwall");
114
112
  if (existingDir === void 0 && fs.existsSync(path.join(target, "package.json"))) throw new Error(`\`${target}\` already has a package.json that isn't a superwall project — move it aside first.`);
115
- migration = migrationFor(target, (await scaffoldFromPaywall(ui, api, {
113
+ const origin = await scaffoldFromPaywall(ui, api, {
116
114
  root: installDir,
117
115
  target,
118
116
  paywallId,
119
- newProject: existingDir === void 0
120
- })).id);
117
+ newProject: existingDir === void 0,
118
+ dryRun
119
+ });
120
+ if (dryRun && origin.url !== void 0) {
121
+ ui.outro("Dry run - no changes made.");
122
+ return;
123
+ }
124
+ migration = dryRun ? void 0 : migrationFor(target, origin.id);
121
125
  if (migration === void 0) throw new Error(`Paywall ${paywallId} has no served document to rebuild from — nothing was recorded in superwall.lock.`);
122
- } else ui.info(`\`paywalls/${migration.surfaceId}\` was scaffolded from paywall ${paywallId} — picking up the rebuild.`);
126
+ } else {
127
+ ui.info(`\`paywalls/${migration.surfaceId}\` was scaffolded from paywall ${paywallId} — picking up the rebuild.`);
128
+ if (dryRun) {
129
+ ui.outro("Dry run - no changes made.");
130
+ return;
131
+ }
132
+ }
123
133
  const choice = await offerMigration(ui, interactive, migration);
124
134
  const opening = choice === "agent" && await askStudio(ui, interactive, migration.surfaceId);
125
135
  ctx.output.render(blocks.nextSteps(migrationNextSteps(opening, path.relative(installDir, migration.superwallDir) || ".", paywallId, choice)), blocks.outro(`Done. ${DASHBOARD_URL}`));
@@ -147,7 +157,7 @@ async function pickScreen(ctx) {
147
157
  }) ?? void 0;
148
158
  }
149
159
  async function runScreenMigration(ctx, screen, skill) {
150
- const { installDir, interactive } = ctx;
160
+ const { installDir, interactive, dryRun } = ctx;
151
161
  if (!skill) ui.intro(`Superwall migrate v${VERSION}`);
152
162
  const existingDir = projectDirOf(installDir);
153
163
  let file = screen.path === "" ? void 0 : path.resolve(screen.path);
@@ -169,17 +179,28 @@ async function runScreenMigration(ctx, screen, skill) {
169
179
  if (existingDir === void 0 && fs.existsSync(path.join(target, "package.json"))) throw new Error(`\`${target}\` already has a package.json that isn't a superwall project — move it aside first.`);
170
180
  let screenshot = screen.screenshot === void 0 ? void 0 : path.resolve(screen.screenshot);
171
181
  if (screenshot !== void 0 && !fs.existsSync(screenshot)) throw new Error(`No screenshot at \`${screen.screenshot}\`.`);
172
- if (screenshot === void 0 && interactive) screenshot = await askForScreenshot(ui);
182
+ if (screenshot === void 0 && interactive && !dryRun) screenshot = await askForScreenshot(ui);
173
183
  scaffoldFromScreen(ui, {
174
184
  root: installDir,
175
185
  target,
176
186
  file,
177
187
  newProject: existingDir === void 0,
178
- screenshot
188
+ screenshot,
189
+ dryRun
179
190
  });
191
+ if (dryRun) {
192
+ ui.outro("Dry run - no changes made.");
193
+ return;
194
+ }
180
195
  migration = screenMigrationFor(target, file);
181
196
  if (migration === void 0) throw new Error(`\`${shown}\` was not recorded in superwall.lock — nothing to rebuild.`);
182
- } else ui.info(`\`paywalls/${migration.surfaceId}\` was scaffolded from \`${shown}\` — picking up the rebuild.`);
197
+ } else {
198
+ ui.info(`\`paywalls/${migration.surfaceId}\` was scaffolded from \`${shown}\` — picking up the rebuild.`);
199
+ if (dryRun) {
200
+ ui.outro("Dry run - no changes made.");
201
+ return;
202
+ }
203
+ }
183
204
  const choice = await offerMigration(ui, interactive, migration);
184
205
  const original = hasOriginal(migration);
185
206
  const opening = choice === "agent" && await askStudio(ui, interactive, migration.surfaceId, original);
@@ -1,7 +1,7 @@
1
- import { D as updateServerNotifications, r as chooseKeyApp } from "./held-sKq3xrsT.js";
2
- import { t as apiCall } from "./spinner-IA6hV8nI.js";
3
- import { i as findAppNotificationUrl } from "./client-BJQXl62Q.js";
4
- import { t as timing } from "./timing-Ca0TXY-A.js";
1
+ import { D as updateServerNotifications, r as chooseKeyApp } from "./held-D5wSX2Mf.js";
2
+ import { t as apiCall } from "./spinner-Dcr-Dqdi.js";
3
+ import { i as findAppNotificationUrl } from "./client-BwYhzITp.js";
4
+ import { t as timing } from "./timing-BKEEIBij.js";
5
5
 
6
6
  //#region src/core/app-store-connect/notification-url.ts
7
7
  const RETRY_DELAYS = [
@@ -1,5 +1,5 @@
1
- import { T as isNonInteractive } from "./environment-BFNzLLPN.js";
2
- import { t as runStudio } from "./server-CcZGdYjE.js";
1
+ import { T as isNonInteractive } from "./environment-Dn7irhZr.js";
2
+ import { t as runStudio } from "./server-C_aMxzvS.js";
3
3
 
4
4
  //#region src/core/paywalls/studio/open.ts
5
5
  async function askStudio(ui, interactive, surfaceId, original = true) {
@@ -1,7 +1,7 @@
1
- import { n as withSpinner } from "./spinner-IA6hV8nI.js";
2
- import { n as ui } from "./ui-D_qf3Gvw.js";
3
- import { n as listOrganizations, t as listOrgGroups } from "./orgs-1OzwUtpT.js";
4
- import { E as titleCase, T as rowName } from "./resources-DNwvf8rg.js";
1
+ import { E as titleCase, T as rowName } from "./resources-BaURbSpY.js";
2
+ import { n as listOrganizations, t as listOrgGroups } from "./orgs-ltP8H0Nl.js";
3
+ import { n as ui } from "./ui-hFgji1e8.js";
4
+ import { n as withSpinner } from "./spinner-Dcr-Dqdi.js";
5
5
 
6
6
  //#region src/core/account/org.ts
7
7
  async function orgForNewProject(api, interactive) {
@@ -1,7 +1,7 @@
1
- import { t as apiCall } from "./spinner-IA6hV8nI.js";
2
- import { a as orgProjects, i as orgIdOf, n as listOrganizations } from "./orgs-1OzwUtpT.js";
3
- import { n as findApplication, t as appNotFound } from "./lookup-Dg55W9S7.js";
4
- import { t as ArtifactError } from "./project-NoMtbMyl.js";
1
+ import { a as orgProjects, i as orgIdOf, n as listOrganizations } from "./orgs-ltP8H0Nl.js";
2
+ import { t as apiCall } from "./spinner-Dcr-Dqdi.js";
3
+ import { n as findApplication, t as appNotFound } from "./lookup-DkcT4E-5.js";
4
+ import { t as ArtifactError } from "./project-BomArwSj.js";
5
5
 
6
6
  //#region src/core/artifacts/organization.ts
7
7
  async function resolveAppScope(api, app, org) {
@@ -1,5 +1,4 @@
1
- import { t as ApiError } from "./client-x08fpvay.js";
2
- import { h as writeOpenedOrgs, s as readOpenedOrgs } from "./config-CGcG7GOt.js";
1
+ import { h as writeOpenedOrgs, s as readOpenedOrgs, y as ApiError } from "./config-DCqRQTJ4.js";
3
2
 
4
3
  //#region src/core/api/orgs.ts
5
4
  async function listOrganizations(api) {
@@ -1,4 +1,4 @@
1
- import { E as resolveEnv } from "./environment-BFNzLLPN.js";
1
+ import { E as resolveEnv } from "./environment-Dn7irhZr.js";
2
2
  import { existsSync } from "node:fs";
3
3
  import { homedir } from "node:os";
4
4
  import { dirname, join } from "node:path";
@@ -1,17 +1,13 @@
1
- import "./token-BbUeExGJ.js";
2
- import "./output-Ggzq5_-t.js";
3
- import "./environment-BFNzLLPN.js";
4
- import "./storage-pR0Wb0d9.js";
5
- import "./client-x08fpvay.js";
6
- import "./config-CGcG7GOt.js";
7
- import { i as updateTelemetryTags, r as track } from "./telemetry-DU56L7Cy.js";
8
- import "./spawn-DmmmHIP-.js";
9
- import "./spinner-IA6hV8nI.js";
10
- import "./ui-D_qf3Gvw.js";
11
- import { t as scanProject } from "./scan-dv0rrY4C.js";
12
- import "./paths-gBbqgkS7.js";
13
- import { d as readBundledSkill } from "./skills-Q7xB784d.js";
14
- import { n as FRAMEWORK_REF, t as detectBilling } from "./billing-B6HK-F_a.js";
1
+ import "./token-CKCBQ4I8.js";
2
+ import "./storage-DdIAHolY.js";
3
+ import "./environment-Dn7irhZr.js";
4
+ import "./config-DCqRQTJ4.js";
5
+ import { S as updateTelemetryTags, d as readBundledSkill, x as track } from "./skills-DnegE1A6.js";
6
+ import { t as scanProject } from "./scan-DugxddUU.js";
7
+ import "./ui-hFgji1e8.js";
8
+ import "./spinner-Dcr-Dqdi.js";
9
+ import "./paths-Cb1RfjaX.js";
10
+ import { n as FRAMEWORK_REF, t as detectBilling } from "./billing-C1LV4-BN.js";
15
11
 
16
12
  //#region src/core/workflows/playbook.ts
17
13
  async function printPlaybook(installDir, playbook) {
@@ -1,4 +1,4 @@
1
- import { n as ascProxyGet } from "./client-BJQXl62Q.js";
1
+ import { n as ascProxyGet } from "./client-BwYhzITp.js";
2
2
 
3
3
  //#region src/core/app-store-connect/store/products.ts
4
4
  function attr(r, key) {
@@ -1,31 +1,30 @@
1
- import "./token-BbUeExGJ.js";
2
- import "./output-Ggzq5_-t.js";
3
- import { x as VERSION } from "./environment-BFNzLLPN.js";
4
- import "./storage-pR0Wb0d9.js";
5
- import { t as ApiError } from "./client-x08fpvay.js";
6
- import "./config-CGcG7GOt.js";
7
- import "./telemetry-DU56L7Cy.js";
8
- import "./spawn-DmmmHIP-.js";
9
- import "./spinner-IA6hV8nI.js";
10
- import { n as ui } from "./ui-D_qf3Gvw.js";
11
- import "./scan-dv0rrY4C.js";
12
- import "./paths-gBbqgkS7.js";
13
- import "./orgs-1OzwUtpT.js";
14
- import { _ as livePaywallVersion, x as promotePaywallVersion } from "./resources-DNwvf8rg.js";
15
- import "./lookup-Dg55W9S7.js";
16
- import "./login-Blhxi20A.js";
17
- import "./skills-Q7xB784d.js";
18
- import "./browser-Bp3yRKlU.js";
19
- import { l as readLock, y as collectProjectDeclarations } from "./lock-DgSx-p8Y.js";
20
- import "./scope-ehZ7L1nj.js";
21
- import { c as planTargets, d as wantedPlatforms, h as resolveApps, i as requireApi, s as parsePlatformFlags, u as targetLabel } from "./base-83ZTv6up.js";
22
- import { l as selectSurfaces, n as resolveFramework, s as resolveProjectDir, v as transition } from "./framework-JFLjmD5Y.js";
23
- import "./login-BlpfYapG.js";
24
- import "./source-BccdO4aL.js";
25
- import "./assets-C_RjojkK.js";
26
- import "./design-lint-CiFc78aM.js";
27
- import { u as resolveBinding } from "./source-push-CG948HrX.js";
28
- import { a as pickApplicationOption, i as timed, o as pickAdoptOption, t as group } from "./push-7N4XIVtg.js";
1
+ import "./token-CKCBQ4I8.js";
2
+ import "./storage-DdIAHolY.js";
3
+ import { x as VERSION } from "./environment-Dn7irhZr.js";
4
+ import { y as ApiError } from "./config-DCqRQTJ4.js";
5
+ import "./skills-DnegE1A6.js";
6
+ import "./scan-DugxddUU.js";
7
+ import { _ as livePaywallVersion, x as promotePaywallVersion } from "./resources-BaURbSpY.js";
8
+ import "./orgs-ltP8H0Nl.js";
9
+ import { n as ui } from "./ui-hFgji1e8.js";
10
+ import "./spinner-Dcr-Dqdi.js";
11
+ import "./lookup-DkcT4E-5.js";
12
+ import { f as readLock, n as collectProjectDeclarations } from "./types-Dc9U_4kp.js";
13
+ import { l as resolveApps, n as requireApi } from "./session-CfG3gzko.js";
14
+ import "./paths-Cb1RfjaX.js";
15
+ import { i as resolveFramework } from "./framework-DW5fqjh4.js";
16
+ import "./login-BMHDhxAx.js";
17
+ import "./browser-BVjaf98V.js";
18
+ import "./login-B7IqDafm.js";
19
+ import "./git-Hf9Wc7Hp.js";
20
+ import "./scope-Cg1AdAfO.js";
21
+ import { i as planTargets, o as targetLabel, r as parsePlatformFlags, s as wantedPlatforms } from "./base-zc1wl_9b.js";
22
+ import { a as resolveProjectDir, g as transition, s as selectSurfaces } from "./selection-C439nEhn.js";
23
+ import "./source-DQs6iLtC.js";
24
+ import "./assets-DTAgbWw0.js";
25
+ import "./design-lint-mgO-2SGS.js";
26
+ import { u as resolveBinding } from "./source-push-MbJjh4Ki.js";
27
+ import { a as pickApplicationOption, i as timed, o as pickAdoptOption, t as group } from "./push-BZN1Qpkq.js";
29
28
  import pc from "picocolors";
30
29
 
31
30
  //#region src/core/paywalls/promote.ts