@superwall/cli 2.6.0-beta.2 → 2.6.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 (144) hide show
  1. package/README.md +47 -16
  2. package/dist/{apple-Dc5pOPms.js → apple-D-rfsuDA.js} +17 -19
  3. package/dist/{approve-BSbdmOez.js → approve-aPc5RoXB.js} +9 -11
  4. package/dist/{assets-C_RjojkK.js → assets-PyuXe45Y.js} +3 -3
  5. package/dist/auth.d.ts +11 -4
  6. package/dist/auth.js +4 -5
  7. package/dist/base-CAU0hWoI.js +82 -0
  8. package/dist/{billing-B6HK-F_a.js → billing-Dt6L_l9R.js} +3 -3
  9. package/dist/{build-DK88pTMW.js → build-CY5FnMNY.js} +35 -16
  10. package/dist/{client-x08fpvay.js → config-DOp5oChe.js} +162 -15
  11. package/dist/{create-B6-Dr3GZ.js → create-BZL5VH4L.js} +41 -41
  12. package/dist/{create-kpqEhqkk.js → create-D6w3UL0m.js} +9 -9
  13. package/dist/create-DM5Y1Pyk.js +18 -0
  14. package/dist/{doctor-DYbm8IKQ.js → doctor-C9FR0qw3.js} +50 -10
  15. package/dist/entry.js +45 -40
  16. package/dist/{environment-BFNzLLPN.js → environment-sE2wZYdg.js} +1 -1
  17. package/dist/{drivers-Dyi-y9Jn.js → existing--peXpOZj.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-CUBCOCGP.js} +8 -8
  21. package/dist/held-DVxvPMSG.js +15 -0
  22. package/dist/{install-DsIsif39.js → install-C5d82gZF.js} +15 -17
  23. package/dist/{integrate-B8eA676b.js → integrate-D8J_X1bj.js} +33 -38
  24. package/dist/{login-Blhxi20A.js → login-C6X7JrhM.js} +8 -9
  25. package/dist/{login-BlpfYapG.js → login-DXhm9L0F.js} +3 -3
  26. package/dist/login-et319ESO.js +13 -0
  27. package/dist/{lookup-Dg55W9S7.js → lookup-DqmIbUkv.js} +28 -4
  28. package/dist/{migrate-DoRb9jmA.js → migrate-BYF6hKZ2.js} +66 -45
  29. package/dist/{notification-url-D82msWF5.js → notification-url-Bo54nkXv.js} +4 -4
  30. package/dist/{open-BAqLpTSI.js → open-xdgXUzaF.js} +2 -2
  31. package/dist/{org-C4G7WjTV.js → org-BD8U3D1_.js} +4 -4
  32. package/dist/{organization-CmuQwcKN.js → organization-D-ZlB3qU.js} +4 -4
  33. package/dist/{orgs-1OzwUtpT.js → orgs-DQQJ3sw_.js} +1 -2
  34. package/dist/{paths-gBbqgkS7.js → paths-CIlyzF2I.js} +1 -1
  35. package/dist/{playbook-BKqlv77S.js → playbook-ecggWGFi.js} +10 -14
  36. package/dist/{products-Cqq59DBQ.js → products-CJq_iXv5.js} +1 -1
  37. package/dist/{promote-D0i8A0CO.js → promote-QVMLGYlU.js} +27 -28
  38. package/dist/{pull-DgQ_UmGv.js → pull-CCXhb2a7.js} +72 -26
  39. package/dist/{pull-CiIrJ5ik.js → pull-CrdsfsAl.js} +33 -39
  40. package/dist/pull-h71pL3r_.js +30 -0
  41. package/dist/push-BIq6R8Ro.js +29 -0
  42. package/dist/push-D6pJM_vv.js +21 -0
  43. package/dist/{push-7N4XIVtg.js → push-DJMGG7zW.js} +23 -12
  44. package/dist/{push-BWsXO7FN.js → push-DiMDwGfe.js} +8 -7
  45. package/dist/{registry-aAR_8VOw.js → registry-BSnQXft4.js} +1286 -901
  46. package/dist/registry-YwzTfCNc.js +22 -0
  47. package/dist/{resolve-CcOpO_5s.js → resolve-DO7bPota.js} +4 -4
  48. package/dist/{resources-DNwvf8rg.js → resources-XwvXA20E.js} +15 -2
  49. package/dist/{run-tVYJ3V5j.js → run-B-YvxfRc.js} +15 -17
  50. package/dist/scan-B36wkZmI.js +4 -0
  51. package/dist/{scan-dv0rrY4C.js → scan-ViBhmrB7.js} +1 -1
  52. package/dist/{scope-BXoQo30_.js → scope-BLLUxbrA.js} +24 -18
  53. package/dist/{scope-ehZ7L1nj.js → scope-Cg1AdAfO.js} +33 -3
  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-C07e_GGY.js} +4 -54
  57. package/dist/{series-D2ZpZ8cx.js → series-B8NJK4yS.js} +1 -1
  58. package/dist/{server-CcZGdYjE.js → server-CBtHzl9y.js} +40 -18
  59. package/dist/server-CZwSfzKe.js +33 -0
  60. package/dist/{base-83ZTv6up.js → session-BfVx50iA.js} +8 -83
  61. package/dist/{session-dHBtgSN0.js → session-BlrwAdGN.js} +1 -1
  62. package/dist/session-Cip4j99n.js +5 -0
  63. package/dist/{migration-BUedsREQ.js → setup-a4B72xJ8.js} +290 -28
  64. package/dist/skills/superwall/SKILL.md +37 -10
  65. package/dist/skills/superwall/references/api.md +66 -21
  66. package/dist/skills/superwall/references/asa.md +109 -64
  67. package/dist/skills/superwall/references/dashboard-links.md +65 -28
  68. package/dist/skills/superwall/references/data-analytics.md +1 -1
  69. package/dist/skills/superwall/workflows/dashboard/setup.md +15 -5
  70. package/dist/skills/superwall/workflows/integrate/flutter.md +9 -7
  71. package/dist/skills/superwall-framework/SKILL.md +197 -14
  72. package/dist/skills/superwall-framework/references/cli.md +98 -7
  73. package/dist/skills/superwall-framework/references/examples.md +2 -2
  74. package/dist/skills/superwall-framework/references/migrate-from-editor.md +5 -0
  75. package/dist/skills/superwall-framework/references/migrate-from-native.md +5 -0
  76. package/dist/{skills-Q7xB784d.js → skills-BB1uIt8t.js} +139 -9
  77. package/dist/{skills-Bqz2l_bx.js → skills-SnxFa2in.js} +8 -12
  78. package/dist/source-DQs6iLtC.js +82 -0
  79. package/dist/{source-push-CG948HrX.js → source-push-w7miTr6m.js} +38 -14
  80. package/dist/{spinner-IA6hV8nI.js → spinner-BQp7fQvK.js} +7 -5
  81. package/dist/{starter-BtUUQWhd.js → starter-BlJ_InZJ.js} +2 -2
  82. package/dist/{status-CB_MrFu5.js → status-DxsIw9zq.js} +9 -11
  83. package/dist/{output-Ggzq5_-t.js → storage-BR6imSqm.js} +40 -1
  84. package/dist/storekit-BqyujKQ_.js +203 -0
  85. package/dist/storekit-ELVCMF0X.js +15 -0
  86. package/dist/{bind-DcWIIPgk.js → theme-Ed0gz6hr.js} +29 -6
  87. package/dist/token-CWQ6tdva.js +100 -0
  88. package/dist/tools-skills/animate-onboarding/SKILL.md +1 -1
  89. package/dist/tools-skills/mobile-design/SKILL.md +1 -1
  90. package/dist/tools-skills/onboarding-questions/SKILL.md +1 -1
  91. package/dist/tools-skills/superwall/SKILL.md +43 -17
  92. package/dist/tools-skills/superwall/references/api.md +74 -24
  93. package/dist/tools-skills/superwall/references/asa.md +109 -64
  94. package/dist/tools-skills/superwall/references/dashboard-links.md +65 -28
  95. package/dist/tools-skills/superwall/references/data-analytics.md +1 -1
  96. package/dist/tools-skills/superwall/workflows/dashboard/playbook.md +4 -3
  97. package/dist/tools-skills/superwall/workflows/dashboard/setup.md +21 -8
  98. package/dist/tools-skills/superwall/workflows/integrate/flutter.md +9 -7
  99. package/dist/tools-skills/superwall/workflows/migrate/adapty.md +4 -3
  100. package/dist/tools-skills/superwall/workflows/migrate/playbook.md +2 -2
  101. package/dist/tools-skills/superwall/workflows/migrate/qonversion.md +4 -3
  102. package/dist/tools-skills/superwall/workflows/migrate/revenuecat.md +4 -3
  103. package/dist/tools-skills/superwall-editor/SKILL.md +2 -3
  104. package/dist/tools.d.ts +1 -1
  105. package/dist/tools.js +1230 -745
  106. package/dist/{try-CS3jLyoP.js → try-C3HW3hPZ.js} +17 -19
  107. package/dist/{lock-DgSx-p8Y.js → types-Dc9U_4kp.js} +86 -80
  108. package/dist/upgrade-Cw9jVt-r.js +348 -0
  109. package/dist/upgrade-DVsonzDF.js +27 -0
  110. package/package.json +11 -3
  111. package/dist/config-CGcG7GOt.js +0 -113
  112. package/dist/create-Du8Fx7W5.js +0 -20
  113. package/dist/existing-WQ3pz94o.js +0 -97
  114. package/dist/held-DmOhszHR.js +0 -17
  115. package/dist/log-C0MDCfA2.js +0 -62
  116. package/dist/login-D9jfRO8w.js +0 -17
  117. package/dist/pull-CO5HlqBe.js +0 -36
  118. package/dist/push-BIhGDNpL.js +0 -30
  119. package/dist/push-BgqTddLA.js +0 -22
  120. package/dist/run-B-YoyB-a.js +0 -100
  121. package/dist/scan-BU41gcQY.js +0 -4
  122. package/dist/screenshot-file-XAS0Xy0e.js +0 -16
  123. package/dist/server-BemmM1FV.js +0 -29
  124. package/dist/session-4aITGsF1.js +0 -6
  125. package/dist/setup-m94dpT3t.js +0 -217
  126. package/dist/spawn-DmmmHIP-.js +0 -71
  127. package/dist/storage-pR0Wb0d9.js +0 -41
  128. package/dist/storekit-BMxyYAHj.js +0 -17
  129. package/dist/storekit-CQnwlpKV.js +0 -47
  130. package/dist/telemetry-DU56L7Cy.js +0 -56
  131. package/dist/theme-DUsCh-Vd.js +0 -25
  132. package/dist/token-BbUeExGJ.js +0 -70
  133. package/dist/upgrade-CKn88PZD.js +0 -206
  134. package/dist/upgrade-DfD3-ClG.js +0 -7
  135. /package/dist/{browser-Bp3yRKlU.js → browser-BVjaf98V.js} +0 -0
  136. /package/dist/{client-BJQXl62Q.js → client-BwYhzITp.js} +0 -0
  137. /package/dist/{design-lint-CiFc78aM.js → design-lint-mgO-2SGS.js} +0 -0
  138. /package/dist/{devtools-ByZ6XYnn.js → devtools-B6Vp6HMy.js} +0 -0
  139. /package/dist/{input-MDd67UIp.js → input-DOT_2Zvb.js} +0 -0
  140. /package/dist/{project-NoMtbMyl.js → project-BomArwSj.js} +0 -0
  141. /package/dist/{reports-HYVp169R.js → reports-hbxsd3Zo.js} +0 -0
  142. /package/dist/{storage-Bdz5AmqS.d.ts → storage-Bh3wT1Rn.d.ts} +0 -0
  143. /package/dist/{timing-Ca0TXY-A.js → timing-BKEEIBij.js} +0 -0
  144. /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-CWQ6tdva.js";
