@superwall/cli 1.7.0 → 2.1.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 +192 -52
- package/dist/{setup-Bxj22rYi.js → apple-CSzNTGHM.js} +82 -76
- package/dist/auth.d.ts +4 -19
- package/dist/auth.js +4 -2
- package/dist/{actions-B7ym3oVS.js → billing-C3Q8DBU2.js} +98 -28
- package/dist/{bind-YrJvuRF9.js → bind-BumHTi9O.js} +38 -33
- package/dist/{build-DLoCW5Ri.js → build-Bpviiclc.js} +20 -26
- package/dist/client-BL0f_yGf.js +176 -0
- package/dist/{asc-Bf7zBbyS.js → client-BZ1UbpXz.js} +16 -15
- package/dist/config-BO1Y87kV.js +105 -0
- package/dist/create-BSfvpWoD.js +19 -0
- package/dist/{create-pkANt1Gs.js → create-BUcVG4Ab.js} +195 -169
- package/dist/{notification-url-DuKF2659.js → create-CfK3PeKA.js} +235 -539
- package/dist/doctor-BWqIYcMn.js +83 -0
- package/dist/{drivers-Qx9LxmRN.js → drivers-CPhdPkW5.js} +185 -172
- package/dist/entry.d.ts +0 -5
- package/dist/entry.js +28072 -1134
- package/dist/environment-eBXjELoN.js +58 -0
- package/dist/{existing-AVEfZu2A.js → existing-BltvQiX5.js} +12 -6
- package/dist/held-CPve03KJ.js +16 -0
- package/dist/held-DgnTFMl3.js +1112 -0
- package/dist/input-vi0bou04.js +42 -0
- package/dist/{integrate-brmhPG-S.js → integrate-BRsqoe01.js} +277 -254
- package/dist/log-NVhVe_oe.js +62 -0
- package/dist/login-BCEH5q0U.js +53 -0
- package/dist/login-BPOONe7n.js +16 -0
- package/dist/{login-Do4wFuLv.js → login-BbTIrCFT.js} +118 -55
- package/dist/lookup-rr1AkCJA.js +71 -0
- package/dist/migrate-C9X2Vz81.js +274 -0
- package/dist/notification-url-CV86qiKP.js +100 -0
- package/dist/{open-studio-DOw-6ydc.js → open-CcpXotHG.js} +34 -43
- package/dist/org-BQQDo7wm.js +35 -0
- package/dist/output-Ggzq5_-t.js +122 -0
- package/dist/paths-CRlU72cq.js +29 -0
- package/dist/playbook-DVMXN7fh.js +53 -0
- package/dist/{asc-products-9JXtDxI4.js → products-DH_fK9tY.js} +6 -6
- package/dist/promote-Da8xctzy.js +91 -0
- package/dist/push-BV-grvQg.js +22 -0
- package/dist/push-D6R9icWN.js +495 -0
- package/dist/registry-BYVD-_h6.js +10385 -0
- package/dist/{reports-CfJqoava.js → reports-D_qbl7_u.js} +7 -6
- package/dist/{resources-Bf9O1JNM.js → resources-DLON3-61.js} +162 -55
- package/dist/{run-DsVZ5snL.js → run-Co-BwhOg.js} +16 -22
- package/dist/scan-B88OlWOt.js +4 -0
- package/dist/{scan-zKsddO72.js → scan-CKuk-_6W.js} +48 -37
- package/dist/scope-DV22_Ufm.js +198 -0
- package/dist/screenshot-file-tVBfUEIi.js +16 -0
- package/dist/{selection-CxZoX4NT.js → selection-C2_KbLuo.js} +100 -51
- package/dist/server-C4f6ccUr.js +22 -0
- package/dist/{dev-DmB3XqaJ.js → server-D0d2oP-5.js} +86 -94
- package/dist/session-B-Uz0cQ7.js +40 -0
- package/dist/session-BuvArt1j.js +6 -0
- package/dist/session-C4rbE3VS.js +796 -0
- package/dist/skills/animate-onboarding/SKILL.md +467 -0
- package/dist/skills/animate-onboarding/references/engine.md +494 -0
- package/dist/skills/animate-onboarding/references/framework/Question.tsx +71 -0
- package/dist/skills/animate-onboarding/references/framework/README.md +40 -0
- package/dist/skills/animate-onboarding/references/framework/answers.ts +19 -0
- package/dist/skills/animate-onboarding/references/framework/flow.ts +80 -0
- package/dist/skills/animate-onboarding/references/framework/handoffs.ts +869 -0
- package/dist/skills/animate-onboarding/references/framework/layout.tsx +113 -0
- package/dist/skills/animate-onboarding/references/framework/motion.css +559 -0
- package/dist/skills/animate-onboarding/references/framework/useStoryRouter.ts +48 -0
- package/dist/skills/animate-onboarding/references/handoffs.md +375 -0
- package/dist/skills/animate-onboarding/references/imageReady.ts +92 -0
- package/dist/skills/animate-onboarding/references/morphFrame.ts +356 -0
- package/dist/skills/animate-onboarding/references/performance.md +41 -0
- package/dist/skills/animate-onboarding/references/web-runtime/README.md +17 -0
- package/dist/skills/animate-onboarding/references/web-runtime/handoffs.ts +858 -0
- package/dist/skills/animate-onboarding/references/web-runtime/story-motion.css +301 -0
- package/dist/skills/index.json +37 -0
- package/dist/skills/mobile-design/SKILL.md +447 -0
- package/dist/skills/mobile-design/references/responsive.md +162 -0
- package/dist/skills/onboarding-questions/SKILL.md +231 -0
- package/dist/skills/onboarding-questions/references/arpu-questions.md +139 -0
- package/dist/skills/onboarding-questions/references/craft.md +142 -0
- package/dist/skills/onboarding-questions/references/example-reflective.md +117 -0
- package/dist/skills/superwall/SKILL.md +82 -9
- package/dist/skills/superwall/references/api.md +153 -37
- package/dist/skills/superwall/references/apple-setup.md +316 -0
- package/dist/skills/superwall/references/asc.md +74 -38
- package/dist/skills/superwall/references/data-analytics.md +55 -21
- package/dist/skills/superwall/workflows/dashboard/playbook.md +3 -3
- package/dist/skills/superwall/workflows/dashboard/setup.md +8 -8
- package/dist/skills/superwall/workflows/migrate/adapty.md +6 -6
- package/dist/skills/superwall/workflows/migrate/playbook.md +4 -4
- package/dist/skills/superwall/workflows/migrate/qonversion.md +5 -5
- package/dist/skills/superwall/workflows/migrate/revenuecat.md +6 -6
- package/dist/skills/superwall/workflows/placements/android.md +2 -2
- package/dist/skills/superwall/workflows/placements/expo.md +2 -2
- package/dist/skills/superwall/workflows/placements/flutter.md +2 -2
- package/dist/skills/superwall/workflows/placements/ios.md +2 -2
- package/dist/skills/superwall/workflows/placements/playbook.md +2 -2
- package/dist/skills/superwall/workflows/placements/react-native.md +2 -2
- package/dist/skills/superwall/workflows/placements/strategy.md +2 -2
- package/dist/skills/superwall/workflows/review/playbook.md +1 -1
- package/dist/skills/superwall-editor/SKILL.md +61 -0
- package/dist/skills/superwall-editor/references/cli.md +135 -0
- package/dist/skills/superwall-editor/references/design.md +51 -0
- package/dist/skills/superwall-editor/references/native-elements.md +171 -0
- package/dist/skills/superwall-editor/references/workflow.md +65 -0
- package/dist/skills/superwall-editor/scripts/sw-editor.sh +662 -0
- package/dist/skills/superwall-framework/SKILL.md +85 -31
- package/dist/skills/superwall-framework/references/cli.md +58 -27
- package/dist/skills/superwall-framework/references/examples.md +4 -3
- package/dist/skills/superwall-framework/references/layout.md +64 -9
- package/dist/skills/superwall-framework/references/migrate-from-editor.md +1 -1
- package/dist/skills/superwall-framework/references/onboarding-state.md +245 -0
- package/dist/skills/wwdc/SKILL.md +22 -0
- package/dist/skills/wwdc/references/docs.md +52 -0
- package/dist/skills/wwdc/scripts/wwdc.sh +266 -0
- package/dist/skills-CLGJuMnF.js +14 -0
- package/dist/{skills-DPzlnfCK.js → skills-CZcpnEnG.js} +100 -122
- package/dist/{spawn-DSoTXy_j.js → spawn-DmmmHIP-.js} +14 -12
- package/dist/spinner-C2U6QBJ9.js +294 -0
- package/dist/storage-6h9vyiAz.js +31 -0
- package/dist/storage-CerJ5KLP.d.ts +16 -0
- package/dist/storekit-CK9JmM2D.js +16 -0
- package/dist/storekit-CinJra3V.js +47 -0
- package/dist/telemetry-DKyDhURo.js +56 -0
- package/dist/theme-DUsCh-Vd.js +25 -0
- package/dist/timing-BVxPrYq3.js +5 -0
- package/dist/{token-C0it-Xh7.js → token-DaxQgQkv.js} +6 -38
- package/dist/tools-skills/animate-onboarding/SKILL.md +467 -0
- package/dist/tools-skills/animate-onboarding/references/engine.md +494 -0
- package/dist/tools-skills/animate-onboarding/references/framework/Question.tsx +71 -0
- package/dist/tools-skills/animate-onboarding/references/framework/README.md +40 -0
- package/dist/tools-skills/animate-onboarding/references/framework/answers.ts +19 -0
- package/dist/tools-skills/animate-onboarding/references/framework/flow.ts +80 -0
- package/dist/tools-skills/animate-onboarding/references/framework/handoffs.ts +869 -0
- package/dist/tools-skills/animate-onboarding/references/framework/layout.tsx +113 -0
- package/dist/tools-skills/animate-onboarding/references/framework/motion.css +559 -0
- package/dist/tools-skills/animate-onboarding/references/framework/useStoryRouter.ts +48 -0
- package/dist/tools-skills/animate-onboarding/references/handoffs.md +375 -0
- package/dist/tools-skills/animate-onboarding/references/imageReady.ts +92 -0
- package/dist/tools-skills/animate-onboarding/references/morphFrame.ts +356 -0
- package/dist/tools-skills/animate-onboarding/references/performance.md +41 -0
- package/dist/tools-skills/animate-onboarding/references/web-runtime/README.md +17 -0
- package/dist/tools-skills/animate-onboarding/references/web-runtime/handoffs.ts +858 -0
- package/dist/tools-skills/animate-onboarding/references/web-runtime/story-motion.css +301 -0
- package/dist/tools-skills/mobile-design/SKILL.md +447 -0
- package/dist/tools-skills/mobile-design/references/responsive.md +162 -0
- package/dist/tools-skills/onboarding-questions/SKILL.md +231 -0
- package/dist/tools-skills/onboarding-questions/references/arpu-questions.md +139 -0
- package/dist/tools-skills/onboarding-questions/references/craft.md +142 -0
- package/dist/tools-skills/onboarding-questions/references/example-reflective.md +117 -0
- package/dist/tools-skills/superwall/SKILL.md +263 -0
- package/dist/tools-skills/superwall/references/api.md +303 -0
- package/dist/tools-skills/superwall/references/asa.md +166 -0
- package/dist/tools-skills/superwall/references/asc.md +95 -0
- package/dist/tools-skills/superwall/references/dashboard-links.md +57 -0
- package/dist/tools-skills/superwall/references/data-analytics.md +896 -0
- package/dist/tools-skills/superwall/references/docs.md +51 -0
- package/dist/tools-skills/superwall/references/sdk-integration.md +104 -0
- package/dist/tools-skills/superwall/references/sdk-source.md +18 -0
- package/dist/tools-skills/superwall/workflows/dashboard/playbook.md +76 -0
- package/dist/tools-skills/superwall/workflows/dashboard/setup.md +100 -0
- package/dist/tools-skills/superwall/workflows/integrate/android.md +292 -0
- package/dist/tools-skills/superwall/workflows/integrate/expo.md +272 -0
- package/dist/tools-skills/superwall/workflows/integrate/flutter.md +285 -0
- package/dist/tools-skills/superwall/workflows/integrate/ios.md +314 -0
- package/dist/tools-skills/superwall/workflows/integrate/playbook.md +83 -0
- package/dist/tools-skills/superwall/workflows/integrate/react-native.md +246 -0
- package/dist/tools-skills/superwall/workflows/migrate/adapty.md +229 -0
- package/dist/tools-skills/superwall/workflows/migrate/playbook.md +78 -0
- package/dist/tools-skills/superwall/workflows/migrate/qonversion.md +227 -0
- package/dist/tools-skills/superwall/workflows/migrate/revenuecat.md +414 -0
- package/dist/tools-skills/superwall/workflows/placements/android.md +175 -0
- package/dist/tools-skills/superwall/workflows/placements/expo.md +161 -0
- package/dist/tools-skills/superwall/workflows/placements/flutter.md +139 -0
- package/dist/tools-skills/superwall/workflows/placements/ios.md +165 -0
- package/dist/tools-skills/superwall/workflows/placements/playbook.md +69 -0
- package/dist/tools-skills/superwall/workflows/placements/react-native.md +145 -0
- package/dist/tools-skills/superwall/workflows/placements/strategy.md +222 -0
- package/dist/tools-skills/superwall/workflows/review/android.md +120 -0
- package/dist/tools-skills/superwall/workflows/review/expo.md +100 -0
- package/dist/tools-skills/superwall/workflows/review/flutter.md +99 -0
- package/dist/tools-skills/superwall/workflows/review/ios.md +108 -0
- package/dist/tools-skills/superwall/workflows/review/playbook.md +70 -0
- package/dist/tools-skills/superwall/workflows/review/react-native.md +100 -0
- package/dist/tools-skills/superwall-editor/SKILL.md +113 -0
- package/dist/tools-skills/superwall-editor/references/cli.md +135 -0
- package/dist/tools-skills/superwall-editor/references/design.md +51 -0
- package/dist/tools-skills/superwall-editor/references/native-elements.md +171 -0
- package/dist/tools-skills/superwall-editor/references/workflow.md +65 -0
- package/dist/tools-skills/superwall-editor/scripts/sw-editor.sh +662 -0
- package/dist/tools-skills/wwdc/SKILL.md +22 -0
- package/dist/tools-skills/wwdc/references/docs.md +52 -0
- package/dist/tools-skills/wwdc/scripts/wwdc.sh +266 -0
- package/dist/tools.d.ts +96 -0
- package/dist/tools.js +11360 -0
- package/dist/ui-D_qf3Gvw.js +53 -0
- package/dist/upgrade-DPo0a4Es.js +117 -0
- package/dist/upgrade-ffseQDMx.js +7 -0
- package/package.json +10 -5
- package/dist/api-CZzirVMj.js +0 -151
- package/dist/api-output-aJNw7Syy.js +0 -20
- package/dist/app-DH6U8yuI.js +0 -190
- package/dist/asa-C-sQzPPn.js +0 -1194
- package/dist/asc-1ZBJ6DwS.js +0 -778
- package/dist/auth-YRhlV3DE.js +0 -140
- package/dist/billing-CCYHdApx.js +0 -80
- package/dist/bundle-id-CKxl_026.js +0 -121
- package/dist/command-CMIz81Da.js +0 -301
- package/dist/dev-DZy6pOnB.js +0 -22
- package/dist/doctor-H-hf-Yww.js +0 -88
- package/dist/feedback-CKf-rpBW.js +0 -152
- package/dist/hosted-CXe9TrWx.js +0 -32
- package/dist/migrate-C9ERDR6y.js +0 -284
- package/dist/org-sj7uyvp-.js +0 -40
- package/dist/output-C4o2gJ1K.js +0 -146
- package/dist/params-l3CrvRtR.js +0 -51
- package/dist/pipeline-BqzqZhX1.js +0 -977
- package/dist/print-skill-ZojRSybs.js +0 -74
- package/dist/promote-BG8X4Nv_.js +0 -88
- package/dist/publish-sxLh-G4G.js +0 -35
- package/dist/push-bQ6Vxtg8.js +0 -35
- package/dist/query-_FbybaH-.js +0 -53
- package/dist/resource-CGIwSd29.js +0 -323
- package/dist/revenue-provider-ebsRINY8.js +0 -100
- package/dist/scope-BvzD-kO4.js +0 -223
- package/dist/skills-D_R-lEsK.js +0 -64
- package/dist/spinner-TWa0hia6.js +0 -18
- package/dist/storekit-Cj9Cpjcz.js +0 -29
- package/dist/telemetry-DeA1mvnT.js +0 -169
- package/dist/ui-Dy0b-9L8.js +0 -27738
- package/dist/update-B2fWIc4q.js +0 -59
- package/dist/upgrade-BmzkTKrh.js +0 -72
- /package/dist/{devtools-8EgLo86w.js → devtools-pBl_vt03.js} +0 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
//#region src/core/state/store.ts
|
|
2
|
+
function memoryStore() {
|
|
3
|
+
const files = /* @__PURE__ */ new Map();
|
|
4
|
+
return {
|
|
5
|
+
read: (name) => files.get(name),
|
|
6
|
+
write: (name, text) => void files.set(name, text),
|
|
7
|
+
remove: (name) => void files.delete(name)
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
const emptyStore = {
|
|
11
|
+
read: () => void 0,
|
|
12
|
+
write: () => {},
|
|
13
|
+
remove: () => {}
|
|
14
|
+
};
|
|
15
|
+
let current = {
|
|
16
|
+
cache: memoryStore(),
|
|
17
|
+
state: memoryStore()
|
|
18
|
+
};
|
|
19
|
+
function useStores(stores) {
|
|
20
|
+
current = stores;
|
|
21
|
+
}
|
|
22
|
+
const cache = () => current.cache;
|
|
23
|
+
const state = () => current.state;
|
|
24
|
+
function readJson(store, name) {
|
|
25
|
+
const text = store.read(name);
|
|
26
|
+
if (text === void 0) return void 0;
|
|
27
|
+
try {
|
|
28
|
+
return JSON.parse(text);
|
|
29
|
+
} catch {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/ui/ansi.ts
|
|
36
|
+
const ANSI = /\u001b\[[0-9;?]*[ -/]*[@-~]|\u001b\][^\u0007\u001b]*(?:\u0007|\u001b\\)/g;
|
|
37
|
+
function stripAnsi(text) {
|
|
38
|
+
return text.replace(ANSI, "");
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/program/output.ts
|
|
43
|
+
function formatJson(value) {
|
|
44
|
+
return JSON.stringify(value, null, 2);
|
|
45
|
+
}
|
|
46
|
+
const blocks = {
|
|
47
|
+
intro: (text) => ({
|
|
48
|
+
kind: "intro",
|
|
49
|
+
text
|
|
50
|
+
}),
|
|
51
|
+
step: (text) => ({
|
|
52
|
+
kind: "step",
|
|
53
|
+
text
|
|
54
|
+
}),
|
|
55
|
+
info: (text) => ({
|
|
56
|
+
kind: "info",
|
|
57
|
+
text
|
|
58
|
+
}),
|
|
59
|
+
success: (text) => ({
|
|
60
|
+
kind: "success",
|
|
61
|
+
text
|
|
62
|
+
}),
|
|
63
|
+
warning: (text) => ({
|
|
64
|
+
kind: "warning",
|
|
65
|
+
text
|
|
66
|
+
}),
|
|
67
|
+
report: (text) => ({
|
|
68
|
+
kind: "report",
|
|
69
|
+
text
|
|
70
|
+
}),
|
|
71
|
+
list: (value) => ({
|
|
72
|
+
kind: "list",
|
|
73
|
+
value
|
|
74
|
+
}),
|
|
75
|
+
nextSteps: (items) => ({
|
|
76
|
+
kind: "nextSteps",
|
|
77
|
+
items
|
|
78
|
+
}),
|
|
79
|
+
outro: (text) => ({
|
|
80
|
+
kind: "outro",
|
|
81
|
+
text
|
|
82
|
+
})
|
|
83
|
+
};
|
|
84
|
+
function writeJson(stream, value) {
|
|
85
|
+
stream.write(`${formatJson(value)}\n`);
|
|
86
|
+
}
|
|
87
|
+
function createCommandOutput(mode, renderer, streams = { stdout: process.stdout }) {
|
|
88
|
+
return {
|
|
89
|
+
mode,
|
|
90
|
+
data(value) {
|
|
91
|
+
if (mode === "json") writeJson(streams.stdout, value);
|
|
92
|
+
else renderer.report(formatJson(value));
|
|
93
|
+
},
|
|
94
|
+
text(value) {
|
|
95
|
+
if (mode === "json") throw new Error("This command must return structured JSON in --json mode.");
|
|
96
|
+
const text = value.replace(/\n$/, "");
|
|
97
|
+
renderer.report(mode === "text" ? stripAnsi(text) : text);
|
|
98
|
+
},
|
|
99
|
+
render(...blocks$1) {
|
|
100
|
+
if (mode === "json") return;
|
|
101
|
+
for (const block of blocks$1) renderBlock(renderer, block);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
function renderBlock(renderer, block) {
|
|
106
|
+
switch (block.kind) {
|
|
107
|
+
case "intro": return renderer.intro(block.text);
|
|
108
|
+
case "step": return renderer.step(block.text);
|
|
109
|
+
case "info": return renderer.info(block.text);
|
|
110
|
+
case "success": return renderer.success(block.text);
|
|
111
|
+
case "warning": return renderer.warn(block.text);
|
|
112
|
+
case "report": return renderer.report(block.text);
|
|
113
|
+
case "list": return renderer.list(block.value);
|
|
114
|
+
case "nextSteps":
|
|
115
|
+
if (block.items.length) renderer.note(block.items.map((item, index) => `${index + 1}. ${item}`).join("\n"), "Next steps");
|
|
116
|
+
return;
|
|
117
|
+
case "outro": return renderer.outro(block.text);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
//#endregion
|
|
122
|
+
export { stripAnsi as a, memoryStore as c, useStores as d, writeJson as i, readJson as l, createCommandOutput as n, cache as o, formatJson as r, emptyStore as s, blocks as t, state as u };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { x as resolveEnv } from "./environment-eBXjELoN.js";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
import { homedir } from "node:os";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
|
|
7
|
+
//#region src/hosts/paths.ts
|
|
8
|
+
const AGENT_SKILLS_DIR = () => process.env.SUPERWALL_AGENT_SKILLS_DIR ?? join(homedir(), ".agents", "skills");
|
|
9
|
+
const SUPERWALL_HOME = () => resolveEnv("SUPERWALL_HOME") ?? join(homedir(), ".superwall");
|
|
10
|
+
function expandHome(path) {
|
|
11
|
+
return path === "~" || path.startsWith("~/") ? join(homedir(), path.slice(1)) : path;
|
|
12
|
+
}
|
|
13
|
+
let root;
|
|
14
|
+
function resolvePackageRoot() {
|
|
15
|
+
if (root) return root;
|
|
16
|
+
let dir = dirname(fileURLToPath(import.meta.url));
|
|
17
|
+
while (!existsSync(join(dir, "package.json"))) {
|
|
18
|
+
const parent = dirname(dir);
|
|
19
|
+
if (parent === dir) break;
|
|
20
|
+
dir = parent;
|
|
21
|
+
}
|
|
22
|
+
return root = dir;
|
|
23
|
+
}
|
|
24
|
+
function packagedDir(name) {
|
|
25
|
+
return join(resolvePackageRoot(), name === "skills" ? "dist/skills" : name) + "/";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
export { packagedDir as i, SUPERWALL_HOME as n, expandHome as r, AGENT_SKILLS_DIR as t };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import "./token-DaxQgQkv.js";
|
|
2
|
+
import "./output-Ggzq5_-t.js";
|
|
3
|
+
import "./environment-eBXjELoN.js";
|
|
4
|
+
import "./storage-6h9vyiAz.js";
|
|
5
|
+
import "./client-BL0f_yGf.js";
|
|
6
|
+
import "./config-BO1Y87kV.js";
|
|
7
|
+
import { i as updateTelemetryTags, r as track } from "./telemetry-DKyDhURo.js";
|
|
8
|
+
import "./spawn-DmmmHIP-.js";
|
|
9
|
+
import "./spinner-C2U6QBJ9.js";
|
|
10
|
+
import "./ui-D_qf3Gvw.js";
|
|
11
|
+
import { t as scanProject } from "./scan-CKuk-_6W.js";
|
|
12
|
+
import "./paths-CRlU72cq.js";
|
|
13
|
+
import { d as readBundledSkill } from "./skills-CZcpnEnG.js";
|
|
14
|
+
import { n as FRAMEWORK_REF, t as detectBilling } from "./billing-C3Q8DBU2.js";
|
|
15
|
+
|
|
16
|
+
//#region src/core/workflows/playbook.ts
|
|
17
|
+
async function printPlaybook(installDir, playbook) {
|
|
18
|
+
const app = (await scanProject(installDir).catch(() => null))?.apps[0];
|
|
19
|
+
if (app) updateTelemetryTags({ framework: app.framework.integration });
|
|
20
|
+
const frameworkRef = app ? FRAMEWORK_REF[app.framework.integration] : void 0;
|
|
21
|
+
if (playbook === "integrate") {
|
|
22
|
+
const parts = [
|
|
23
|
+
readBundledSkill("superwall-integrate", frameworkRef),
|
|
24
|
+
readBundledSkill("superwall-placements", ["strategy", frameworkRef]),
|
|
25
|
+
readBundledSkill("superwall-dashboard")
|
|
26
|
+
].filter(Boolean);
|
|
27
|
+
if (!parts.length) {
|
|
28
|
+
process.stderr.write("No bundled skills found for integrate.\n");
|
|
29
|
+
process.exitCode = 1;
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
process.stdout.write("# Set up Superwall - full integration\n\nDo all three phases in order:\n\n---\n\n" + parts.join("\n\n---\n\n") + "\n");
|
|
33
|
+
track("skill printed", { workflow: playbook });
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const body = readBundledSkill(playbook === "migrate" ? "superwall-migrate" : "superwall-review", playbook === "migrate" ? providerRef(app) : frameworkRef);
|
|
37
|
+
if (!body) {
|
|
38
|
+
process.stderr.write(`No bundled skill found for ${playbook}.\n`);
|
|
39
|
+
process.exitCode = 1;
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
process.stdout.write(body + "\n");
|
|
43
|
+
track("skill printed", { workflow: playbook });
|
|
44
|
+
}
|
|
45
|
+
function providerRef(app) {
|
|
46
|
+
const billing = app ? detectBilling(app) : null;
|
|
47
|
+
if (billing?.revenueCat) return "revenuecat";
|
|
48
|
+
if (billing?.adapty) return "adapty";
|
|
49
|
+
if (billing?.qonversion) return "qonversion";
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
//#endregion
|
|
53
|
+
export { printPlaybook };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as ascProxyGet } from "./
|
|
1
|
+
import { n as ascProxyGet } from "./client-BZ1UbpXz.js";
|
|
2
2
|
|
|
3
|
-
//#region src/core/
|
|
3
|
+
//#region src/core/app-store-connect/store/products.ts
|
|
4
4
|
function attr(r, key) {
|
|
5
5
|
const v = r.attributes?.[key];
|
|
6
6
|
return typeof v === "string" ? v : void 0;
|
|
@@ -15,7 +15,7 @@ async function listAscApps(api, teamId) {
|
|
|
15
15
|
bundleId: attr(a, "bundleId")
|
|
16
16
|
}));
|
|
17
17
|
}
|
|
18
|
-
async function
|
|
18
|
+
async function listUnimportedAscProducts(api, teamId, ascAppId, existingIds) {
|
|
19
19
|
const byId = /* @__PURE__ */ new Map();
|
|
20
20
|
const groups = await ascProxyGet(api, teamId, `/v1/apps/${ascAppId}/subscriptionGroups?limit=200`);
|
|
21
21
|
for (const group of groups.data ?? []) {
|
|
@@ -33,12 +33,12 @@ async function fetchUnimportedAscProducts(api, teamId, ascAppId, existingIds) {
|
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
const iaps = await ascProxyGet(api, teamId, `/v1/apps/${ascAppId}/
|
|
36
|
+
const iaps = await ascProxyGet(api, teamId, `/v1/apps/${ascAppId}/inAppPurchasesV2?limit=200`);
|
|
37
37
|
for (const iap of iaps.data ?? []) {
|
|
38
38
|
const productId = attr(iap, "productId");
|
|
39
39
|
if (productId && !byId.has(productId)) byId.set(productId, {
|
|
40
40
|
productId,
|
|
41
|
-
referenceName: attr(iap, "
|
|
41
|
+
referenceName: attr(iap, "name") ?? "",
|
|
42
42
|
type: attr(iap, "inAppPurchaseType") ?? "UNKNOWN",
|
|
43
43
|
state: attr(iap, "state") ?? "UNKNOWN"
|
|
44
44
|
});
|
|
@@ -57,4 +57,4 @@ function ascTypeDisplay(type) {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
//#endregion
|
|
60
|
-
export {
|
|
60
|
+
export { listUnimportedAscProducts as i, findAscAppId as n, listAscApps as r, ascTypeDisplay as t };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import "./token-DaxQgQkv.js";
|
|
2
|
+
import "./output-Ggzq5_-t.js";
|
|
3
|
+
import { _ as VERSION } from "./environment-eBXjELoN.js";
|
|
4
|
+
import "./storage-6h9vyiAz.js";
|
|
5
|
+
import { t as ApiError } from "./client-BL0f_yGf.js";
|
|
6
|
+
import "./config-BO1Y87kV.js";
|
|
7
|
+
import "./telemetry-DKyDhURo.js";
|
|
8
|
+
import "./spawn-DmmmHIP-.js";
|
|
9
|
+
import "./spinner-C2U6QBJ9.js";
|
|
10
|
+
import { n as ui } from "./ui-D_qf3Gvw.js";
|
|
11
|
+
import "./scan-CKuk-_6W.js";
|
|
12
|
+
import "./paths-CRlU72cq.js";
|
|
13
|
+
import { b as promotePaywallVersion, g as livePaywallVersion } from "./resources-DLON3-61.js";
|
|
14
|
+
import "./lookup-rr1AkCJA.js";
|
|
15
|
+
import "./login-BbTIrCFT.js";
|
|
16
|
+
import "./skills-CZcpnEnG.js";
|
|
17
|
+
import { N as resolveFramework, a as resolveProjectDir, g as transition, s as selectSurfaces, v as collectProjectDeclarations, w as readLock } from "./selection-C2_KbLuo.js";
|
|
18
|
+
import { _ as targetLabel, g as planTargets, h as parsePlatformFlags, n as requireApi, v as wantedPlatforms, x as resolveApps, y as resolveBinding } from "./session-C4rbE3VS.js";
|
|
19
|
+
import { a as pickApplicationOption, i as timed, o as pickAdoptOption, t as group } from "./push-D6R9icWN.js";
|
|
20
|
+
import "./login-BCEH5q0U.js";
|
|
21
|
+
import pc from "picocolors";
|
|
22
|
+
|
|
23
|
+
//#region src/core/paywalls/promote.ts
|
|
24
|
+
function assertSourced(lock, target, version) {
|
|
25
|
+
const pending = (target.surface.kind === "paywall" ? lock.paywalls : lock.funnels)[target.surface.id]?.[target.platform]?.sourcePending;
|
|
26
|
+
if (pending === void 0 || version !== void 0 && version !== pending) return;
|
|
27
|
+
throw new Error(`${target.surface.id} version ${pending} has no source yet — run \`superwall push\` to finish it, then promote.`);
|
|
28
|
+
}
|
|
29
|
+
async function runPromote(ctx, { args, flags }) {
|
|
30
|
+
const api = await requireApi(ctx.interactive);
|
|
31
|
+
const dir = resolveProjectDir(args.dir);
|
|
32
|
+
const framework = await resolveFramework(dir);
|
|
33
|
+
const project = framework.discoverProject(dir);
|
|
34
|
+
const surfaces = selectSurfaces(project, flags.id);
|
|
35
|
+
const declared = (await collectProjectDeclarations(framework, project.root)).platforms;
|
|
36
|
+
const version = flags.version;
|
|
37
|
+
if (version !== void 0 && !Number.isInteger(version)) throw new Error("--version takes a pushed version number, e.g. --version 3.");
|
|
38
|
+
if (version !== void 0 && surfaces.length > 1) throw new Error("--version targets one surface — combine it with a single --id <id>.");
|
|
39
|
+
ui.intro(`Superwall ${pc.dim(`v${VERSION}`)}`);
|
|
40
|
+
const apps = await resolveApps({
|
|
41
|
+
api,
|
|
42
|
+
superwallDir: project.superwallDir,
|
|
43
|
+
wanted: wantedPlatforms(surfaces, declared),
|
|
44
|
+
pickApplication: ctx.interactive ? pickApplicationOption : void 0
|
|
45
|
+
});
|
|
46
|
+
const multi = Object.keys(apps).length > 1;
|
|
47
|
+
const targets = planTargets({
|
|
48
|
+
surfaces,
|
|
49
|
+
declared,
|
|
50
|
+
apps,
|
|
51
|
+
only: parsePlatformFlags(flags.platform)
|
|
52
|
+
});
|
|
53
|
+
if (version !== void 0 && targets.length > 1) throw new Error(`--version targets one paywall — \`${surfaces[0]?.id}\` is pushed to ${targets.map((target) => target.platform).join(", ")}; add --platform <platform> to pick one.`);
|
|
54
|
+
let promoted = 0;
|
|
55
|
+
let skipped = 0;
|
|
56
|
+
for (const target of targets) {
|
|
57
|
+
let changed = true;
|
|
58
|
+
await group(ctx.outputMode, targetLabel(target, multi), async (note) => {
|
|
59
|
+
note("Finding on Superwall");
|
|
60
|
+
const binding = await resolveBinding({
|
|
61
|
+
api,
|
|
62
|
+
superwallDir: project.superwallDir,
|
|
63
|
+
surface: target.surface,
|
|
64
|
+
app: {
|
|
65
|
+
platform: target.platform,
|
|
66
|
+
applicationId: target.applicationId
|
|
67
|
+
},
|
|
68
|
+
surfaces: project.surfaces,
|
|
69
|
+
create: false,
|
|
70
|
+
confirmAdopt: ctx.interactive ? pickAdoptOption : void 0
|
|
71
|
+
});
|
|
72
|
+
assertSourced(readLock(project.superwallDir), target, version);
|
|
73
|
+
note("Promoting");
|
|
74
|
+
const before = await livePaywallVersion(api, binding.paywallId);
|
|
75
|
+
const promo = await timed(() => promotePaywallVersion(api, binding.paywallId, { version }).catch((error) => {
|
|
76
|
+
if (error instanceof ApiError && error.status === 404 && version !== void 0) error.hint = "Run `superwall promote` without --version to promote the latest.";
|
|
77
|
+
throw error;
|
|
78
|
+
}));
|
|
79
|
+
changed = before !== promo.value.version;
|
|
80
|
+
return [`${transition(before, promo.value.version)} ${promo.took}`];
|
|
81
|
+
});
|
|
82
|
+
if (changed) promoted += 1;
|
|
83
|
+
else skipped += 1;
|
|
84
|
+
}
|
|
85
|
+
const noun = (n) => n === 1 ? "paywall" : "paywalls";
|
|
86
|
+
const unchanged = skipped > 0 ? ` · ${pc.dim(`${skipped} already live`)}` : "";
|
|
87
|
+
ui.outro(promoted > 0 ? `${pc.green(`${promoted} ${noun(promoted)} live`)}${unchanged}.` : `Nothing to do · ${skipped} already live.`);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
//#endregion
|
|
91
|
+
export { assertSourced, runPromote };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import "./token-DaxQgQkv.js";
|
|
2
|
+
import "./output-Ggzq5_-t.js";
|
|
3
|
+
import "./environment-eBXjELoN.js";
|
|
4
|
+
import "./storage-6h9vyiAz.js";
|
|
5
|
+
import "./client-BL0f_yGf.js";
|
|
6
|
+
import "./config-BO1Y87kV.js";
|
|
7
|
+
import "./telemetry-DKyDhURo.js";
|
|
8
|
+
import "./spawn-DmmmHIP-.js";
|
|
9
|
+
import "./spinner-C2U6QBJ9.js";
|
|
10
|
+
import "./ui-D_qf3Gvw.js";
|
|
11
|
+
import "./scan-CKuk-_6W.js";
|
|
12
|
+
import "./paths-CRlU72cq.js";
|
|
13
|
+
import "./resources-DLON3-61.js";
|
|
14
|
+
import "./lookup-rr1AkCJA.js";
|
|
15
|
+
import "./login-BbTIrCFT.js";
|
|
16
|
+
import "./skills-CZcpnEnG.js";
|
|
17
|
+
import "./selection-C2_KbLuo.js";
|
|
18
|
+
import "./session-C4rbE3VS.js";
|
|
19
|
+
import { i as timed, n as runPush, r as runPushPipeline, t as group } from "./push-D6R9icWN.js";
|
|
20
|
+
import "./login-BCEH5q0U.js";
|
|
21
|
+
|
|
22
|
+
export { group, runPush, runPushPipeline, timed };
|