@superwall/cli 1.4.0 → 1.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 +21 -5
- package/dist/{actions-EfP8phmb.js → actions-Dt35nIi8.js} +3 -2
- package/dist/{api-CEwXCCoC.js → api-BOR-uXZe.js} +9 -9
- package/dist/{app-D8mEVlQo.js → app-BU27SLPX.js} +9 -9
- package/dist/{asa-BFWehnTA.js → asa-2ykGnjaV.js} +11 -11
- package/dist/{asc-DJqQmtmR.js → asc-r3xmFT0L.js} +14 -14
- package/dist/{auth-CT2DWX8r.js → auth-BWZfguI8.js} +9 -9
- package/dist/auth.js +2 -2
- package/dist/{billing-BzEnVPD2.js → billing-BsQgXXYh.js} +1 -1
- package/dist/{bind-BZxVyt9P.js → bind-BSTAinn6.js} +5 -4
- package/dist/{command-DP96_gmP.js → command-DMoMn7uc.js} +39 -16
- package/dist/{create-Q8TqqjZt.js → create-CSo6XjSm.js} +118 -91
- package/dist/dev-B0MF6z3L.js +21 -0
- package/dist/{dev-DlCcwFu5.js → dev-CuXa3J4Z.js} +29 -24
- package/dist/{doctor-CJsjHpCZ.js → doctor-DXJaDqsx.js} +10 -10
- package/dist/{drivers-UT36AnOw.js → drivers-Cr252DOJ.js} +3 -3
- package/dist/entry.js +84 -50
- package/dist/{existing-Cak1WxWB.js → existing-Ckx_g7Be.js} +6 -3
- package/dist/{feedback-DDRzoqPx.js → feedback-Dt5yebMS.js} +6 -6
- package/dist/{hosted-CEH78QVn.js → hosted-Cjekn8oJ.js} +2 -2
- package/dist/{integrate-D8jyhDzk.js → integrate-DVqhvPVq.js} +25 -66
- package/dist/{login-kneYhhk0.js → login-Bjj8QvIN.js} +6 -6
- package/dist/migrate-qmvOtp3l.js +283 -0
- package/dist/open-studio-CpHqjovS.js +1299 -0
- package/dist/{org-Cg25bcsj.js → org-CV8c849b.js} +3 -3
- package/dist/{output-csAtR6kJ.js → output-CiELrN8w.js} +15 -2
- package/dist/{pipeline-DAeI9tHs.js → pipeline-DSCHL9KA.js} +482 -9
- package/dist/{print-skill-BHVPP9cX.js → print-skill-CaHRJ8xW.js} +7 -7
- package/dist/{promote-Boek5K2d.js → promote-UMTh8Q33.js} +17 -18
- package/dist/publish-DWX8S9yZ.js +34 -0
- package/dist/push-Dox4_5Dq.js +34 -0
- package/dist/{query-B8G6T8Ba.js → query-CnSsDZ7Q.js} +10 -10
- package/dist/reports-C0xHCLnt.js +27 -0
- package/dist/{resource-DjsWVka-.js → resource-5bgyyL9B.js} +15 -15
- package/dist/{resources-s64mBHaC.js → resources-Bf9O1JNM.js} +28 -2
- package/dist/{run-BtcQJCP8.js → run-BVeZWbXx.js} +39 -22
- package/dist/{scan-DJixvuHn.js → scan-CAObNRgc.js} +44 -4
- package/dist/skills/superwall/SKILL.md +146 -0
- package/dist/skills/superwall/references/api.md +275 -0
- package/dist/skills/superwall/references/asa.md +160 -0
- package/dist/skills/superwall/references/asc.md +96 -0
- package/dist/skills/superwall/references/dashboard-links.md +57 -0
- package/dist/skills/superwall/references/data-analytics.md +893 -0
- package/dist/skills/superwall/references/docs.md +51 -0
- package/dist/skills/superwall/references/sdk-integration.md +105 -0
- package/dist/skills/superwall/references/sdk-source.md +18 -0
- package/{skills/superwall-dashboard/SKILL.md → dist/skills/superwall/workflows/dashboard/playbook.md} +3 -9
- package/{skills/superwall-dashboard/references → dist/skills/superwall/workflows/dashboard}/setup.md +1 -3
- package/dist/skills/superwall/workflows/integrate/android.md +292 -0
- package/{skills/superwall-integrate/SKILL.md → dist/skills/superwall/workflows/integrate/playbook.md} +16 -11
- package/{skills/superwall-migrate/references → dist/skills/superwall/workflows/migrate}/adapty.md +4 -4
- package/{skills/superwall-migrate/SKILL.md → dist/skills/superwall/workflows/migrate/playbook.md} +4 -10
- package/{skills/superwall-migrate/references → dist/skills/superwall/workflows/migrate}/qonversion.md +4 -4
- package/{skills/superwall-migrate/references → dist/skills/superwall/workflows/migrate}/revenuecat.md +4 -4
- package/dist/skills/superwall/workflows/placements/android.md +175 -0
- package/{skills/superwall-placements/references → dist/skills/superwall/workflows/placements}/expo.md +1 -1
- package/{skills/superwall-placements/references → dist/skills/superwall/workflows/placements}/flutter.md +1 -1
- package/{skills/superwall-placements/references → dist/skills/superwall/workflows/placements}/ios.md +1 -1
- package/{skills/superwall-placements/SKILL.md → dist/skills/superwall/workflows/placements/playbook.md} +6 -10
- package/{skills/superwall-placements/references → dist/skills/superwall/workflows/placements}/react-native.md +2 -2
- package/{skills/superwall-placements/references → dist/skills/superwall/workflows/placements}/strategy.md +4 -3
- package/dist/skills/superwall/workflows/review/android.md +120 -0
- package/{skills/superwall-review/references → dist/skills/superwall/workflows/review}/expo.md +1 -1
- package/{skills/superwall-review/references → dist/skills/superwall/workflows/review}/flutter.md +1 -1
- package/{skills/superwall-review/references → dist/skills/superwall/workflows/review}/ios.md +1 -1
- package/{skills/superwall-review/SKILL.md → dist/skills/superwall/workflows/review/playbook.md} +2 -7
- package/{skills/superwall-review/references → dist/skills/superwall/workflows/review}/react-native.md +1 -1
- package/dist/skills/superwall-framework/SKILL.md +253 -0
- package/dist/skills/superwall-framework/references/cli.md +340 -0
- package/dist/skills/superwall-framework/references/examples.md +123 -0
- package/dist/skills/superwall-framework/references/layout.md +295 -0
- package/dist/skills/superwall-framework/references/migrate-from-editor.md +208 -0
- package/dist/skills/superwall-framework/references/migrate-from-native.md +193 -0
- package/dist/skills/superwall-framework/references/mobile-design.md +371 -0
- package/dist/skills/superwall-framework/references/native/android.md +83 -0
- package/dist/skills/superwall-framework/references/native/flutter.md +65 -0
- package/dist/skills/superwall-framework/references/native/ios.md +77 -0
- package/dist/skills/superwall-framework/references/native/react-native.md +67 -0
- package/dist/skills/superwall-framework/references/responsive.md +162 -0
- package/dist/{skills-CRG1xk0G.js → skills-Cu41i-Az.js} +12 -12
- package/dist/{skills-CODut1Hn.js → skills-grTDuHlc.js} +134 -36
- package/dist/{spinner-B9dT3DBY.js → spinner-DFctF_Jw.js} +1 -1
- package/dist/{telemetry-BtkMdT-5.js → telemetry-BuCbmoux.js} +3 -3
- package/dist/{token-hM7V1KMG.js → token-mju3Q-vc.js} +3 -3
- package/dist/{ui-Lqt_zFOr.js → ui-4gLyfrgl.js} +76 -46
- package/dist/{update-CeylIjx5.js → update-DnGfpCD7.js} +2 -2
- package/dist/{upgrade-DRqUfCBT.js → upgrade-PMoj3yqJ.js} +6 -6
- package/package.json +8 -7
- package/prompts/actions/paywall-migrate.xml +24 -0
- package/prompts/actions/screen-migrate.xml +26 -0
- package/dist/git-ZwA3Mx8m.js +0 -433
- package/dist/migrate-D_x1oyTk.js +0 -114
- package/dist/publish-C-zEUnO9.js +0 -35
- package/dist/push-DUDQG-EO.js +0 -35
- package/skills/README.md +0 -118
- /package/dist/{api-output-D9ggXQIr.js → api-output-CEhN-U_N.js} +0 -0
- /package/dist/{asc-products-C6MvSy8H.js → asc-products-1e1DoGeL.js} +0 -0
- /package/dist/{params-B1zeElGa.js → params-BxgTuCzr.js} +0 -0
- /package/{skills/superwall-integrate/references → dist/skills/superwall/workflows/integrate}/expo.md +0 -0
- /package/{skills/superwall-integrate/references → dist/skills/superwall/workflows/integrate}/flutter.md +0 -0
- /package/{skills/superwall-integrate/references → dist/skills/superwall/workflows/integrate}/ios.md +0 -0
- /package/{skills/superwall-integrate/references → dist/skills/superwall/workflows/integrate}/react-native.md +0 -0
- /package/dist/{storekit-DPonXSwe.js → storekit-Dlpbq5Wv.js} +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import "./output-CiELrN8w.js";
|
|
2
|
+
import "./telemetry-BuCbmoux.js";
|
|
3
|
+
import "./update-DnGfpCD7.js";
|
|
4
|
+
import "./token-mju3Q-vc.js";
|
|
5
|
+
import { t as defineCommand } from "./command-DMoMn7uc.js";
|
|
6
|
+
import "./ui-4gLyfrgl.js";
|
|
7
|
+
import "./skills-grTDuHlc.js";
|
|
8
|
+
import "./spawn-DSoTXy_j.js";
|
|
9
|
+
import "./login-Bjj8QvIN.js";
|
|
10
|
+
import "./scan-CAObNRgc.js";
|
|
11
|
+
import "./hosted-Cjekn8oJ.js";
|
|
12
|
+
import "./spinner-DFctF_Jw.js";
|
|
13
|
+
import "./resources-Bf9O1JNM.js";
|
|
14
|
+
import "./org-CV8c849b.js";
|
|
15
|
+
import "./bind-BSTAinn6.js";
|
|
16
|
+
import { A as requireApi, n as runPushPipeline } from "./pipeline-DSCHL9KA.js";
|
|
17
|
+
import "./actions-Dt35nIi8.js";
|
|
18
|
+
import "./app-BU27SLPX.js";
|
|
19
|
+
|
|
20
|
+
//#region src/commands/paywalls/push.ts
|
|
21
|
+
const runPush = defineCommand({
|
|
22
|
+
name: "push",
|
|
23
|
+
output: "human",
|
|
24
|
+
async run(context) {
|
|
25
|
+
const api = await requireApi(context.interactive);
|
|
26
|
+
await runPushPipeline({
|
|
27
|
+
...context,
|
|
28
|
+
api
|
|
29
|
+
}, { promote: false });
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
export { runPush };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import "./output-
|
|
2
|
-
import "./telemetry-
|
|
3
|
-
import "./update-
|
|
4
|
-
import "./token-
|
|
5
|
-
import { t as defineCommand } from "./command-
|
|
6
|
-
import "./ui-
|
|
7
|
-
import "./spinner-
|
|
8
|
-
import "./resources-
|
|
9
|
-
import { t as requireOrg } from "./org-
|
|
10
|
-
import { t as apiCall } from "./api-output-
|
|
1
|
+
import "./output-CiELrN8w.js";
|
|
2
|
+
import "./telemetry-BuCbmoux.js";
|
|
3
|
+
import "./update-DnGfpCD7.js";
|
|
4
|
+
import "./token-mju3Q-vc.js";
|
|
5
|
+
import { t as defineCommand } from "./command-DMoMn7uc.js";
|
|
6
|
+
import "./ui-4gLyfrgl.js";
|
|
7
|
+
import "./spinner-DFctF_Jw.js";
|
|
8
|
+
import "./resources-Bf9O1JNM.js";
|
|
9
|
+
import { t as requireOrg } from "./org-CV8c849b.js";
|
|
10
|
+
import { t as apiCall } from "./api-output-CEhN-U_N.js";
|
|
11
11
|
import { readFileSync } from "node:fs";
|
|
12
12
|
|
|
13
13
|
//#region src/commands/platform/query.ts
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
3
|
+
|
|
4
|
+
//#region src/core/state/reports.ts
|
|
5
|
+
function dir(appPath) {
|
|
6
|
+
return join(appPath, ".superwall");
|
|
7
|
+
}
|
|
8
|
+
function path(appPath, id) {
|
|
9
|
+
return join(dir(appPath), `${id}.md`);
|
|
10
|
+
}
|
|
11
|
+
function saveReport(appPath, id, text) {
|
|
12
|
+
try {
|
|
13
|
+
mkdirSync(dir(appPath), { recursive: true });
|
|
14
|
+
writeFileSync(path(appPath, id), text, "utf8");
|
|
15
|
+
} catch {}
|
|
16
|
+
}
|
|
17
|
+
function loadReport(appPath, id) {
|
|
18
|
+
try {
|
|
19
|
+
const p = path(appPath, id);
|
|
20
|
+
return existsSync(p) ? readFileSync(p, "utf8") : void 0;
|
|
21
|
+
} catch {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export { saveReport as n, loadReport as t };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { r as formatJson, t as blocks } from "./output-
|
|
2
|
-
import { f as setDefaultApp, o as getDefaultApp } from "./telemetry-
|
|
3
|
-
import "./update-
|
|
4
|
-
import "./token-
|
|
5
|
-
import {
|
|
6
|
-
import "./ui-
|
|
7
|
-
import { t as scanProject } from "./scan-
|
|
8
|
-
import { t as detectExisting } from "./existing-
|
|
9
|
-
import "./spinner-
|
|
10
|
-
import {
|
|
11
|
-
import { t as requireOrg } from "./org-
|
|
12
|
-
import { t as platformForIntegration } from "./bind-
|
|
13
|
-
import { t as apiCall } from "./api-output-
|
|
14
|
-
import { t as generateStoreKit } from "./storekit-
|
|
1
|
+
import { r as formatJson, t as blocks } from "./output-CiELrN8w.js";
|
|
2
|
+
import { f as setDefaultApp, o as getDefaultApp } from "./telemetry-BuCbmoux.js";
|
|
3
|
+
import "./update-DnGfpCD7.js";
|
|
4
|
+
import "./token-mju3Q-vc.js";
|
|
5
|
+
import { r as ApiError, t as defineCommand } from "./command-DMoMn7uc.js";
|
|
6
|
+
import "./ui-4gLyfrgl.js";
|
|
7
|
+
import { t as scanProject } from "./scan-CAObNRgc.js";
|
|
8
|
+
import { t as detectExisting } from "./existing-Ckx_g7Be.js";
|
|
9
|
+
import "./spinner-DFctF_Jw.js";
|
|
10
|
+
import { E as titleCase, T as rowName, b as platformLabel, g as listResource, h as listProjects, i as createEntitlement, l as getPaywallApplicationId, m as listOrganizations, n as createApplication, o as createProduct, r as createCampaign, s as createProject, t as addPlacement, u as isAppScoped } from "./resources-Bf9O1JNM.js";
|
|
11
|
+
import { t as requireOrg } from "./org-CV8c849b.js";
|
|
12
|
+
import { t as platformForIntegration } from "./bind-BSTAinn6.js";
|
|
13
|
+
import { t as apiCall } from "./api-output-CEhN-U_N.js";
|
|
14
|
+
import { t as generateStoreKit } from "./storekit-Dlpbq5Wv.js";
|
|
15
|
+
import * as path from "node:path";
|
|
15
16
|
import * as fs from "node:fs";
|
|
16
17
|
import { writeFileSync } from "node:fs";
|
|
17
|
-
import * as path from "node:path";
|
|
18
18
|
|
|
19
19
|
//#region src/commands/resource/scope.ts
|
|
20
20
|
async function detectLocal(installDir) {
|
|
@@ -121,6 +121,21 @@ async function listAppPaywalls(api, applicationId, options = {}) {
|
|
|
121
121
|
};
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
|
+
const productRefsOf = (value) => {
|
|
125
|
+
if (!Array.isArray(value)) return [];
|
|
126
|
+
const refs = [];
|
|
127
|
+
for (const entry of value) {
|
|
128
|
+
if (typeof entry !== "object" || entry === null) continue;
|
|
129
|
+
const row = entry;
|
|
130
|
+
if (typeof row.reference_name !== "string" || typeof row.identifier !== "string") continue;
|
|
131
|
+
refs.push({
|
|
132
|
+
reference: row.reference_name,
|
|
133
|
+
identifier: row.identifier,
|
|
134
|
+
...typeof row.store === "string" ? { store: row.store } : {}
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
return refs;
|
|
138
|
+
};
|
|
124
139
|
async function getPaywall(api, paywallId) {
|
|
125
140
|
const row = await api.get(`/v2/paywalls/${encodeURIComponent(paywallId)}`);
|
|
126
141
|
const metadata = {};
|
|
@@ -135,10 +150,21 @@ async function getPaywall(api, paywallId) {
|
|
|
135
150
|
archived: row.archived === true,
|
|
136
151
|
metadata,
|
|
137
152
|
applicationId: typeof applicationId === "string" || typeof applicationId === "number" ? String(applicationId) : void 0,
|
|
153
|
+
projectId: typeof row.project_id === "string" || typeof row.project_id === "number" ? String(row.project_id) : void 0,
|
|
154
|
+
platform: typeof row.application_platform === "string" ? row.application_platform : void 0,
|
|
138
155
|
version: typeof row.version === "number" ? row.version : void 0,
|
|
139
|
-
url: typeof row.paywall_url === "string" ? row.paywall_url : void 0
|
|
156
|
+
url: typeof row.paywall_url === "string" ? row.paywall_url : void 0,
|
|
157
|
+
previewUrl: typeof row.preview_url === "string" ? row.preview_url : void 0,
|
|
158
|
+
headless: row.headless === true,
|
|
159
|
+
presentationStyle: typeof row.presentation_style === "string" ? row.presentation_style : void 0,
|
|
160
|
+
featureGating: typeof row.feature_gating === "string" ? row.feature_gating : void 0,
|
|
161
|
+
products: productRefsOf(row.products)
|
|
140
162
|
};
|
|
141
163
|
}
|
|
164
|
+
async function projectOrganizationId(api, projectId) {
|
|
165
|
+
const organization = (await api.get(`/v2/projects/${encodeURIComponent(projectId)}`)).organization_id;
|
|
166
|
+
return typeof organization === "string" || typeof organization === "number" ? String(organization) : void 0;
|
|
167
|
+
}
|
|
142
168
|
const SNAPSHOT_IN_URL = /([a-f0-9]{64})\.html/;
|
|
143
169
|
async function livePaywall(api, paywallId) {
|
|
144
170
|
return getPaywall(api, paywallId).then((paywall) => ({
|
|
@@ -231,4 +257,4 @@ function promotePaywallVersion(api, paywallId, opts = {}) {
|
|
|
231
257
|
}
|
|
232
258
|
|
|
233
259
|
//#endregion
|
|
234
|
-
export {
|
|
260
|
+
export { pushPaywallAssets as C, versionProducts as D, titleCase as E, promotePaywallVersion as S, rowName as T, livePaywall as _, createHeadlessPaywall as a, platformLabel as b, getPaywall as c, linkSourceCommit as d, listAppPaywalls as f, listResource as g, listProjects as h, createEntitlement as i, getPaywallApplicationId as l, listOrganizations as m, createApplication as n, createProduct as o, listApplications as p, createCampaign as r, createProject as s, addPlacement as t, isAppScoped as u, livePaywallVersion as v, pushPaywallVersion as w, projectOrganizationId as x, mintSourceAccess as y };
|
|
@@ -1,27 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { s as packagedDir } from "./skills-
|
|
3
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
1
|
+
import { f as DASHBOARD_URL } from "./output-CiELrN8w.js";
|
|
2
|
+
import { s as packagedDir } from "./skills-grTDuHlc.js";
|
|
4
3
|
import { join } from "node:path";
|
|
4
|
+
import { readFileSync } from "node:fs";
|
|
5
|
+
import { spawn } from "node:child_process";
|
|
5
6
|
|
|
6
|
-
//#region src/
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
//#region src/clipboard.ts
|
|
8
|
+
async function copyToClipboard(text) {
|
|
9
|
+
const cmd = clipboardCommand();
|
|
10
|
+
if (!cmd) return false;
|
|
11
|
+
return new Promise((resolve$1) => {
|
|
12
|
+
try {
|
|
13
|
+
const child = spawn(cmd.command, cmd.args, { stdio: [
|
|
14
|
+
"pipe",
|
|
15
|
+
"ignore",
|
|
16
|
+
"ignore"
|
|
17
|
+
] });
|
|
18
|
+
child.on("error", () => resolve$1(false));
|
|
19
|
+
child.on("close", (code) => resolve$1(code === 0));
|
|
20
|
+
child.stdin.on("error", () => resolve$1(false));
|
|
21
|
+
child.stdin.write(text);
|
|
22
|
+
child.stdin.end();
|
|
23
|
+
} catch {
|
|
24
|
+
resolve$1(false);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
18
27
|
}
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
28
|
+
function clipboardCommand() {
|
|
29
|
+
switch (process.platform) {
|
|
30
|
+
case "darwin": return {
|
|
31
|
+
command: "pbcopy",
|
|
32
|
+
args: []
|
|
33
|
+
};
|
|
34
|
+
case "win32": return {
|
|
35
|
+
command: "clip",
|
|
36
|
+
args: []
|
|
37
|
+
};
|
|
38
|
+
default: return {
|
|
39
|
+
command: "xclip",
|
|
40
|
+
args: ["-selection", "clipboard"]
|
|
41
|
+
};
|
|
25
42
|
}
|
|
26
43
|
}
|
|
27
44
|
|
|
@@ -86,4 +103,4 @@ async function runWithDriverFallback(drivers, options) {
|
|
|
86
103
|
}
|
|
87
104
|
|
|
88
105
|
//#endregion
|
|
89
|
-
export {
|
|
106
|
+
export { copyToClipboard as a, loadPrompt as i, runWithDriverFallback as n, buildCopyPrompt as r, runAction as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
1
|
+
import { m as Integration } from "./output-CiELrN8w.js";
|
|
3
2
|
import { basename, dirname, join, relative, sep } from "node:path";
|
|
3
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
4
4
|
import fg from "fast-glob";
|
|
5
5
|
|
|
6
6
|
//#region src/core/project/frameworks.ts
|
|
@@ -12,6 +12,13 @@ const frameworkByIntegration = {
|
|
|
12
12
|
sdkPackage: "https://github.com/superwall/Superwall-iOS",
|
|
13
13
|
docsUrl: "https://superwall.com/docs/ios/quickstart/install"
|
|
14
14
|
},
|
|
15
|
+
[Integration.android]: {
|
|
16
|
+
integration: Integration.android,
|
|
17
|
+
name: "Android (Kotlin)",
|
|
18
|
+
supported: true,
|
|
19
|
+
sdkPackage: "com.superwall.sdk:superwall-android",
|
|
20
|
+
docsUrl: "https://superwall.com/docs/android/quickstart/install"
|
|
21
|
+
},
|
|
15
22
|
[Integration.expo]: {
|
|
16
23
|
integration: Integration.expo,
|
|
17
24
|
name: "Expo (React Native)",
|
|
@@ -115,6 +122,20 @@ function classifyJs(dir) {
|
|
|
115
122
|
};
|
|
116
123
|
return null;
|
|
117
124
|
}
|
|
125
|
+
function androidUiKind(dir, gradle) {
|
|
126
|
+
if (/androidx\.compose|compose-bom|compose\.ui|kotlin\("plugin\.compose"\)|org\.jetbrains\.kotlin\.plugin\.compose/.test(gradle)) return "Jetpack Compose";
|
|
127
|
+
const files = fg.sync("**/*.kt", {
|
|
128
|
+
cwd: dir,
|
|
129
|
+
ignore: IGNORE,
|
|
130
|
+
absolute: true,
|
|
131
|
+
deep: 8
|
|
132
|
+
});
|
|
133
|
+
for (const f of files.slice(0, 300)) try {
|
|
134
|
+
if (readFileSync(f, "utf8").includes("@Composable")) return "Jetpack Compose";
|
|
135
|
+
} catch {}
|
|
136
|
+
return "Views";
|
|
137
|
+
}
|
|
138
|
+
const ANDROID_APP_PLUGIN = /com\.android\.application|alias\(libs\.plugins\.android\.application\)|libs\.plugins\.androidApplication/;
|
|
118
139
|
function swiftUiKind(dir) {
|
|
119
140
|
const files = fg.sync("**/*.swift", {
|
|
120
141
|
cwd: dir,
|
|
@@ -172,7 +193,7 @@ async function scanProject(root) {
|
|
|
172
193
|
ignore: IGNORE,
|
|
173
194
|
deep: SCAN_DEPTH
|
|
174
195
|
};
|
|
175
|
-
const [pkgPaths, xcodeProjects, packageSwifts, tuistProjects, pubspecs] = await Promise.all([
|
|
196
|
+
const [pkgPaths, xcodeProjects, packageSwifts, tuistProjects, pubspecs, gradles] = await Promise.all([
|
|
176
197
|
fg("**/package.json", opts),
|
|
177
198
|
fg("**/*.xcodeproj", {
|
|
178
199
|
...opts,
|
|
@@ -180,7 +201,8 @@ async function scanProject(root) {
|
|
|
180
201
|
}),
|
|
181
202
|
fg("**/Package.swift", opts),
|
|
182
203
|
fg("**/Project.swift", opts),
|
|
183
|
-
fg("**/pubspec.yaml", opts)
|
|
204
|
+
fg("**/pubspec.yaml", opts),
|
|
205
|
+
fg("**/build.gradle{,.kts}", opts)
|
|
184
206
|
]);
|
|
185
207
|
const jsRoots = pkgPaths.map((p) => dirname(join(root, p)));
|
|
186
208
|
const jsRootSet = new Set(jsRoots);
|
|
@@ -208,6 +230,24 @@ async function scanProject(root) {
|
|
|
208
230
|
score: .95
|
|
209
231
|
}));
|
|
210
232
|
}
|
|
233
|
+
const nativeRoots = new Set([...jsRootSet, ...pubspecs.map((p) => dirname(join(root, p)))]);
|
|
234
|
+
for (const g of gradles) {
|
|
235
|
+
const file = join(root, g);
|
|
236
|
+
let gradle;
|
|
237
|
+
try {
|
|
238
|
+
gradle = readFileSync(file, "utf8");
|
|
239
|
+
} catch {
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
242
|
+
if (!gradle.split("\n").some((line) => ANDROID_APP_PLUGIN.test(line) && !/apply\s+false/.test(line))) continue;
|
|
243
|
+
const moduleDir = dirname(file);
|
|
244
|
+
if (isGeneratedNative(moduleDir, nativeRoots)) continue;
|
|
245
|
+
apps.push(makeApp(root, moduleDir, {
|
|
246
|
+
integration: Integration.android,
|
|
247
|
+
details: androidUiKind(moduleDir, gradle),
|
|
248
|
+
score: .95
|
|
249
|
+
}));
|
|
250
|
+
}
|
|
211
251
|
for (const p of pubspecs) {
|
|
212
252
|
const dir = dirname(join(root, p));
|
|
213
253
|
apps.push(makeApp(root, dir, {
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: superwall
|
|
3
|
+
description: Use the `superwall` CLI to manage apps, products, entitlements, campaigns, paywalls, App Store Connect, Apple Search Ads, and ClickHouse analytics. Also covers documentation lookup, dashboard links, SDK source inspection, and integration, migration, review, and dashboard workflows. Use for Superwall API or CLI tasks, data analysis, SDK setup, provider migration, webhook events, and SDK debugging.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Superwall
|
|
7
|
+
|
|
8
|
+
Everything here runs through the `superwall` CLI. Read the relevant reference
|
|
9
|
+
before proceeding.
|
|
10
|
+
|
|
11
|
+
## Setup — probe first, fix only what's missing
|
|
12
|
+
|
|
13
|
+
Everything here needs the `superwall` CLI on PATH and a logged-in session. Probe
|
|
14
|
+
once; the output tells you what to do:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
superwall whoami --json
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
- **`superwall: command not found`** → the CLI isn't installed. Install it
|
|
21
|
+
globally, or prefix one-off commands with `npx -y`:
|
|
22
|
+
```bash
|
|
23
|
+
npm install --global superwall # or: npx -y superwall whoami --json
|
|
24
|
+
```
|
|
25
|
+
- **`{"authenticated": false}`** → ask the user to run `superwall login` (device
|
|
26
|
+
-flow OAuth; it opens a browser, so you can't do it for them). CI/headless:
|
|
27
|
+
`superwall login --api-key <key>`.
|
|
28
|
+
- **account shown** → ready. Proceed.
|
|
29
|
+
|
|
30
|
+
The session lives under `~/.superwall`; commands act as the logged-in user.
|
|
31
|
+
Logging in also installs these agent skills and keeps them current.
|
|
32
|
+
|
|
33
|
+
## CLI - resources & raw API
|
|
34
|
+
|
|
35
|
+
Use when: managing resources, scoping to a project/app, calling `/v2/...`, or
|
|
36
|
+
viewing the account with `bootstrap`.
|
|
37
|
+
|
|
38
|
+
[Read the CLI reference](references/api.md).
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
superwall apps list --json
|
|
42
|
+
superwall products list --project <id> --json
|
|
43
|
+
superwall campaigns create "New user paywall" onboarding_complete --project <id> --app <id> --json
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## App Store Connect - the full ASC API, agent-safe
|
|
47
|
+
|
|
48
|
+
Use when: creating or managing anything in App Store Connect - subscriptions,
|
|
49
|
+
IAPs, prices, introductory/promotional offers, groups. `superwall asc` proxies
|
|
50
|
+
the entire ASC API with a signed request (no `.p8`/JWT).
|
|
51
|
+
|
|
52
|
+
**Before any `asc post`/`asc patch`, run `superwall asc docs <path> <verb>`** for
|
|
53
|
+
the exact schema. Pass flat `-d` params - the proxy builds the JSON:API body and
|
|
54
|
+
validates it, returning the precise fix if it's wrong. Never guess a body.
|
|
55
|
+
|
|
56
|
+
[Read the App Store Connect reference](references/asc.md).
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
superwall asc docs "subscription" # discover endpoints
|
|
60
|
+
superwall asc docs /v1/subscriptions post # exact schema
|
|
61
|
+
superwall asc post /v1/subscriptions -d name="Pro Monthly" \
|
|
62
|
+
-d productId=com.acme.pro -d subscriptionPeriod=ONE_MONTH -d group=<id> --json
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Apple Search Ads - the full Apple Ads API, agent-safe
|
|
66
|
+
|
|
67
|
+
Use when: reading or managing Apple Search Ads - campaigns, ad groups,
|
|
68
|
+
keywords, negative keywords, ads, creatives, reports, budget orders.
|
|
69
|
+
`superwall asa` proxies the entire Apple Ads Campaign Management API v5 with the
|
|
70
|
+
credentials connected in the dashboard (no client secret, token, or org id).
|
|
71
|
+
|
|
72
|
+
**Before any `asa <resource> create|update`, run `superwall asa docs <resource> <action>`**
|
|
73
|
+
for Apple's exact fields and enums. Typed flags cover the common fields; `--body`
|
|
74
|
+
sends a full payload. Never guess a body.
|
|
75
|
+
|
|
76
|
+
[Read the Apple Search Ads reference](references/asa.md).
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
superwall asa docs # every endpoint, grouped
|
|
80
|
+
superwall asa docs campaigns create # Apple's page: fields, enums, examples
|
|
81
|
+
superwall asa campaigns find --field status --op EQUALS --values ENABLED --all --json
|
|
82
|
+
superwall asa keywords create --campaign <id> --adgroup <id> \
|
|
83
|
+
--text "grammar checker" --match-type EXACT --bid 1.25 --json
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Data & Analytics - ClickHouse data warehouse
|
|
87
|
+
|
|
88
|
+
Use when: querying events/revenue/subscriptions or building custom dashboards
|
|
89
|
+
and recurring report/notification workflows.
|
|
90
|
+
|
|
91
|
+
[Read the data analytics reference](references/data-analytics.md).
|
|
92
|
+
|
|
93
|
+
Use this proactively whenever Superwall data can answer the question; agents get
|
|
94
|
+
a composable analytics tool without an export or separate warehouse.
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
superwall query "SELECT ..." --json
|
|
98
|
+
superwall query --file report.sql --json
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Docs - documentation, SDK integration, dashboard links
|
|
102
|
+
|
|
103
|
+
Use when: looking up docs, integrating/debugging an SDK, linking dashboard pages,
|
|
104
|
+
cloning SDK source, or configuring webhooks.
|
|
105
|
+
|
|
106
|
+
[Read the documentation reference](references/docs.md).
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
curl -sL https://superwall.com/docs/llms.txt # Find the right page
|
|
110
|
+
curl -sL https://superwall.com/docs/{path}.md # Fetch a specific page
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Workflows - integrate, migrate, review, placements, dashboard
|
|
114
|
+
|
|
115
|
+
Use when: integrating, migrating, reviewing an existing setup, adding placements, or wiring campaigns.
|
|
116
|
+
|
|
117
|
+
> **Agents: do the work yourself.** Never run orchestrated workflows without
|
|
118
|
+
> `--skill`; they spawn another agent. The playbooks are files in this skill's
|
|
119
|
+
> `workflows/` directory: read `workflows/<job>/playbook.md`, then the one
|
|
120
|
+
> file for the app's framework beside it (`ios.md`, `android.md`, `expo.md`,
|
|
121
|
+
> `react-native.md`, `flutter.md`) or provider (`revenuecat.md`, `adapty.md`,
|
|
122
|
+
> `qonversion.md`). That is exactly what the CLI composes; `superwall <job>
|
|
123
|
+
> --skill` prints the same text if you would rather have it in one piece. The
|
|
124
|
+
> plain workflows are for humans.
|
|
125
|
+
|
|
126
|
+
| Job | Read | Human at a terminal |
|
|
127
|
+
| --- | --- | --- |
|
|
128
|
+
| Full setup | `workflows/integrate/playbook.md` + the `<framework>.md` beside it (`ios`, `android`, `expo`, `react-native`, `flutter`), then `workflows/placements/` and `workflows/dashboard/` | `superwall integrate` |
|
|
129
|
+
| Placements at feature gates | `workflows/placements/playbook.md` + `strategy.md` + the `<framework>.md` beside it | part of `superwall integrate` |
|
|
130
|
+
| Entitlements, products, campaigns | `workflows/dashboard/playbook.md` + `setup.md` | part of `superwall integrate` |
|
|
131
|
+
| Existing setup review | `workflows/review/playbook.md` + the `<framework>.md` beside it (not `references/`, which is the CLI and API) | `superwall review` (`--fix` for safe fixes) |
|
|
132
|
+
| Provider migration | `workflows/migrate/playbook.md` + `revenuecat.md` / `adapty.md` / `qonversion.md` beside it | `superwall migrate` |
|
|
133
|
+
|
|
134
|
+
The CLI bundles this skill at build time as an
|
|
135
|
+
offline fallback, installs the live repo at `superwall login`, and reads the
|
|
136
|
+
installed live copy first, so `--skill`, headless runs and what you read here
|
|
137
|
+
are the same, newest text.
|
|
138
|
+
|
|
139
|
+
## Feedback - tell the team what's broken
|
|
140
|
+
|
|
141
|
+
When the user is frustrated, blocked, or complains about the CLI or a Superwall
|
|
142
|
+
workflow, send it upstream - don't just apologize. This reaches the team directly.
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
superwall feedback "user hit X running Y; expected Z" --json
|
|
146
|
+
```
|