2
+ import "./storage-BR6imSqm.js";
3
+ import "./environment-sE2wZYdg.js";
4
+ import "./config-DOp5oChe.js";
5
+ import "./resources-XwvXA20E.js";
6
+ import "./orgs-DQQJ3sw_.js";
7
+ import "./ui-hFgji1e8.js";
8
+ import "./spinner-BQp7fQvK.js";
9
+ import "./lookup-DqmIbUkv.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-DO7bPota.js";
14
+ import { t as ArtifactError } from "./project-BomArwSj.js";
15
+ import { n as resolveOrganization, t as resolveAppScope } from "./organization-D-ZlB3qU.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-CWQ6tdva.js";
2
+ import { f as formatJson, i as removeSession, n as readSession, s as sessionOrgName, u as blocks } from "./storage-BR6imSqm.js";
3
+ import { d as DASHBOARD_URL, x as VERSION } from "./environment-sE2wZYdg.js";
4
+ import { S as superwallApi, i as readOnboardedApp } from "./config-DOp5oChe.js";
5
+ import { S as updateTelemetryTags, s as ensureSkillsCurrent } from "./skills-BB1uIt8t.js";
6
+ import { n as SUPPORTED_LABEL, t as scanProject } from "./scan-ViBhmrB7.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-XwvXA20E.js";
8
+ import "./orgs-DQQJ3sw_.js";
9
+ import { n as ui } from "./ui-hFgji1e8.js";
10
+ import { n as withSpinner } from "./spinner-BQp7fQvK.js";
11
+ import "./org-BD8U3D1_.js";
12
+ import { a as resolveScopeFromKey, i as resolveAppBinding, r as platformForIntegration } from "./theme-Ed0gz6hr.js";
13
+ import "./lookup-DqmIbUkv.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--peXpOZj.js";
15
+ import { r as expandHome } from "./paths-CIlyzF2I.js";
16
+ import "./login-C6X7JrhM.js";
17
+ import "./browser-BVjaf98V.js";
18
+ import { n as performLoginWithUi, t as createLoginGate } from "./login-DXhm9L0F.js";
19
+ import "./scope-BLLUxbrA.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-BqyujKQ_.js";
24
+ import { r as actionById, t as detectBilling } from "./billing-Dt6L_l9R.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,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-BR6imSqm.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-sE2wZYdg.js";
3
+ import { a as readOnboardedOrg, m as writeOnboardedOrg, o as readOnboardingIdempotencyKey, p as writeOnboardedApp } from "./config-DOp5oChe.js";
4
+ import { s as ensureSkillsCurrent, x as track } from "./skills-BB1uIt8t.js";
5
+ import { t as scanProject } from "./scan-ViBhmrB7.js";
6
+ import { n as ui } from "./ui-hFgji1e8.js";
7
+ import { r as UsageError } from "./spinner-BQp7fQvK.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
@@ -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-C6X7JrhM.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) {
@@ -0,0 +1,13 @@
1
+ import "./token-CWQ6tdva.js";
2
+ import "./storage-BR6imSqm.js";
3
+ import "./environment-sE2wZYdg.js";
4
+ import "./config-DOp5oChe.js";
5
+ import "./skills-BB1uIt8t.js";
6
+ import "./scan-ViBhmrB7.js";
7
+ import "./ui-hFgji1e8.js";
8
+ import "./spinner-BQp7fQvK.js";
9
+ import "./paths-CIlyzF2I.js";
10
+ import { i as startLogin, n as pollLogin, r as runLogin, t as performLogin } from "./login-C6X7JrhM.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-DOp5oChe.js";
2
+ import { m as listProjects } from "./resources-XwvXA20E.js";
3
+ import { a as orgProjects, s as rememberOrg } from "./orgs-DQQJ3sw_.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-CWQ6tdva.js";
2
+ import { n as readSession, s as sessionOrgName, u as blocks } from "./storage-BR6imSqm.js";
3
+ import { d as DASHBOARD_URL, x as VERSION } from "./environment-sE2wZYdg.js";
4
+ import "./config-DOp5oChe.js";
5
+ import "./skills-BB1uIt8t.js";
6
+ import { t as scanProject } from "./scan-ViBhmrB7.js";
7
+ import "./resources-XwvXA20E.js";
8
+ import "./orgs-DQQJ3sw_.js";
9
+ import { n as ui } from "./ui-hFgji1e8.js";
10
+ import "./spinner-BQp7fQvK.js";
11
+ import "./org-BD8U3D1_.js";
12
+ import "./theme-Ed0gz6hr.js";
13
+ import "./lookup-DqmIbUkv.js";
14
+ import "./types-Dc9U_4kp.js";
15
+ import { n as requireApi } from "./session-BfVx50iA.js";
16
+ import { a as runAction, l as detectDrivers, n as stripReport, t as detectExisting } from "./existing--peXpOZj.js";
17
+ import "./paths-CIlyzF2I.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-a4B72xJ8.js";
19
+ import "./framework-DW5fqjh4.js";
20
+ import "./login-C6X7JrhM.js";
21
+ import "./browser-BVjaf98V.js";
22
+ import { n as performLoginWithUi } from "./login-DXhm9L0F.js";
23
+ import "./git-Hf9Wc7Hp.js";
24
+ import "./scope-Cg1AdAfO.js";
25
+ import "./upgrade-Cw9jVt-r.js";
26
+ import "./base-CAU0hWoI.js";
27
+ import "./selection-C07e_GGY.js";
28
+ import "./source-DQs6iLtC.js";
29
+ import "./assets-PyuXe45Y.js";
30
+ import "./source-push-w7miTr6m.js";
31
+ import "./server-CBtHzl9y.js";
32
+ import { i as startStudio, n as migrationNextSteps, r as screenNextSteps, t as askStudio } from "./open-xdgXUzaF.js";
33
+ import { r as actionById, t as detectBilling } from "./billing-Dt6L_l9R.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-CUBCOCGP.js";
2
+ import { t as apiCall } from "./spinner-BQp7fQvK.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-sE2wZYdg.js";
2
+ import { t as runStudio } from "./server-CBtHzl9y.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-XwvXA20E.js";
2
+ import { n as listOrganizations, t as listOrgGroups } from "./orgs-DQQJ3sw_.js";
3
+ import { n as ui } from "./ui-hFgji1e8.js";
4
+ import { n as withSpinner } from "./spinner-BQp7fQvK.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-DQQJ3sw_.js";
2
+ import { t as apiCall } from "./spinner-BQp7fQvK.js";
3
+ import { n as findApplication, t as appNotFound } from "./lookup-DqmIbUkv.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-DOp5oChe.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-sE2wZYdg.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-CWQ6tdva.js";
2
+ import "./storage-BR6imSqm.js";
3
+ import "./environment-sE2wZYdg.js";
4
+ import "./config-DOp5oChe.js";
5
+ import { S as updateTelemetryTags, d as readBundledSkill, x as track } from "./skills-BB1uIt8t.js";
6
+ import { t as scanProject } from "./scan-ViBhmrB7.js";
7
+ import "./ui-hFgji1e8.js";
8
+ import "./spinner-BQp7fQvK.js";
9
+ import "./paths-CIlyzF2I.js";
10
+ import { n as FRAMEWORK_REF, t as detectBilling } from "./billing-Dt6L_l9R.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-CWQ6tdva.js";
2
+ import "./storage-BR6imSqm.js";
3
+ import { x as VERSION } from "./environment-sE2wZYdg.js";
4
+ import { y as ApiError } from "./config-DOp5oChe.js";
5
+ import "./skills-BB1uIt8t.js";
6
+ import "./scan-ViBhmrB7.js";
7
+ import { _ as livePaywallVersion, x as promotePaywallVersion } from "./resources-XwvXA20E.js";
8
+ import "./orgs-DQQJ3sw_.js";
9
+ import { n as ui } from "./ui-hFgji1e8.js";
10
+ import "./spinner-BQp7fQvK.js";
11
+ import "./lookup-DqmIbUkv.js";
12
+ import { f as readLock, n as collectProjectDeclarations } from "./types-Dc9U_4kp.js";
13
+ import { l as resolveApps, n as requireApi } from "./session-BfVx50iA.js";
14
+ import "./paths-CIlyzF2I.js";
15
+ import { i as resolveFramework } from "./framework-DW5fqjh4.js";
16
+ import "./login-C6X7JrhM.js";
17
+ import "./browser-BVjaf98V.js";
18
+ import "./login-DXhm9L0F.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-CAU0hWoI.js";
22
+ import { a as resolveProjectDir, g as transition, s as selectSurfaces } from "./selection-C07e_GGY.js";
23
+ import "./source-DQs6iLtC.js";
24
+ import "./assets-PyuXe45Y.js";
25
+ import "./design-lint-mgO-2SGS.js";
26
+ import { u as resolveBinding } from "./source-push-w7miTr6m.js";
27
+ import { a as pickApplicationOption, i as timed, o as pickAdoptOption, t as group } from "./push-DJMGG7zW.js";
29
28
  import pc from "picocolors";
30
29
 
31
30
  //#region src/core/paywalls/promote.ts