@superwall/cli 2.6.0-beta.1 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/README.md +47 -16
  2. package/dist/{apple-Bmt_iywx.js → apple-D-rfsuDA.js} +17 -19
  3. package/dist/{approve-D2UgqaRx.js → approve-aPc5RoXB.js} +14 -13
  4. package/dist/{assets-B_quADds.js → assets-PyuXe45Y.js} +3 -3
  5. package/dist/auth.d.ts +11 -4
  6. package/dist/auth.js +4 -5
  7. package/dist/base-CAU0hWoI.js +82 -0
  8. package/dist/{billing-ZIETn0j4.js → billing-Dt6L_l9R.js} +3 -3
  9. package/dist/{build-BWjXurjs.js → build-CY5FnMNY.js} +35 -16
  10. package/dist/config-DOp5oChe.js +377 -0
  11. package/dist/{create-C3uklw-U.js → create-BZL5VH4L.js} +41 -41
  12. package/dist/{create-BCIgjRHn.js → create-D6w3UL0m.js} +9 -9
  13. package/dist/create-DM5Y1Pyk.js +18 -0
  14. package/dist/{doctor-D2Q1EZe8.js → doctor-C9FR0qw3.js} +50 -10
  15. package/dist/entry.js +45 -40
  16. package/dist/{environment-BocmdvZ-.js → environment-sE2wZYdg.js} +1 -1
  17. package/dist/{drivers-BQkO5tHs.js → existing--peXpOZj.js} +305 -8
  18. package/dist/framework-DW5fqjh4.js +65 -0
  19. package/dist/{source-BccdO4aL.js → git-Hf9Wc7Hp.js} +34 -92
  20. package/dist/{held-Bykbwy-m.js → held-CUBCOCGP.js} +8 -8
  21. package/dist/held-DVxvPMSG.js +15 -0
  22. package/dist/{install-dXZZ79Oe.js → install-C5d82gZF.js} +15 -17
  23. package/dist/{integrate-DiSjlOjC.js → integrate-D8J_X1bj.js} +33 -38
  24. package/dist/{login-5sWIKDI2.js → login-C6X7JrhM.js} +8 -9
  25. package/dist/{login-Jp6E6d2e.js → login-DXhm9L0F.js} +3 -3
  26. package/dist/login-et319ESO.js +13 -0
  27. package/dist/{lookup-CWzVfPpq.js → lookup-DqmIbUkv.js} +28 -4
  28. package/dist/{migrate-BKiOUsMY.js → migrate-BYF6hKZ2.js} +66 -45
  29. package/dist/{notification-url-BDBxbwZq.js → notification-url-Bo54nkXv.js} +4 -4
  30. package/dist/{open-DNd49kT-.js → open-xdgXUzaF.js} +2 -2
  31. package/dist/{org-Dud1rF9f.js → org-BD8U3D1_.js} +4 -4
  32. package/dist/{organization-7vJA3uy1.js → organization-D-ZlB3qU.js} +4 -4
  33. package/dist/{orgs-Z0H9WOs1.js → orgs-DQQJ3sw_.js} +1 -2
  34. package/dist/{paths-CzTJVpfi.js → paths-CIlyzF2I.js} +1 -1
  35. package/dist/{playbook-DJ__edOW.js → playbook-ecggWGFi.js} +10 -14
  36. package/dist/{products-Cqq59DBQ.js → products-CJq_iXv5.js} +1 -1
  37. package/dist/{promote-DLtPSvmL.js → promote-QVMLGYlU.js} +27 -28
  38. package/dist/{pull-AoUmaiMK.js → pull-CCXhb2a7.js} +72 -26
  39. package/dist/{pull-D-YuT3e0.js → pull-CrdsfsAl.js} +33 -39
  40. package/dist/pull-h71pL3r_.js +30 -0
  41. package/dist/push-BIq6R8Ro.js +29 -0
  42. package/dist/push-D6pJM_vv.js +21 -0
  43. package/dist/{push-BMblzg_6.js → push-DJMGG7zW.js} +23 -12
  44. package/dist/{push-BrzMFd4Z.js → push-DiMDwGfe.js} +15 -8
  45. package/dist/{registry-DDU10_Ix.js → registry-BSnQXft4.js} +1288 -901
  46. package/dist/registry-YwzTfCNc.js +22 -0
  47. package/dist/{resolve-DpOSDDdr.js → resolve-DO7bPota.js} +52 -6
  48. package/dist/{resources-CptT7HD6.js → resources-XwvXA20E.js} +15 -2
  49. package/dist/{run-r3foWfhV.js → run-B-YvxfRc.js} +15 -17
  50. package/dist/scan-B36wkZmI.js +4 -0
  51. package/dist/{scan-nVQO7JLx.js → scan-ViBhmrB7.js} +1 -1
  52. package/dist/{scope-l1qGLsgz.js → scope-BLLUxbrA.js} +24 -18
  53. package/dist/{scope-ehZ7L1nj.js → scope-Cg1AdAfO.js} +33 -3
  54. package/dist/screenshot-file-Dix2Qynm.js +127 -0
  55. package/dist/{sdk-DEfQttek.js → sdk-BFunw4Hc.js} +1 -1
  56. package/dist/{framework-CLmf4swr.js → selection-C07e_GGY.js} +4 -54
  57. package/dist/{series-D2ZpZ8cx.js → series-B8NJK4yS.js} +1 -1
  58. package/dist/{server-DLARhh1k.js → server-CBtHzl9y.js} +40 -18
  59. package/dist/server-CZwSfzKe.js +33 -0
  60. package/dist/{base-ChTi42M0.js → session-BfVx50iA.js} +8 -83
  61. package/dist/{session-Z0BeaJPf.js → session-BlrwAdGN.js} +1 -1
  62. package/dist/session-Cip4j99n.js +5 -0
  63. package/dist/{migration-Z69tLeHC.js → setup-a4B72xJ8.js} +290 -28
  64. package/dist/skills/superwall/SKILL.md +37 -10
  65. package/dist/skills/superwall/references/api.md +66 -21
  66. package/dist/skills/superwall/references/asa.md +109 -64
  67. package/dist/skills/superwall/references/dashboard-links.md +65 -28
  68. package/dist/skills/superwall/references/data-analytics.md +1 -1
  69. package/dist/skills/superwall/workflows/dashboard/setup.md +15 -5
  70. package/dist/skills/superwall/workflows/integrate/flutter.md +9 -7
  71. package/dist/skills/superwall-artifacts/SKILL.md +7 -2
  72. package/dist/skills/superwall-artifacts/references/cli.md +4 -1
  73. package/dist/skills/superwall-framework/SKILL.md +197 -14
  74. package/dist/skills/superwall-framework/references/cli.md +98 -7
  75. package/dist/skills/superwall-framework/references/examples.md +2 -2
  76. package/dist/skills/superwall-framework/references/migrate-from-editor.md +5 -0
  77. package/dist/skills/superwall-framework/references/migrate-from-native.md +5 -0
  78. package/dist/{skills-421SFEyF.js → skills-BB1uIt8t.js} +139 -9
  79. package/dist/{skills-CdKwaTRS.js → skills-SnxFa2in.js} +8 -12
  80. package/dist/source-DQs6iLtC.js +82 -0
  81. package/dist/{source-push-B4s6r9bB.js → source-push-w7miTr6m.js} +38 -14
  82. package/dist/{spinner-DPdBlZe2.js → spinner-BQp7fQvK.js} +7 -5
  83. package/dist/{starter-0OdVPH4l.js → starter-BlJ_InZJ.js} +16 -6
  84. package/dist/{status-Dsc7d3z2.js → status-DxsIw9zq.js} +9 -11
  85. package/dist/{output-Ggzq5_-t.js → storage-BR6imSqm.js} +40 -1
  86. package/dist/storekit-BqyujKQ_.js +203 -0
  87. package/dist/storekit-ELVCMF0X.js +15 -0
  88. package/dist/{bind-ClFjTt0U.js → theme-Ed0gz6hr.js} +29 -6
  89. package/dist/token-CWQ6tdva.js +100 -0
  90. package/dist/tools-skills/animate-onboarding/SKILL.md +1 -1
  91. package/dist/tools-skills/mobile-design/SKILL.md +1 -1
  92. package/dist/tools-skills/onboarding-questions/SKILL.md +1 -1
  93. package/dist/tools-skills/superwall/SKILL.md +43 -17
  94. package/dist/tools-skills/superwall/references/api.md +74 -24
  95. package/dist/tools-skills/superwall/references/asa.md +109 -64
  96. package/dist/tools-skills/superwall/references/dashboard-links.md +65 -28
  97. package/dist/tools-skills/superwall/references/data-analytics.md +1 -1
  98. package/dist/tools-skills/superwall/workflows/dashboard/playbook.md +4 -3
  99. package/dist/tools-skills/superwall/workflows/dashboard/setup.md +21 -8
  100. package/dist/tools-skills/superwall/workflows/integrate/flutter.md +9 -7
  101. package/dist/tools-skills/superwall/workflows/migrate/adapty.md +4 -3
  102. package/dist/tools-skills/superwall/workflows/migrate/playbook.md +2 -2
  103. package/dist/tools-skills/superwall/workflows/migrate/qonversion.md +4 -3
  104. package/dist/tools-skills/superwall/workflows/migrate/revenuecat.md +4 -3
  105. package/dist/tools-skills/superwall-editor/SKILL.md +2 -3
  106. package/dist/tools.d.ts +6 -1
  107. package/dist/tools.js +1290 -747
  108. package/dist/{try-B8FYkTvQ.js → try-C3HW3hPZ.js} +20 -22
  109. package/dist/{lock-DgSx-p8Y.js → types-Dc9U_4kp.js} +86 -80
  110. package/dist/upgrade-Cw9jVt-r.js +348 -0
  111. package/dist/upgrade-DVsonzDF.js +27 -0
  112. package/package.json +11 -3
  113. package/dist/client-CyrYJzBF.js +0 -180
  114. package/dist/config-CGcG7GOt.js +0 -113
  115. package/dist/create-7HDW3DCl.js +0 -20
  116. package/dist/existing-Cl5x6_5u.js +0 -97
  117. package/dist/held-Chw3BtBV.js +0 -17
  118. package/dist/log-C0MDCfA2.js +0 -62
  119. package/dist/login-DZ8Pipf6.js +0 -17
  120. package/dist/pull-C1xm2zqG.js +0 -36
  121. package/dist/push-B42D8fKf.js +0 -22
  122. package/dist/push-Co5jk6Kr.js +0 -30
  123. package/dist/run-c1O2_8pp.js +0 -100
  124. package/dist/scan-D86kLtM7.js +0 -4
  125. package/dist/screenshot-file-XAS0Xy0e.js +0 -16
  126. package/dist/server-BEcsQaPu.js +0 -29
  127. package/dist/session-Csuaw6RU.js +0 -6
  128. package/dist/setup-C6NFy14d.js +0 -217
  129. package/dist/spawn-DmmmHIP-.js +0 -71
  130. package/dist/storage-DT_wxwJ8.js +0 -41
  131. package/dist/storekit-B9M2raxe.js +0 -47
  132. package/dist/storekit-BWZf-fNE.js +0 -17
  133. package/dist/telemetry-ovPiseFm.js +0 -56
  134. package/dist/theme-DUsCh-Vd.js +0 -25
  135. package/dist/token-Bu3FaRkv.js +0 -70
  136. package/dist/upgrade-B7TmvEPP.js +0 -206
  137. package/dist/upgrade-CAHyrWUL.js +0 -7
  138. /package/dist/{browser-Bp3yRKlU.js → browser-BVjaf98V.js} +0 -0
  139. /package/dist/{client-BJQXl62Q.js → client-BwYhzITp.js} +0 -0
  140. /package/dist/{design-lint-CiFc78aM.js → design-lint-mgO-2SGS.js} +0 -0
  141. /package/dist/{devtools-ByZ6XYnn.js → devtools-B6Vp6HMy.js} +0 -0
  142. /package/dist/{input-MDd67UIp.js → input-DOT_2Zvb.js} +0 -0
  143. /package/dist/{project-NoMtbMyl.js → project-BomArwSj.js} +0 -0
  144. /package/dist/{reports-HYVp169R.js → reports-hbxsd3Zo.js} +0 -0
  145. /package/dist/{storage-Bdz5AmqS.d.ts → storage-Bh3wT1Rn.d.ts} +0 -0
  146. /package/dist/{timing-Ca0TXY-A.js → timing-BKEEIBij.js} +0 -0
  147. /package/dist/{ui-D_qf3Gvw.js → ui-hFgji1e8.js} +0 -0
