@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.
- package/README.md +47 -16
- package/dist/{apple-Dc5pOPms.js → apple-D-rfsuDA.js} +17 -19
- package/dist/{approve-BSbdmOez.js → approve-aPc5RoXB.js} +9 -11
- package/dist/{assets-C_RjojkK.js → assets-PyuXe45Y.js} +3 -3
- package/dist/auth.d.ts +11 -4
- package/dist/auth.js +4 -5
- package/dist/base-CAU0hWoI.js +82 -0
- package/dist/{billing-B6HK-F_a.js → billing-Dt6L_l9R.js} +3 -3
- package/dist/{build-DK88pTMW.js → build-CY5FnMNY.js} +35 -16
- package/dist/{client-x08fpvay.js → config-DOp5oChe.js} +162 -15
- package/dist/{create-B6-Dr3GZ.js → create-BZL5VH4L.js} +41 -41
- package/dist/{create-kpqEhqkk.js → create-D6w3UL0m.js} +9 -9
- package/dist/create-DM5Y1Pyk.js +18 -0
- package/dist/{doctor-DYbm8IKQ.js → doctor-C9FR0qw3.js} +50 -10
- package/dist/entry.js +45 -40
- package/dist/{environment-BFNzLLPN.js → environment-sE2wZYdg.js} +1 -1
- package/dist/{drivers-Dyi-y9Jn.js → existing--peXpOZj.js} +305 -8
- package/dist/framework-DW5fqjh4.js +65 -0
- package/dist/{source-BccdO4aL.js → git-Hf9Wc7Hp.js} +34 -92
- package/dist/{held-sKq3xrsT.js → held-CUBCOCGP.js} +8 -8
- package/dist/held-DVxvPMSG.js +15 -0
- package/dist/{install-DsIsif39.js → install-C5d82gZF.js} +15 -17
- package/dist/{integrate-B8eA676b.js → integrate-D8J_X1bj.js} +33 -38
- package/dist/{login-Blhxi20A.js → login-C6X7JrhM.js} +8 -9
- package/dist/{login-BlpfYapG.js → login-DXhm9L0F.js} +3 -3
- package/dist/login-et319ESO.js +13 -0
- package/dist/{lookup-Dg55W9S7.js → lookup-DqmIbUkv.js} +28 -4
- package/dist/{migrate-DoRb9jmA.js → migrate-BYF6hKZ2.js} +66 -45
- package/dist/{notification-url-D82msWF5.js → notification-url-Bo54nkXv.js} +4 -4
- package/dist/{open-BAqLpTSI.js → open-xdgXUzaF.js} +2 -2
- package/dist/{org-C4G7WjTV.js → org-BD8U3D1_.js} +4 -4
- package/dist/{organization-CmuQwcKN.js → organization-D-ZlB3qU.js} +4 -4
- package/dist/{orgs-1OzwUtpT.js → orgs-DQQJ3sw_.js} +1 -2
- package/dist/{paths-gBbqgkS7.js → paths-CIlyzF2I.js} +1 -1
- package/dist/{playbook-BKqlv77S.js → playbook-ecggWGFi.js} +10 -14
- package/dist/{products-Cqq59DBQ.js → products-CJq_iXv5.js} +1 -1
- package/dist/{promote-D0i8A0CO.js → promote-QVMLGYlU.js} +27 -28
- package/dist/{pull-DgQ_UmGv.js → pull-CCXhb2a7.js} +72 -26
- package/dist/{pull-CiIrJ5ik.js → pull-CrdsfsAl.js} +33 -39
- package/dist/pull-h71pL3r_.js +30 -0
- package/dist/push-BIq6R8Ro.js +29 -0
- package/dist/push-D6pJM_vv.js +21 -0
- package/dist/{push-7N4XIVtg.js → push-DJMGG7zW.js} +23 -12
- package/dist/{push-BWsXO7FN.js → push-DiMDwGfe.js} +8 -7
- package/dist/{registry-aAR_8VOw.js → registry-BSnQXft4.js} +1286 -901
- package/dist/registry-YwzTfCNc.js +22 -0
- package/dist/{resolve-CcOpO_5s.js → resolve-DO7bPota.js} +4 -4
- package/dist/{resources-DNwvf8rg.js → resources-XwvXA20E.js} +15 -2
- package/dist/{run-tVYJ3V5j.js → run-B-YvxfRc.js} +15 -17
- package/dist/scan-B36wkZmI.js +4 -0
- package/dist/{scan-dv0rrY4C.js → scan-ViBhmrB7.js} +1 -1
- package/dist/{scope-BXoQo30_.js → scope-BLLUxbrA.js} +24 -18
- package/dist/{scope-ehZ7L1nj.js → scope-Cg1AdAfO.js} +33 -3
- package/dist/screenshot-file-Dix2Qynm.js +127 -0
- package/dist/{sdk-DEfQttek.js → sdk-BFunw4Hc.js} +1 -1
- package/dist/{framework-JFLjmD5Y.js → selection-C07e_GGY.js} +4 -54
- package/dist/{series-D2ZpZ8cx.js → series-B8NJK4yS.js} +1 -1
- package/dist/{server-CcZGdYjE.js → server-CBtHzl9y.js} +40 -18
- package/dist/server-CZwSfzKe.js +33 -0
- package/dist/{base-83ZTv6up.js → session-BfVx50iA.js} +8 -83
- package/dist/{session-dHBtgSN0.js → session-BlrwAdGN.js} +1 -1
- package/dist/session-Cip4j99n.js +5 -0
- package/dist/{migration-BUedsREQ.js → setup-a4B72xJ8.js} +290 -28
- package/dist/skills/superwall/SKILL.md +37 -10
- package/dist/skills/superwall/references/api.md +66 -21
- package/dist/skills/superwall/references/asa.md +109 -64
- package/dist/skills/superwall/references/dashboard-links.md +65 -28
- package/dist/skills/superwall/references/data-analytics.md +1 -1
- package/dist/skills/superwall/workflows/dashboard/setup.md +15 -5
- package/dist/skills/superwall/workflows/integrate/flutter.md +9 -7
- package/dist/skills/superwall-framework/SKILL.md +197 -14
- package/dist/skills/superwall-framework/references/cli.md +98 -7
- package/dist/skills/superwall-framework/references/examples.md +2 -2
- package/dist/skills/superwall-framework/references/migrate-from-editor.md +5 -0
- package/dist/skills/superwall-framework/references/migrate-from-native.md +5 -0
- package/dist/{skills-Q7xB784d.js → skills-BB1uIt8t.js} +139 -9
- package/dist/{skills-Bqz2l_bx.js → skills-SnxFa2in.js} +8 -12
- package/dist/source-DQs6iLtC.js +82 -0
- package/dist/{source-push-CG948HrX.js → source-push-w7miTr6m.js} +38 -14
- package/dist/{spinner-IA6hV8nI.js → spinner-BQp7fQvK.js} +7 -5
- package/dist/{starter-BtUUQWhd.js → starter-BlJ_InZJ.js} +2 -2
- package/dist/{status-CB_MrFu5.js → status-DxsIw9zq.js} +9 -11
- package/dist/{output-Ggzq5_-t.js → storage-BR6imSqm.js} +40 -1
- package/dist/storekit-BqyujKQ_.js +203 -0
- package/dist/storekit-ELVCMF0X.js +15 -0
- package/dist/{bind-DcWIIPgk.js → theme-Ed0gz6hr.js} +29 -6
- package/dist/token-CWQ6tdva.js +100 -0
- package/dist/tools-skills/animate-onboarding/SKILL.md +1 -1
- package/dist/tools-skills/mobile-design/SKILL.md +1 -1
- package/dist/tools-skills/onboarding-questions/SKILL.md +1 -1
- package/dist/tools-skills/superwall/SKILL.md +43 -17
- package/dist/tools-skills/superwall/references/api.md +74 -24
- package/dist/tools-skills/superwall/references/asa.md +109 -64
- package/dist/tools-skills/superwall/references/dashboard-links.md +65 -28
- package/dist/tools-skills/superwall/references/data-analytics.md +1 -1
- package/dist/tools-skills/superwall/workflows/dashboard/playbook.md +4 -3
- package/dist/tools-skills/superwall/workflows/dashboard/setup.md +21 -8
- package/dist/tools-skills/superwall/workflows/integrate/flutter.md +9 -7
- package/dist/tools-skills/superwall/workflows/migrate/adapty.md +4 -3
- package/dist/tools-skills/superwall/workflows/migrate/playbook.md +2 -2
- package/dist/tools-skills/superwall/workflows/migrate/qonversion.md +4 -3
- package/dist/tools-skills/superwall/workflows/migrate/revenuecat.md +4 -3
- package/dist/tools-skills/superwall-editor/SKILL.md +2 -3
- package/dist/tools.d.ts +1 -1
- package/dist/tools.js +1230 -745
- package/dist/{try-CS3jLyoP.js → try-C3HW3hPZ.js} +17 -19
- package/dist/{lock-DgSx-p8Y.js → types-Dc9U_4kp.js} +86 -80
- package/dist/upgrade-Cw9jVt-r.js +348 -0
- package/dist/upgrade-DVsonzDF.js +27 -0
- package/package.json +11 -3
- package/dist/config-CGcG7GOt.js +0 -113
- package/dist/create-Du8Fx7W5.js +0 -20
- package/dist/existing-WQ3pz94o.js +0 -97
- package/dist/held-DmOhszHR.js +0 -17
- package/dist/log-C0MDCfA2.js +0 -62
- package/dist/login-D9jfRO8w.js +0 -17
- package/dist/pull-CO5HlqBe.js +0 -36
- package/dist/push-BIhGDNpL.js +0 -30
- package/dist/push-BgqTddLA.js +0 -22
- package/dist/run-B-YoyB-a.js +0 -100
- package/dist/scan-BU41gcQY.js +0 -4
- package/dist/screenshot-file-XAS0Xy0e.js +0 -16
- package/dist/server-BemmM1FV.js +0 -29
- package/dist/session-4aITGsF1.js +0 -6
- package/dist/setup-m94dpT3t.js +0 -217
- package/dist/spawn-DmmmHIP-.js +0 -71
- package/dist/storage-pR0Wb0d9.js +0 -41
- package/dist/storekit-BMxyYAHj.js +0 -17
- package/dist/storekit-CQnwlpKV.js +0 -47
- package/dist/telemetry-DU56L7Cy.js +0 -56
- package/dist/theme-DUsCh-Vd.js +0 -25
- package/dist/token-BbUeExGJ.js +0 -70
- package/dist/upgrade-CKn88PZD.js +0 -206
- package/dist/upgrade-DfD3-ClG.js +0 -7
- /package/dist/{browser-Bp3yRKlU.js → browser-BVjaf98V.js} +0 -0
- /package/dist/{client-BJQXl62Q.js → client-BwYhzITp.js} +0 -0
- /package/dist/{design-lint-CiFc78aM.js → design-lint-mgO-2SGS.js} +0 -0
- /package/dist/{devtools-ByZ6XYnn.js → devtools-B6Vp6HMy.js} +0 -0
- /package/dist/{input-MDd67UIp.js → input-DOT_2Zvb.js} +0 -0
- /package/dist/{project-NoMtbMyl.js → project-BomArwSj.js} +0 -0
- /package/dist/{reports-HYVp169R.js → reports-hbxsd3Zo.js} +0 -0
- /package/dist/{storage-Bdz5AmqS.d.ts → storage-Bh3wT1Rn.d.ts} +0 -0
- /package/dist/{timing-Ca0TXY-A.js → timing-BKEEIBij.js} +0 -0
- /package/dist/{ui-D_qf3Gvw.js → ui-hFgji1e8.js} +0 -0
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import "./token-
|
|
2
|
-
import "./
|
|
3
|
-
import "./environment-
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
8
|
-
import "./
|
|
9
|
-
import "./
|
|
10
|
-
import "./
|
|
11
|
-
import "./
|
|
12
|
-
import
|
|
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-
|
|
14
|
-
import { t as ArtifactError } from "./project-
|
|
15
|
-
import "./
|
|
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-
|
|
2
|
-
import {
|
|
3
|
-
import { d as DASHBOARD_URL, x as VERSION } from "./environment-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import "./
|
|
9
|
-
import { n as
|
|
10
|
-
import { n as
|
|
11
|
-
import "./
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import { t as detectExisting } from "./existing
|
|
15
|
-
import { r as expandHome } from "./paths-
|
|
16
|
-
import "./
|
|
17
|
-
import
|
|
18
|
-
import "./
|
|
19
|
-
import "./
|
|
20
|
-
import "./
|
|
21
|
-
import {
|
|
22
|
-
import
|
|
23
|
-
import "./
|
|
24
|
-
import {
|
|
25
|
-
import "./
|
|
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
|
-
|
|
389
|
-
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import { a as readOnboardedOrg, m as writeOnboardedOrg, o as readOnboardingIdempotencyKey, p as writeOnboardedApp } from "./config-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { n as ui } from "./ui-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
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-
|
|
2
|
-
import { a as onboardingHooks, t as performLogin } from "./login-
|
|
3
|
-
import { t as BROWSER_UNAVAILABLE } from "./browser-
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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,
|
|
96
|
+
export { parseDashboardUrl as a, findProject as i, findApplication as n, findCustomStore as r, appNotFound as t };
|
|
@@ -1,39 +1,37 @@
|
|
|
1
|
-
import "./token-
|
|
2
|
-
import {
|
|
3
|
-
import { d as DASHBOARD_URL, x as VERSION } from "./environment-
|
|
4
|
-
import
|
|
5
|
-
import "./
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
8
|
-
import "./
|
|
9
|
-
import "./
|
|
10
|
-
import
|
|
11
|
-
import "./
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import "./
|
|
16
|
-
import "./
|
|
17
|
-
import "./
|
|
18
|
-
import "./
|
|
19
|
-
import "./
|
|
20
|
-
import "./
|
|
21
|
-
import "./browser-
|
|
22
|
-
import "./
|
|
23
|
-
import "./
|
|
24
|
-
import
|
|
25
|
-
import "./
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import "./source-
|
|
31
|
-
import "./
|
|
32
|
-
import "./
|
|
33
|
-
import "./
|
|
34
|
-
import {
|
|
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
|
-
|
|
113
|
+
const origin = await scaffoldFromPaywall(ui, api, {
|
|
116
114
|
root: installDir,
|
|
117
115
|
target,
|
|
118
116
|
paywallId,
|
|
119
|
-
newProject: existingDir === void 0
|
|
120
|
-
|
|
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
|
|
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
|
|
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-
|
|
2
|
-
import { t as apiCall } from "./spinner-
|
|
3
|
-
import { i as findAppNotificationUrl } from "./client-
|
|
4
|
-
import { t as timing } from "./timing-
|
|
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-
|
|
2
|
-
import { t as runStudio } from "./server-
|
|
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 {
|
|
2
|
-
import { n as
|
|
3
|
-
import { n as
|
|
4
|
-
import {
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import { n as findApplication, t as appNotFound } from "./lookup-
|
|
4
|
-
import { t as ArtifactError } from "./project-
|
|
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 {
|
|
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,17 +1,13 @@
|
|
|
1
|
-
import "./token-
|
|
2
|
-
import "./
|
|
3
|
-
import "./environment-
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import "./
|
|
7
|
-
import
|
|
8
|
-
import "./
|
|
9
|
-
import "./
|
|
10
|
-
import "./
|
|
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,31 +1,30 @@
|
|
|
1
|
-
import "./token-
|
|
2
|
-
import "./
|
|
3
|
-
import { x as VERSION } from "./environment-
|
|
4
|
-
import "./
|
|
5
|
-
import
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
8
|
-
import "./
|
|
9
|
-
import "./
|
|
10
|
-
import
|
|
11
|
-
import "./
|
|
12
|
-
import "./
|
|
13
|
-
import "./
|
|
14
|
-
import
|
|
15
|
-
import "./
|
|
16
|
-
import "./login-
|
|
17
|
-
import "./
|
|
18
|
-
import "./
|
|
19
|
-
import
|
|
20
|
-
import "./scope-
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import "./
|
|
24
|
-
import "./
|
|
25
|
-
import "./
|
|
26
|
-
import "./
|
|
27
|
-
import {
|
|
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
|