@superwall/cli 1.6.2 → 1.7.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 +110 -3
- package/dist/{actions-H7f6knyY.js → actions-B7ym3oVS.js} +2 -2
- package/dist/{api-Dv3LyZ5m.js → api-CZzirVMj.js} +6 -6
- package/dist/{app-mJC5NDtW.js → app-DH6U8yuI.js} +11 -10
- package/dist/{asa-D6H7Pjae.js → asa-C-sQzPPn.js} +8 -8
- package/dist/{asc-xCin0akG.js → asc-1ZBJ6DwS.js} +280 -41
- package/dist/asc-Bf7zBbyS.js +65 -0
- package/dist/{asc-products-Dvcyef3_.js → asc-products-9JXtDxI4.js} +2 -35
- package/dist/{auth-ZlLL-Gko.js → auth-YRhlV3DE.js} +11 -10
- package/dist/auth.js +2 -2
- package/dist/{billing-C8kBge_S.js → billing-CCYHdApx.js} +1 -1
- package/dist/{bind-BIzaGq8K.js → bind-YrJvuRF9.js} +3 -3
- package/dist/{build-B7BS1rF2.js → build-DLoCW5Ri.js} +7 -7
- package/dist/bundle-id-CKxl_026.js +121 -0
- package/dist/{command-3fGYyC8r.js → command-CMIz81Da.js} +5 -5
- package/dist/{create-CwnnNqv4.js → create-pkANt1Gs.js} +22 -22
- package/dist/dev-DZy6pOnB.js +22 -0
- package/dist/{dev-CgGAb5Al.js → dev-DmB3XqaJ.js} +12 -7
- package/dist/{doctor-CyUvut31.js → doctor-H-hf-Yww.js} +10 -10
- package/dist/{drivers-6RMOPIdn.js → drivers-Qx9LxmRN.js} +2 -2
- package/dist/entry.js +382 -39
- package/dist/{existing-DHpPn1y6.js → existing-AVEfZu2A.js} +2 -2
- package/dist/{feedback-RKyGuQ8_.js → feedback-CKf-rpBW.js} +6 -6
- package/dist/{hosted-BeGVAntr.js → hosted-CXe9TrWx.js} +2 -2
- package/dist/{integrate-BR2LR-EK.js → integrate-brmhPG-S.js} +23 -22
- package/dist/{login-Bhxgqwtm.js → login-Do4wFuLv.js} +31 -16
- package/dist/{migrate-C-4ISELN.js → migrate-C9ERDR6y.js} +24 -24
- package/dist/notification-url-DuKF2659.js +1273 -0
- package/dist/{open-studio-BnVD6tJ9.js → open-studio-DOw-6ydc.js} +10 -10
- package/dist/{org-CQduIOic.js → org-sj7uyvp-.js} +2 -2
- package/dist/{output-C-4UKMot.js → output-C4o2gJ1K.js} +12 -2
- package/dist/{pipeline-CHX0Syre.js → pipeline-BqzqZhX1.js} +6 -6
- package/dist/{print-skill-BiZLdCKv.js → print-skill-ZojRSybs.js} +7 -7
- package/dist/{promote-Pgpz-3xl.js → promote-BG8X4Nv_.js} +17 -17
- package/dist/publish-sxLh-G4G.js +35 -0
- package/dist/push-bQ6Vxtg8.js +35 -0
- package/dist/{query-CWLaZkdm.js → query-_FbybaH-.js} +8 -8
- package/dist/{resource-jwASPCrw.js → resource-CGIwSd29.js} +16 -176
- package/dist/revenue-provider-ebsRINY8.js +100 -0
- package/dist/{run-D-NbZLpj.js → run-DsVZ5snL.js} +2 -2
- package/dist/{scan-BmAW413l.js → scan-zKsddO72.js} +1 -1
- package/dist/scope-BvzD-kO4.js +223 -0
- package/dist/{selection-BGi6GyxC.js → selection-CxZoX4NT.js} +2 -2
- package/dist/setup-Bxj22rYi.js +189 -0
- package/dist/{skills-AxAf7bDB.js → skills-DPzlnfCK.js} +3 -3
- package/dist/{skills-FK5aDuNV.js → skills-D_R-lEsK.js} +8 -8
- package/dist/{spinner-DFctF_Jw.js → spinner-TWa0hia6.js} +1 -1
- package/dist/{telemetry-Ch9cCTI-.js → telemetry-DeA1mvnT.js} +1 -1
- package/dist/{token-BGAVPSQc.js → token-C0it-Xh7.js} +1 -1
- package/dist/{ui-4gLyfrgl.js → ui-Dy0b-9L8.js} +4 -3
- package/dist/{update-DIXbL-H9.js → update-B2fWIc4q.js} +2 -2
- package/dist/{upgrade-De7JMI1g.js → upgrade-BmzkTKrh.js} +6 -6
- package/package.json +2 -2
- package/dist/dev-Dx99K183.js +0 -22
- package/dist/publish-BPeuc3lq.js +0 -35
- package/dist/push-DcSQ4odB.js +0 -35
- /package/dist/{reports-DqMs9xNR.js → reports-CfJqoava.js} +0 -0
- /package/dist/{storekit-CC4gnTI6.js → storekit-Cj9Cpjcz.js} +0 -0
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as setTelemetryTags, s as getOnboardedApp } from "./telemetry-
|
|
3
|
-
import "./update-
|
|
4
|
-
import { i as loadSession } from "./token-
|
|
5
|
-
import { a as superwallApi, t as defineCommand } from "./command-
|
|
6
|
-
import { i as stripReport, n as ui } from "./ui-
|
|
7
|
-
import { n as ensureSkillsCurrent } from "./skills-
|
|
1
|
+
import { S as apiKeyFromEnv, f as DASHBOARD_URL, r as formatJson, t as blocks, x as VERSION } from "./output-C4o2gJ1K.js";
|
|
2
|
+
import { r as setTelemetryTags, s as getOnboardedApp } from "./telemetry-DeA1mvnT.js";
|
|
3
|
+
import "./update-B2fWIc4q.js";
|
|
4
|
+
import { i as loadSession } from "./token-C0it-Xh7.js";
|
|
5
|
+
import { a as superwallApi, t as defineCommand } from "./command-CMIz81Da.js";
|
|
6
|
+
import { i as stripReport, n as ui } from "./ui-Dy0b-9L8.js";
|
|
7
|
+
import { n as ensureSkillsCurrent } from "./skills-DPzlnfCK.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-
|
|
9
|
+
import "./login-Do4wFuLv.js";
|
|
10
|
+
import { i as SUPPORTED_LABEL, t as scanProject } from "./scan-zKsddO72.js";
|
|
11
|
+
import { t as detectDrivers } from "./drivers-Qx9LxmRN.js";
|
|
12
|
+
import "./hosted-CXe9TrWx.js";
|
|
13
|
+
import { t as detectExisting } from "./existing-AVEfZu2A.js";
|
|
14
|
+
import { t as withSpinner } from "./spinner-TWa0hia6.js";
|
|
15
15
|
import { T as rowName, b as platformLabel, g as listResource, o as createProduct, p as listApplications } from "./resources-Bf9O1JNM.js";
|
|
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 { a as copyToClipboard, r as buildCopyPrompt, t as runAction } from "./run-
|
|
21
|
-
import {
|
|
22
|
-
import { t as
|
|
23
|
-
import {
|
|
24
|
-
import { t as
|
|
16
|
+
import "./org-sj7uyvp-.js";
|
|
17
|
+
import { n as resolveAppBinding, r as resolveScopeFromKey, t as platformForIntegration } from "./bind-YrJvuRF9.js";
|
|
18
|
+
import { r as actionById } from "./actions-B7ym3oVS.js";
|
|
19
|
+
import { a as recoverUnmatchedScope, i as pickApp, n as ensureAgentDriverReady, o as stage, r as performLoginWithUi, t as chooseAction } from "./app-DH6U8yuI.js";
|
|
20
|
+
import { a as copyToClipboard, r as buildCopyPrompt, t as runAction } from "./run-DsVZ5snL.js";
|
|
21
|
+
import { o as listAscConfigs, r as createAscConfig } from "./asc-Bf7zBbyS.js";
|
|
22
|
+
import { i as listAscApps, n as fetchUnimportedAscProducts, r as findAscAppId, t as ascTypeDisplay } from "./asc-products-9JXtDxI4.js";
|
|
23
|
+
import { t as generateStoreKit } from "./storekit-Cj9Cpjcz.js";
|
|
24
|
+
import { n as saveReport, t as loadReport } from "./reports-CfJqoava.js";
|
|
25
|
+
import { t as detectBilling } from "./billing-CCYHdApx.js";
|
|
25
26
|
import { basename, join } from "node:path";
|
|
26
27
|
import { homedir } from "node:os";
|
|
27
28
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as getOnboardedOrg, l as getOnboardingIdempotencyKey, m as setOnboardedOrg, p as setOnboardedApp } from "./telemetry-
|
|
3
|
-
import { a as saveSession } from "./token-
|
|
4
|
-
import { n as ui } from "./ui-
|
|
1
|
+
import { _ as OAUTH_SCOPE, c as AUTH_HOST, d as CLI_CLIENT_ID, g as Integration, o as API_HOST } from "./output-C4o2gJ1K.js";
|
|
2
|
+
import { c as getOnboardedOrg, l as getOnboardingIdempotencyKey, m as setOnboardedOrg, p as setOnboardedApp } from "./telemetry-DeA1mvnT.js";
|
|
3
|
+
import { a as saveSession } from "./token-C0it-Xh7.js";
|
|
4
|
+
import { n as ui } from "./ui-Dy0b-9L8.js";
|
|
5
5
|
import { spawn } from "node:child_process";
|
|
6
6
|
|
|
7
7
|
//#region src/core/account/onboarding.ts
|
|
@@ -46,20 +46,34 @@ function onboardingHooks(app) {
|
|
|
46
46
|
|
|
47
47
|
//#endregion
|
|
48
48
|
//#region src/core/auth/browser.ts
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
const BROWSER_UNAVAILABLE = "Couldn't open a browser here. Open the URL above to approve the login.";
|
|
50
|
+
function hasDisplay(env, platform) {
|
|
51
|
+
if (platform !== "linux") return true;
|
|
52
|
+
return Boolean(env.DISPLAY || env.WAYLAND_DISPLAY || env.WSL_DISTRO_NAME);
|
|
53
|
+
}
|
|
54
|
+
function openBrowser(url, deps = {}) {
|
|
55
|
+
const platform = deps.platform ?? process.platform;
|
|
56
|
+
if (!hasDisplay(deps.env ?? process.env, platform)) return Promise.resolve(false);
|
|
57
|
+
const cmd = platform === "darwin" ? "open" : platform === "win32" ? "cmd" : "xdg-open";
|
|
58
|
+
const args = platform === "win32" ? [
|
|
52
59
|
"/c",
|
|
53
60
|
"start",
|
|
54
61
|
"",
|
|
55
62
|
url
|
|
56
63
|
] : [url];
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
return new Promise((resolve) => {
|
|
65
|
+
try {
|
|
66
|
+
const child = (deps.spawn ?? spawn)(cmd, args, {
|
|
67
|
+
stdio: "ignore",
|
|
68
|
+
detached: true
|
|
69
|
+
});
|
|
70
|
+
child.once("error", () => resolve(false));
|
|
71
|
+
child.once("spawn", () => resolve(true));
|
|
72
|
+
child.unref();
|
|
73
|
+
} catch {
|
|
74
|
+
resolve(false);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
63
77
|
}
|
|
64
78
|
|
|
65
79
|
//#endregion
|
|
@@ -74,11 +88,12 @@ async function performLogin(opts = {}) {
|
|
|
74
88
|
if (!disc.device_authorization_endpoint) throw new Error("auth.superwall.com does not advertise a device-authorization endpoint.");
|
|
75
89
|
const dev = await startDeviceAuth(disc.device_authorization_endpoint, clientId);
|
|
76
90
|
const url = dev.verification_uri_complete ?? dev.verification_uri;
|
|
91
|
+
const browserOpened = await (opts.openBrowser ?? openBrowser)(url);
|
|
77
92
|
opts.onVerify?.({
|
|
78
93
|
url,
|
|
79
|
-
userCode: dev.user_code
|
|
94
|
+
userCode: dev.user_code,
|
|
95
|
+
browserOpened
|
|
80
96
|
});
|
|
81
|
-
openBrowser(url);
|
|
82
97
|
const { accessToken, refreshToken, expiresIn, idToken } = await pollForToken(disc.token_endpoint, clientId, dev, opts.onStatus);
|
|
83
98
|
let apiToken = accessToken;
|
|
84
99
|
if (idToken) await getJson(`${apiHost}/v2/me`, idToken).catch(() => null);
|
|
@@ -288,4 +303,4 @@ async function postJson(url, accessToken, body) {
|
|
|
288
303
|
}
|
|
289
304
|
|
|
290
305
|
//#endregion
|
|
291
|
-
export { onboardingHooks as i, performLogin as n,
|
|
306
|
+
export { onboardingHooks as a, openBrowser as i, performLogin as n, BROWSER_UNAVAILABLE as r, loginWithApiKey as t };
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { f as DASHBOARD_URL, t as blocks,
|
|
2
|
-
import "./telemetry-
|
|
3
|
-
import "./update-
|
|
4
|
-
import { i as loadSession } from "./token-
|
|
5
|
-
import { t as defineCommand } from "./command-
|
|
6
|
-
import { i as stripReport, n as ui } from "./ui-
|
|
7
|
-
import "./skills-
|
|
1
|
+
import { f as DASHBOARD_URL, t as blocks, x as VERSION } from "./output-C4o2gJ1K.js";
|
|
2
|
+
import "./telemetry-DeA1mvnT.js";
|
|
3
|
+
import "./update-B2fWIc4q.js";
|
|
4
|
+
import { i as loadSession } from "./token-C0it-Xh7.js";
|
|
5
|
+
import { t as defineCommand } from "./command-CMIz81Da.js";
|
|
6
|
+
import { i as stripReport, n as ui } from "./ui-Dy0b-9L8.js";
|
|
7
|
+
import "./skills-DPzlnfCK.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-
|
|
9
|
+
import "./login-Do4wFuLv.js";
|
|
10
|
+
import { t as scanProject } from "./scan-zKsddO72.js";
|
|
11
|
+
import { t as detectDrivers } from "./drivers-Qx9LxmRN.js";
|
|
12
|
+
import "./hosted-CXe9TrWx.js";
|
|
13
|
+
import { t as detectExisting } from "./existing-AVEfZu2A.js";
|
|
14
|
+
import "./spinner-TWa0hia6.js";
|
|
15
15
|
import "./resources-Bf9O1JNM.js";
|
|
16
|
-
import "./selection-
|
|
17
|
-
import "./org-
|
|
18
|
-
import "./bind-
|
|
19
|
-
import { _ as requireApi } from "./pipeline-
|
|
20
|
-
import { r as actionById } from "./actions-
|
|
21
|
-
import { r as performLoginWithUi } from "./app-
|
|
22
|
-
import { t as runAction } from "./run-
|
|
23
|
-
import { _ as screenNameOf, a as buildMigrationCopyPrompt, c as migrationFor, d as projectDirOf, f as scaffoldFromPaywall, g as placementOfName, h as findScreenCandidates, i as startStudio, l as migrationSource, m as screenMigrationFor, n as migrationNextSteps, o as hasOriginal, p as scaffoldFromScreen, r as screenNextSteps, t as askStudio, u as offerMigration } from "./open-studio-
|
|
24
|
-
import "./dev-
|
|
25
|
-
import { n as saveReport } from "./reports-
|
|
26
|
-
import { t as detectBilling } from "./billing-
|
|
16
|
+
import "./selection-CxZoX4NT.js";
|
|
17
|
+
import "./org-sj7uyvp-.js";
|
|
18
|
+
import "./bind-YrJvuRF9.js";
|
|
19
|
+
import { _ as requireApi } from "./pipeline-BqzqZhX1.js";
|
|
20
|
+
import { r as actionById } from "./actions-B7ym3oVS.js";
|
|
21
|
+
import { r as performLoginWithUi } from "./app-DH6U8yuI.js";
|
|
22
|
+
import { t as runAction } from "./run-DsVZ5snL.js";
|
|
23
|
+
import { _ as screenNameOf, a as buildMigrationCopyPrompt, c as migrationFor, d as projectDirOf, f as scaffoldFromPaywall, g as placementOfName, h as findScreenCandidates, i as startStudio, l as migrationSource, m as screenMigrationFor, n as migrationNextSteps, o as hasOriginal, p as scaffoldFromScreen, r as screenNextSteps, t as askStudio, u as offerMigration } from "./open-studio-DOw-6ydc.js";
|
|
24
|
+
import "./dev-DmB3XqaJ.js";
|
|
25
|
+
import { n as saveReport } from "./reports-CfJqoava.js";
|
|
26
|
+
import { t as detectBilling } from "./billing-CCYHdApx.js";
|
|
27
27
|
import * as path from "node:path";
|
|
28
28
|
import * as os$1 from "node:os";
|
|
29
29
|
import * as fs from "node:fs";
|