@superwall/cli 2.2.0 → 2.3.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 +26 -11
- package/dist/{apple-Bcr_PteR.js → apple-D79LBw5E.js} +13 -13
- package/dist/assets-Diivv88t.js +89 -0
- package/dist/auth.d.ts +1 -1
- package/dist/auth.js +3 -3
- package/dist/{billing-CWM1ds3K.js → billing-CCuMv6mh.js} +3 -3
- package/dist/{bind-DEYxsnZD.js → bind-CVRlFlRo.js} +4 -4
- package/dist/{build--oQKfZU6.js → build-BCq0cGh-.js} +7 -6
- package/dist/{client-CimFymxG.js → client-CYtQvWJR.js} +3 -3
- package/dist/{create-BG9n4fvs.js → create-BZyUW60x.js} +28 -226
- package/dist/{create-DTAyHkxb.js → create-BaP6hoQ1.js} +6 -6
- package/dist/create-DNfuZ9os.js +19 -0
- package/dist/{doctor-BkygMUe2.js → doctor-kx01VvQX.js} +6 -6
- package/dist/{drivers-C6eXj5-r.js → drivers-D0818zGc.js} +3 -3
- package/dist/entry.js +19 -19
- package/dist/{environment-CQn323uB.js → environment-a7W-0wg0.js} +1 -1
- package/dist/{existing-CvOluc9U.js → existing-B7qxYiUX.js} +2 -2
- package/dist/held-C4BiAQ_X.js +16 -0
- package/dist/{held-QM7yfrXq.js → held-CEyXc1SI.js} +6 -6
- package/dist/{integrate-Ci_MLkQG.js → integrate-RK5U0GTQ.js} +22 -22
- package/dist/login-DV70XgZO.js +16 -0
- package/dist/{login-BIAWgdzM.js → login-DrMLxlF4.js} +6 -6
- package/dist/{login-DLi71nJq.js → login-NxCl2WuU.js} +1 -1
- package/dist/{lookup-DZFrfzO0.js → lookup-Dor6ch5A.js} +2 -2
- package/dist/{migrate-BKF1WckS.js → migrate-CjSpcnNu.js} +25 -22
- package/dist/{open-BjvGVwJf.js → migration-MlzZHGP-.js} +22 -56
- package/dist/{notification-url-erXQ1edb.js → notification-url-C_QXtljc.js} +2 -2
- package/dist/open-CBW0Cuog.js +41 -0
- package/dist/{org-CvPGVSBF.js → org-BJCyaL1b.js} +2 -2
- package/dist/{paths-oRuC18Kt.js → paths-Cp_lgyWO.js} +1 -1
- package/dist/{playbook-CtTj1HBK.js → playbook-VqV7546k.js} +10 -10
- package/dist/{promote-BkJYISza.js → promote-BSckFPwZ.js} +18 -16
- package/dist/pull-DEumBwvc.js +303 -0
- package/dist/{push-Ul2SW87i.js → push-D-dewDd1.js} +8 -6
- package/dist/push-YEPqa6hs.js +24 -0
- package/dist/{registry-OmPZ6dj0.js → registry-D6M1JxYC.js} +236 -142
- package/dist/{resources-FIrK7pE9.js → resources-DKn4itf3.js} +21 -7
- package/dist/{run-CwEY1eu5.js → run-Ccv5egCC.js} +2 -2
- package/dist/{scan-CpbfZ2ju.js → scan-Be17rMcQ.js} +1 -1
- package/dist/scan-CocGVPe0.js +4 -0
- package/dist/{scope-BSqVfZvy.js → scope-92neiQ2q.js} +5 -4
- package/dist/{selection-CHnVk8uw.js → selection-C5ZY23dQ.js} +16 -96
- package/dist/server-1pOxW1GJ.js +24 -0
- package/dist/{server-D5xl5iKO.js → server-DZ7L28w4.js} +9 -7
- package/dist/{session-BFwasPVq.js → session-CdnUL4zt.js} +444 -243
- package/dist/session-Cm0U68t3.js +6 -0
- package/dist/{session-6lnJ0shD.js → session-gTuw2_8i.js} +1 -1
- package/dist/setup-esb3_a7N.js +216 -0
- package/dist/skills/animate-onboarding/SKILL.md +2 -2
- package/dist/skills/index.json +18 -18
- package/dist/skills/mobile-design/SKILL.md +2 -2
- package/dist/skills/onboarding-questions/SKILL.md +2 -2
- package/dist/skills/superwall/SKILL.md +104 -20
- package/dist/skills/superwall/references/api.md +21 -5
- package/dist/skills/superwall/workflows/dashboard/playbook.md +6 -4
- package/dist/skills/superwall/workflows/dashboard/setup.md +10 -5
- package/dist/skills/superwall/workflows/integrate/playbook.md +4 -2
- package/dist/skills/superwall/workflows/migrate/adapty.md +7 -6
- package/dist/skills/superwall/workflows/migrate/playbook.md +4 -3
- package/dist/skills/superwall/workflows/migrate/qonversion.md +7 -6
- package/dist/skills/superwall/workflows/migrate/revenuecat.md +8 -7
- package/dist/skills/superwall-editor/SKILL.md +52 -1
- package/dist/skills/superwall-framework/SKILL.md +90 -15
- package/dist/skills/superwall-framework/references/cli.md +92 -21
- package/dist/skills/superwall-framework/references/migrate-from-editor.md +6 -2
- package/dist/skills/superwall-framework/references/mobile-design.md +1 -1
- package/dist/{skills-B8uSuanf.js → skills-B_oH2dYK.js} +8 -8
- package/dist/{skills-D7sG0xom.js → skills-miJDcjQ2.js} +4 -4
- package/dist/source-push-NVrs53Uo.js +205 -0
- package/dist/{spinner-TZeZEeVv.js → spinner-D6phP4Af.js} +3 -3
- package/dist/{storage-DqKJe13V.js → storage-BcvKhvzZ.js} +1 -1
- package/dist/storekit-D1A5VHT1.js +16 -0
- package/dist/{storekit-uyT3DWo4.js → storekit-Di3BkafX.js} +3 -3
- package/dist/{telemetry-D_uIIuSk.js → telemetry-BpYXL-z3.js} +1 -1
- package/dist/{token-BJsLGoSX.js → token-4dQOfOaK.js} +1 -1
- 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 +80 -8
- package/dist/tools-skills/superwall/references/api.md +116 -24
- package/dist/tools-skills/superwall/references/apple-setup.md +316 -0
- package/dist/tools-skills/superwall/references/asc.md +74 -38
- package/dist/tools-skills/superwall/references/data-analytics.md +62 -29
- package/dist/tools-skills/superwall/workflows/dashboard/playbook.md +3 -3
- package/dist/tools-skills/superwall/workflows/dashboard/setup.md +8 -8
- package/dist/tools-skills/superwall/workflows/migrate/adapty.md +6 -6
- package/dist/tools-skills/superwall/workflows/migrate/playbook.md +4 -4
- package/dist/tools-skills/superwall/workflows/migrate/qonversion.md +5 -5
- package/dist/tools-skills/superwall/workflows/migrate/revenuecat.md +6 -6
- package/dist/tools-skills/superwall/workflows/placements/android.md +2 -2
- package/dist/tools-skills/superwall/workflows/placements/expo.md +2 -2
- package/dist/tools-skills/superwall/workflows/placements/flutter.md +2 -2
- package/dist/tools-skills/superwall/workflows/placements/ios.md +2 -2
- package/dist/tools-skills/superwall/workflows/placements/playbook.md +2 -2
- package/dist/tools-skills/superwall/workflows/placements/react-native.md +2 -2
- package/dist/tools-skills/superwall/workflows/placements/strategy.md +2 -2
- package/dist/tools-skills/superwall/workflows/review/playbook.md +1 -1
- package/dist/tools-skills/superwall-editor/SKILL.md +2 -2
- package/dist/tools.d.ts +1 -1
- package/dist/tools.js +222 -109
- package/dist/{upgrade-DV_rmhyV.js → upgrade-BnOq32zn.js} +2 -2
- package/dist/{upgrade-BRM51As6.js → upgrade-Cb6f4S_c.js} +1 -1
- package/package.json +2 -2
- package/dist/create-kT2C9k4h.js +0 -19
- package/dist/held-Bwkhufdj.js +0 -16
- package/dist/login-Dy9N5ZDH.js +0 -16
- package/dist/push-BIizJJOn.js +0 -22
- package/dist/scan-DjyvuWel.js +0 -4
- package/dist/server-BTveynqC.js +0 -22
- package/dist/session-Ds6tLC19.js +0 -6
- package/dist/storekit-C_LFh8qy.js +0 -16
- /package/dist/{reports-D_qbl7_u.js → reports-CwwKLUh0.js} +0 -0
- /package/dist/{storage-BbJF7z3l.d.ts → storage-gRyQetN9.d.ts} +0 -0
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { a as stripAnsi, l as readJson, o as cache, r as formatJson, t as blocks } from "./output-Ggzq5_-t.js";
|
|
2
|
-
import { a as CHANNEL, g as TELEMETRY_KEY, h as TELEMETRY_HOST, t as API_HOST, v as VERSION, x as detectAgent } from "./environment-
|
|
3
|
-
import { n as readSession } from "./storage-
|
|
4
|
-
import { a as withQuery$1, t as ApiError } from "./client-
|
|
5
|
-
import { C as listKeySources, S as listBundleIdSuggestions, T as replaceRevenueProvider, _ as checkServerNotifications, b as importAppKey, c as resolveAscOrgApi, d as runAscDocs, f as parseParams, h as REVENUE_INTEGRATIONS, i as savedKey, l as resolveAscTeam, m as KEY_LABEL, n as testModeWarning, p as KEY_KINDS, r as chooseKeyApp, t as upsertHeldKey, u as sendAscRequest, v as copyAppKey, w as removeAppKey, x as keyKind, y as findIntegrations } from "./held-
|
|
2
|
+
import { a as CHANNEL, g as TELEMETRY_KEY, h as TELEMETRY_HOST, t as API_HOST, v as VERSION, x as detectAgent } from "./environment-a7W-0wg0.js";
|
|
3
|
+
import { n as readSession } from "./storage-BcvKhvzZ.js";
|
|
4
|
+
import { a as withQuery$1, t as ApiError } from "./client-CYtQvWJR.js";
|
|
5
|
+
import { C as listKeySources, S as listBundleIdSuggestions, T as replaceRevenueProvider, _ as checkServerNotifications, b as importAppKey, c as resolveAscOrgApi, d as runAscDocs, f as parseParams, h as REVENUE_INTEGRATIONS, i as savedKey, l as resolveAscTeam, m as KEY_LABEL, n as testModeWarning, p as KEY_KINDS, r as chooseKeyApp, t as upsertHeldKey, u as sendAscRequest, v as copyAppKey, w as removeAppKey, x as keyKind, y as findIntegrations } from "./held-CEyXc1SI.js";
|
|
6
6
|
import { n as readDefaultApp, r as readOnboardedApp, t as readAnonymousId, u as writeDefaultApp } from "./config-BO1Y87kV.js";
|
|
7
|
-
import { a as defineCommand, d as readInput, i as defineCatalog, r as UsageError, t as apiCall } from "./spinner-
|
|
7
|
+
import { a as defineCommand, d as readInput, i as defineCatalog, r as UsageError, t as apiCall } from "./spinner-D6phP4Af.js";
|
|
8
8
|
import { n as fg, t as THEME } from "./theme-DUsCh-Vd.js";
|
|
9
|
-
import { n as runWhoami } from "./session-
|
|
10
|
-
import {
|
|
11
|
-
import { n as orgForNewProject } from "./org-
|
|
12
|
-
import { n as findApplication, r as findProject, t as appNotFound } from "./lookup-
|
|
13
|
-
import { a as pickScope, i as pickProject, n as chooseApp, r as pickOrganization, t as boundOrganization } from "./scope-
|
|
9
|
+
import { n as runWhoami } from "./session-gTuw2_8i.js";
|
|
10
|
+
import { F as orgIdOf, M as textField, N as listOrgGroups, T as rowName, a as createEntitlement, c as createProject, h as listResource, i as createCampaign, j as parseJson, k as isRecord, m as listProjects, r as createApplication, s as createProduct, t as RESOURCES, u as isAppScoped, y as platformLabel } from "./resources-DKn4itf3.js";
|
|
11
|
+
import { n as orgForNewProject } from "./org-BJCyaL1b.js";
|
|
12
|
+
import { n as findApplication, r as findProject, t as appNotFound } from "./lookup-Dor6ch5A.js";
|
|
13
|
+
import { a as pickScope, i as pickProject, n as chooseApp, r as pickOrganization, t as boundOrganization } from "./scope-92neiQ2q.js";
|
|
14
14
|
import { a as listAscConfigs, i as findAppNotificationUrl, o as removeAscConfig, t as ascProxy } from "./client-BZ1UbpXz.js";
|
|
15
15
|
import { i as listUnimportedAscProducts, n as findAscAppId, r as listAscApps, t as ascTypeDisplay } from "./products-DH_fK9tY.js";
|
|
16
16
|
import { n as readResourceFlags, r as textOf, t as fieldName } from "./input-vi0bou04.js";
|
|
17
|
-
import { a as runAscNotificationUrlSet, i as printServerNotifications, t as describeNotificationUrl } from "./notification-url-
|
|
18
|
-
import { t as platformForIntegration } from "./bind-
|
|
17
|
+
import { a as runAscNotificationUrlSet, i as printServerNotifications, t as describeNotificationUrl } from "./notification-url-C_QXtljc.js";
|
|
18
|
+
import { t as platformForIntegration } from "./bind-CVRlFlRo.js";
|
|
19
19
|
import pc from "picocolors";
|
|
20
20
|
|
|
21
21
|
//#region src/ui/help-layout.ts
|
|
@@ -142,7 +142,7 @@ const command = defineCommand({
|
|
|
142
142
|
prompts: true,
|
|
143
143
|
mcp: false,
|
|
144
144
|
async run(ctx, input) {
|
|
145
|
-
const { runLogin } = await import("./login-
|
|
145
|
+
const { runLogin } = await import("./login-DV70XgZO.js");
|
|
146
146
|
return runLogin(ctx, input);
|
|
147
147
|
}
|
|
148
148
|
});
|
|
@@ -158,7 +158,7 @@ const command$1 = defineCommand({
|
|
|
158
158
|
prompts: true,
|
|
159
159
|
mcp: false,
|
|
160
160
|
async run(ctx) {
|
|
161
|
-
const { runLogout } = await import("./session-
|
|
161
|
+
const { runLogout } = await import("./session-Cm0U68t3.js");
|
|
162
162
|
return runLogout(ctx);
|
|
163
163
|
}
|
|
164
164
|
});
|
|
@@ -1452,21 +1452,21 @@ function parseFlag(key, flag$1, raw) {
|
|
|
1452
1452
|
}
|
|
1453
1453
|
return parseChoice(key, flag$1, text);
|
|
1454
1454
|
}
|
|
1455
|
-
function parseArg(command$
|
|
1455
|
+
function parseArg(command$69, arg, word) {
|
|
1456
1456
|
if (word === void 0 || !arg.choices) return word;
|
|
1457
1457
|
const found = arg.choices.find((choice) => choice.toLowerCase() === word.toLowerCase());
|
|
1458
|
-
if (!found) throw new UsageError(`${command$
|
|
1458
|
+
if (!found) throw new UsageError(`${command$69} takes <${arg.name}> as one of: ${arg.choices.join(", ")} (not "${word}").`);
|
|
1459
1459
|
return found;
|
|
1460
1460
|
}
|
|
1461
|
-
function parseInput(command$
|
|
1461
|
+
function parseInput(command$69, operation, words, raw) {
|
|
1462
1462
|
const specs = operation.flags ?? {};
|
|
1463
|
-
for (const key of Object.keys(raw)) if (!(key in specs) && !(key in COMMON_FLAGS)) throw new UsageError(`${command$
|
|
1463
|
+
for (const key of Object.keys(raw)) if (!(key in specs) && !(key in COMMON_FLAGS)) throw new UsageError(`${command$69} has no --${kebab(key)}. Run superwall ${command$69} --help for its flags.`);
|
|
1464
1464
|
const flags = Object.fromEntries(Object.entries(specs).map(([key, flag$1]) => [key, parseFlag(key, flag$1, raw[key])]));
|
|
1465
|
-
for (const [key, flag$1] of Object.entries(specs)) if (flag$1.required && flags[key] === void 0) throw new UsageError(`${command$
|
|
1465
|
+
for (const [key, flag$1] of Object.entries(specs)) if (flag$1.required && flags[key] === void 0) throw new UsageError(`${command$69} needs --${kebab(key)}.`);
|
|
1466
1466
|
const specArgs = operation.args ?? [];
|
|
1467
|
-
if (words.length > specArgs.length) throw new UsageError(`${command$
|
|
1468
|
-
const args = Object.fromEntries(specArgs.map((arg, index) => [arg.name, parseArg(command$
|
|
1469
|
-
for (const arg of specArgs) if (arg.required && args[arg.name] === void 0) throw new UsageError(`${command$
|
|
1467
|
+
if (words.length > specArgs.length) throw new UsageError(`${command$69} doesn't take "${words.slice(specArgs.length).join(" ")}".`);
|
|
1468
|
+
const args = Object.fromEntries(specArgs.map((arg, index) => [arg.name, parseArg(command$69, arg, words[index])]));
|
|
1469
|
+
for (const arg of specArgs) if (arg.required && args[arg.name] === void 0) throw new UsageError(`${command$69} needs <${arg.name}>.`);
|
|
1470
1470
|
return {
|
|
1471
1471
|
args,
|
|
1472
1472
|
flags,
|
|
@@ -1629,7 +1629,7 @@ async function selectLatestVersion(session, kind, id$1) {
|
|
|
1629
1629
|
}
|
|
1630
1630
|
async function resolveDraftVersion(session, kind, id$1) {
|
|
1631
1631
|
const latest = await selectLatestVersion(session, kind, id$1);
|
|
1632
|
-
if (latest &&
|
|
1632
|
+
if (latest && EDITABLE$1.has(latest.state ?? "")) return latest.id;
|
|
1633
1633
|
const spec = KINDS[kind];
|
|
1634
1634
|
const created = await session.send("post", spec.versionPath, { data: {
|
|
1635
1635
|
type: spec.versionType,
|
|
@@ -2886,10 +2886,9 @@ async function runIapsCreate(session, input) {
|
|
|
2886
2886
|
const id$1 = iap.id;
|
|
2887
2887
|
const displayName = textOf$1(input, "displayName");
|
|
2888
2888
|
if (displayName) {
|
|
2889
|
-
const version = await
|
|
2890
|
-
if (!version) throw new Error(`Apple made no version of in-app purchase ${id$1} to localize.`);
|
|
2889
|
+
const version = await resolveDraftVersion(session, "iap", id$1);
|
|
2891
2890
|
const description = textOf$1(input, "description");
|
|
2892
|
-
await createLocalization(session, "iap", version
|
|
2891
|
+
await createLocalization(session, "iap", version, {
|
|
2893
2892
|
locale: textOf$1(input, "locale") ?? DEFAULT_LOCALE$2,
|
|
2894
2893
|
name: displayName,
|
|
2895
2894
|
...description ? { description } : {}
|
|
@@ -3470,7 +3469,7 @@ A purchase_key is for the app's bundle ID; an app with none gets --bundle-id sav
|
|
|
3470
3469
|
prompts: true,
|
|
3471
3470
|
mcp: false,
|
|
3472
3471
|
async run(ctx, input) {
|
|
3473
|
-
const { runAscKeysCreate } = await import("./create-
|
|
3472
|
+
const { runAscKeysCreate } = await import("./create-DNfuZ9os.js");
|
|
3474
3473
|
return runAscKeysCreate(ctx, input);
|
|
3475
3474
|
}
|
|
3476
3475
|
});
|
|
@@ -3857,7 +3856,7 @@ With --app it saves the key you hold on that app instead, as asc keys create --k
|
|
|
3857
3856
|
prompts: true,
|
|
3858
3857
|
mcp: false,
|
|
3859
3858
|
async run(ctx, { args, flags }) {
|
|
3860
|
-
const { upsertHeldKey: upsertHeldKey$1 } = await import("./held-
|
|
3859
|
+
const { upsertHeldKey: upsertHeldKey$1 } = await import("./held-C4BiAQ_X.js");
|
|
3861
3860
|
return upsertHeldKey$1(ctx, {
|
|
3862
3861
|
action: "update",
|
|
3863
3862
|
key: {
|
|
@@ -4860,10 +4859,9 @@ async function runSubscriptionGroupsCreate(session, input) {
|
|
|
4860
4859
|
} }, "group");
|
|
4861
4860
|
if (!group$1) throw new Error("Apple created no subscription group.");
|
|
4862
4861
|
if (displayName) {
|
|
4863
|
-
const version = await
|
|
4864
|
-
if (!version) throw new Error(`Apple made no version of subscription group ${group$1.id} to localize.`);
|
|
4862
|
+
const version = await resolveDraftVersion(session, "group", group$1.id);
|
|
4865
4863
|
const customAppName = textOf$1(input, "customAppName");
|
|
4866
|
-
await createLocalization(session, "group", version
|
|
4864
|
+
await createLocalization(session, "group", version, {
|
|
4867
4865
|
locale: textOf$1(input, "locale") ?? DEFAULT_LOCALE$1,
|
|
4868
4866
|
name: displayName,
|
|
4869
4867
|
...customAppName ? { customAppName } : {}
|
|
@@ -5110,7 +5108,7 @@ Exit codes
|
|
|
5110
5108
|
prompts: true,
|
|
5111
5109
|
mcp: false,
|
|
5112
5110
|
async run(ctx, input) {
|
|
5113
|
-
const { runSetupApple } = await import("./apple-
|
|
5111
|
+
const { runSetupApple } = await import("./apple-D79LBw5E.js");
|
|
5114
5112
|
return runSetupApple(ctx, input);
|
|
5115
5113
|
}
|
|
5116
5114
|
});
|
|
@@ -5244,10 +5242,9 @@ async function runSubscriptionsCreate(session, input) {
|
|
|
5244
5242
|
const id$1 = subscription.id;
|
|
5245
5243
|
const displayName = textOf$1(input, "displayName");
|
|
5246
5244
|
if (displayName) {
|
|
5247
|
-
const version = await
|
|
5248
|
-
if (!version) throw new Error(`Apple made no version of subscription ${id$1} to localize.`);
|
|
5245
|
+
const version = await resolveDraftVersion(session, "subscription", id$1);
|
|
5249
5246
|
const description = textOf$1(input, "description");
|
|
5250
|
-
await createLocalization(session, "subscription", version
|
|
5247
|
+
await createLocalization(session, "subscription", version, {
|
|
5251
5248
|
locale: textOf$1(input, "locale") ?? DEFAULT_LOCALE,
|
|
5252
5249
|
name: displayName,
|
|
5253
5250
|
...description ? { description } : {}
|
|
@@ -7741,9 +7738,8 @@ const command$45 = defineCommand({
|
|
|
7741
7738
|
json: true,
|
|
7742
7739
|
prompts: true,
|
|
7743
7740
|
mcp: false,
|
|
7744
|
-
channel: "next",
|
|
7745
7741
|
async run(ctx, { args, flags }) {
|
|
7746
|
-
const { runBuildPipeline } = await import("./build
|
|
7742
|
+
const { runBuildPipeline } = await import("./build-BCq0cGh-.js");
|
|
7747
7743
|
await runBuildPipeline({
|
|
7748
7744
|
output: ctx.output,
|
|
7749
7745
|
json: ctx.json
|
|
@@ -7803,9 +7799,8 @@ const command$46 = defineCommand({
|
|
|
7803
7799
|
json: false,
|
|
7804
7800
|
prompts: true,
|
|
7805
7801
|
mcp: false,
|
|
7806
|
-
channel: "next",
|
|
7807
7802
|
async run(ctx, { args, flags }) {
|
|
7808
|
-
const { runCreate } = await import("./create-
|
|
7803
|
+
const { runCreate } = await import("./create-BZyUW60x.js");
|
|
7809
7804
|
return runCreate(ctx, {
|
|
7810
7805
|
dir: args.dir,
|
|
7811
7806
|
...flags
|
|
@@ -7847,9 +7842,8 @@ const command$47 = defineCommand({
|
|
|
7847
7842
|
json: false,
|
|
7848
7843
|
prompts: true,
|
|
7849
7844
|
mcp: false,
|
|
7850
|
-
channel: "next",
|
|
7851
7845
|
async run(ctx, { args, flags }) {
|
|
7852
|
-
const { runStudio } = await import("./server-
|
|
7846
|
+
const { runStudio } = await import("./server-1pOxW1GJ.js");
|
|
7853
7847
|
await runStudio({
|
|
7854
7848
|
dirs: args.dir,
|
|
7855
7849
|
port: flags.port,
|
|
@@ -7888,9 +7882,8 @@ const command$48 = defineCommand({
|
|
|
7888
7882
|
json: false,
|
|
7889
7883
|
prompts: true,
|
|
7890
7884
|
mcp: false,
|
|
7891
|
-
channel: "next",
|
|
7892
7885
|
async run(ctx, input) {
|
|
7893
|
-
const { runPromote } = await import("./promote-
|
|
7886
|
+
const { runPromote } = await import("./promote-BSckFPwZ.js");
|
|
7894
7887
|
return runPromote(ctx, input);
|
|
7895
7888
|
}
|
|
7896
7889
|
});
|
|
@@ -7925,7 +7918,7 @@ const command$49 = defineCommand({
|
|
|
7925
7918
|
},
|
|
7926
7919
|
overwriteSource: {
|
|
7927
7920
|
type: "boolean",
|
|
7928
|
-
describe: "Replace the
|
|
7921
|
+
describe: "Replace the pushed paywalls' source in the app's repo with yours even though it can't be merged - other paywalls and funnels stay"
|
|
7929
7922
|
}
|
|
7930
7923
|
},
|
|
7931
7924
|
examples: [["publish", "Push every changed paywall and funnel and make it live"], ["publish --id plus-upgrade --platform ios -m \"New annual price\"", "Ship one paywall on one platform and record why"]],
|
|
@@ -7933,16 +7926,51 @@ const command$49 = defineCommand({
|
|
|
7933
7926
|
json: false,
|
|
7934
7927
|
prompts: true,
|
|
7935
7928
|
mcp: false,
|
|
7936
|
-
channel: "next",
|
|
7937
7929
|
async run(ctx, input) {
|
|
7938
|
-
const { runPush } = await import("./push-
|
|
7930
|
+
const { runPush } = await import("./push-YEPqa6hs.js");
|
|
7939
7931
|
return runPush(ctx, input, true);
|
|
7940
7932
|
}
|
|
7941
7933
|
});
|
|
7942
7934
|
|
|
7943
7935
|
//#endregion
|
|
7944
|
-
//#region src/commands/paywalls/
|
|
7936
|
+
//#region src/commands/paywalls/pull.ts
|
|
7945
7937
|
const command$50 = defineCommand({
|
|
7938
|
+
name: "pull",
|
|
7939
|
+
summary: "Bring teammates' published source into this project, merged with your edits",
|
|
7940
|
+
args: { dir: { describe: "Project directory, or with --app the folder to create superwall/ in (default: cwd)" } },
|
|
7941
|
+
flags: {
|
|
7942
|
+
app: {
|
|
7943
|
+
...app,
|
|
7944
|
+
describe: "Set up a new project from this app's source (id, name or dashboard link) in an empty folder"
|
|
7945
|
+
},
|
|
7946
|
+
platform: {
|
|
7947
|
+
type: "list",
|
|
7948
|
+
value: "platform",
|
|
7949
|
+
describe: "Limit to the apps of these platforms (repeatable, or comma-separated) - ios, android, web"
|
|
7950
|
+
},
|
|
7951
|
+
theirs: {
|
|
7952
|
+
type: "boolean",
|
|
7953
|
+
describe: "Where you and the source repo both changed a file, take the source repo's version"
|
|
7954
|
+
}
|
|
7955
|
+
},
|
|
7956
|
+
examples: [
|
|
7957
|
+
["pull", "Merge what teammates published into this project"],
|
|
7958
|
+
["pull --theirs", "Take the source repo's version of files you both changed"],
|
|
7959
|
+
["pull --app 20749", "Get every paywall of app 20749 into ./superwall, no GitHub needed"]
|
|
7960
|
+
],
|
|
7961
|
+
auth: "none",
|
|
7962
|
+
json: false,
|
|
7963
|
+
prompts: true,
|
|
7964
|
+
mcp: false,
|
|
7965
|
+
async run(ctx, input) {
|
|
7966
|
+
const { runPull } = await import("./pull-DEumBwvc.js");
|
|
7967
|
+
return runPull(ctx, input);
|
|
7968
|
+
}
|
|
7969
|
+
});
|
|
7970
|
+
|
|
7971
|
+
//#endregion
|
|
7972
|
+
//#region src/commands/paywalls/push.ts
|
|
7973
|
+
const command$51 = defineCommand({
|
|
7946
7974
|
name: "push",
|
|
7947
7975
|
summary: "Build and push your paywalls as immutable versions (production untouched)",
|
|
7948
7976
|
args: { dir: { describe: "Project directory (default: cwd)" } },
|
|
@@ -7970,7 +7998,7 @@ const command$50 = defineCommand({
|
|
|
7970
7998
|
},
|
|
7971
7999
|
overwriteSource: {
|
|
7972
8000
|
type: "boolean",
|
|
7973
|
-
describe: "Replace the
|
|
8001
|
+
describe: "Replace the pushed paywalls' source in the app's repo with yours even though it can't be merged - other paywalls and funnels stay"
|
|
7974
8002
|
}
|
|
7975
8003
|
},
|
|
7976
8004
|
examples: [["push", "Push every changed paywall and funnel as a new version"], ["push --id plus-upgrade -m \"New annual price\"", "Push one paywall and record why"]],
|
|
@@ -7978,9 +8006,8 @@ const command$50 = defineCommand({
|
|
|
7978
8006
|
json: false,
|
|
7979
8007
|
prompts: true,
|
|
7980
8008
|
mcp: false,
|
|
7981
|
-
channel: "next",
|
|
7982
8009
|
async run(ctx, input) {
|
|
7983
|
-
const { runPush } = await import("./push-
|
|
8010
|
+
const { runPush } = await import("./push-YEPqa6hs.js");
|
|
7984
8011
|
return runPush(ctx, input, false);
|
|
7985
8012
|
}
|
|
7986
8013
|
});
|
|
@@ -8097,7 +8124,7 @@ function resourceHelp(resource) {
|
|
|
8097
8124
|
})),
|
|
8098
8125
|
{
|
|
8099
8126
|
title: "Related",
|
|
8100
|
-
lines: table((resource.related ?? []).map(([command$
|
|
8127
|
+
lines: table((resource.related ?? []).map(([command$69, text]) => [`superwall ${command$69}`, pc.dim(text)]), ([left]) => left.length)
|
|
8101
8128
|
},
|
|
8102
8129
|
{
|
|
8103
8130
|
title: "Examples",
|
|
@@ -8337,6 +8364,7 @@ async function create(context, api, resource, rawValue, value2, flags) {
|
|
|
8337
8364
|
if (!value$1) throw new Error(resource === "campaigns" ? "Usage: superwall campaigns create --description \"<description>\" --placement <placement>" : `Usage: superwall ${resource} create --identifier <identifier>`);
|
|
8338
8365
|
if (resource === "campaigns" && !value2) throw new Error("Usage: superwall campaigns create --description \"<description>\" --placement <placement> (campaigns need at least one placement)");
|
|
8339
8366
|
const scope = await pickScope(context, api, isAppScoped(resource) || resource === "products" && context.target.app !== void 0);
|
|
8367
|
+
const grants = resource === "products" ? await resolveProductEntitlements(context, api, scope, entitlementValues(flags.fields)) : void 0;
|
|
8340
8368
|
if (dryRun$1) {
|
|
8341
8369
|
const { projectCount: _projects, appCount: _apps,...where } = scope;
|
|
8342
8370
|
const plan = {
|
|
@@ -8344,15 +8372,20 @@ async function create(context, api, resource, rawValue, value2, flags) {
|
|
|
8344
8372
|
action: "create",
|
|
8345
8373
|
resource,
|
|
8346
8374
|
value: value$1,
|
|
8347
|
-
scope:
|
|
8375
|
+
scope: grants?.app ? {
|
|
8376
|
+
...where,
|
|
8377
|
+
applicationId: String(grants.app.id)
|
|
8378
|
+
} : where,
|
|
8379
|
+
...grants?.ids.length ? { entitlements: grants.ids } : {}
|
|
8348
8380
|
};
|
|
8349
8381
|
if (json) return context.output.data(plan);
|
|
8350
|
-
const target = scope.applicationId ? `${scope.appName ?? scope.applicationId} (${platformLabel(scope.appPlatform)})` : scope.projectName ?? scope.projectId;
|
|
8351
|
-
|
|
8382
|
+
const target = grants?.app ? appLabel(grants.app) : scope.applicationId ? `${scope.appName ?? scope.applicationId} (${platformLabel(scope.appPlatform)})` : resource === "entitlements" && scope.boundApplicationId ? `${scope.projectName ?? scope.projectId}, app ${scope.boundApplicationId}` : scope.projectName ?? scope.projectId;
|
|
8383
|
+
const granting = grants?.ids.length ? ` granting entitlement ${grants.ids.join(", ")}` : "";
|
|
8384
|
+
ui.info(`[dry-run] would create ${resource.replace(/s$/, "")} "${value$1}" in ${target}${granting}`);
|
|
8352
8385
|
return;
|
|
8353
8386
|
}
|
|
8354
8387
|
const created = await apiCall(context, `Creating ${resource.replace(/s$/, "")}`, () => {
|
|
8355
|
-
return createOne(api, resource, scope, value$1, value2, flags.fields);
|
|
8388
|
+
return createOne(api, resource, scope, value$1, value2, flags.fields, grants);
|
|
8356
8389
|
});
|
|
8357
8390
|
if (json) return context.output.data(created);
|
|
8358
8391
|
ui.success(`Created ${resource.replace(/s$/, "")} \`${rowName(created)}\` ${created.id ?? ""}`);
|
|
@@ -8369,7 +8402,7 @@ async function createApp(context, api, nameArg, fields) {
|
|
|
8369
8402
|
let name = nameArg;
|
|
8370
8403
|
let platform = textOf(fields.platform);
|
|
8371
8404
|
if (interactive && (!name || !platform)) {
|
|
8372
|
-
const { scanProject } = await import("./scan-
|
|
8405
|
+
const { scanProject } = await import("./scan-CocGVPe0.js");
|
|
8373
8406
|
const detected = (await scanProject(context.installDir).catch(() => null))?.apps[0];
|
|
8374
8407
|
if (detected && !name && !platform) {
|
|
8375
8408
|
ui.info(`Detected \`${detected.framework.name}\`` + (detected.details ? ` · \`${detected.details}\`` : ""));
|
|
@@ -8446,13 +8479,17 @@ async function createApp(context, api, nameArg, fields) {
|
|
|
8446
8479
|
const projectLabel = project$1.name ? ` in \`${project$1.name}\`` : "";
|
|
8447
8480
|
ui.success(`Added \`${platformLabel(platform)}\` app \`${name}\`${projectLabel}${key}`);
|
|
8448
8481
|
}
|
|
8449
|
-
function createOne(api, resource, scope, value$1, value2, fields) {
|
|
8482
|
+
function createOne(api, resource, scope, value$1, value2, fields, grants) {
|
|
8450
8483
|
switch (resource) {
|
|
8451
|
-
case "entitlements": return createEntitlement(api, scope, value$1);
|
|
8452
|
-
case "products":
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8484
|
+
case "entitlements": return createEntitlement(api, scope, value$1, scope.boundApplicationId);
|
|
8485
|
+
case "products": {
|
|
8486
|
+
const applicationId = grants?.app ? String(grants.app.id) : scope.applicationId;
|
|
8487
|
+
return createProduct(api, scope, value$1, {
|
|
8488
|
+
...productOptions(fields),
|
|
8489
|
+
...applicationId ? { applicationId } : {},
|
|
8490
|
+
...grants?.ids.length ? { entitlements: grants.ids } : {}
|
|
8491
|
+
});
|
|
8492
|
+
}
|
|
8456
8493
|
case "campaigns": return createCampaign(api, scope, value$1, String(value2));
|
|
8457
8494
|
default: throw new Error(`create is not supported for ${resource} yet.`);
|
|
8458
8495
|
}
|
|
@@ -8469,11 +8506,78 @@ function productOptions(fields) {
|
|
|
8469
8506
|
period_count: fields.periodCount !== void 0 ? Number(fields.periodCount) : 1,
|
|
8470
8507
|
...fields.trialDays !== void 0 ? { trial_period_days: Number(fields.trialDays) } : {}
|
|
8471
8508
|
};
|
|
8472
|
-
const entitlement = fields.entitlement;
|
|
8473
|
-
const entitlements = Array.isArray(entitlement) ? entitlement.map(String) : [];
|
|
8474
|
-
if (entitlements.length) options.entitlements = entitlements;
|
|
8475
8509
|
return options;
|
|
8476
8510
|
}
|
|
8511
|
+
const NATIVE_PLATFORMS = new Set(["ios", "android"]);
|
|
8512
|
+
const ANY_NATIVE_PLATFORMS = new Set([
|
|
8513
|
+
"stripe",
|
|
8514
|
+
"web",
|
|
8515
|
+
"webapp",
|
|
8516
|
+
"custom"
|
|
8517
|
+
]);
|
|
8518
|
+
function entitlementValues(fields) {
|
|
8519
|
+
const raw = fields.entitlement;
|
|
8520
|
+
return (Array.isArray(raw) ? raw : raw === void 0 || raw === null ? [] : [raw]).map((value$1) => String(value$1).trim()).filter(Boolean);
|
|
8521
|
+
}
|
|
8522
|
+
function appLabel(app$1) {
|
|
8523
|
+
return `${app$1.name ?? app$1.id} (${platformLabel(app$1.platform)})`;
|
|
8524
|
+
}
|
|
8525
|
+
function grantsFrom(product, entitlementApp) {
|
|
8526
|
+
if (ANY_NATIVE_PLATFORMS.has((product.platform ?? "").toLowerCase())) return NATIVE_PLATFORMS.has((entitlementApp?.platform ?? "").toLowerCase());
|
|
8527
|
+
return entitlementApp !== void 0 && String(entitlementApp.id) === String(product.id);
|
|
8528
|
+
}
|
|
8529
|
+
async function resolveProductEntitlements(context, api, scope, values) {
|
|
8530
|
+
if (values.length === 0) return { ids: [] };
|
|
8531
|
+
const apps = (await findProject(api, scope.projectId))?.applications ?? [];
|
|
8532
|
+
const rows = await apiCall(context, "Loading entitlements", () => listResource(api, "entitlements", scope));
|
|
8533
|
+
const projectLabel = scope.projectName ?? `Project ${scope.projectId}`;
|
|
8534
|
+
const appOf$1 = (row) => {
|
|
8535
|
+
const id$1 = row.application_id;
|
|
8536
|
+
if (id$1 === void 0 || id$1 === null) return void 0;
|
|
8537
|
+
return apps.find((app$1) => String(app$1.id) === String(id$1)) ?? { id: String(id$1) };
|
|
8538
|
+
};
|
|
8539
|
+
const describe$1 = (row) => {
|
|
8540
|
+
const app$1 = appOf$1(row);
|
|
8541
|
+
const name = row.identifier ? ` (${String(row.identifier)})` : "";
|
|
8542
|
+
return `${String(row.id)}${name} is on ${app$1 ? appLabel(app$1) : "no app"}`;
|
|
8543
|
+
};
|
|
8544
|
+
const wanted = values.map((value$1) => {
|
|
8545
|
+
const byId$1 = rows.filter((row) => String(row.id) === value$1);
|
|
8546
|
+
const found = byId$1.length > 0 ? byId$1 : rows.filter((row) => row.identifier === value$1);
|
|
8547
|
+
const [first] = found;
|
|
8548
|
+
if (!first) throw new Error(`${projectLabel} has no entitlement "${value$1}" - create it first: superwall entitlements create --identifier ${value$1} --app <app>`);
|
|
8549
|
+
return {
|
|
8550
|
+
first,
|
|
8551
|
+
found
|
|
8552
|
+
};
|
|
8553
|
+
});
|
|
8554
|
+
const fits = (app$1) => wanted.every(({ found }) => found.some((row) => grantsFrom(app$1, appOf$1(row))));
|
|
8555
|
+
const named = scope.applicationId ? apps.find((app$1) => String(app$1.id) === scope.applicationId) ?? {
|
|
8556
|
+
id: scope.applicationId,
|
|
8557
|
+
name: scope.appName,
|
|
8558
|
+
platform: scope.appPlatform
|
|
8559
|
+
} : void 0;
|
|
8560
|
+
const nativeApps = [...apps.filter((app$1) => (app$1.platform ?? "").toLowerCase() === "ios"), ...apps.filter((app$1) => (app$1.platform ?? "").toLowerCase() === "android")];
|
|
8561
|
+
const product = named ?? nativeApps.find(fits);
|
|
8562
|
+
if (!product) {
|
|
8563
|
+
const spread = wanted.map(({ found }) => found.map(describe$1).join(", ")).join("; ");
|
|
8564
|
+
throw new Error(`No app of ${projectLabel} can grant all of these entitlements: ${spread}. An iOS or Android product grants only its own app's entitlements - pass --app <id>, or create the missing ones there: superwall entitlements create --identifier <identifier> --app <id>`);
|
|
8565
|
+
}
|
|
8566
|
+
const ids = wanted.map(({ first, found }) => {
|
|
8567
|
+
const granted = found.filter((candidate) => grantsFrom(product, appOf$1(candidate)));
|
|
8568
|
+
const row = granted.find((candidate) => String(appOf$1(candidate)?.id) === String(product.id)) ?? granted[0];
|
|
8569
|
+
if (row) return String(row.id);
|
|
8570
|
+
const owner = appOf$1(first);
|
|
8571
|
+
const identifier = String(first.identifier ?? "<identifier>");
|
|
8572
|
+
if (ANY_NATIVE_PLATFORMS.has((product.platform ?? "").toLowerCase())) throw new Error(`Entitlement ${describe$1(first)} - ${appLabel(product)} products grant only iOS or Android entitlements: superwall entitlements create --identifier ${identifier} --app <ios or android app>`);
|
|
8573
|
+
const move = owner && NATIVE_PLATFORMS.has((owner.platform ?? "").toLowerCase()) ? `pass --app ${String(owner.id)} to create the product there, or ` : "";
|
|
8574
|
+
throw new Error(`Entitlement ${describe$1(first)}, not ${appLabel(product)} - ${move}create it on ${product.name ?? product.id}: superwall entitlements create --identifier ${identifier} --app ${String(product.id)}`);
|
|
8575
|
+
});
|
|
8576
|
+
return {
|
|
8577
|
+
app: product,
|
|
8578
|
+
ids: [...new Set(ids)]
|
|
8579
|
+
};
|
|
8580
|
+
}
|
|
8477
8581
|
|
|
8478
8582
|
//#endregion
|
|
8479
8583
|
//#region src/core/main/revenue-provider.ts
|
|
@@ -8608,7 +8712,7 @@ async function runResource(ctx, resource, action, value$1, value2, flags) {
|
|
|
8608
8712
|
if (action === "create") return create(ctx, ctx.api, resource, value$1, value2, flags);
|
|
8609
8713
|
if (action === "use" && resource === "apps") return useApp(ctx, ctx.api, value$1);
|
|
8610
8714
|
if (action === "storekit" && resource === "products") {
|
|
8611
|
-
const { writeStoreKit } = await import("./storekit-
|
|
8715
|
+
const { writeStoreKit } = await import("./storekit-D1A5VHT1.js");
|
|
8612
8716
|
return writeStoreKit(ctx, ctx.api, flags.fields.out);
|
|
8613
8717
|
}
|
|
8614
8718
|
throw new Error(`Unknown action "${action}" for ${resource}.`);
|
|
@@ -8622,15 +8726,15 @@ async function runOperation(ctx, owner, resource, op$1, args, flags) {
|
|
|
8622
8726
|
}
|
|
8623
8727
|
const toFlag = (field) => `--${field.replace(/_/g, "-")}`;
|
|
8624
8728
|
async function callOperation(context, owner, resource, op$1, ids, flags, merged = {}) {
|
|
8625
|
-
const command$
|
|
8729
|
+
const command$69 = `superwall ${owner === resource ? "" : `${owner.name} `}${resource.name} ${op$1.name}`;
|
|
8626
8730
|
const { method, path: template } = op$1;
|
|
8627
|
-
if (!method || !template) throw new Error(`${command$
|
|
8731
|
+
if (!method || !template) throw new Error(`${command$69} has no API endpoint.`);
|
|
8628
8732
|
const spec = await apiCall(context, "Loading the API reference", () => findSpec(op$1));
|
|
8629
8733
|
const args = [...ids];
|
|
8630
8734
|
const ctx = owner.appArg && args[0] && !context.target.app ? withApp(context, args.shift()) : context;
|
|
8631
8735
|
const positional = positionalParams(op$1);
|
|
8632
|
-
if (args.length < positional.length) throw new Error(`Usage: ${command$
|
|
8633
|
-
if (args.length > positional.length) throw new Error(`${command$
|
|
8736
|
+
if (args.length < positional.length) throw new Error(`Usage: ${command$69} ${usageOf(owner, op$1)}\nRun \`${command$69} --help\` for its flags.`);
|
|
8737
|
+
if (args.length > positional.length) throw new Error(`${command$69} takes ${positional.length || "no"} argument${positional.length === 1 ? "" : "s"}; got "${args.slice(positional.length).join(" ")}".`);
|
|
8634
8738
|
const pathValues = /* @__PURE__ */ new Map();
|
|
8635
8739
|
const query = {};
|
|
8636
8740
|
const queryNames = new Set(spec?.params.filter((param) => param.in === "query").map((param) => param.name));
|
|
@@ -8650,7 +8754,7 @@ async function callOperation(context, owner, resource, op$1, ids, flags, merged
|
|
|
8650
8754
|
if (queryParam) query[field] = coerce(raw, queryParam.type);
|
|
8651
8755
|
else if (bodyField) body[field] = coerce(raw, bodyField.type);
|
|
8652
8756
|
else if (!spec) (sendsBody ? body : query)[field] = raw;
|
|
8653
|
-
else throw new Error(`${command$
|
|
8757
|
+
else throw new Error(`${command$69} has no ${toFlag(field)}. \`${command$69} --help\` lists what it takes.`);
|
|
8654
8758
|
}
|
|
8655
8759
|
Object.assign(sendsBody ? body : query, parseParams(flags.data));
|
|
8656
8760
|
await fillScope(ctx, op$1, spec, pathValues, query, body);
|
|
@@ -8659,11 +8763,11 @@ async function callOperation(context, owner, resource, op$1, ids, flags, merged
|
|
|
8659
8763
|
});
|
|
8660
8764
|
if (missing$1.length > 0) {
|
|
8661
8765
|
const needs = missing$1.map((param) => `${toFlag(param.name)} <${param.type.replace(/"/g, "").replace(/ \| /g, "|")}>`);
|
|
8662
|
-
throw new Error(`${command$
|
|
8766
|
+
throw new Error(`${command$69} needs ${needs.join(" and ")}.`);
|
|
8663
8767
|
}
|
|
8664
8768
|
const url = withQuery(template.replace(/\{([^}]+)\}/g, (_, param) => {
|
|
8665
8769
|
const value$1 = pathValues.get(param);
|
|
8666
|
-
if (value$1 === void 0) throw new Error(`${command$
|
|
8770
|
+
if (value$1 === void 0) throw new Error(`${command$69} needs ${param}.`);
|
|
8667
8771
|
return encodeURIComponent(value$1);
|
|
8668
8772
|
}), query);
|
|
8669
8773
|
if (ctx.dryRun) return renderValue(ctx, {
|
|
@@ -8775,7 +8879,7 @@ async function dispatch(ctx, owner, words, flags) {
|
|
|
8775
8879
|
const nested = rest[0] ? findNested(owner, rest[0]) : void 0;
|
|
8776
8880
|
if (nested) rest = rest.slice(1);
|
|
8777
8881
|
const resource = nested ?? owner;
|
|
8778
|
-
const command$
|
|
8882
|
+
const command$69 = nested ? `${owner.name} ${nested.name}` : owner.name;
|
|
8779
8883
|
if (rest[0] && /^(\d+|https?:\/\/.*)$/.test(rest[0]) && findOperation(resource, "get")) rest = ["get", ...rest];
|
|
8780
8884
|
const [opName, ...args] = rest;
|
|
8781
8885
|
if (!opName) {
|
|
@@ -8787,7 +8891,7 @@ async function dispatch(ctx, owner, words, flags) {
|
|
|
8787
8891
|
if (!op$1) {
|
|
8788
8892
|
const known = resource.operations.map((candidate) => candidate.name);
|
|
8789
8893
|
const nestedNames = nested ? [] : (owner.nested ?? []).map((candidate) => candidate.name);
|
|
8790
|
-
throw new UsageError(`${command$
|
|
8894
|
+
throw new UsageError(`${command$69} has no "${opName}". It takes: ${[...known, ...nestedNames].join(", ")}.\nRun superwall ${command$69} --help for what each does.`, command$69);
|
|
8791
8895
|
}
|
|
8792
8896
|
await runOperation(ctx, owner, resource, op$1, args, flags);
|
|
8793
8897
|
}
|
|
@@ -8958,7 +9062,7 @@ const FLAGS = {
|
|
|
8958
9062
|
entitlement: {
|
|
8959
9063
|
type: "list",
|
|
8960
9064
|
value: "id",
|
|
8961
|
-
describe: "products create: entitlement ids to grant"
|
|
9065
|
+
describe: "products create: entitlement ids or identifiers to grant"
|
|
8962
9066
|
}
|
|
8963
9067
|
};
|
|
8964
9068
|
function defineResource(resource) {
|
|
@@ -8981,7 +9085,7 @@ function defineResource(resource) {
|
|
|
8981
9085
|
|
|
8982
9086
|
//#endregion
|
|
8983
9087
|
//#region src/commands/main/annotations.ts
|
|
8984
|
-
const command$
|
|
9088
|
+
const command$52 = defineResource({
|
|
8985
9089
|
name: "annotations",
|
|
8986
9090
|
summary: "Releases, campaigns and incidents marked on an app's charts",
|
|
8987
9091
|
operations: [
|
|
@@ -9031,7 +9135,7 @@ const command$51 = defineResource({
|
|
|
9031
9135
|
|
|
9032
9136
|
//#endregion
|
|
9033
9137
|
//#region src/commands/main/apps.ts
|
|
9034
|
-
const command$
|
|
9138
|
+
const command$53 = defineResource({
|
|
9035
9139
|
name: "apps",
|
|
9036
9140
|
summary: "Every app you can open",
|
|
9037
9141
|
appArg: true,
|
|
@@ -9284,7 +9388,7 @@ function renderAccountTree(tree) {
|
|
|
9284
9388
|
|
|
9285
9389
|
//#endregion
|
|
9286
9390
|
//#region src/commands/main/bootstrap.ts
|
|
9287
|
-
const command$
|
|
9391
|
+
const command$54 = defineCommand({
|
|
9288
9392
|
name: "bootstrap",
|
|
9289
9393
|
summary: "Everything at once: projects, apps, campaigns, products",
|
|
9290
9394
|
details: "The complete account tree: organizations, projects, apps, campaigns and their placements,\npaywalls, products and entitlements.",
|
|
@@ -9317,7 +9421,7 @@ const command$53 = defineCommand({
|
|
|
9317
9421
|
|
|
9318
9422
|
//#endregion
|
|
9319
9423
|
//#region src/commands/main/campaigns.ts
|
|
9320
|
-
const command$
|
|
9424
|
+
const command$55 = defineResource({
|
|
9321
9425
|
name: "campaigns",
|
|
9322
9426
|
summary: "Who sees which paywall, and when",
|
|
9323
9427
|
operations: [
|
|
@@ -9542,7 +9646,7 @@ const command$54 = defineResource({
|
|
|
9542
9646
|
|
|
9543
9647
|
//#endregion
|
|
9544
9648
|
//#region src/commands/main/entitlements.ts
|
|
9545
|
-
const command$
|
|
9649
|
+
const command$56 = defineResource({
|
|
9546
9650
|
name: "entitlements",
|
|
9547
9651
|
summary: "What a purchase unlocks",
|
|
9548
9652
|
operations: [
|
|
@@ -9620,7 +9724,7 @@ const command$55 = defineResource({
|
|
|
9620
9724
|
|
|
9621
9725
|
//#endregion
|
|
9622
9726
|
//#region src/commands/main/events.ts
|
|
9623
|
-
const command$
|
|
9727
|
+
const command$57 = defineResource({
|
|
9624
9728
|
name: "events",
|
|
9625
9729
|
summary: "Events sent to your webhooks",
|
|
9626
9730
|
operations: [
|
|
@@ -9661,7 +9765,7 @@ const command$56 = defineResource({
|
|
|
9661
9765
|
|
|
9662
9766
|
//#endregion
|
|
9663
9767
|
//#region src/commands/main/paywalls.ts
|
|
9664
|
-
const command$
|
|
9768
|
+
const command$58 = defineResource({
|
|
9665
9769
|
name: "paywalls",
|
|
9666
9770
|
summary: "Paywalls in the dashboard",
|
|
9667
9771
|
operations: [
|
|
@@ -9731,7 +9835,7 @@ const command$57 = defineResource({
|
|
|
9731
9835
|
|
|
9732
9836
|
//#endregion
|
|
9733
9837
|
//#region src/commands/main/products.ts
|
|
9734
|
-
const command$
|
|
9838
|
+
const command$59 = defineResource({
|
|
9735
9839
|
name: "products",
|
|
9736
9840
|
summary: "Products and their store prices",
|
|
9737
9841
|
operations: [
|
|
@@ -9763,7 +9867,7 @@ const command$58 = defineResource({
|
|
|
9763
9867
|
["--period <p>", "day | week | month | year"],
|
|
9764
9868
|
["--period-count <n>", "Periods per cycle, default 1"],
|
|
9765
9869
|
["--trial-days <n>", "Free-trial length in days"],
|
|
9766
|
-
["--entitlement <id>", "Entitlement to grant (repeatable)"]
|
|
9870
|
+
["--entitlement <id>", "Entitlement to grant, by id or identifier (repeatable); it must be on the product's app"]
|
|
9767
9871
|
]
|
|
9768
9872
|
},
|
|
9769
9873
|
{
|
|
@@ -9798,12 +9902,16 @@ const command$58 = defineResource({
|
|
|
9798
9902
|
mcp: false
|
|
9799
9903
|
}
|
|
9800
9904
|
],
|
|
9801
|
-
examples: [
|
|
9905
|
+
examples: [
|
|
9906
|
+
["products list --app <app>", "Products of an app's project"],
|
|
9907
|
+
["products create --identifier <id> --price 9.99 --period month", "A monthly subscription"],
|
|
9908
|
+
["products create --identifier <id> --price 9.99 --period month --entitlement pro", "One that grants pro"]
|
|
9909
|
+
]
|
|
9802
9910
|
});
|
|
9803
9911
|
|
|
9804
9912
|
//#endregion
|
|
9805
9913
|
//#region src/commands/main/users.ts
|
|
9806
|
-
const command$
|
|
9914
|
+
const command$60 = defineResource({
|
|
9807
9915
|
name: "users",
|
|
9808
9916
|
summary: "Your app's users: subscriptions, entitlements, attributes",
|
|
9809
9917
|
operations: [
|
|
@@ -9874,7 +9982,7 @@ const command$59 = defineResource({
|
|
|
9874
9982
|
|
|
9875
9983
|
//#endregion
|
|
9876
9984
|
//#region src/commands/main/webhooks.ts
|
|
9877
|
-
const command$
|
|
9985
|
+
const command$61 = defineResource({
|
|
9878
9986
|
name: "webhooks",
|
|
9879
9987
|
summary: "Endpoints that receive your events",
|
|
9880
9988
|
operations: [
|
|
@@ -9948,7 +10056,7 @@ Overwrites destination, filters, headers and disabled state; can stop or redirec
|
|
|
9948
10056
|
|
|
9949
10057
|
//#endregion
|
|
9950
10058
|
//#region src/commands/support/doctor.ts
|
|
9951
|
-
const command$
|
|
10059
|
+
const command$62 = defineCommand({
|
|
9952
10060
|
name: "doctor",
|
|
9953
10061
|
summary: "Check the health of your Superwall integration",
|
|
9954
10062
|
flags: { installDir },
|
|
@@ -9958,7 +10066,7 @@ const command$61 = defineCommand({
|
|
|
9958
10066
|
prompts: true,
|
|
9959
10067
|
mcp: false,
|
|
9960
10068
|
async run(ctx) {
|
|
9961
|
-
const { runDoctor } = await import("./doctor-
|
|
10069
|
+
const { runDoctor } = await import("./doctor-kx01VvQX.js");
|
|
9962
10070
|
return runDoctor(ctx);
|
|
9963
10071
|
}
|
|
9964
10072
|
});
|
|
@@ -10104,7 +10212,7 @@ async function runFeedback(ctx, { args, flags }) {
|
|
|
10104
10212
|
|
|
10105
10213
|
//#endregion
|
|
10106
10214
|
//#region src/commands/support/feedback.ts
|
|
10107
|
-
const command$
|
|
10215
|
+
const command$63 = defineCommand({
|
|
10108
10216
|
name: "feedback",
|
|
10109
10217
|
summary: "Report a bug or send feedback to the Superwall team",
|
|
10110
10218
|
details: `Goes straight to the Superwall team. Pass the app it happened in so the team can find the account. Report anything you confirm doesn't work, as a reproducible report with every ID and version in context. Without a shell, paste the relevant part of a log into the message: a tool cannot attach files.
|
|
@@ -10165,7 +10273,7 @@ Sends the supplied message and context to the Superwall team as a persisted even
|
|
|
10165
10273
|
|
|
10166
10274
|
//#endregion
|
|
10167
10275
|
//#region src/commands/support/skills.ts
|
|
10168
|
-
const command$
|
|
10276
|
+
const command$64 = defineCommand({
|
|
10169
10277
|
name: "skills",
|
|
10170
10278
|
summary: "Install or update the Superwall agent skills for your coding agents",
|
|
10171
10279
|
flags: {
|
|
@@ -10194,14 +10302,14 @@ const command$63 = defineCommand({
|
|
|
10194
10302
|
prompts: true,
|
|
10195
10303
|
mcp: false,
|
|
10196
10304
|
async run(ctx, input) {
|
|
10197
|
-
const { runSkills } = await import("./skills-
|
|
10305
|
+
const { runSkills } = await import("./skills-B_oH2dYK.js");
|
|
10198
10306
|
return runSkills(ctx, input);
|
|
10199
10307
|
}
|
|
10200
10308
|
});
|
|
10201
10309
|
|
|
10202
10310
|
//#endregion
|
|
10203
10311
|
//#region src/commands/support/upgrade.ts
|
|
10204
|
-
const command$
|
|
10312
|
+
const command$65 = defineCommand({
|
|
10205
10313
|
name: "upgrade",
|
|
10206
10314
|
summary: "Update the CLI to the latest version",
|
|
10207
10315
|
examples: [["upgrade", "Install the latest version globally with npm"]],
|
|
@@ -10210,14 +10318,14 @@ const command$64 = defineCommand({
|
|
|
10210
10318
|
prompts: true,
|
|
10211
10319
|
mcp: false,
|
|
10212
10320
|
async run(ctx) {
|
|
10213
|
-
const { runUpgrade } = await import("./upgrade-
|
|
10321
|
+
const { runUpgrade } = await import("./upgrade-BnOq32zn.js");
|
|
10214
10322
|
return runUpgrade(ctx);
|
|
10215
10323
|
}
|
|
10216
10324
|
});
|
|
10217
10325
|
|
|
10218
10326
|
//#endregion
|
|
10219
10327
|
//#region src/commands/workflows/integrate.ts
|
|
10220
|
-
const command$
|
|
10328
|
+
const command$66 = defineCommand({
|
|
10221
10329
|
name: "integrate",
|
|
10222
10330
|
summary: "Set up the SDK, placements, and dashboard in your app",
|
|
10223
10331
|
flags: {
|
|
@@ -10249,8 +10357,8 @@ const command$65 = defineCommand({
|
|
|
10249
10357
|
prompts: true,
|
|
10250
10358
|
mcp: false,
|
|
10251
10359
|
async run(ctx, { flags }) {
|
|
10252
|
-
const { runIntegrate } = await import("./integrate-
|
|
10253
|
-
const { printPlaybook } = await import("./playbook-
|
|
10360
|
+
const { runIntegrate } = await import("./integrate-RK5U0GTQ.js");
|
|
10361
|
+
const { printPlaybook } = await import("./playbook-VqV7546k.js");
|
|
10254
10362
|
if (flags.skill) return printPlaybook(ctx.installDir, "integrate");
|
|
10255
10363
|
await runIntegrate({
|
|
10256
10364
|
...ctx,
|
|
@@ -10262,14 +10370,10 @@ const command$65 = defineCommand({
|
|
|
10262
10370
|
|
|
10263
10371
|
//#endregion
|
|
10264
10372
|
//#region src/commands/workflows/migrate.ts
|
|
10265
|
-
const command$
|
|
10373
|
+
const command$67 = defineCommand({
|
|
10266
10374
|
name: "migrate",
|
|
10267
|
-
summary: "Migrate from RevenueCat / Adapty / Qonversion",
|
|
10268
|
-
|
|
10269
|
-
args: { paywall: {
|
|
10270
|
-
describe: "A dashboard paywall id: scaffold it as code (if not already) and rebuild its pages with your agent, or copy the prompt",
|
|
10271
|
-
channel: "next"
|
|
10272
|
-
} },
|
|
10375
|
+
summary: "Migrate from RevenueCat / Adapty / Qonversion, or rebuild a paywall or native screen as code",
|
|
10376
|
+
args: { paywall: { describe: "A dashboard paywall id: scaffold it as code (if not already) and rebuild its pages with your agent, or copy the prompt" } },
|
|
10273
10377
|
flags: {
|
|
10274
10378
|
installDir,
|
|
10275
10379
|
dryRun: {
|
|
@@ -10281,37 +10385,27 @@ const command$66 = defineCommand({
|
|
|
10281
10385
|
type: "string",
|
|
10282
10386
|
value: "path",
|
|
10283
10387
|
bare: true,
|
|
10284
|
-
describe: "A SwiftUI, UIKit, Kotlin (Compose or Views), React Native or Flutter file to rebuild as a Superwall screen (no path: pick from likely candidates)"
|
|
10285
|
-
channel: "next"
|
|
10388
|
+
describe: "A SwiftUI, UIKit, Kotlin (Compose or Views), React Native or Flutter file to rebuild as a Superwall screen (no path: pick from likely candidates)"
|
|
10286
10389
|
},
|
|
10287
10390
|
screenshot: {
|
|
10288
10391
|
type: "string",
|
|
10289
10392
|
value: "path",
|
|
10290
|
-
describe: "A screenshot of the native screen, shown as Compare › Original in the studio"
|
|
10291
|
-
channel: "next"
|
|
10393
|
+
describe: "A screenshot of the native screen, shown as Compare › Original in the studio"
|
|
10292
10394
|
}
|
|
10293
10395
|
},
|
|
10294
10396
|
examples: [
|
|
10295
10397
|
["migrate", "Move this app off RevenueCat / Adapty / Qonversion"],
|
|
10296
10398
|
["migrate --skill", "Print the migration playbook for your own agent"],
|
|
10297
|
-
[
|
|
10298
|
-
|
|
10299
|
-
"Rebuild dashboard paywall 65920 as code",
|
|
10300
|
-
"next"
|
|
10301
|
-
],
|
|
10302
|
-
[
|
|
10303
|
-
"migrate --screen App/UpdateRequiredView.swift",
|
|
10304
|
-
"Rebuild a native screen as a Superwall surface",
|
|
10305
|
-
"next"
|
|
10306
|
-
]
|
|
10399
|
+
["migrate 65920", "Rebuild dashboard paywall 65920 as code"],
|
|
10400
|
+
["migrate --screen App/UpdateRequiredView.swift", "Rebuild a native screen as a Superwall surface"]
|
|
10307
10401
|
],
|
|
10308
10402
|
auth: "optional",
|
|
10309
10403
|
json: false,
|
|
10310
10404
|
prompts: true,
|
|
10311
10405
|
mcp: false,
|
|
10312
10406
|
async run(ctx, { args, flags }) {
|
|
10313
|
-
const { runPaywallMigration, runProviderMigration, runScreenMigration } = await import("./migrate-
|
|
10314
|
-
const { printPlaybook } = await import("./playbook-
|
|
10407
|
+
const { runPaywallMigration, runProviderMigration, runScreenMigration } = await import("./migrate-CjSpcnNu.js");
|
|
10408
|
+
const { printPlaybook } = await import("./playbook-VqV7546k.js");
|
|
10315
10409
|
if (flags.screen !== void 0) return runScreenMigration(ctx, {
|
|
10316
10410
|
path: flags.screen,
|
|
10317
10411
|
screenshot: flags.screenshot
|
|
@@ -10324,7 +10418,7 @@ const command$66 = defineCommand({
|
|
|
10324
10418
|
|
|
10325
10419
|
//#endregion
|
|
10326
10420
|
//#region src/commands/workflows/review.ts
|
|
10327
|
-
const command$
|
|
10421
|
+
const command$68 = defineCommand({
|
|
10328
10422
|
name: "review",
|
|
10329
10423
|
summary: "Review an existing Superwall setup end to end",
|
|
10330
10424
|
flags: {
|
|
@@ -10345,8 +10439,8 @@ const command$67 = defineCommand({
|
|
|
10345
10439
|
prompts: true,
|
|
10346
10440
|
mcp: false,
|
|
10347
10441
|
async run(ctx, { flags }) {
|
|
10348
|
-
const { runReview } = await import("./integrate-
|
|
10349
|
-
const { printPlaybook } = await import("./playbook-
|
|
10442
|
+
const { runReview } = await import("./integrate-RK5U0GTQ.js");
|
|
10443
|
+
const { printPlaybook } = await import("./playbook-VqV7546k.js");
|
|
10350
10444
|
if (flags.skill) return printPlaybook(ctx.installDir, flags.fix ? "review-fix" : "review");
|
|
10351
10445
|
await runReview(ctx, flags.fix);
|
|
10352
10446
|
}
|
|
@@ -10360,23 +10454,23 @@ const GROUPS = [
|
|
|
10360
10454
|
title: "Workflows",
|
|
10361
10455
|
notes: ["Each takes --skill to print the playbook instead of running."],
|
|
10362
10456
|
commands: [
|
|
10363
|
-
command$
|
|
10364
|
-
command$
|
|
10365
|
-
command$
|
|
10457
|
+
command$66,
|
|
10458
|
+
command$68,
|
|
10459
|
+
command$67
|
|
10366
10460
|
]
|
|
10367
10461
|
},
|
|
10368
10462
|
{
|
|
10369
10463
|
id: "paywalls",
|
|
10370
10464
|
title: "Paywalls & funnels",
|
|
10371
|
-
|
|
10372
|
-
notes: ["push and publish take -m <note> to record why, in the source commit.", "All four take --platform <p> when a project pushes to several platforms."],
|
|
10465
|
+
notes: ["push and publish take -m <note> to record why, in the source commit.", "build, push, promote, publish and pull take --platform <p> when a project pushes to several platforms."],
|
|
10373
10466
|
commands: [
|
|
10374
10467
|
command$46,
|
|
10375
10468
|
command$47,
|
|
10376
10469
|
command$45,
|
|
10377
|
-
command$
|
|
10470
|
+
command$51,
|
|
10378
10471
|
command$48,
|
|
10379
|
-
command$49
|
|
10472
|
+
command$49,
|
|
10473
|
+
command$50
|
|
10380
10474
|
]
|
|
10381
10475
|
},
|
|
10382
10476
|
{
|
|
@@ -10384,16 +10478,16 @@ const GROUPS = [
|
|
|
10384
10478
|
title: "Commands",
|
|
10385
10479
|
notes: ["superwall <command> --help lists its operations; <operation> --help, its flags."],
|
|
10386
10480
|
commands: [
|
|
10387
|
-
command$53,
|
|
10388
|
-
command$52,
|
|
10389
|
-
command$58,
|
|
10390
|
-
command$55,
|
|
10391
10481
|
command$54,
|
|
10392
|
-
command$
|
|
10482
|
+
command$53,
|
|
10393
10483
|
command$59,
|
|
10394
|
-
command$60,
|
|
10395
10484
|
command$56,
|
|
10396
|
-
command$
|
|
10485
|
+
command$55,
|
|
10486
|
+
command$58,
|
|
10487
|
+
command$60,
|
|
10488
|
+
command$61,
|
|
10489
|
+
command$57,
|
|
10490
|
+
command$52
|
|
10397
10491
|
]
|
|
10398
10492
|
},
|
|
10399
10493
|
{
|
|
@@ -10594,10 +10688,10 @@ proxy uses. No command prints a private key, and none revokes a key at Apple.`
|
|
|
10594
10688
|
id: "support",
|
|
10595
10689
|
title: "Support & updates",
|
|
10596
10690
|
commands: [
|
|
10597
|
-
command$
|
|
10598
|
-
command$63,
|
|
10691
|
+
command$62,
|
|
10599
10692
|
command$64,
|
|
10600
|
-
command$
|
|
10693
|
+
command$65,
|
|
10694
|
+
command$63
|
|
10601
10695
|
]
|
|
10602
10696
|
}
|
|
10603
10697
|
];
|
|
@@ -10607,7 +10701,7 @@ function visible(channel) {
|
|
|
10607
10701
|
function listGroups() {
|
|
10608
10702
|
return GROUPS.filter((group$1) => visible(group$1.channel)).map((group$1) => ({
|
|
10609
10703
|
...group$1,
|
|
10610
|
-
commands: group$1.commands.filter((command$
|
|
10704
|
+
commands: group$1.commands.filter((command$69) => visible(command$69.channel))
|
|
10611
10705
|
}));
|
|
10612
10706
|
}
|
|
10613
10707
|
|