@superwall/cli 1.1.1 → 1.3.0-beta.3
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 +37 -4
- package/dist/{actions-I5gVO5jN.js → actions-DvHycH3X.js} +2 -2
- package/dist/{api-emImQnVy.js → api-B50i89j0.js} +9 -9
- package/dist/{api-output-B5hh0q4V.js → api-output-D9ggXQIr.js} +1 -1
- package/dist/{app-DE9lxNNV.js → app-FiC9SQVp.js} +11 -11
- package/dist/asa-B5hrBL3t.js +1194 -0
- package/dist/{asc-DYc_Yo9e.js → asc-CRtRYv17.js} +13 -13
- package/dist/{auth-Bir_Un8l.js → auth-CYognaF4.js} +10 -10
- package/dist/auth.js +2 -2
- package/dist/{billing-CW0diI2X.js → billing-CSOUhWso.js} +1 -1
- package/dist/{bind-DO11eXrR.js → bind-BbzBenoP.js} +4 -4
- package/dist/{command-CmJMNVVz.js → command-B7Te31wp.js} +96 -101
- package/dist/{create-CwDgWW16.js → create--Q8nPgoa.js} +18 -18
- package/dist/{dev-OnmMOsgK.js → dev-Dr6gXH-o.js} +37 -19
- package/dist/{doctor-CpYkDfdC.js → doctor-Cf0qNjbq.js} +10 -10
- package/dist/{drivers-Cweb9bWA.js → drivers-ItOmKzrw.js} +2 -2
- package/dist/entry.js +531 -279
- package/dist/{existing-p-hX-Nxc.js → existing-B-e22WOr.js} +2 -2
- package/dist/{feedback-CV4JnRuk.js → feedback-C3UtAxye.js} +9 -9
- package/dist/{git-BrTxQ7ui.js → git-2wRxiwOc.js} +10 -10
- package/dist/{hosted-CbNJSJAC.js → hosted-vk05ZF6w.js} +3 -3
- package/dist/{integrate-DOLvHr1D.js → integrate-Cv8r_i2l.js} +30 -29
- package/dist/{login-B7fSpJKc.js → login-DOES7Kup.js} +8 -7
- package/dist/{migrate-Bn5btm_H.js → migrate-C7R29RPH.js} +20 -20
- package/dist/{org-B2gy9Pmu.js → org-Cg25bcsj.js} +3 -3
- package/dist/output-D2Ax_hHL.js +123 -0
- package/dist/{params-Bvq0iqQK.js → params-B1zeElGa.js} +1 -2
- package/dist/{pipeline-COr4sB6U.js → pipeline-BVeUA6Ig.js} +106 -173
- package/dist/{print-skill-D0j2D6tw.js → print-skill-D-R81bno.js} +7 -7
- package/dist/{promote-UmKZySRx.js → promote-CV_Lsmqd.js} +18 -18
- package/dist/publish-CSnNvHHi.js +35 -0
- package/dist/push-sjnRI6iL.js +35 -0
- package/dist/{query-CbGfXmKu.js → query-CdcWSinl.js} +10 -10
- package/dist/{resource-m6yz1jwE.js → resource-PVg0uzSK.js} +14 -14
- package/dist/{resources-CVrWwA1K.js → resources-s64mBHaC.js} +1 -0
- package/dist/{run-BTLaOoKK.js → run-XIkrFIgw.js} +2 -2
- package/dist/{scan-BfoeYW1v.js → scan-Dk0ZlCY6.js} +2 -2
- package/dist/{skills-HlIKA9xR.js → skills-B-mR2CqM.js} +4 -3
- package/dist/{skills-C4Yzl64N.js → skills-CoEIW0mE.js} +8 -8
- package/dist/{spinner-gOxIMz-V.js → spinner-B9dT3DBY.js} +1 -1
- package/dist/{telemetry-CLi7mjDP.js → telemetry-yJs7t0rt.js} +6 -41
- package/dist/{token-DHRH8cxi.js → token-GcbyH6G8.js} +2 -2
- package/dist/{ui-C4ncRJqd.js → ui-Lqt_zFOr.js} +5 -1
- package/dist/update-B4hoLAN-.js +59 -0
- package/dist/{upgrade-Cbh-7q_o.js → upgrade-ByCYDXgb.js} +6 -6
- package/package.json +4 -3
- package/dist/json-C3hPIMkI.js +0 -7
- package/dist/publish-BVnG2UOU.js +0 -35
- package/dist/push-hHtVTZ1m.js +0 -35
- package/dist/update-CxP4fmMe.js +0 -137
- /package/dist/{asc-products-YQ6Oc6YO.js → asc-products-C6MvSy8H.js} +0 -0
- /package/dist/{storekit-Ddvs4Ynw.js → storekit-DPonXSwe.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as allDeps, r as readPackageJson } from "./scan-
|
|
1
|
+
import { d as Integration } from "./output-D2Ax_hHL.js";
|
|
2
|
+
import { n as allDeps, r as readPackageJson } from "./scan-Dk0ZlCY6.js";
|
|
3
3
|
import { readFileSync } from "node:fs";
|
|
4
4
|
import fg from "fast-glob";
|
|
5
5
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
import "./update-
|
|
4
|
-
import { i as loadSession } from "./token-
|
|
5
|
-
import { t as defineCommand } from "./command-
|
|
6
|
-
import "./ui-
|
|
1
|
+
import { g as VERSION, h as TELEMETRY_KEY, m as TELEMETRY_HOST } from "./output-D2Ax_hHL.js";
|
|
2
|
+
import { a as getAnonymousId } from "./telemetry-yJs7t0rt.js";
|
|
3
|
+
import "./update-B4hoLAN-.js";
|
|
4
|
+
import { i as loadSession } from "./token-GcbyH6G8.js";
|
|
5
|
+
import { t as defineCommand } from "./command-B7Te31wp.js";
|
|
6
|
+
import "./ui-Lqt_zFOr.js";
|
|
7
7
|
|
|
8
8
|
//#region src/core/feedback.ts
|
|
9
9
|
function buildFeedbackEvent(message, via, distinctId, session) {
|
|
10
10
|
return {
|
|
11
|
-
api_key: TELEMETRY_KEY,
|
|
11
|
+
api_key: TELEMETRY_KEY(),
|
|
12
12
|
event: "feedback submitted",
|
|
13
13
|
distinct_id: distinctId,
|
|
14
14
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -25,10 +25,10 @@ function buildFeedbackEvent(message, via, distinctId, session) {
|
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
async function submitFeedback(message, via) {
|
|
28
|
-
if (!TELEMETRY_KEY) return false;
|
|
28
|
+
if (!TELEMETRY_KEY()) return false;
|
|
29
29
|
const payload = buildFeedbackEvent(message, via, getAnonymousId(), loadSession());
|
|
30
30
|
try {
|
|
31
|
-
return (await fetch(`${TELEMETRY_HOST}/capture/`, {
|
|
31
|
+
return (await fetch(`${TELEMETRY_HOST()}/capture/`, {
|
|
32
32
|
method: "POST",
|
|
33
33
|
headers: { "content-type": "application/json" },
|
|
34
34
|
body: JSON.stringify(payload),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as loadSession } from "./token-
|
|
3
|
-
import { r as
|
|
4
|
-
import { n as ui } from "./ui-
|
|
5
|
-
import { f as listApplications, y as platformLabel } from "./resources-
|
|
6
|
-
import { r as performLoginWithUi } from "./app-
|
|
1
|
+
import { _ as apiKeyFromEnv, a as API_HOST, u as ENV_API_KEY } from "./output-D2Ax_hHL.js";
|
|
2
|
+
import { i as loadSession } from "./token-GcbyH6G8.js";
|
|
3
|
+
import { r as createSuperwallApi } from "./command-B7Te31wp.js";
|
|
4
|
+
import { n as ui } from "./ui-Lqt_zFOr.js";
|
|
5
|
+
import { f as listApplications, y as platformLabel } from "./resources-s64mBHaC.js";
|
|
6
|
+
import { r as performLoginWithUi } from "./app-FiC9SQVp.js";
|
|
7
7
|
import { promisify } from "node:util";
|
|
8
8
|
import * as fs from "node:fs";
|
|
9
9
|
import * as os$1 from "node:os";
|
|
@@ -232,19 +232,19 @@ var LoginRequiredError = class extends Error {
|
|
|
232
232
|
};
|
|
233
233
|
async function requireApi(interactive) {
|
|
234
234
|
const apiKey = apiKeyFromEnv();
|
|
235
|
-
if (apiKey) return
|
|
235
|
+
if (apiKey) return createSuperwallApi({
|
|
236
236
|
authMethod: "api_key",
|
|
237
237
|
apiKey,
|
|
238
|
-
host: process.env.SUPERWALL_API_HOST ?? API_HOST,
|
|
238
|
+
host: process.env.SUPERWALL_API_HOST ?? API_HOST(),
|
|
239
239
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
240
240
|
});
|
|
241
241
|
const session = loadSession();
|
|
242
|
-
if (session) return
|
|
242
|
+
if (session) return createSuperwallApi(session);
|
|
243
243
|
if (!interactive) throw new LoginRequiredError();
|
|
244
244
|
ui.info("You're not signed in to Superwall yet — let's fix that.");
|
|
245
245
|
const signedIn = await performLoginWithUi();
|
|
246
246
|
if (!signedIn) throw new LoginRequiredError();
|
|
247
|
-
return
|
|
247
|
+
return createSuperwallApi(signedIn);
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
//#endregion
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as loadSession, t as getOAuthAccessToken } from "./token-
|
|
1
|
+
import { a as API_HOST } from "./output-D2Ax_hHL.js";
|
|
2
|
+
import { i as loadSession, t as getOAuthAccessToken } from "./token-GcbyH6G8.js";
|
|
3
3
|
|
|
4
4
|
//#region src/core/agent/hosted.ts
|
|
5
5
|
const STATUS_PATH = "/v2/cli-agent/status";
|
|
6
6
|
const ANTHROPIC_PROXY_PATH = "/v2/cli-agent/anthropic";
|
|
7
7
|
function baseUrl() {
|
|
8
|
-
return loadSession()?.host || API_HOST;
|
|
8
|
+
return loadSession()?.host || API_HOST();
|
|
9
9
|
}
|
|
10
10
|
function getHostedAnthropicBaseUrl() {
|
|
11
11
|
return `${baseUrl()}${ANTHROPIC_PROXY_PATH}`;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { i as loadSession } from "./token-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { n as ensureSkillsCurrent } from "./skills-
|
|
1
|
+
import { _ as apiKeyFromEnv, g as VERSION, l as DASHBOARD_URL, r as formatJson, t as blocks } from "./output-D2Ax_hHL.js";
|
|
2
|
+
import { r as setTelemetryTags, s as getOnboardedApp } from "./telemetry-yJs7t0rt.js";
|
|
3
|
+
import "./update-B4hoLAN-.js";
|
|
4
|
+
import { i as loadSession } from "./token-GcbyH6G8.js";
|
|
5
|
+
import { i as superwallApi, t as defineCommand } from "./command-B7Te31wp.js";
|
|
6
|
+
import { i as stripReport, n as ui } from "./ui-Lqt_zFOr.js";
|
|
7
|
+
import { n as ensureSkillsCurrent } from "./skills-B-mR2CqM.js";
|
|
8
8
|
import "./spawn-DSoTXy_j.js";
|
|
9
|
-
import "./login-
|
|
10
|
-
import { i as SUPPORTED_LABEL, t as scanProject } from "./scan-
|
|
11
|
-
import { t as detectDrivers } from "./drivers-
|
|
12
|
-
import "./hosted-
|
|
13
|
-
import { t as detectExisting } from "./existing-
|
|
14
|
-
import { t as withSpinner } from "./spinner-
|
|
15
|
-
import { C as rowName, f as listApplications, h as listResource, o as createProduct, y as platformLabel } from "./resources-
|
|
16
|
-
import "./org-
|
|
17
|
-
import { n as resolveAppBinding, r as resolveScopeFromKey, t as platformForIntegration } from "./bind-
|
|
18
|
-
import { r as actionById } from "./actions-
|
|
19
|
-
import { a as recoverUnmatchedScope, i as pickApp, n as ensureAgentDriverReady, o as stage, r as performLoginWithUi, t as chooseAction } from "./app-
|
|
20
|
-
import { c as listAscConfigs, i as listAscApps, n as fetchUnimportedAscProducts, o as createAscConfig, r as findAscAppId, t as ascTypeDisplay } from "./asc-products-
|
|
21
|
-
import { t as generateStoreKit } from "./storekit-
|
|
22
|
-
import { i as saveReport, n as buildCopyPrompt, r as loadReport, t as runAction } from "./run-
|
|
23
|
-
import { t as detectBilling } from "./billing-
|
|
9
|
+
import "./login-DOES7Kup.js";
|
|
10
|
+
import { i as SUPPORTED_LABEL, t as scanProject } from "./scan-Dk0ZlCY6.js";
|
|
11
|
+
import { t as detectDrivers } from "./drivers-ItOmKzrw.js";
|
|
12
|
+
import "./hosted-vk05ZF6w.js";
|
|
13
|
+
import { t as detectExisting } from "./existing-B-e22WOr.js";
|
|
14
|
+
import { t as withSpinner } from "./spinner-B9dT3DBY.js";
|
|
15
|
+
import { C as rowName, f as listApplications, h as listResource, o as createProduct, y as platformLabel } from "./resources-s64mBHaC.js";
|
|
16
|
+
import "./org-Cg25bcsj.js";
|
|
17
|
+
import { n as resolveAppBinding, r as resolveScopeFromKey, t as platformForIntegration } from "./bind-BbzBenoP.js";
|
|
18
|
+
import { r as actionById } from "./actions-DvHycH3X.js";
|
|
19
|
+
import { a as recoverUnmatchedScope, i as pickApp, n as ensureAgentDriverReady, o as stage, r as performLoginWithUi, t as chooseAction } from "./app-FiC9SQVp.js";
|
|
20
|
+
import { c as listAscConfigs, i as listAscApps, n as fetchUnimportedAscProducts, o as createAscConfig, r as findAscAppId, t as ascTypeDisplay } from "./asc-products-C6MvSy8H.js";
|
|
21
|
+
import { t as generateStoreKit } from "./storekit-DPonXSwe.js";
|
|
22
|
+
import { i as saveReport, n as buildCopyPrompt, r as loadReport, t as runAction } from "./run-XIkrFIgw.js";
|
|
23
|
+
import { t as detectBilling } from "./billing-CSOUhWso.js";
|
|
24
24
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
25
25
|
import { homedir } from "node:os";
|
|
26
26
|
import { basename, join } from "node:path";
|
|
@@ -407,7 +407,7 @@ async function runFallback(installDir) {
|
|
|
407
407
|
}
|
|
408
408
|
|
|
409
409
|
//#endregion
|
|
410
|
-
//#region src/
|
|
410
|
+
//#region src/clipboard.ts
|
|
411
411
|
async function copyToClipboard(text) {
|
|
412
412
|
const cmd = clipboardCommand();
|
|
413
413
|
if (!cmd) return false;
|
|
@@ -420,6 +420,7 @@ async function copyToClipboard(text) {
|
|
|
420
420
|
] });
|
|
421
421
|
child.on("error", () => resolve$1(false));
|
|
422
422
|
child.on("close", (code) => resolve$1(code === 0));
|
|
423
|
+
child.stdin.on("error", () => resolve$1(false));
|
|
423
424
|
child.stdin.write(text);
|
|
424
425
|
child.stdin.end();
|
|
425
426
|
} catch {
|
|
@@ -610,7 +611,7 @@ async function runPipeline(ctx) {
|
|
|
610
611
|
let session = loadSession();
|
|
611
612
|
if (session?.apiKey) process.env.SUPERWALL_API_KEY = session.apiKey;
|
|
612
613
|
let scopePromise = null;
|
|
613
|
-
if (session && existing.apiKey) scopePromise = resolveScopeFromKey(
|
|
614
|
+
if (session && existing.apiKey) scopePromise = resolveScopeFromKey(superwallApi(), existing.apiKey).catch(() => null);
|
|
614
615
|
const provisionedRef = { current: null };
|
|
615
616
|
const ensureLogin = async () => {
|
|
616
617
|
if (session) return true;
|
|
@@ -642,7 +643,7 @@ async function runPipeline(ctx) {
|
|
|
642
643
|
if (!apiKey && !flagKey) {
|
|
643
644
|
if (!ctx.interactive) {
|
|
644
645
|
if (session) {
|
|
645
|
-
const disc = await withSpinner("Finding your app", () => discoverPublicApiKey(
|
|
646
|
+
const disc = await withSpinner("Finding your app", () => discoverPublicApiKey(superwallApi()));
|
|
646
647
|
if (disc) {
|
|
647
648
|
apiKey = disc.apiKey;
|
|
648
649
|
ui.info(`Using app \`${disc.app.name ?? disc.app.bundle_id ?? disc.app.id}\``);
|
|
@@ -659,7 +660,7 @@ async function runPipeline(ctx) {
|
|
|
659
660
|
};
|
|
660
661
|
ui.success(`Created \`${app.name}\` in Superwall`);
|
|
661
662
|
} else try {
|
|
662
|
-
const bound = await resolveAppBinding(
|
|
663
|
+
const bound = await resolveAppBinding(superwallApi(), {
|
|
663
664
|
platform: platformForIntegration(app.integration),
|
|
664
665
|
appName: app.name
|
|
665
666
|
});
|
|
@@ -732,7 +733,7 @@ async function runPipeline(ctx) {
|
|
|
732
733
|
process.exitCode = 1;
|
|
733
734
|
}
|
|
734
735
|
if (!dryRun && !scope && (canResolveHeadless || ctx.interactive && await ensureLogin())) {
|
|
735
|
-
const resolved = await withSpinner("Finding this app in Superwall", () => scopePromise ? scopePromise : resolveScopeFromKey(
|
|
736
|
+
const resolved = await withSpinner("Finding this app in Superwall", () => scopePromise ? scopePromise : resolveScopeFromKey(superwallApi(), apiKey).catch(() => null));
|
|
736
737
|
if (resolved) {
|
|
737
738
|
scope = resolved;
|
|
738
739
|
bundleId = resolved.bundleId;
|
|
@@ -747,7 +748,7 @@ async function runPipeline(ctx) {
|
|
|
747
748
|
}
|
|
748
749
|
if (scope) {
|
|
749
750
|
const stageCtx = {
|
|
750
|
-
api:
|
|
751
|
+
api: superwallApi(),
|
|
751
752
|
scope,
|
|
752
753
|
appName: app.name,
|
|
753
754
|
bundleId,
|
|
@@ -818,7 +819,7 @@ async function runFlow(ctx, forced) {
|
|
|
818
819
|
apiKey = provisionedRef.current.publicApiKey;
|
|
819
820
|
ui.success(`Created \`${app.name}\` in Superwall`);
|
|
820
821
|
} else try {
|
|
821
|
-
const bound = await resolveAppBinding(
|
|
822
|
+
const bound = await resolveAppBinding(superwallApi(), {
|
|
822
823
|
platform: platformForIntegration(app.integration),
|
|
823
824
|
appName: app.name
|
|
824
825
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { a as API_HOST, c as CLI_CLIENT_ID, d as Integration, f as OAUTH_SCOPE, s as AUTH_HOST } from "./output-D2Ax_hHL.js";
|
|
2
|
+
import { c as getOnboardedOrg, l as getOnboardingIdempotencyKey, m as setOnboardedOrg, p as setOnboardedApp } from "./telemetry-yJs7t0rt.js";
|
|
3
|
+
import { a as saveSession } from "./token-GcbyH6G8.js";
|
|
4
|
+
import { n as ui } from "./ui-Lqt_zFOr.js";
|
|
4
5
|
import { spawn } from "node:child_process";
|
|
5
6
|
|
|
6
7
|
//#region src/core/account/onboarding.ts
|
|
@@ -66,9 +67,9 @@ function openBrowser(url) {
|
|
|
66
67
|
const DEVICE_GRANT = "urn:ietf:params:oauth:grant-type:device_code";
|
|
67
68
|
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
68
69
|
async function performLogin(opts = {}) {
|
|
69
|
-
const issuer = opts.issuer ?? AUTH_HOST;
|
|
70
|
-
const apiHost = opts.apiHost ?? API_HOST;
|
|
71
|
-
const clientId = opts.clientId ?? CLI_CLIENT_ID;
|
|
70
|
+
const issuer = opts.issuer ?? AUTH_HOST();
|
|
71
|
+
const apiHost = opts.apiHost ?? API_HOST();
|
|
72
|
+
const clientId = opts.clientId ?? CLI_CLIENT_ID();
|
|
72
73
|
const disc = await discover(issuer);
|
|
73
74
|
if (!disc.device_authorization_endpoint) throw new Error("auth.superwall.com does not advertise a device-authorization endpoint.");
|
|
74
75
|
const dev = await startDeviceAuth(disc.device_authorization_endpoint, clientId);
|
|
@@ -138,7 +139,7 @@ async function performLogin(opts = {}) {
|
|
|
138
139
|
saveSession(session);
|
|
139
140
|
return session;
|
|
140
141
|
}
|
|
141
|
-
async function loginWithApiKey(apiKey, apiHost = API_HOST) {
|
|
142
|
+
async function loginWithApiKey(apiKey, apiHost = API_HOST()) {
|
|
142
143
|
const key = apiKey.trim();
|
|
143
144
|
if (!key) throw new Error("An API key is required.");
|
|
144
145
|
let org = {};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
import
|
|
4
|
-
import { i as loadSession } from "./token-
|
|
5
|
-
import { t as defineCommand } from "./command-
|
|
6
|
-
import {
|
|
7
|
-
import "./skills-
|
|
1
|
+
import { g as VERSION, l as DASHBOARD_URL, t as blocks } from "./output-D2Ax_hHL.js";
|
|
2
|
+
import "./telemetry-yJs7t0rt.js";
|
|
3
|
+
import "./update-B4hoLAN-.js";
|
|
4
|
+
import { i as loadSession } from "./token-GcbyH6G8.js";
|
|
5
|
+
import { t as defineCommand } from "./command-B7Te31wp.js";
|
|
6
|
+
import { i as stripReport, n as ui } from "./ui-Lqt_zFOr.js";
|
|
7
|
+
import "./skills-B-mR2CqM.js";
|
|
8
8
|
import "./spawn-DSoTXy_j.js";
|
|
9
|
-
import "./login-
|
|
10
|
-
import { t as scanProject } from "./scan-
|
|
11
|
-
import { t as detectDrivers } from "./drivers-
|
|
12
|
-
import "./hosted-
|
|
13
|
-
import { t as detectExisting } from "./existing-
|
|
14
|
-
import "./spinner-
|
|
15
|
-
import "./resources-
|
|
16
|
-
import "./org-
|
|
17
|
-
import "./bind-
|
|
18
|
-
import { r as actionById } from "./actions-
|
|
19
|
-
import { r as performLoginWithUi } from "./app-
|
|
20
|
-
import { i as saveReport, t as runAction } from "./run-
|
|
21
|
-
import { t as detectBilling } from "./billing-
|
|
9
|
+
import "./login-DOES7Kup.js";
|
|
10
|
+
import { t as scanProject } from "./scan-Dk0ZlCY6.js";
|
|
11
|
+
import { t as detectDrivers } from "./drivers-ItOmKzrw.js";
|
|
12
|
+
import "./hosted-vk05ZF6w.js";
|
|
13
|
+
import { t as detectExisting } from "./existing-B-e22WOr.js";
|
|
14
|
+
import "./spinner-B9dT3DBY.js";
|
|
15
|
+
import "./resources-s64mBHaC.js";
|
|
16
|
+
import "./org-Cg25bcsj.js";
|
|
17
|
+
import "./bind-BbzBenoP.js";
|
|
18
|
+
import { r as actionById } from "./actions-DvHycH3X.js";
|
|
19
|
+
import { r as performLoginWithUi } from "./app-FiC9SQVp.js";
|
|
20
|
+
import { i as saveReport, t as runAction } from "./run-XIkrFIgw.js";
|
|
21
|
+
import { t as detectBilling } from "./billing-CSOUhWso.js";
|
|
22
22
|
|
|
23
23
|
//#region src/commands/workflow/migrate.ts
|
|
24
24
|
const runMigrate = defineCommand({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as ui } from "./ui-
|
|
2
|
-
import { t as withSpinner } from "./spinner-
|
|
3
|
-
import { C as rowName, p as listOrganizations, w as titleCase } from "./resources-
|
|
1
|
+
import { n as ui } from "./ui-Lqt_zFOr.js";
|
|
2
|
+
import { t as withSpinner } from "./spinner-B9dT3DBY.js";
|
|
3
|
+
import { C as rowName, p as listOrganizations, w as titleCase } from "./resources-s64mBHaC.js";
|
|
4
4
|
|
|
5
5
|
//#region src/core/account/org.ts
|
|
6
6
|
/**
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { stripVTControlCharacters } from "node:util";
|
|
2
|
+
|
|
3
|
+
//#region package.json
|
|
4
|
+
var version = "1.3.0-beta.3";
|
|
5
|
+
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/environment.ts
|
|
8
|
+
const VERSION = version;
|
|
9
|
+
const DASHBOARD_URL = "https://superwall.com/dashboard";
|
|
10
|
+
const ENV_API_KEY = "SUPERWALL_API_KEY";
|
|
11
|
+
const SUPERWALL_HOME = () => {
|
|
12
|
+
const value = process.env.SUPERWALL_HOME;
|
|
13
|
+
return value && value.trim() !== "" ? value.trim() : void 0;
|
|
14
|
+
};
|
|
15
|
+
const host = (name, fallback) => {
|
|
16
|
+
const value = process.env[name];
|
|
17
|
+
return value && value.trim() !== "" ? value.trim() : fallback;
|
|
18
|
+
};
|
|
19
|
+
const AUTH_HOST = () => host("SUPERWALL_AUTH_HOST", "https://auth.superwall.com");
|
|
20
|
+
const ASSET_HOST = () => host("SUPERWALL_ASSET_HOST", "https://user-content.superwalleditor.com/user-content/hl");
|
|
21
|
+
const API_HOST = () => host("SUPERWALL_API_HOST", "https://api.superwall.com");
|
|
22
|
+
const CLI_CLIENT_ID = () => host("SUPERWALL_CLI_CLIENT_ID", "client_01KWEWM154D2T28NZAS02B8MWT");
|
|
23
|
+
const OAUTH_SCOPE = "openid profile email offline_access";
|
|
24
|
+
const TELEMETRY_HOST = () => host("SUPERWALL_TELEMETRY_HOST", "https://us.i.posthog.com");
|
|
25
|
+
const TELEMETRY_KEY = () => host("SUPERWALL_TELEMETRY_KEY", "phc_obWpK8cuSfhNkZUKmDByATHp928RHPRD5DoMEDreAHS6");
|
|
26
|
+
let Integration = /* @__PURE__ */ function(Integration$1) {
|
|
27
|
+
Integration$1["swift"] = "swift";
|
|
28
|
+
Integration$1["expo"] = "expo";
|
|
29
|
+
Integration$1["reactNative"] = "react-native";
|
|
30
|
+
Integration$1["flutter"] = "flutter";
|
|
31
|
+
Integration$1["web"] = "web";
|
|
32
|
+
return Integration$1;
|
|
33
|
+
}({});
|
|
34
|
+
function apiKeyFromEnv() {
|
|
35
|
+
const v = process.env[ENV_API_KEY];
|
|
36
|
+
return v && v.trim() ? v.trim() : void 0;
|
|
37
|
+
}
|
|
38
|
+
function isNonInteractive() {
|
|
39
|
+
return !process.stdout.isTTY || !process.stdin.isTTY || process.env.CI === "true";
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/output.ts
|
|
44
|
+
function formatJson(value) {
|
|
45
|
+
return JSON.stringify(value, null, 2);
|
|
46
|
+
}
|
|
47
|
+
const blocks = {
|
|
48
|
+
intro: (text) => ({
|
|
49
|
+
kind: "intro",
|
|
50
|
+
text
|
|
51
|
+
}),
|
|
52
|
+
step: (text) => ({
|
|
53
|
+
kind: "step",
|
|
54
|
+
text
|
|
55
|
+
}),
|
|
56
|
+
info: (text) => ({
|
|
57
|
+
kind: "info",
|
|
58
|
+
text
|
|
59
|
+
}),
|
|
60
|
+
success: (text) => ({
|
|
61
|
+
kind: "success",
|
|
62
|
+
text
|
|
63
|
+
}),
|
|
64
|
+
warning: (text) => ({
|
|
65
|
+
kind: "warning",
|
|
66
|
+
text
|
|
67
|
+
}),
|
|
68
|
+
report: (text) => ({
|
|
69
|
+
kind: "report",
|
|
70
|
+
text
|
|
71
|
+
}),
|
|
72
|
+
list: (value) => ({
|
|
73
|
+
kind: "list",
|
|
74
|
+
value
|
|
75
|
+
}),
|
|
76
|
+
nextSteps: (items) => ({
|
|
77
|
+
kind: "nextSteps",
|
|
78
|
+
items
|
|
79
|
+
}),
|
|
80
|
+
outro: (text) => ({
|
|
81
|
+
kind: "outro",
|
|
82
|
+
text
|
|
83
|
+
})
|
|
84
|
+
};
|
|
85
|
+
function writeJson(stream, value) {
|
|
86
|
+
stream.write(`${formatJson(value)}\n`);
|
|
87
|
+
}
|
|
88
|
+
function createCommandOutput(mode, renderer, streams = { stdout: process.stdout }) {
|
|
89
|
+
return {
|
|
90
|
+
mode,
|
|
91
|
+
data(value) {
|
|
92
|
+
if (mode === "json") writeJson(streams.stdout, value);
|
|
93
|
+
else renderer.report(formatJson(value));
|
|
94
|
+
},
|
|
95
|
+
text(value) {
|
|
96
|
+
if (mode === "json") throw new Error("This command must return structured JSON in --json mode.");
|
|
97
|
+
const text = value.replace(/\n$/, "");
|
|
98
|
+
renderer.report(mode === "text" ? stripVTControlCharacters(text) : text);
|
|
99
|
+
},
|
|
100
|
+
render(...blocks$1) {
|
|
101
|
+
if (mode === "json") return;
|
|
102
|
+
for (const block of blocks$1) renderBlock(renderer, block);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
function renderBlock(renderer, block) {
|
|
107
|
+
switch (block.kind) {
|
|
108
|
+
case "intro": return renderer.intro(block.text);
|
|
109
|
+
case "step": return renderer.step(block.text);
|
|
110
|
+
case "info": return renderer.info(block.text);
|
|
111
|
+
case "success": return renderer.success(block.text);
|
|
112
|
+
case "warning": return renderer.warn(block.text);
|
|
113
|
+
case "report": return renderer.report(block.text);
|
|
114
|
+
case "list": return renderer.list(block.value);
|
|
115
|
+
case "nextSteps":
|
|
116
|
+
if (block.items.length) renderer.note(block.items.map((item, index) => `${index + 1}. ${item}`).join("\n"), "Next steps");
|
|
117
|
+
return;
|
|
118
|
+
case "outro": return renderer.outro(block.text);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
//#endregion
|
|
123
|
+
export { apiKeyFromEnv as _, API_HOST as a, CLI_CLIENT_ID as c, Integration as d, OAUTH_SCOPE as f, VERSION as g, TELEMETRY_KEY as h, writeJson as i, DASHBOARD_URL as l, TELEMETRY_HOST as m, createCommandOutput as n, ASSET_HOST as o, SUPERWALL_HOME as p, formatJson as r, AUTH_HOST as s, blocks as t, ENV_API_KEY as u, isNonInteractive as v };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region src/
|
|
1
|
+
//#region src/commands/platform/params.ts
|
|
2
2
|
function parseParams(pairs) {
|
|
3
3
|
const root = {};
|
|
4
4
|
for (const pair of pairs ?? []) {
|
|
@@ -19,7 +19,6 @@ function parseTyped(raw, pair) {
|
|
|
19
19
|
throw new Error(`Invalid -d "${pair}" - value after := must be JSON (number, true/false, null, "quoted", [...], {...}).`);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
/** `items[0][price]` → ["items", "0", "price"]. */
|
|
23
22
|
function splitKey(key) {
|
|
24
23
|
return key.replace(/\]/g, "").split("[").filter((p) => p !== "");
|
|
25
24
|
}
|