@@ -1,180 +0,0 @@
1
- import { n as resolveAuthToken, r as NotLoggedInError } from "./token-Bu3FaRkv.js";
2
- import { b as USER_AGENT } from "./environment-BocmdvZ-.js";
3
- import { a as resolveApiHost, n as readSession } from "./storage-DT_wxwJ8.js";
4
-
5
- //#region src/core/api/client.ts
6
- const BODY_SNIPPET = 200;
7
- function parseErrorEnvelope(body) {
8
- let parsed;
9
- try {
10
- parsed = JSON.parse(body);
11
- } catch {
12
- return;
13
- }
14
- if (typeof parsed !== "object" || parsed === null) return void 0;
15
- const text = (key) => {
16
- const value = Reflect.get(parsed, key);
17
- return typeof value === "string" && value !== "" ? value : void 0;
18
- };
19
- const message = text("message");
20
- if (message === void 0) return void 0;
21
- return {
22
- message,
23
- detail: {
24
- type: text("type"),
25
- code: text("code"),
26
- param: text("param"),
27
- docUrl: text("doc_url"),
28
- resourceType: text("resource_type"),
29
- resourceId: text("resource_id")
30
- }
31
- };
32
- }
33
- var ApiError = class extends Error {
34
- detail;
35
- request;
36
- envelope;
37
- hint;
38
- constructor(request, status, body) {
39
- const envelope = body === void 0 ? void 0 : parseErrorEnvelope(body);
40
- const snippet = body?.trim().slice(0, BODY_SNIPPET);
41
- super(envelope?.message ?? (snippet ? `HTTP ${status} — ${snippet}` : `HTTP ${status}`));
42
- this.status = status;
43
- this.body = body;
44
- this.detail = envelope?.detail ?? {};
45
- this.request = request;
46
- this.envelope = envelope !== void 0;
47
- }
48
- };
49
- var ApiUnreachableError = class extends Error {
50
- constructor(host, cause) {
51
- const local = /^https?:\/\/(localhost|127\.0\.0\.1|\[::1\])/.test(host);
52
- super(`Couldn't reach the Superwall API at ${host}.\n` + (local ? " That's a local address — start the API, or unset SUPERWALL_API_HOST to use production." : " Check your network or proxy, then try again."));
53
- this.name = "ApiUnreachableError";
54
- this.cause = cause;
55
- }
56
- };
57
- const PAGE_LIMIT = 50;
58
- const GET_RETRIES = 3;
59
- const RETRYABLE = new Set([
60
- 429,
61
- 502,
62
- 503,
63
- 504
64
- ]);
65
- async function parseApiError(request, res) {
66
- const text = await res.text().catch(() => "");
67
- return new ApiError(request, res.status, text);
68
- }
69
- const namesUserAgent = (headers) => Object.keys(headers ?? {}).some((name) => name.toLowerCase() === "user-agent");
70
- function retryDelay(res, retry) {
71
- const after = Number(res.headers.get("retry-after"));
72
- if (Number.isFinite(after) && after >= 0 && res.headers.has("retry-after")) return after * 1e3;
73
- return 400 * 2 ** retry;
74
- }
75
- const createSuperwallApi = (initial, { userAgent = USER_AGENT() } = {}) => {
76
- let session = initial;
77
- const host = () => resolveApiHost(session);
78
- const send = async (url, init) => {
79
- try {
80
- return await fetch(url, init);
81
- } catch (error) {
82
- throw new ApiUnreachableError(host(), error);
83
- }
84
- };
85
- const authorized = async () => {
86
- const resolved = await resolveAuthToken(session);
87
- session = resolved.session;
88
- return resolved.token;
89
- };
90
- const request = async (method, path, body, options = {}) => {
91
- const token = await authorized();
92
- const attempt = () => {
93
- return send(`${host()}${path}`, {
94
- method,
95
- headers: {
96
- ...namesUserAgent(options.headers) ? {} : { "user-agent": userAgent },
97
- ...options.headers,
98
- authorization: `Bearer ${token}`,
99
- accept: "application/json",
100
- ...body !== void 0 ? { "content-type": "application/json" } : {}
101
- },
102
- ...body !== void 0 ? { body: JSON.stringify(body) } : {}
103
- });
104
- };
105
- let res = await attempt();
106
- for (let retry = 0; method === "GET" && RETRYABLE.has(res.status) && retry < GET_RETRIES; retry++) {
107
- await new Promise((done) => setTimeout(done, retryDelay(res, retry)));
108
- res = await attempt();
109
- }
110
- if (!res.ok) throw await parseApiError(`${method} ${path}`, res);
111
- if (res.status === 204) return void 0;
112
- return await res.json();
113
- };
114
- const api = {
115
- org: {},
116
- get userEmail() {
117
- return session.userEmail;
118
- },
119
- get host() {
120
- return host();
121
- },
122
- forOrg: (id) => ({
123
- ...api,
124
- org: { id },
125
- forOrg: api.forOrg
126
- }),
127
- get: (path, options) => request("GET", path, void 0, options),
128
- post: (path, body, options) => request("POST", path, body, options),
129
- put: (path, body, options) => request("PUT", path, body, options),
130
- patch: (path, body, options) => request("PATCH", path, body, options),
131
- del: (path, options) => request("DELETE", path, void 0, options),
132
- async postText(path, body) {
133
- const token = await authorized();
134
- const res = await send(`${host()}${path}`, {
135
- method: "POST",
136
- headers: {
137
- authorization: `Bearer ${token}`,
138
- "user-agent": userAgent,
139
- accept: "text/plain",
140
- "content-type": "text/plain; charset=utf-8"
141
- },
142
- body
143
- });
144
- if (!res.ok) throw await parseApiError(`POST ${path}`, res);
145
- return res.text();
146
- },
147
- async list(path) {
148
- const out = [];
149
- let after;
150
- for (let page = 0; page < PAGE_LIMIT; page++) {
151
- const url = `${path}${path.includes("?") ? "&" : "?"}limit=100${after ? `&starting_after=${after}` : ""}`;
152
- const batch = await api.get(url);
153
- out.push(...batch.data);
154
- if (!batch.has_more || batch.data.length === 0) break;
155
- const last = batch.data.at(-1);
156
- if (typeof last !== "object" || last === null || !("id" in last) || last.id == null) break;
157
- after = String(last.id);
158
- }
159
- return out;
160
- }
161
- };
162
- return api;
163
- };
164
- const superwallApi = () => {
165
- const session = readSession();
166
- if (!session) throw new NotLoggedInError();
167
- return createSuperwallApi(session);
168
- };
169
- function withQuery(path, qs) {
170
- const params = qs instanceof URLSearchParams ? qs : new URLSearchParams();
171
- if (!(qs instanceof URLSearchParams)) for (const [key, value] of Object.entries(qs)) {
172
- if (typeof value === "object" && value !== null) throw new Error(`Nested -d params aren't supported on GET/DELETE (got "${key}").`);
173
- params.set(key, String(value));
174
- }
175
- const s = params.toString();
176
- return s ? `${path}${path.includes("?") ? "&" : "?"}${s}` : path;
177
- }
178
-
179
- //#endregion
180
- export { withQuery as a, superwallApi as i, ApiUnreachableError as n, createSuperwallApi as r, ApiError as t };
@@ -1,113 +0,0 @@
1
- import { l as readJson, r as formatJson, u as state } from "./output-Ggzq5_-t.js";
2
-
3
- //#region src/core/state/config.ts
4
- const FILE = "config.json";
5
- function read() {
6
- return readJson(state(), FILE) ?? {};
7
- }
8
- function write(config) {
9
- state().write(FILE, `${formatJson(config)}\n`);
10
- }
11
- function readDefaultApp(projectId) {
12
- return read().defaultApp?.[projectId];
13
- }
14
- function writeDefaultApp(projectId, applicationId) {
15
- const config = read();
16
- config.defaultApp = {
17
- ...config.defaultApp ?? {},
18
- [projectId]: applicationId
19
- };
20
- write(config);
21
- }
22
- function readOpenedOrgs() {
23
- return read().openedOrgs ?? [];
24
- }
25
- function writeOpenedOrgs(ids) {
26
- const config = read();
27
- const next = [...new Set(ids)];
28
- if (next.join() === (config.openedOrgs ?? []).join()) return;
29
- config.openedOrgs = next;
30
- write(config);
31
- }
32
- function readSkillsSync() {
33
- return read().skillsSync;
34
- }
35
- function writeSkillsSync(sync) {
36
- const config = read();
37
- config.skillsSync = sync;
38
- write(config);
39
- }
40
- function readAnonymousId() {
41
- const config = read();
42
- if (config.telemetry?.anonymousId) return config.telemetry.anonymousId;
43
- const anonymousId = crypto.randomUUID();
44
- config.telemetry = {
45
- ...config.telemetry,
46
- anonymousId
47
- };
48
- write(config);
49
- return anonymousId;
50
- }
51
- function readOnboardedOrg() {
52
- return read().onboarded?.org;
53
- }
54
- function writeOnboardedOrg(org) {
55
- const config = read();
56
- config.onboarded = {
57
- ...config.onboarded,
58
- org
59
- };
60
- write(config);
61
- }
62
- function readOnboardedApp(appPath) {
63
- return read().onboarded?.apps?.[appPath];
64
- }
65
- function writeOnboardedApp(appPath, app) {
66
- const config = read();
67
- config.onboarded = {
68
- ...config.onboarded,
69
- apps: {
70
- ...config.onboarded?.apps,
71
- [appPath]: app
72
- }
73
- };
74
- write(config);
75
- }
76
- function readUpdateCheck() {
77
- return read().updateCheck;
78
- }
79
- function writeUpdateCheck(check) {
80
- const config = read();
81
- config.updateCheck = check;
82
- write(config);
83
- }
84
- function readAutoUpdate() {
85
- return read().autoUpdate;
86
- }
87
- function writeAutoUpdate(update) {
88
- const config = read();
89
- config.autoUpdate = update;
90
- write(config);
91
- }
92
- function readOnboardingIdempotencyKey() {
93
- const config = read();
94
- if (config.onboardingIdempotencyKey) return config.onboardingIdempotencyKey;
95
- const key = crypto.randomUUID();
96
- config.onboardingIdempotencyKey = key;
97
- write(config);
98
- return key;
99
- }
100
- function telemetryNoticeShown() {
101
- return Boolean(read().telemetry?.noticeShown);
102
- }
103
- function writeTelemetryNoticeShown() {
104
- const config = read();
105
- config.telemetry = {
106
- ...config.telemetry,
107
- noticeShown: true
108
- };
109
- write(config);
110
- }
111
-
112
- //#endregion
113
- export { writeTelemetryNoticeShown as _, readOnboardedOrg as a, readSkillsSync as c, writeAutoUpdate as d, writeDefaultApp as f, writeSkillsSync as g, writeOpenedOrgs as h, readOnboardedApp as i, readUpdateCheck as l, writeOnboardedOrg as m, readAutoUpdate as n, readOnboardingIdempotencyKey as o, writeOnboardedApp as p, readDefaultApp as r, readOpenedOrgs as s, readAnonymousId as t, telemetryNoticeShown as u, writeUpdateCheck as v };
@@ -1,20 +0,0 @@
1
- import "./token-Bu3FaRkv.js";
2
- import "./output-Ggzq5_-t.js";
3
- import "./environment-BocmdvZ-.js";
4
- import "./storage-DT_wxwJ8.js";
5
- import "./client-CyrYJzBF.js";
6
- import "./held-Bykbwy-m.js";
7
- import "./config-CGcG7GOt.js";
8
- import "./spinner-DPdBlZe2.js";
9
- import "./ui-D_qf3Gvw.js";
10
- import "./paths-CzTJVpfi.js";
11
- import "./orgs-Z0H9WOs1.js";
12
- import "./resources-CptT7HD6.js";
13
- import "./org-Dud1rF9f.js";
14
- import "./lookup-CWzVfPpq.js";
15
- import "./scope-l1qGLsgz.js";
16
- import "./client-BJQXl62Q.js";
17
- import "./timing-Ca0TXY-A.js";
18
- import { i as runAscKeysCreate, n as keyAccess, r as keyRole, t as createAndSaveKey } from "./create-BCIgjRHn.js";
19
-
20
- export { createAndSaveKey, keyAccess, keyRole, runAscKeysCreate };
@@ -1,97 +0,0 @@
1
- import { h as Integration } from "./environment-BocmdvZ-.js";
2
- import { i as readPackageJson, r as allDeps } from "./scan-nVQO7JLx.js";
3
- import { readFileSync } from "node:fs";
4
- import fg from "fast-glob";
5
-
6
- //#region src/core/codebase/existing.ts
7
- const JS_SDK_PACKAGES = {
8
- [Integration.expo]: ["expo-superwall"],
9
- [Integration.reactNative]: ["@superwall/react-native-superwall", "react-native-superwall"],
10
- [Integration.web]: ["@superwall/web", "superwall-js"]
11
- };
12
- const PK_RE = /pk_[A-Za-z0-9._-]{6,}/;
13
- const CONFIGURE_RE = /Superwall\.(shared\.)?configure|configureSuperwall|SuperwallProvider|\.configure\(\s*apiKey/;
14
- const SDK_REF_RE = /Superwall-iOS|SuperwallKit|superwallkit_flutter|expo-superwall|superwall/i;
15
- const SOURCE_GLOBS = [
16
- "**/*.{swift,ts,tsx,js,jsx,kt,dart}",
17
- "**/.env*",
18
- "**/*.xcconfig"
19
- ];
20
- const IGNORE = [
21
- "**/node_modules/**",
22
- "**/.git/**",
23
- "**/Pods/**",
24
- "**/build/**",
25
- "**/.build/**",
26
- "**/DerivedData/**",
27
- "**/dist/**",
28
- "**/.next/**"
29
- ];
30
- const MAX_FILES = 600;
31
- function sdkInstalledFor(app) {
32
- const jsPkgs = JS_SDK_PACKAGES[app.integration];
33
- if (jsPkgs) {
34
- const deps = allDeps(readPackageJson(app.path));
35
- if (jsPkgs.some((p) => p in deps)) return true;
36
- }
37
- const manifests = fg.sync([
38
- "**/Package.resolved",
39
- "**/project.pbxproj",
40
- "**/Podfile",
41
- "**/pubspec.yaml",
42
- "**/pubspec.lock",
43
- "**/build.gradle",
44
- "**/build.gradle.kts",
45
- "**/libs.versions.toml"
46
- ], {
47
- cwd: app.path,
48
- ignore: IGNORE,
49
- absolute: true,
50
- deep: 5
51
- });
52
- for (const f of manifests) {
53
- let content;
54
- try {
55
- content = readFileSync(f, "utf8");
56
- } catch {
57
- continue;
58
- }
59
- if (SDK_REF_RE.test(content)) return true;
60
- }
61
- return false;
62
- }
63
- function detectExisting(app) {
64
- const sdkInstalled = sdkInstalledFor(app);
65
- let configureFound = false;
66
- let apiKey;
67
- const files = fg.sync(SOURCE_GLOBS, {
68
- cwd: app.path,
69
- ignore: IGNORE,
70
- absolute: true,
71
- deep: 6,
72
- dot: true
73
- });
74
- for (const f of files.slice(0, MAX_FILES)) {
75
- let content;
76
- try {
77
- content = readFileSync(f, "utf8");
78
- } catch {
79
- continue;
80
- }
81
- if (!configureFound && CONFIGURE_RE.test(content)) configureFound = true;
82
- if (!apiKey) {
83
- const m = content.match(PK_RE);
84
- if (m) apiKey = m[0];
85
- }
86
- if (configureFound && apiKey) break;
87
- }
88
- return {
89
- sdkInstalled,
90
- configureFound,
91
- apiKey,
92
- fullyIntegrated: sdkInstalled && configureFound
93
- };
94
- }
95
-
96
- //#endregion
97
- export { detectExisting as t };
@@ -1,17 +0,0 @@
1
- import "./token-Bu3FaRkv.js";
2
- import "./output-Ggzq5_-t.js";
3
- import "./environment-BocmdvZ-.js";
4
- import "./storage-DT_wxwJ8.js";
5
- import "./client-CyrYJzBF.js";
6
- import { t as upsertHeldKey } from "./held-Bykbwy-m.js";
7
- import "./config-CGcG7GOt.js";
8
- import "./spinner-DPdBlZe2.js";
9
- import "./ui-D_qf3Gvw.js";
10
- import "./orgs-Z0H9WOs1.js";
11
- import "./resources-CptT7HD6.js";
12
- import "./org-Dud1rF9f.js";
13
- import "./lookup-CWzVfPpq.js";
14
- import "./scope-l1qGLsgz.js";
15
- import "./client-BJQXl62Q.js";
16
-
17
- export { upsertHeldKey };
@@ -1,62 +0,0 @@
1
- import { n as fg, t as THEME } from "./theme-DUsCh-Vd.js";
2
- import { pathToFileURL } from "node:url";
3
- import pc from "picocolors";
4
- import { link } from "ansi-escapes";
5
- import wrapAnsi from "wrap-ansi";
6
-
7
- //#region src/ui/log.ts
8
- function brand(text) {
9
- return fg(THEME.primary, text);
10
- }
11
- function stripReport(raw) {
12
- const lines = raw.replace(/\r/g, "").split("\n").filter((l) => !/^\s*\[STATUS\]/i.test(l));
13
- while (lines[0]?.trim() === "") lines.shift();
14
- while (lines.at(-1)?.trim() === "") lines.pop();
15
- return lines.join("\n");
16
- }
17
- function styleMarkdown(text) {
18
- return text.split("\n").map((line) => styleMarkdownLine(line)).join("\n");
19
- }
20
- function styleMarkdownLine(line, opts = {}) {
21
- const heading = line.match(/^\s*(#{1,6})\s+(.*)$/)?.[2];
22
- if (heading !== void 0) return brand(pc.bold(styleInline(heading, opts.hyperlinks ?? false)));
23
- return styleInline(line, opts.hyperlinks ?? false);
24
- }
25
- function wrapReportLine(line, columns) {
26
- const prefix = line.match(/^(\s*(?:(?:[-*+])|(?:\d+[.)]))\s+)/)?.[1] ?? "";
27
- const content = prefix ? line.slice(prefix.length) : line;
28
- const width = Math.max(12, columns - prefix.length);
29
- return wrapAnsi(styleMarkdownLine(content, { hyperlinks: true }), width, {
30
- hard: true,
31
- trim: false
32
- }).split("\n").map((part, index) => `${index === 0 ? prefix : " ".repeat(prefix.length)}${part}`);
33
- }
34
- function styleInline(line, hyperlinks) {
35
- const re = /\[([^\]]+)]\(([^)]+)\)|\*\*(.+?)\*\*|`([^`]+)`|(https?:\/\/[^\s]+)/g;
36
- let out = "";
37
- let last = 0;
38
- let match;
39
- while (match = re.exec(line)) {
40
- out += line.slice(last, match.index);
41
- if (match[1] != null && match[2] != null) {
42
- const label = match[1];
43
- const target = match[2];
44
- out += hyperlinks ? link(brand(pc.underline(label)), terminalLinkTarget(target)) : `${label} (${target})`;
45
- } else if (match[3] != null) out += pc.bold(match[3]);
46
- else if (match[4] != null) out += brand(match[4]);
47
- else if (match[5] != null) out += hyperlinks ? link(brand(pc.underline(match[5])), match[5]) : match[5];
48
- last = re.lastIndex;
49
- }
50
- out += line.slice(last);
51
- return out;
52
- }
53
- function terminalLinkTarget(target) {
54
- const local = target.match(/^(\/.*?)(?::(\d+))?$/);
55
- const file = local?.[1];
56
- if (file === void 0) return target;
57
- const url = pathToFileURL(file).href;
58
- return local?.[2] ? `${url}#L${local[2]}` : url;
59
- }
60
-
61
- //#endregion
62
- export { styleMarkdown as n, wrapReportLine as r, stripReport as t };
@@ -1,17 +0,0 @@
1
- import "./token-Bu3FaRkv.js";
2
- import "./output-Ggzq5_-t.js";
3
- import "./environment-BocmdvZ-.js";
4
- import "./storage-DT_wxwJ8.js";
5
- import "./client-CyrYJzBF.js";
6
- import "./config-CGcG7GOt.js";
7
- import "./telemetry-ovPiseFm.js";
8
- import "./spawn-DmmmHIP-.js";
9
- import "./spinner-DPdBlZe2.js";
10
- import "./ui-D_qf3Gvw.js";
11
- import "./scan-nVQO7JLx.js";
12
- import "./paths-CzTJVpfi.js";
13
- import { i as startLogin, n as pollLogin, r as runLogin, t as performLogin } from "./login-5sWIKDI2.js";
14
- import "./skills-421SFEyF.js";
15
- import "./browser-Bp3yRKlU.js";
16
-
17
- export { performLogin, pollLogin, runLogin, startLogin };
@@ -1,36 +0,0 @@
1
- import "./token-Bu3FaRkv.js";
2
- import "./output-Ggzq5_-t.js";
3
- import "./environment-BocmdvZ-.js";
4
- import "./storage-DT_wxwJ8.js";
5
- import "./client-CyrYJzBF.js";
6
- import "./config-CGcG7GOt.js";
7
- import "./telemetry-ovPiseFm.js";
8
- import "./spawn-DmmmHIP-.js";
9
- import "./spinner-DPdBlZe2.js";
10
- import "./ui-D_qf3Gvw.js";
11
- import "./theme-DUsCh-Vd.js";
12
- import "./log-C0MDCfA2.js";
13
- import "./scan-nVQO7JLx.js";
14
- import "./existing-Cl5x6_5u.js";
15
- import "./paths-CzTJVpfi.js";
16
- import "./orgs-Z0H9WOs1.js";
17
- import "./resources-CptT7HD6.js";
18
- import "./org-Dud1rF9f.js";
19
- import "./lookup-CWzVfPpq.js";
20
- import "./bind-ClFjTt0U.js";
21
- import "./login-5sWIKDI2.js";
22
- import "./skills-421SFEyF.js";
23
- import "./browser-Bp3yRKlU.js";
24
- import "./lock-DgSx-p8Y.js";
25
- import "./scope-ehZ7L1nj.js";
26
- import "./base-ChTi42M0.js";
27
- import "./framework-CLmf4swr.js";
28
- import "./run-c1O2_8pp.js";
29
- import "./drivers-BQkO5tHs.js";
30
- import "./migration-Z69tLeHC.js";
31
- import "./login-Jp6E6d2e.js";
32
- import "./source-BccdO4aL.js";
33
- import "./setup-C6NFy14d.js";
34
- import { a as cloneInto, c as pullInto, i as boundPaywall, l as runPull, n as applyPulledChanges, o as cloneTarget, r as appsToPull, s as mergePulledLock, t as PullPathError } from "./pull-AoUmaiMK.js";
35
-
36
- export { PullPathError, applyPulledChanges, appsToPull, boundPaywall, cloneInto, cloneTarget, mergePulledLock, pullInto, runPull };
@@ -1,22 +0,0 @@
1
- import "./token-Bu3FaRkv.js";
2
- import "./output-Ggzq5_-t.js";
3
- import "./environment-BocmdvZ-.js";
4
- import "./storage-DT_wxwJ8.js";
5
- import "./client-CyrYJzBF.js";
6
- import "./config-CGcG7GOt.js";
7
- import "./spinner-DPdBlZe2.js";
8
- import "./ui-D_qf3Gvw.js";
9
- import "./orgs-Z0H9WOs1.js";
10
- import "./resources-CptT7HD6.js";
11
- import "./lookup-CWzVfPpq.js";
12
- import "./resolve-DpOSDDdr.js";
13
- import "./project-NoMtbMyl.js";
14
- import "./lock-DgSx-p8Y.js";
15
- import "./scope-ehZ7L1nj.js";
16
- import "./organization-7vJA3uy1.js";
17
- import "./download-DhGd4hOB.js";
18
- import "./sdk-DEfQttek.js";
19
- import "./source-BccdO4aL.js";
20
- import { a as toSourceAccess, i as slugOfName, n as namesOf, o as waitForBuild, r as runArtifactPush, t as IncomingCommitsRefused } from "./push-BrzMFd4Z.js";
21
-
22
- export { IncomingCommitsRefused, namesOf, runArtifactPush, slugOfName, toSourceAccess, waitForBuild };
@@ -1,30 +0,0 @@
1
- import "./token-Bu3FaRkv.js";
2
- import "./output-Ggzq5_-t.js";
3
- import "./environment-BocmdvZ-.js";
4
- import "./storage-DT_wxwJ8.js";
5
- import "./client-CyrYJzBF.js";
6
- import "./config-CGcG7GOt.js";
7
- import "./telemetry-ovPiseFm.js";
8
- import "./spawn-DmmmHIP-.js";
9
- import "./spinner-DPdBlZe2.js";
10
- import "./ui-D_qf3Gvw.js";
11
- import "./scan-nVQO7JLx.js";
12
- import "./paths-CzTJVpfi.js";
13
- import "./orgs-Z0H9WOs1.js";
14
- import "./resources-CptT7HD6.js";
15
- import "./lookup-CWzVfPpq.js";
16
- import "./login-5sWIKDI2.js";
17
- import "./skills-421SFEyF.js";
18
- import "./browser-Bp3yRKlU.js";
19
- import "./lock-DgSx-p8Y.js";
20
- import "./scope-ehZ7L1nj.js";
21
- import "./base-ChTi42M0.js";
22
- import "./framework-CLmf4swr.js";
23
- import "./login-Jp6E6d2e.js";
24
- import "./source-BccdO4aL.js";
25
- import "./assets-B_quADds.js";
26
- import "./design-lint-CiFc78aM.js";
27
- import "./source-push-B4s6r9bB.js";
28
- import { i as timed, n as runPush, r as runPushPipeline, t as group } from "./push-BMblzg_6.js";
29
-
30
- export { group, runPush, runPushPipeline, timed };