@superwall/cli 2.3.1 → 2.5.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 +10 -0
- package/dist/{apple-z2qjOzIZ.js → apple-Dyr7OFBx.js} +17 -16
- package/dist/approve-Czs1-JO9.js +186 -0
- package/dist/{assets-DXXegdDt.js → assets-BrB9jQPQ.js} +3 -3
- package/dist/auth.d.ts +1 -1
- package/dist/auth.js +3 -3
- package/dist/{billing-B8tOjsnY.js → billing-D5qqIlVb.js} +3 -3
- package/dist/{bind-Bx9K6LwP.js → bind-B3eEcRyp.js} +4 -4
- package/dist/browser-Bp3yRKlU.js +36 -0
- package/dist/{build-Bu2kkzRe.js → build-DD9pSwHX.js} +10 -8
- package/dist/{client-DOgk9gAS.js → client-AI9H4GGB.js} +3 -3
- package/dist/{config-BO1Y87kV.js → config-CGcG7GOt.js} +9 -1
- package/dist/{create-B03MAuPe.js → create-B4m-IKlr.js} +8 -8
- package/dist/create-CJljlkJK.js +20 -0
- package/dist/{create-DzC_89gq.js → create-ChfgWpiM.js} +41 -69
- package/dist/{doctor-BGZSKY_B.js → doctor-XtXW6tKE.js} +6 -6
- package/dist/download-2Zu2I_Og.js +58 -0
- package/dist/{drivers-DqLgQxkC.js → drivers-CMEL13gp.js} +4 -4
- package/dist/entry.js +69 -33
- package/dist/{environment-i8BhiBDB.js → environment-BWT2S4qC.js} +9 -2
- package/dist/{existing-BPOG5zLO.js → existing-b0GxFcnc.js} +2 -2
- package/dist/{session-BDLQUJyV.js → git-D7AVdugb.js} +97 -335
- package/dist/held-CX7Zf8u-.js +17 -0
- package/dist/{held-C56PYMRH.js → held-D3PUNky2.js} +7 -7
- package/dist/install-CVUXsx8c.js +103 -0
- package/dist/{integrate-DZ4Qvoch.js → integrate-qvKd9pVW.js} +29 -27
- package/dist/{log-NVhVe_oe.js → log-C0MDCfA2.js} +1 -1
- package/dist/{login-p9GVEKzD.js → login-COmGHrU5.js} +2 -1
- package/dist/login-ClnJi1Ea.js +17 -0
- package/dist/{login-ONZdK8vN.js → login-PMoXUGqq.js} +9 -42
- package/dist/{lookup-flTi0at0.js → lookup-gjcKIZvh.js} +4 -3
- package/dist/{migrate-DnXpbhL1.js → migrate-SkkLLdmr.js} +33 -28
- package/dist/{migration-DJ1uNKhk.js → migration-DS44-3Zr.js} +10 -10
- package/dist/{notification-url-CCDeS5S-.js → notification-url-BjQPLf4-.js} +4 -4
- package/dist/{open-QdsZ_N47.js → open-DQpm2yVs.js} +2 -2
- package/dist/{org-BiFPjoHD.js → org-C04eAO-j.js} +3 -2
- package/dist/organization-BOECL3vZ.js +39 -0
- package/dist/orgs-D6Kk96mG.js +81 -0
- package/dist/{paths-yRgm5Jpa.js → paths-REb-GrbX.js} +2 -2
- package/dist/{playbook-B-pRKNa4.js → playbook-Du4Oydbf.js} +11 -11
- package/dist/{products-DH_fK9tY.js → products-Cqq59DBQ.js} +1 -1
- package/dist/project-CP6hiHra.js +47 -0
- package/dist/{promote-Djzk4C81.js → promote-Dm2_b1WK.js} +24 -19
- package/dist/pull-DsdOoG-D.js +36 -0
- package/dist/{pull-BLA9XwHj.js → pull-F6pvO4To.js} +9 -28
- package/dist/pull-zYAbqo9n.js +106 -0
- package/dist/{push-gSBxGDik.js → push-BIFLhAiO.js} +9 -7
- package/dist/push-CJVfvFZq.js +29 -0
- package/dist/push-D_l9KJZN.js +290 -0
- package/dist/push-SVzv7fzE.js +22 -0
- package/dist/{registry-D3xmWk9p.js → registry-DIJB0mJa.js} +890 -158
- package/dist/resolve--GsHj0Q1.js +171 -0
- package/dist/{resources-BTnczJCA.js → resources-BaP3p_LY.js} +3 -80
- package/dist/{run-C1SoizcJ.js → run-C5OPwhvS.js} +2 -2
- package/dist/run-CgLmD2vR.js +1345 -0
- package/dist/{scan-Dwk_lT5q.js → scan-Bj5y0zTZ.js} +1 -1
- package/dist/scan-v_WTE722.js +4 -0
- package/dist/{scope-Db7blD-l.js → scope-Bp_zwJOo.js} +6 -5
- package/dist/scope-CCb_7UvN.js +89 -0
- package/dist/sdk-TvT0p_nO.js +71 -0
- package/dist/selection-BltBpyp5.js +179 -0
- package/dist/series-TAixFBWW.js +685 -0
- package/dist/{server-Cb2N75JL.js → server-CdVIboQn.js} +10 -8
- package/dist/server-CvJVusw3.js +29 -0
- package/dist/session-B8JNXkwN.js +6 -0
- package/dist/session-D3fgXQBt.js +219 -0
- package/dist/{session-CnDJp_HO.js → session-Ywim-P8M.js} +1 -1
- package/dist/{setup-BLahHpgy.js → setup-zzjtTy8k.js} +9 -8
- package/dist/skills/index.json +5 -0
- package/dist/skills/superwall/SKILL.md +48 -30
- package/dist/skills/superwall/references/api.md +3 -2
- package/dist/skills/superwall-editor/SKILL.md +7 -5
- package/dist/skills/superwall-framework/SKILL.md +11 -8
- package/dist/skills/superwall-framework/references/onboarding-state.md +21 -14
- package/dist/skills/superwall-workspaces/SKILL.md +313 -0
- package/dist/skills/superwall-workspaces/references/cli.md +174 -0
- package/dist/skills/superwall-workspaces/references/slots.md +103 -0
- package/dist/{skills-zebMTZyr.js → skills-2qYaUXGE.js} +15 -9
- package/dist/skills-8um2fBPS.js +14 -0
- package/dist/{source-push-DxuJuwEf.js → source-push-kAep4gPe.js} +6 -5
- package/dist/{spinner-BN3U1CVB.js → spinner-BANVLncC.js} +17 -5
- package/dist/starter-CiLrp1cN.js +190 -0
- package/dist/status-CoYMK7QL.js +139 -0
- package/dist/{storage-VagEaaJC.js → storage-DzP22xKn.js} +1 -1
- package/dist/storekit-D5eopLM0.js +17 -0
- package/dist/{storekit-CoOf4Rvh.js → storekit-n1x0bWkQ.js} +4 -4
- package/dist/{telemetry-CM0BDwCK.js → telemetry-CXN6f-ZX.js} +2 -2
- package/dist/{token-lUUOkTJA.js → token-FmeHywYt.js} +1 -1
- package/dist/tools-skills/superwall/SKILL.md +49 -31
- package/dist/tools-skills/superwall/references/api.md +3 -2
- package/dist/tools-skills/superwall-editor/SKILL.md +7 -5
- package/dist/tools.d.ts +1 -1
- package/dist/tools.js +575 -75
- package/dist/try-BWbzgelb.js +120 -0
- package/dist/{selection-u2KiKu_d.js → types-JdxmnCko.js} +1 -178
- package/dist/upgrade-Bk5boOgW.js +206 -0
- package/dist/upgrade-CoWCEnoi.js +7 -0
- package/package.json +5 -3
- package/prompts/commandments.xml +2 -0
- package/dist/create-BdZS_T68.js +0 -19
- package/dist/held-DSNUY-NZ.js +0 -16
- package/dist/login-Blrkm6oi.js +0 -16
- package/dist/push-BkMgOT6X.js +0 -24
- package/dist/scan-Kp-MAutK.js +0 -4
- package/dist/server-psYghr9K.js +0 -24
- package/dist/session-CehHJWZk.js +0 -6
- package/dist/skills-DDV4zcLR.js +0 -14
- package/dist/storekit-BcBb2jXB.js +0 -16
- package/dist/upgrade-CpTJv_M7.js +0 -7
- package/dist/upgrade-DZbKb67W.js +0 -117
- /package/dist/{client-BZ1UbpXz.js → client-BJQXl62Q.js} +0 -0
- /package/dist/{devtools-pBl_vt03.js → devtools-ByZ6XYnn.js} +0 -0
- /package/dist/{input-vi0bou04.js → input-MDd67UIp.js} +0 -0
- /package/dist/{reports-CwwKLUh0.js → reports-CuhB1_ub.js} +0 -0
- /package/dist/{screenshot-file-tVBfUEIi.js → screenshot-file-XAS0Xy0e.js} +0 -0
- /package/dist/{storage-gRyQetN9.d.ts → storage-BjQCiTuz.d.ts} +0 -0
- /package/dist/{timing-BVxPrYq3.js → timing-Ca0TXY-A.js} +0 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import "./token-FmeHywYt.js";
|
|
2
|
+
import "./output-Ggzq5_-t.js";
|
|
3
|
+
import "./environment-BWT2S4qC.js";
|
|
4
|
+
import "./storage-DzP22xKn.js";
|
|
5
|
+
import "./client-AI9H4GGB.js";
|
|
6
|
+
import "./config-CGcG7GOt.js";
|
|
7
|
+
import "./spinner-BANVLncC.js";
|
|
8
|
+
import "./ui-D_qf3Gvw.js";
|
|
9
|
+
import "./orgs-D6Kk96mG.js";
|
|
10
|
+
import "./resources-BaP3p_LY.js";
|
|
11
|
+
import "./lookup-gjcKIZvh.js";
|
|
12
|
+
import { n as openBrowser } from "./browser-Bp3yRKlU.js";
|
|
13
|
+
import "./types-JdxmnCko.js";
|
|
14
|
+
import "./scope-CCb_7UvN.js";
|
|
15
|
+
import { S as listWorkspaces, T as setInstallation, a as openLink, c as resolveWorkspace, d as readBinding, g as deleteInstallation, r as latestManifest, s as projectRoot, t as appEntrypointUrl, x as listVersions, y as listInstallations } from "./resolve--GsHj0Q1.js";
|
|
16
|
+
import { r as WorkspaceError } from "./project-CP6hiHra.js";
|
|
17
|
+
import { n as resolveOrganization, t as resolveAppScope } from "./organization-BOECL3vZ.js";
|
|
18
|
+
|
|
19
|
+
//#region src/core/workspaces/install.ts
|
|
20
|
+
const whereLabel = (application) => application === null || application === void 0 ? "the whole organization" : `app ${application}`;
|
|
21
|
+
const installationItem = (installation) => ({
|
|
22
|
+
label: installation.entrypoint_id,
|
|
23
|
+
meta: [
|
|
24
|
+
installation.slot,
|
|
25
|
+
whereLabel(installation.application_id),
|
|
26
|
+
installation.enabled ? "on" : "off",
|
|
27
|
+
`position ${installation.position}`
|
|
28
|
+
].join(", ")
|
|
29
|
+
});
|
|
30
|
+
async function runWorkspaceInstall(ctx, input) {
|
|
31
|
+
const workspace = await resolveWorkspace(ctx, input);
|
|
32
|
+
if (input.entrypoint === void 0) {
|
|
33
|
+
if (input.remove || input.disable || input.app !== void 0 || input.position !== void 0) throw new WorkspaceError("Say which entrypoint: `superwall workspaces install <entrypoint>`.");
|
|
34
|
+
const installations = await listInstallations(ctx.api, workspace.id);
|
|
35
|
+
if (ctx.json) ctx.output.data({ data: installations });
|
|
36
|
+
else ctx.ui.list({
|
|
37
|
+
empty: "Nothing is installed yet.",
|
|
38
|
+
items: installations.map(installationItem)
|
|
39
|
+
});
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const applicationId = input.app === void 0 ? void 0 : (await resolveAppScope(ctx.api, input.app, String(workspace.organization_id))).applicationId;
|
|
43
|
+
if (input.remove) {
|
|
44
|
+
if (!input.yes) {
|
|
45
|
+
if (!ctx.interactive) throw new WorkspaceError("Removing an installation ends sessions that are open. Pass --yes to go ahead.");
|
|
46
|
+
if (!await ctx.ui.confirm({
|
|
47
|
+
message: `Remove \`${input.entrypoint}\` from ${whereLabel(applicationId)}? Sessions that are open will end.`,
|
|
48
|
+
initial: false
|
|
49
|
+
})) {
|
|
50
|
+
ctx.ui.outro("Nothing was removed.");
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const left = await deleteInstallation(ctx.api, workspace.id, input.entrypoint, applicationId);
|
|
55
|
+
if (ctx.json) ctx.output.data(left);
|
|
56
|
+
else ctx.ui.success(`Removed \`${input.entrypoint}\` from ${whereLabel(applicationId)}.`);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const installation = await setInstallation(ctx.api, workspace.id, {
|
|
60
|
+
entrypoint_id: input.entrypoint,
|
|
61
|
+
application_id: applicationId === void 0 ? null : Number(applicationId),
|
|
62
|
+
enabled: !input.disable,
|
|
63
|
+
...input.position === void 0 ? {} : { position: input.position }
|
|
64
|
+
});
|
|
65
|
+
if (ctx.json) {
|
|
66
|
+
ctx.output.data(installation);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
ctx.ui.success(input.disable ? `Turned \`${input.entrypoint}\` off for ${whereLabel(applicationId)}.` : `Installed \`${input.entrypoint}\` for ${whereLabel(applicationId)}.`);
|
|
70
|
+
}
|
|
71
|
+
async function runWorkspaceList(ctx, input) {
|
|
72
|
+
const organizationId = await resolveOrganization(ctx, input.org ?? readBinding(projectRoot(input.dir))?.organizationId);
|
|
73
|
+
const workspaces = await listWorkspaces(ctx.api, organizationId);
|
|
74
|
+
if (ctx.json) {
|
|
75
|
+
ctx.output.data({ data: workspaces });
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
ctx.ui.list({
|
|
79
|
+
empty: `No workspaces in organization ${organizationId} yet.`,
|
|
80
|
+
items: workspaces.map((workspace) => ({
|
|
81
|
+
label: workspace.name,
|
|
82
|
+
meta: `${workspace.slug}, id ${workspace.id}, ${workspace.state.replaceAll("_", " ")}`
|
|
83
|
+
}))
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
async function runWorkspaceOpen(ctx, input, seams = {}) {
|
|
87
|
+
const workspace = await resolveWorkspace(ctx, input);
|
|
88
|
+
if (input.entrypoint !== void 0 && input.app === void 0) throw new WorkspaceError("An entrypoint opens inside an app. Say which with --app <id>.");
|
|
89
|
+
let url;
|
|
90
|
+
if (input.entrypoint !== void 0 && input.app !== void 0) {
|
|
91
|
+
const { applicationId } = await resolveAppScope(ctx.api, input.app, String(workspace.organization_id));
|
|
92
|
+
url = appEntrypointUrl(ctx.api.host, workspace, String(applicationId), input.entrypoint);
|
|
93
|
+
} else url = (await openLink(ctx, workspace, latestManifest(await listVersions(ctx.api, workspace.id).catch(() => [])))).url;
|
|
94
|
+
if (ctx.json) {
|
|
95
|
+
ctx.output.data({ url });
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
ctx.ui.info(`Open ${url}`);
|
|
99
|
+
if (input.open && ctx.outputMode === "rich") await (seams.open ?? openBrowser)(url);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
//#endregion
|
|
103
|
+
export { runWorkspaceInstall, runWorkspaceList, runWorkspaceOpen };
|
|
@@ -1,34 +1,36 @@
|
|
|
1
|
-
import "./token-
|
|
1
|
+
import "./token-FmeHywYt.js";
|
|
2
2
|
import { r as formatJson, t as blocks } from "./output-Ggzq5_-t.js";
|
|
3
|
-
import {
|
|
4
|
-
import { i as removeSession, n as readSession, s as sessionOrgName } from "./storage-
|
|
5
|
-
import { i as superwallApi } from "./client-
|
|
6
|
-
import {
|
|
7
|
-
import { i as updateTelemetryTags } from "./telemetry-
|
|
3
|
+
import { d as DASHBOARD_URL, x as VERSION } from "./environment-BWT2S4qC.js";
|
|
4
|
+
import { i as removeSession, n as readSession, s as sessionOrgName } from "./storage-DzP22xKn.js";
|
|
5
|
+
import { i as superwallApi } from "./client-AI9H4GGB.js";
|
|
6
|
+
import { i as readOnboardedApp } from "./config-CGcG7GOt.js";
|
|
7
|
+
import { i as updateTelemetryTags } from "./telemetry-CXN6f-ZX.js";
|
|
8
8
|
import "./spawn-DmmmHIP-.js";
|
|
9
|
-
import { n as withSpinner } from "./spinner-
|
|
9
|
+
import { n as withSpinner } from "./spinner-BANVLncC.js";
|
|
10
10
|
import { n as ui } from "./ui-D_qf3Gvw.js";
|
|
11
11
|
import "./theme-DUsCh-Vd.js";
|
|
12
|
-
import { t as stripReport } from "./log-
|
|
13
|
-
import { n as SUPPORTED_LABEL, t as scanProject } from "./scan-
|
|
14
|
-
import { t as detectExisting } from "./existing-
|
|
15
|
-
import { r as expandHome } from "./paths-
|
|
16
|
-
import
|
|
17
|
-
import "./
|
|
18
|
-
import "./
|
|
19
|
-
import "./
|
|
20
|
-
import
|
|
21
|
-
import {
|
|
22
|
-
import "./
|
|
23
|
-
import
|
|
24
|
-
import "./
|
|
25
|
-
import
|
|
26
|
-
import {
|
|
27
|
-
import
|
|
28
|
-
import {
|
|
29
|
-
import { n as
|
|
30
|
-
import { r as
|
|
31
|
-
import { n as
|
|
12
|
+
import { t as stripReport } from "./log-C0MDCfA2.js";
|
|
13
|
+
import { n as SUPPORTED_LABEL, t as scanProject } from "./scan-Bj5y0zTZ.js";
|
|
14
|
+
import { t as detectExisting } from "./existing-b0GxFcnc.js";
|
|
15
|
+
import { r as expandHome } from "./paths-REb-GrbX.js";
|
|
16
|
+
import "./orgs-D6Kk96mG.js";
|
|
17
|
+
import { A as listField, O as field, T as rowName, h as listResource, p as listApplications, s as createProduct, y as platformLabel } from "./resources-BaP3p_LY.js";
|
|
18
|
+
import "./org-C04eAO-j.js";
|
|
19
|
+
import "./lookup-gjcKIZvh.js";
|
|
20
|
+
import "./scope-Bp_zwJOo.js";
|
|
21
|
+
import { a as listAscConfigs, r as createAscConfig } from "./client-BJQXl62Q.js";
|
|
22
|
+
import { i as listUnimportedAscProducts, n as findAscAppId, r as listAscApps, t as ascTypeDisplay } from "./products-Cqq59DBQ.js";
|
|
23
|
+
import "./input-MDd67UIp.js";
|
|
24
|
+
import { n as resolveAppBinding, r as resolveScopeFromKey, t as platformForIntegration } from "./bind-B3eEcRyp.js";
|
|
25
|
+
import "./login-PMoXUGqq.js";
|
|
26
|
+
import { s as ensureSkillsCurrent } from "./skills-2qYaUXGE.js";
|
|
27
|
+
import "./browser-Bp3yRKlU.js";
|
|
28
|
+
import { t as generateStoreKit } from "./storekit-n1x0bWkQ.js";
|
|
29
|
+
import { n as performLoginWithUi, t as createLoginGate } from "./login-COmGHrU5.js";
|
|
30
|
+
import { a as copyToClipboard, r as buildCopyPrompt, t as runAction } from "./run-C5OPwhvS.js";
|
|
31
|
+
import { n as selectHostedStatus, t as detectDrivers } from "./drivers-CMEL13gp.js";
|
|
32
|
+
import { r as actionById, t as detectBilling } from "./billing-D5qqIlVb.js";
|
|
33
|
+
import { n as writeReport, t as readReport } from "./reports-CuhB1_ub.js";
|
|
32
34
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
33
35
|
import { basename } from "node:path";
|
|
34
36
|
import fg from "fast-glob";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as fg, t as THEME } from "./theme-DUsCh-Vd.js";
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
2
3
|
import pc from "picocolors";
|
|
3
4
|
import { link } from "ansi-escapes";
|
|
4
5
|
import wrapAnsi from "wrap-ansi";
|
|
5
|
-
import { pathToFileURL } from "node:url";
|
|
6
6
|
|
|
7
7
|
//#region src/ui/log.ts
|
|
8
8
|
function brand(text) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { n as ui } from "./ui-D_qf3Gvw.js";
|
|
2
|
-
import { a as
|
|
2
|
+
import { a as onboardingHooks, t as performLogin } from "./login-PMoXUGqq.js";
|
|
3
|
+
import { t as BROWSER_UNAVAILABLE } from "./browser-Bp3yRKlU.js";
|
|
3
4
|
|
|
4
5
|
//#region src/core/workflows/login.ts
|
|
5
6
|
async function performLoginWithUi(app, onProvisioned) {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "./token-FmeHywYt.js";
|
|
2
|
+
import "./output-Ggzq5_-t.js";
|
|
3
|
+
import "./environment-BWT2S4qC.js";
|
|
4
|
+
import "./storage-DzP22xKn.js";
|
|
5
|
+
import "./client-AI9H4GGB.js";
|
|
6
|
+
import "./config-CGcG7GOt.js";
|
|
7
|
+
import "./telemetry-CXN6f-ZX.js";
|
|
8
|
+
import "./spawn-DmmmHIP-.js";
|
|
9
|
+
import "./spinner-BANVLncC.js";
|
|
10
|
+
import "./ui-D_qf3Gvw.js";
|
|
11
|
+
import "./scan-Bj5y0zTZ.js";
|
|
12
|
+
import "./paths-REb-GrbX.js";
|
|
13
|
+
import { i as startLogin, n as pollLogin, r as runLogin, t as performLogin } from "./login-PMoXUGqq.js";
|
|
14
|
+
import "./skills-2qYaUXGE.js";
|
|
15
|
+
import "./browser-Bp3yRKlU.js";
|
|
16
|
+
|
|
17
|
+
export { performLogin, pollLogin, runLogin, startLogin };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as writePendingLogin, l as writeSession, o as serializeSession, r as removePendingLogin, t as readPendingLogin } from "./storage-
|
|
3
|
-
import { a as
|
|
4
|
-
import { r as track } from "./telemetry-
|
|
5
|
-
import { r as UsageError } from "./spinner-
|
|
1
|
+
import { g as OAUTH_SCOPE, h as Integration, i as AUTH_HOST, l as CLI_CLIENT_ID, t as API_HOST } from "./environment-BWT2S4qC.js";
|
|
2
|
+
import { c as writePendingLogin, l as writeSession, o as serializeSession, r as removePendingLogin, t as readPendingLogin } from "./storage-DzP22xKn.js";
|
|
3
|
+
import { a as readOnboardedOrg, m as writeOnboardedOrg, o as readOnboardingIdempotencyKey, p as writeOnboardedApp } from "./config-CGcG7GOt.js";
|
|
4
|
+
import { r as track } from "./telemetry-CXN6f-ZX.js";
|
|
5
|
+
import { r as UsageError } from "./spinner-BANVLncC.js";
|
|
6
6
|
import { n as ui } from "./ui-D_qf3Gvw.js";
|
|
7
|
-
import { t as scanProject } from "./scan-
|
|
8
|
-
import { s as ensureSkillsCurrent } from "./skills-
|
|
9
|
-
import {
|
|
7
|
+
import { t as scanProject } from "./scan-Bj5y0zTZ.js";
|
|
8
|
+
import { s as ensureSkillsCurrent } from "./skills-2qYaUXGE.js";
|
|
9
|
+
import { n as openBrowser, t as BROWSER_UNAVAILABLE } from "./browser-Bp3yRKlU.js";
|
|
10
10
|
import { setTimeout } from "node:timers/promises";
|
|
11
11
|
|
|
12
12
|
//#region src/core/account/onboarding.ts
|
|
@@ -57,39 +57,6 @@ function onboardingHooks(app) {
|
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
//#endregion
|
|
61
|
-
//#region src/core/account/browser.ts
|
|
62
|
-
const BROWSER_UNAVAILABLE = "Couldn't open a browser here. Open the URL above to approve the login.";
|
|
63
|
-
function hasDisplay(env, platform) {
|
|
64
|
-
if (platform !== "linux") return true;
|
|
65
|
-
return Boolean(env.DISPLAY || env.WAYLAND_DISPLAY || env.WSL_DISTRO_NAME);
|
|
66
|
-
}
|
|
67
|
-
function openBrowser(url, deps = {}) {
|
|
68
|
-
const platform = deps.platform ?? process.platform;
|
|
69
|
-
const env = deps.env ?? process.env;
|
|
70
|
-
if (env.BROWSER === "none" || !hasDisplay(env, platform)) return Promise.resolve(false);
|
|
71
|
-
const cmd = platform === "darwin" ? "open" : platform === "win32" ? "cmd" : "xdg-open";
|
|
72
|
-
const args = platform === "win32" ? [
|
|
73
|
-
"/c",
|
|
74
|
-
"start",
|
|
75
|
-
"",
|
|
76
|
-
url
|
|
77
|
-
] : [url];
|
|
78
|
-
return new Promise((resolve) => {
|
|
79
|
-
try {
|
|
80
|
-
const child = (deps.spawn ?? spawn)(cmd, args, {
|
|
81
|
-
stdio: "ignore",
|
|
82
|
-
detached: true
|
|
83
|
-
});
|
|
84
|
-
child.once("error", () => resolve(false));
|
|
85
|
-
child.once("spawn", () => resolve(true));
|
|
86
|
-
child.unref();
|
|
87
|
-
} catch {
|
|
88
|
-
resolve(false);
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
|
|
93
60
|
//#endregion
|
|
94
61
|
//#region src/core/account/login.ts
|
|
95
62
|
const DEVICE_GRANT = "urn:ietf:params:oauth:grant-type:device_code";
|
|
@@ -589,4 +556,4 @@ async function runLogin(ctx, { flags, openBrowser: openBrowser$1 }) {
|
|
|
589
556
|
}
|
|
590
557
|
|
|
591
558
|
//#endregion
|
|
592
|
-
export {
|
|
559
|
+
export { onboardingHooks as a, startLogin as i, pollLogin as n, runLogin as r, performLogin as t };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { t as ApiError } from "./client-
|
|
2
|
-
import {
|
|
1
|
+
import { t as ApiError } from "./client-AI9H4GGB.js";
|
|
2
|
+
import { a as orgProjects, s as rememberOrg } from "./orgs-D6Kk96mG.js";
|
|
3
|
+
import { m as listProjects } from "./resources-BaP3p_LY.js";
|
|
3
4
|
|
|
4
5
|
//#region src/core/api/lookup.ts
|
|
5
6
|
const DASHBOARD_PATH = /^\/(\d+)(?:\/(\d+))?(?:\/|$)/;
|
|
@@ -68,4 +69,4 @@ function appNotFound(ref) {
|
|
|
68
69
|
}
|
|
69
70
|
|
|
70
71
|
//#endregion
|
|
71
|
-
export { findApplication as n, findProject as r, appNotFound as t };
|
|
72
|
+
export { parseDashboardUrl as i, findApplication as n, findProject as r, appNotFound as t };
|
|
@@ -1,38 +1,43 @@
|
|
|
1
|
-
import "./token-
|
|
1
|
+
import "./token-FmeHywYt.js";
|
|
2
2
|
import { t as blocks } from "./output-Ggzq5_-t.js";
|
|
3
|
-
import {
|
|
4
|
-
import { n as readSession, s as sessionOrgName } from "./storage-
|
|
5
|
-
import "./client-
|
|
6
|
-
import "./config-
|
|
7
|
-
import "./telemetry-
|
|
3
|
+
import { d as DASHBOARD_URL, x as VERSION } from "./environment-BWT2S4qC.js";
|
|
4
|
+
import { n as readSession, s as sessionOrgName } from "./storage-DzP22xKn.js";
|
|
5
|
+
import "./client-AI9H4GGB.js";
|
|
6
|
+
import "./config-CGcG7GOt.js";
|
|
7
|
+
import "./telemetry-CXN6f-ZX.js";
|
|
8
8
|
import "./spawn-DmmmHIP-.js";
|
|
9
|
-
import "./spinner-
|
|
9
|
+
import "./spinner-BANVLncC.js";
|
|
10
10
|
import { n as ui } from "./ui-D_qf3Gvw.js";
|
|
11
11
|
import "./theme-DUsCh-Vd.js";
|
|
12
|
-
import { t as stripReport } from "./log-
|
|
13
|
-
import { t as scanProject } from "./scan-
|
|
14
|
-
import { t as detectExisting } from "./existing-
|
|
15
|
-
import "./paths-
|
|
16
|
-
import "./
|
|
17
|
-
import "./
|
|
18
|
-
import "./
|
|
19
|
-
import "./
|
|
20
|
-
import "./
|
|
21
|
-
import "./
|
|
22
|
-
import
|
|
23
|
-
import "./
|
|
24
|
-
import
|
|
25
|
-
import {
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import "./
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
12
|
+
import { t as stripReport } from "./log-C0MDCfA2.js";
|
|
13
|
+
import { t as scanProject } from "./scan-Bj5y0zTZ.js";
|
|
14
|
+
import { t as detectExisting } from "./existing-b0GxFcnc.js";
|
|
15
|
+
import "./paths-REb-GrbX.js";
|
|
16
|
+
import "./orgs-D6Kk96mG.js";
|
|
17
|
+
import "./resources-BaP3p_LY.js";
|
|
18
|
+
import "./lookup-gjcKIZvh.js";
|
|
19
|
+
import "./login-PMoXUGqq.js";
|
|
20
|
+
import "./skills-2qYaUXGE.js";
|
|
21
|
+
import "./browser-Bp3yRKlU.js";
|
|
22
|
+
import "./assets-BrB9jQPQ.js";
|
|
23
|
+
import "./selection-BltBpyp5.js";
|
|
24
|
+
import "./types-JdxmnCko.js";
|
|
25
|
+
import { n as requireApi } from "./session-D3fgXQBt.js";
|
|
26
|
+
import "./source-push-kAep4gPe.js";
|
|
27
|
+
import "./git-D7AVdugb.js";
|
|
28
|
+
import "./scope-CCb_7UvN.js";
|
|
29
|
+
import { n as performLoginWithUi } from "./login-COmGHrU5.js";
|
|
30
|
+
import { t as runAction } from "./run-C5OPwhvS.js";
|
|
31
|
+
import { t as detectDrivers } from "./drivers-CMEL13gp.js";
|
|
32
|
+
import { a as migrationSource, c as scaffoldFromPaywall, d as findScreenCandidates, f as placementOfName, i as migrationFor, l as scaffoldFromScreen, n as hasOriginal, o as offerMigration, p as screenNameOf, s as projectDirOf, t as buildMigrationCopyPrompt, u as screenMigrationFor } from "./migration-DS44-3Zr.js";
|
|
33
|
+
import "./server-CdVIboQn.js";
|
|
34
|
+
import { i as startStudio, n as migrationNextSteps, r as screenNextSteps, t as askStudio } from "./open-DQpm2yVs.js";
|
|
35
|
+
import { r as actionById, t as detectBilling } from "./billing-D5qqIlVb.js";
|
|
36
|
+
import { n as writeReport } from "./reports-CuhB1_ub.js";
|
|
32
37
|
import { execFile } from "node:child_process";
|
|
33
38
|
import * as fs from "node:fs";
|
|
34
|
-
import * as path from "node:path";
|
|
35
39
|
import * as os$1 from "node:os";
|
|
40
|
+
import * as path from "node:path";
|
|
36
41
|
|
|
37
42
|
//#region src/core/paywalls/simulator.ts
|
|
38
43
|
function createSimulator(run = execFile, platform = os$1.platform()) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as ApiError } from "./client-
|
|
3
|
-
import { t as stripReport } from "./log-
|
|
4
|
-
import { i as readPackageJson, r as allDeps } from "./scan-
|
|
5
|
-
import { l as findPaywall, p as listApplications } from "./resources-
|
|
6
|
-
import { d as readBundledSkill } from "./skills-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { a as copyToClipboard, i as readPrompt, n as runWithDriverFallback } from "./run-
|
|
10
|
-
import { t as detectDrivers } from "./drivers-
|
|
1
|
+
import { d as DASHBOARD_URL } from "./environment-BWT2S4qC.js";
|
|
2
|
+
import { t as ApiError } from "./client-AI9H4GGB.js";
|
|
3
|
+
import { t as stripReport } from "./log-C0MDCfA2.js";
|
|
4
|
+
import { i as readPackageJson, r as allDeps } from "./scan-Bj5y0zTZ.js";
|
|
5
|
+
import { l as findPaywall, p as listApplications } from "./resources-BaP3p_LY.js";
|
|
6
|
+
import { d as readBundledSkill } from "./skills-2qYaUXGE.js";
|
|
7
|
+
import { c as isScreenOrigin, f as readLock, m as writeApp, v as writeOrigin } from "./types-JdxmnCko.js";
|
|
8
|
+
import { a as projectPackageName } from "./session-D3fgXQBt.js";
|
|
9
|
+
import { a as copyToClipboard, i as readPrompt, n as runWithDriverFallback } from "./run-C5OPwhvS.js";
|
|
10
|
+
import { t as detectDrivers } from "./drivers-CMEL13gp.js";
|
|
11
11
|
import * as fs from "node:fs";
|
|
12
12
|
import * as path from "node:path";
|
|
13
13
|
import fg from "fast-glob";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { D as updateServerNotifications, r as chooseKeyApp } from "./held-
|
|
2
|
-
import { t as apiCall } from "./spinner-
|
|
3
|
-
import { i as findAppNotificationUrl } from "./client-
|
|
4
|
-
import { t as timing } from "./timing-
|
|
1
|
+
import { D as updateServerNotifications, r as chooseKeyApp } from "./held-D3PUNky2.js";
|
|
2
|
+
import { t as apiCall } from "./spinner-BANVLncC.js";
|
|
3
|
+
import { i as findAppNotificationUrl } from "./client-BJQXl62Q.js";
|
|
4
|
+
import { t as timing } from "./timing-Ca0TXY-A.js";
|
|
5
5
|
|
|
6
6
|
//#region src/core/app-store-connect/notification-url.ts
|
|
7
7
|
const RETRY_DELAYS = [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as runStudio } from "./server-
|
|
1
|
+
import { T as isNonInteractive } from "./environment-BWT2S4qC.js";
|
|
2
|
+
import { t as runStudio } from "./server-CdVIboQn.js";
|
|
3
3
|
|
|
4
4
|
//#region src/core/paywalls/studio/open.ts
|
|
5
5
|
async function askStudio(ui, interactive, surfaceId, original = true) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { n as withSpinner } from "./spinner-
|
|
1
|
+
import { n as withSpinner } from "./spinner-BANVLncC.js";
|
|
2
2
|
import { n as ui } from "./ui-D_qf3Gvw.js";
|
|
3
|
-
import {
|
|
3
|
+
import { n as listOrganizations, t as listOrgGroups } from "./orgs-D6Kk96mG.js";
|
|
4
|
+
import { E as titleCase, T as rowName } from "./resources-BaP3p_LY.js";
|
|
4
5
|
|
|
5
6
|
//#region src/core/account/org.ts
|
|
6
7
|
async function orgForNewProject(api, interactive) {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { t as apiCall } from "./spinner-BANVLncC.js";
|
|
2
|
+
import { a as orgProjects, i as orgIdOf, n as listOrganizations } from "./orgs-D6Kk96mG.js";
|
|
3
|
+
import { n as findApplication, t as appNotFound } from "./lookup-gjcKIZvh.js";
|
|
4
|
+
import { r as WorkspaceError } from "./project-CP6hiHra.js";
|
|
5
|
+
|
|
6
|
+
//#region src/core/workspaces/organization.ts
|
|
7
|
+
async function resolveAppScope(api, app, org) {
|
|
8
|
+
if (/^\d+$/.test(app) && org !== void 0) return {
|
|
9
|
+
organizationId: org,
|
|
10
|
+
applicationId: app
|
|
11
|
+
};
|
|
12
|
+
const found = await findApplication(api, app, org === void 0 ? void 0 : await orgProjects(api, org));
|
|
13
|
+
if (!found) throw appNotFound(app);
|
|
14
|
+
const home = orgIdOf(found.project);
|
|
15
|
+
if (org !== void 0 && home !== org) throw new WorkspaceError(`App ${app} is in organization ${home ?? "unknown"}, not ${org}.`);
|
|
16
|
+
return {
|
|
17
|
+
organizationId: org ?? home,
|
|
18
|
+
applicationId: String(found.app.id)
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
async function resolveOrganization(ctx, org) {
|
|
22
|
+
if (org !== void 0) return org;
|
|
23
|
+
const organizations = await apiCall(ctx, "Loading your organizations", () => listOrganizations(ctx.api));
|
|
24
|
+
const [only] = organizations;
|
|
25
|
+
if (only !== void 0 && organizations.length === 1) return String(only.id);
|
|
26
|
+
if (!ctx.interactive || organizations.length === 0) throw new WorkspaceError("Say which organization with --org <id>.");
|
|
27
|
+
const picked = await ctx.ui.select({
|
|
28
|
+
message: "Which organization?",
|
|
29
|
+
options: organizations.map((organization) => ({
|
|
30
|
+
value: String(organization.id),
|
|
31
|
+
label: String(organization.name ?? organization.id)
|
|
32
|
+
}))
|
|
33
|
+
});
|
|
34
|
+
if (picked === null) throw new WorkspaceError("No organization picked.");
|
|
35
|
+
return picked;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
export { resolveOrganization as n, resolveAppScope as t };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { t as ApiError } from "./client-AI9H4GGB.js";
|
|
2
|
+
import { h as writeOpenedOrgs, s as readOpenedOrgs } from "./config-CGcG7GOt.js";
|
|
3
|
+
|
|
4
|
+
//#region src/core/api/orgs.ts
|
|
5
|
+
async function listOrganizations(api) {
|
|
6
|
+
const res = await api.get("/v2/me/organizations");
|
|
7
|
+
return [...new Map((res.data ?? []).map((org) => [String(org.id), org])).values()];
|
|
8
|
+
}
|
|
9
|
+
function orgProjects(api, orgId) {
|
|
10
|
+
return api.list(`/v2/projects?organization_id=${encodeURIComponent(orgId)}`).then((projects) => projects.map((project) => ({
|
|
11
|
+
organization_id: orgId,
|
|
12
|
+
...project
|
|
13
|
+
})));
|
|
14
|
+
}
|
|
15
|
+
function orgIdOf(project) {
|
|
16
|
+
return project.organization_id === void 0 ? void 0 : String(project.organization_id);
|
|
17
|
+
}
|
|
18
|
+
function asksForOrg(error) {
|
|
19
|
+
return error instanceof ApiError && error.status === 400 && /organization_id/.test(error.message);
|
|
20
|
+
}
|
|
21
|
+
async function listReachableProjects(api) {
|
|
22
|
+
let members = await api.list("/v2/projects").catch(async (error) => {
|
|
23
|
+
if (!asksForOrg(error)) throw error;
|
|
24
|
+
const orgs = await listOrganizations(api);
|
|
25
|
+
return (await Promise.all(orgs.map((org) => orgProjects(api, String(org.id))))).flat();
|
|
26
|
+
});
|
|
27
|
+
members = unique(members);
|
|
28
|
+
const seen = new Set(members.map(orgIdOf).filter((id) => id !== void 0));
|
|
29
|
+
const opened = readOpenedOrgs().filter((id) => !seen.has(id));
|
|
30
|
+
if (opened.length === 0) return members;
|
|
31
|
+
const reached = await Promise.all(opened.map((id) => {
|
|
32
|
+
return orgProjects(api, id).catch((error) => {
|
|
33
|
+
if (error instanceof ApiError && [
|
|
34
|
+
400,
|
|
35
|
+
403,
|
|
36
|
+
404
|
|
37
|
+
].includes(error.status)) return [];
|
|
38
|
+
throw error;
|
|
39
|
+
});
|
|
40
|
+
}));
|
|
41
|
+
writeOpenedOrgs(opened.filter((_, index) => (reached[index]?.length ?? 0) > 0));
|
|
42
|
+
return [...members, ...reached.flat()];
|
|
43
|
+
}
|
|
44
|
+
function unique(projects) {
|
|
45
|
+
return [...new Map(projects.map((project) => [String(project.id), project])).values()];
|
|
46
|
+
}
|
|
47
|
+
function rememberOrg(project) {
|
|
48
|
+
const id = project && orgIdOf(project);
|
|
49
|
+
if (id) writeOpenedOrgs([...readOpenedOrgs(), id]);
|
|
50
|
+
}
|
|
51
|
+
async function listOrgGroups(api) {
|
|
52
|
+
const [projects, memberships] = await Promise.all([listReachableProjects(api), listOrganizations(api).catch(() => [])]);
|
|
53
|
+
const members = new Map(memberships.map((org) => [String(org.id), org]));
|
|
54
|
+
const groups = /* @__PURE__ */ new Map();
|
|
55
|
+
for (const project of projects) {
|
|
56
|
+
const id = orgIdOf(project) ?? "";
|
|
57
|
+
const name = members.get(id)?.name;
|
|
58
|
+
const group = groups.get(id) ?? {
|
|
59
|
+
id,
|
|
60
|
+
name: typeof name === "string" ? name : void 0,
|
|
61
|
+
member: members.has(id) || id === "",
|
|
62
|
+
projects: []
|
|
63
|
+
};
|
|
64
|
+
group.projects.push(project);
|
|
65
|
+
groups.set(id, group);
|
|
66
|
+
}
|
|
67
|
+
await Promise.all([...groups.values()].filter((group) => !group.member && !group.name).map(async (group) => {
|
|
68
|
+
const org = await api.get(`/v2/organizations/${encodeURIComponent(group.id)}`).catch(() => void 0);
|
|
69
|
+
if (typeof org?.name === "string") group.name = org.name;
|
|
70
|
+
}));
|
|
71
|
+
return [...groups.values()].sort((a, b) => Number(b.member) - Number(a.member));
|
|
72
|
+
}
|
|
73
|
+
async function organizationOf(api, projectId, known) {
|
|
74
|
+
const local = known?.find((project) => String(project.id) === projectId);
|
|
75
|
+
const id = (local && orgIdOf(local)) ?? orgIdOf(await api.get(`/v2/projects/${encodeURIComponent(projectId)}`));
|
|
76
|
+
if (!id) throw new Error(`Couldn't tell which account project ${projectId} belongs to.`);
|
|
77
|
+
return id;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
81
|
+
export { orgProjects as a, orgIdOf as i, listOrganizations as n, organizationOf as o, listReachableProjects as r, rememberOrg as s, listOrgGroups as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as resolveEnv } from "./environment-BWT2S4qC.js";
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
|
-
import { dirname, join } from "node:path";
|
|
4
3
|
import { homedir } from "node:os";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
|
|
7
7
|
//#region src/hosts/paths.ts
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import "./token-
|
|
1
|
+
import "./token-FmeHywYt.js";
|
|
2
2
|
import "./output-Ggzq5_-t.js";
|
|
3
|
-
import "./environment-
|
|
4
|
-
import "./storage-
|
|
5
|
-
import "./client-
|
|
6
|
-
import "./config-
|
|
7
|
-
import { i as updateTelemetryTags, r as track } from "./telemetry-
|
|
3
|
+
import "./environment-BWT2S4qC.js";
|
|
4
|
+
import "./storage-DzP22xKn.js";
|
|
5
|
+
import "./client-AI9H4GGB.js";
|
|
6
|
+
import "./config-CGcG7GOt.js";
|
|
7
|
+
import { i as updateTelemetryTags, r as track } from "./telemetry-CXN6f-ZX.js";
|
|
8
8
|
import "./spawn-DmmmHIP-.js";
|
|
9
|
-
import "./spinner-
|
|
9
|
+
import "./spinner-BANVLncC.js";
|
|
10
10
|
import "./ui-D_qf3Gvw.js";
|
|
11
|
-
import { t as scanProject } from "./scan-
|
|
12
|
-
import "./paths-
|
|
13
|
-
import { d as readBundledSkill } from "./skills-
|
|
14
|
-
import { n as FRAMEWORK_REF, t as detectBilling } from "./billing-
|
|
11
|
+
import { t as scanProject } from "./scan-Bj5y0zTZ.js";
|
|
12
|
+
import "./paths-REb-GrbX.js";
|
|
13
|
+
import { d as readBundledSkill } from "./skills-2qYaUXGE.js";
|
|
14
|
+
import { n as FRAMEWORK_REF, t as detectBilling } from "./billing-D5qqIlVb.js";
|
|
15
15
|
|
|
16
16
|
//#region src/core/workflows/playbook.ts
|
|
17
17
|
async function printPlaybook(installDir, playbook) {
|