@superwall/cli 2.5.0 → 2.6.0-beta.1
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 +7 -0
- package/dist/{apple-Dyr7OFBx.js → apple-Bmt_iywx.js} +14 -14
- package/dist/{approve-Czs1-JO9.js → approve-D2UgqaRx.js} +31 -27
- package/dist/{assets-BrB9jQPQ.js → assets-B_quADds.js} +3 -3
- package/dist/auth.d.ts +1 -1
- package/dist/auth.js +3 -3
- package/dist/{session-D3fgXQBt.js → base-ChTi42M0.js} +35 -35
- package/dist/{billing-D5qqIlVb.js → billing-ZIETn0j4.js} +3 -3
- package/dist/{bind-B3eEcRyp.js → bind-ClFjTt0U.js} +4 -4
- package/dist/{build-DD9pSwHX.js → build-BWjXurjs.js} +11 -9
- package/dist/{client-AI9H4GGB.js → client-CyrYJzBF.js} +3 -3
- package/dist/create-7HDW3DCl.js +20 -0
- package/dist/{create-B4m-IKlr.js → create-BCIgjRHn.js} +6 -6
- package/dist/{create-ChfgWpiM.js → create-C3uklw-U.js} +31 -31
- package/dist/design-lint-CiFc78aM.js +158 -0
- package/dist/{doctor-XtXW6tKE.js → doctor-D2Q1EZe8.js} +6 -6
- package/dist/{drivers-CMEL13gp.js → drivers-BQkO5tHs.js} +3 -3
- package/dist/entry.js +20 -20
- package/dist/{environment-BWT2S4qC.js → environment-BocmdvZ-.js} +3 -3
- package/dist/{existing-b0GxFcnc.js → existing-Cl5x6_5u.js} +2 -2
- package/dist/{selection-BltBpyp5.js → framework-CLmf4swr.js} +50 -50
- package/dist/{held-D3PUNky2.js → held-Bykbwy-m.js} +6 -6
- package/dist/held-Chw3BtBV.js +17 -0
- package/dist/install-dXZZ79Oe.js +109 -0
- package/dist/{integrate-qvKd9pVW.js → integrate-DiSjlOjC.js} +23 -23
- package/dist/{types-JdxmnCko.js → lock-DgSx-p8Y.js} +79 -79
- package/dist/{login-PMoXUGqq.js → login-5sWIKDI2.js} +6 -6
- package/dist/login-DZ8Pipf6.js +17 -0
- package/dist/{login-COmGHrU5.js → login-Jp6E6d2e.js} +1 -1
- package/dist/{lookup-gjcKIZvh.js → lookup-CWzVfPpq.js} +3 -3
- package/dist/{migrate-SkkLLdmr.js → migrate-BKiOUsMY.js} +29 -29
- package/dist/{migration-DS44-3Zr.js → migration-Z69tLeHC.js} +29 -11
- package/dist/{notification-url-BjQPLf4-.js → notification-url-BDBxbwZq.js} +2 -2
- package/dist/{open-DQpm2yVs.js → open-DNd49kT-.js} +2 -2
- package/dist/{org-C04eAO-j.js → org-Dud1rF9f.js} +3 -3
- package/dist/{organization-BOECL3vZ.js → organization-7vJA3uy1.js} +8 -8
- package/dist/{orgs-D6Kk96mG.js → orgs-Z0H9WOs1.js} +1 -1
- package/dist/{paths-REb-GrbX.js → paths-CzTJVpfi.js} +1 -1
- package/dist/{playbook-Du4Oydbf.js → playbook-DJ__edOW.js} +10 -10
- package/dist/{project-CP6hiHra.js → project-NoMtbMyl.js} +9 -9
- package/dist/{promote-Dm2_b1WK.js → promote-DLtPSvmL.js} +23 -22
- package/dist/{pull-F6pvO4To.js → pull-AoUmaiMK.js} +8 -8
- package/dist/pull-C1xm2zqG.js +36 -0
- package/dist/pull-D-YuT3e0.js +106 -0
- package/dist/push-B42D8fKf.js +22 -0
- package/dist/{push-BIFLhAiO.js → push-BMblzg_6.js} +122 -22
- package/dist/{push-D_l9KJZN.js → push-BrzMFd4Z.js} +47 -47
- package/dist/push-Co5jk6Kr.js +30 -0
- package/dist/{registry-DIJB0mJa.js → registry-DDU10_Ix.js} +176 -155
- package/dist/resolve-DpOSDDdr.js +196 -0
- package/dist/{resources-BaP3p_LY.js → resources-CptT7HD6.js} +2 -2
- package/dist/{run-C5OPwhvS.js → run-c1O2_8pp.js} +2 -2
- package/dist/{run-CgLmD2vR.js → run-r3foWfhV.js} +93 -70
- package/dist/scan-D86kLtM7.js +4 -0
- package/dist/{scan-Bj5y0zTZ.js → scan-nVQO7JLx.js} +1 -1
- package/dist/{scope-CCb_7UvN.js → scope-ehZ7L1nj.js} +25 -11
- package/dist/{scope-Bp_zwJOo.js → scope-l1qGLsgz.js} +5 -5
- package/dist/{sdk-TvT0p_nO.js → sdk-DEfQttek.js} +7 -7
- package/dist/{series-TAixFBWW.js → series-D2ZpZ8cx.js} +96 -63
- package/dist/server-BEcsQaPu.js +29 -0
- package/dist/{server-CdVIboQn.js → server-DLARhh1k.js} +9 -9
- package/dist/session-Csuaw6RU.js +6 -0
- package/dist/{session-Ywim-P8M.js → session-Z0BeaJPf.js} +1 -1
- package/dist/{setup-zzjtTy8k.js → setup-C6NFy14d.js} +9 -9
- package/dist/skills/index.json +2 -2
- package/dist/skills/{superwall-workspaces → superwall-artifacts}/SKILL.md +41 -31
- package/dist/skills/{superwall-workspaces → superwall-artifacts}/references/cli.md +31 -28
- package/dist/skills/{superwall-workspaces → superwall-artifacts}/references/slots.md +9 -9
- package/dist/{skills-2qYaUXGE.js → skills-421SFEyF.js} +4 -4
- package/dist/{skills-8um2fBPS.js → skills-CdKwaTRS.js} +8 -8
- package/dist/{git-D7AVdugb.js → source-BccdO4aL.js} +111 -102
- package/dist/{source-push-kAep4gPe.js → source-push-B4s6r9bB.js} +43 -26
- package/dist/{spinner-BANVLncC.js → spinner-DPdBlZe2.js} +3 -3
- package/dist/{starter-CiLrp1cN.js → starter-0OdVPH4l.js} +27 -27
- package/dist/{status-CoYMK7QL.js → status-Dsc7d3z2.js} +42 -39
- package/dist/{storage-DzP22xKn.js → storage-DT_wxwJ8.js} +1 -1
- package/dist/{storekit-n1x0bWkQ.js → storekit-B9M2raxe.js} +3 -3
- package/dist/storekit-BWZf-fNE.js +17 -0
- package/dist/{telemetry-CXN6f-ZX.js → telemetry-ovPiseFm.js} +1 -1
- package/dist/{token-FmeHywYt.js → token-Bu3FaRkv.js} +1 -1
- package/dist/tools.d.ts +1 -1
- package/dist/tools.js +148 -128
- package/dist/{try-BWbzgelb.js → try-B8FYkTvQ.js} +29 -29
- package/dist/{upgrade-Bk5boOgW.js → upgrade-B7TmvEPP.js} +2 -2
- package/dist/{upgrade-CoWCEnoi.js → upgrade-CAHyrWUL.js} +2 -2
- package/package.json +2 -2
- package/dist/create-CJljlkJK.js +0 -20
- package/dist/held-CX7Zf8u-.js +0 -17
- package/dist/install-CVUXsx8c.js +0 -103
- package/dist/login-ClnJi1Ea.js +0 -17
- package/dist/pull-DsdOoG-D.js +0 -36
- package/dist/pull-zYAbqo9n.js +0 -106
- package/dist/push-CJVfvFZq.js +0 -29
- package/dist/push-SVzv7fzE.js +0 -22
- package/dist/resolve--GsHj0Q1.js +0 -171
- package/dist/scan-v_WTE722.js +0 -4
- package/dist/server-CvJVusw3.js +0 -29
- package/dist/session-B8JNXkwN.js +0 -6
- package/dist/storekit-D5eopLM0.js +0 -17
- /package/dist/{download-2Zu2I_Og.js → download-DhGd4hOB.js} +0 -0
- /package/dist/{reports-CuhB1_ub.js → reports-HYVp169R.js} +0 -0
- /package/dist/{storage-BjQCiTuz.d.ts → storage-Bdz5AmqS.d.ts} +0 -0
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import "./token-
|
|
1
|
+
import "./token-Bu3FaRkv.js";
|
|
2
2
|
import "./output-Ggzq5_-t.js";
|
|
3
|
-
import "./environment-
|
|
4
|
-
import "./storage-
|
|
5
|
-
import { t as ApiError } from "./client-
|
|
3
|
+
import "./environment-BocmdvZ-.js";
|
|
4
|
+
import "./storage-DT_wxwJ8.js";
|
|
5
|
+
import { t as ApiError } from "./client-CyrYJzBF.js";
|
|
6
6
|
import "./config-CGcG7GOt.js";
|
|
7
|
-
import "./spinner-
|
|
7
|
+
import "./spinner-DPdBlZe2.js";
|
|
8
8
|
import "./ui-D_qf3Gvw.js";
|
|
9
|
-
import "./orgs-
|
|
10
|
-
import "./resources-
|
|
11
|
-
import "./lookup-
|
|
9
|
+
import "./orgs-Z0H9WOs1.js";
|
|
10
|
+
import "./resources-CptT7HD6.js";
|
|
11
|
+
import "./lookup-CWzVfPpq.js";
|
|
12
12
|
import { n as openBrowser } from "./browser-Bp3yRKlU.js";
|
|
13
|
-
import "./
|
|
14
|
-
import "./
|
|
15
|
-
import "./
|
|
16
|
-
import
|
|
17
|
-
import { a as
|
|
18
|
-
import {
|
|
19
|
-
import
|
|
20
|
-
import { i as warnIfSdkBehind } from "./sdk-
|
|
13
|
+
import { r as dashboardOrigin } from "./resolve-DpOSDDdr.js";
|
|
14
|
+
import { a as findEntrypoint, s as readProject, t as ArtifactError } from "./project-NoMtbMyl.js";
|
|
15
|
+
import "./lock-DgSx-p8Y.js";
|
|
16
|
+
import "./scope-ehZ7L1nj.js";
|
|
17
|
+
import { _ as DRAFT_MODULE_MAX_BYTES, a as summarizeSeries, c as defaultRange, n as parseFilters, u as bundleArtifact } from "./series-D2ZpZ8cx.js";
|
|
18
|
+
import { n as resolveOrganization, t as resolveAppScope } from "./organization-7vJA3uy1.js";
|
|
19
|
+
import "./download-DhGd4hOB.js";
|
|
20
|
+
import { i as warnIfSdkBehind } from "./sdk-DEfQttek.js";
|
|
21
21
|
|
|
22
|
-
//#region src/core/
|
|
22
|
+
//#region src/core/artifacts/try.ts
|
|
23
23
|
async function postDraft(ctx, path, body) {
|
|
24
24
|
try {
|
|
25
25
|
return await ctx.api.post(path, body);
|
|
26
26
|
} catch (error) {
|
|
27
|
-
if (error instanceof ApiError && error.status === 400) throw new
|
|
27
|
+
if (error instanceof ApiError && error.status === 400) throw new ArtifactError(error.message);
|
|
28
28
|
throw error;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
async function uploadDraft(ctx, project, organizationId, wrangler) {
|
|
32
|
-
const { module, bytes } = await
|
|
33
|
-
if (bytes > DRAFT_MODULE_MAX_BYTES) throw new
|
|
34
|
-
return postDraft(ctx, "/v2/
|
|
32
|
+
const { module, bytes } = await bundleArtifact(project.root, wrangler);
|
|
33
|
+
if (bytes > DRAFT_MODULE_MAX_BYTES) throw new ArtifactError(`The bundle is ${bytes} bytes; a draft can be ${DRAFT_MODULE_MAX_BYTES} at most.`);
|
|
34
|
+
return postDraft(ctx, "/v2/artifacts/drafts", {
|
|
35
35
|
organization_id: Number(organizationId),
|
|
36
36
|
manifest: project.manifest,
|
|
37
37
|
module
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
async function tryMetric(ctx, project, entrypoint, input, wrangler) {
|
|
41
|
-
if (input.app === void 0) throw new
|
|
41
|
+
if (input.app === void 0) throw new ArtifactError("A metric runs for one app. Say which with --app <id>.");
|
|
42
42
|
const { organizationId, applicationId } = await resolveAppScope(ctx.api, input.app, input.org);
|
|
43
|
-
if (organizationId === void 0) throw new
|
|
43
|
+
if (organizationId === void 0) throw new ArtifactError(`Couldn't find the organization of app ${input.app}. Say which with --org <id>.`);
|
|
44
44
|
const range = defaultRange(input.days);
|
|
45
45
|
const filters = parseFilters(input.filter);
|
|
46
46
|
const draft = await uploadDraft(ctx, project, organizationId, wrangler);
|
|
47
|
-
const run = await postDraft(ctx, `/v2/
|
|
47
|
+
const run = await postDraft(ctx, `/v2/artifacts/drafts/${encodeURIComponent(draft.id)}/metric`, {
|
|
48
48
|
organization_id: Number(organizationId),
|
|
49
49
|
application_id: Number(applicationId),
|
|
50
50
|
entrypoint_id: entrypoint.id,
|
|
@@ -82,14 +82,14 @@ async function tryMetric(ctx, project, entrypoint, input, wrangler) {
|
|
|
82
82
|
const round = (value) => Math.round(value * 1e3) / 1e3;
|
|
83
83
|
async function tryFrame(ctx, project, entrypoint, input, seams) {
|
|
84
84
|
const scope = input.app === void 0 ? { organizationId: await resolveOrganization(ctx, input.org) } : await resolveAppScope(ctx.api, input.app, input.org);
|
|
85
|
-
if (scope.organizationId === void 0) throw new
|
|
85
|
+
if (scope.organizationId === void 0) throw new ArtifactError(`Couldn't find the organization of app ${input.app}. Say which with --org <id>.`);
|
|
86
86
|
const draft = await uploadDraft(ctx, project, scope.organizationId, seams.wrangler);
|
|
87
87
|
const search = new URLSearchParams({ entrypoint: entrypoint.id });
|
|
88
88
|
if (scope.applicationId !== void 0) search.set("app", scope.applicationId);
|
|
89
89
|
if (input.campaign !== void 0) search.set("campaign", input.campaign);
|
|
90
90
|
if (input.user !== void 0) search.set("user", input.user);
|
|
91
91
|
if (input.environment !== void 0) search.set("environment", input.environment);
|
|
92
|
-
const url = `${dashboardOrigin(ctx.api.host)}/${scope.organizationId}/
|
|
92
|
+
const url = `${dashboardOrigin(ctx.api.host)}/${scope.organizationId}/artifact-drafts/${draft.id}?${search}`;
|
|
93
93
|
if (ctx.json) {
|
|
94
94
|
ctx.output.data({
|
|
95
95
|
draft_id: draft.id,
|
|
@@ -105,9 +105,9 @@ async function tryFrame(ctx, project, entrypoint, input, seams) {
|
|
|
105
105
|
if (input.open && ctx.outputMode === "rich") await (seams.open ?? openBrowser)(url);
|
|
106
106
|
}
|
|
107
107
|
function tryReadout(entrypoint) {
|
|
108
|
-
throw new
|
|
108
|
+
throw new ArtifactError(`\`${entrypoint.id}\` (${entrypoint.slot}) is a readout, and readouts can't be tried on the real runtime yet. Run \`superwall artifacts dev\` to run it locally.`);
|
|
109
109
|
}
|
|
110
|
-
async function
|
|
110
|
+
async function runArtifactTry(ctx, input, seams = {}) {
|
|
111
111
|
const project = readProject(input.dir);
|
|
112
112
|
const entrypoint = findEntrypoint(project.manifest, input.entrypoint);
|
|
113
113
|
await warnIfSdkBehind(ctx.ui, project.root);
|
|
@@ -117,4 +117,4 @@ async function runWorkspaceTry(ctx, input, seams = {}) {
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
//#endregion
|
|
120
|
-
export {
|
|
120
|
+
export { runArtifactTry };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as RUNNING_VIA_NPX, a as AUTO_UPDATE, x as VERSION } from "./environment-
|
|
1
|
+
import { _ as RUNNING_VIA_NPX, a as AUTO_UPDATE, x as VERSION } from "./environment-BocmdvZ-.js";
|
|
2
2
|
import { c as readSkillsSync, d as writeAutoUpdate, l as readUpdateCheck, n as readAutoUpdate, v as writeUpdateCheck } from "./config-CGcG7GOt.js";
|
|
3
3
|
import { r as spawnStream } from "./spawn-DmmmHIP-.js";
|
|
4
4
|
import { execFileSync } from "node:child_process";
|
|
@@ -111,7 +111,7 @@ async function updateAgentSkills(ctx, work) {
|
|
|
111
111
|
return skills;
|
|
112
112
|
}
|
|
113
113
|
async function updateSkillsInProcess() {
|
|
114
|
-
const { updateSkills } = await import("./skills-
|
|
114
|
+
const { updateSkills } = await import("./skills-CdKwaTRS.js");
|
|
115
115
|
return updateSkills();
|
|
116
116
|
}
|
|
117
117
|
async function updateSkillsWithInstalledCli(version) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./output-Ggzq5_-t.js";
|
|
2
|
-
import "./environment-
|
|
2
|
+
import "./environment-BocmdvZ-.js";
|
|
3
3
|
import "./config-CGcG7GOt.js";
|
|
4
4
|
import "./spawn-DmmmHIP-.js";
|
|
5
|
-
import { a as printAutoUpdate, c as runUpgrade, i as maybeNotifyUpdate, l as selectAutoUpdate, n as isGlobalInstall, o as recordAutoUpdate, r as isNewerVersion, s as refreshUpdateCheck, t as flushUpdateCheck } from "./upgrade-
|
|
5
|
+
import { a as printAutoUpdate, c as runUpgrade, i as maybeNotifyUpdate, l as selectAutoUpdate, n as isGlobalInstall, o as recordAutoUpdate, r as isNewerVersion, s as refreshUpdateCheck, t as flushUpdateCheck } from "./upgrade-B7TmvEPP.js";
|
|
6
6
|
|
|
7
7
|
export { flushUpdateCheck, isGlobalInstall, isNewerVersion, maybeNotifyUpdate, printAutoUpdate, recordAutoUpdate, refreshUpdateCheck, runUpgrade, selectAutoUpdate };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superwall/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0-beta.1",
|
|
4
4
|
"description": "The official CLI for managing Superwall from your terminal or coding agent.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"@anthropic-ai/claude-agent-sdk": "0.3.201",
|
|
67
|
-
"@superwall/studio": "2.
|
|
67
|
+
"@superwall/studio": "2.6.0-beta.1",
|
|
68
68
|
"ansi-escapes": "^7.3.0",
|
|
69
69
|
"fast-glob": "^3.3.3",
|
|
70
70
|
"ink": "^5.2.1",
|
package/dist/create-CJljlkJK.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
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 "./held-D3PUNky2.js";
|
|
7
|
-
import "./config-CGcG7GOt.js";
|
|
8
|
-
import "./spinner-BANVLncC.js";
|
|
9
|
-
import "./ui-D_qf3Gvw.js";
|
|
10
|
-
import "./paths-REb-GrbX.js";
|
|
11
|
-
import "./orgs-D6Kk96mG.js";
|
|
12
|
-
import "./resources-BaP3p_LY.js";
|
|
13
|
-
import "./org-C04eAO-j.js";
|
|
14
|
-
import "./lookup-gjcKIZvh.js";
|
|
15
|
-
import "./scope-Bp_zwJOo.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-B4m-IKlr.js";
|
|
19
|
-
|
|
20
|
-
export { createAndSaveKey, keyAccess, keyRole, runAscKeysCreate };
|
package/dist/held-CX7Zf8u-.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
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 { t as upsertHeldKey } from "./held-D3PUNky2.js";
|
|
7
|
-
import "./config-CGcG7GOt.js";
|
|
8
|
-
import "./spinner-BANVLncC.js";
|
|
9
|
-
import "./ui-D_qf3Gvw.js";
|
|
10
|
-
import "./orgs-D6Kk96mG.js";
|
|
11
|
-
import "./resources-BaP3p_LY.js";
|
|
12
|
-
import "./org-C04eAO-j.js";
|
|
13
|
-
import "./lookup-gjcKIZvh.js";
|
|
14
|
-
import "./scope-Bp_zwJOo.js";
|
|
15
|
-
import "./client-BJQXl62Q.js";
|
|
16
|
-
|
|
17
|
-
export { upsertHeldKey };
|
package/dist/install-CVUXsx8c.js
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
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 };
|
package/dist/login-ClnJi1Ea.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
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 };
|
package/dist/pull-DsdOoG-D.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
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 "./theme-DUsCh-Vd.js";
|
|
12
|
-
import "./log-C0MDCfA2.js";
|
|
13
|
-
import "./scan-Bj5y0zTZ.js";
|
|
14
|
-
import "./existing-b0GxFcnc.js";
|
|
15
|
-
import "./paths-REb-GrbX.js";
|
|
16
|
-
import "./orgs-D6Kk96mG.js";
|
|
17
|
-
import "./resources-BaP3p_LY.js";
|
|
18
|
-
import "./org-C04eAO-j.js";
|
|
19
|
-
import "./lookup-gjcKIZvh.js";
|
|
20
|
-
import "./bind-B3eEcRyp.js";
|
|
21
|
-
import "./login-PMoXUGqq.js";
|
|
22
|
-
import "./skills-2qYaUXGE.js";
|
|
23
|
-
import "./browser-Bp3yRKlU.js";
|
|
24
|
-
import "./selection-BltBpyp5.js";
|
|
25
|
-
import "./types-JdxmnCko.js";
|
|
26
|
-
import "./session-D3fgXQBt.js";
|
|
27
|
-
import "./git-D7AVdugb.js";
|
|
28
|
-
import "./scope-CCb_7UvN.js";
|
|
29
|
-
import "./login-COmGHrU5.js";
|
|
30
|
-
import "./run-C5OPwhvS.js";
|
|
31
|
-
import "./drivers-CMEL13gp.js";
|
|
32
|
-
import "./migration-DS44-3Zr.js";
|
|
33
|
-
import "./setup-zzjtTy8k.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-F6pvO4To.js";
|
|
35
|
-
|
|
36
|
-
export { PullPathError, applyPulledChanges, appsToPull, boundPaywall, cloneInto, cloneTarget, mergePulledLock, pullInto, runPull };
|
package/dist/pull-zYAbqo9n.js
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
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 "./theme-DUsCh-Vd.js";
|
|
12
|
-
import "./log-C0MDCfA2.js";
|
|
13
|
-
import "./scan-Bj5y0zTZ.js";
|
|
14
|
-
import "./existing-b0GxFcnc.js";
|
|
15
|
-
import "./paths-REb-GrbX.js";
|
|
16
|
-
import "./orgs-D6Kk96mG.js";
|
|
17
|
-
import "./resources-BaP3p_LY.js";
|
|
18
|
-
import "./org-C04eAO-j.js";
|
|
19
|
-
import "./lookup-gjcKIZvh.js";
|
|
20
|
-
import "./bind-B3eEcRyp.js";
|
|
21
|
-
import "./login-PMoXUGqq.js";
|
|
22
|
-
import "./skills-2qYaUXGE.js";
|
|
23
|
-
import "./browser-Bp3yRKlU.js";
|
|
24
|
-
import "./selection-BltBpyp5.js";
|
|
25
|
-
import "./types-JdxmnCko.js";
|
|
26
|
-
import "./session-D3fgXQBt.js";
|
|
27
|
-
import { a as collectSourceFiles, n as pullSourceTree } from "./git-D7AVdugb.js";
|
|
28
|
-
import { r as WORKSPACE_DERIVED_FILES } from "./scope-CCb_7UvN.js";
|
|
29
|
-
import "./login-COmGHrU5.js";
|
|
30
|
-
import "./run-C5OPwhvS.js";
|
|
31
|
-
import "./drivers-CMEL13gp.js";
|
|
32
|
-
import "./migration-DS44-3Zr.js";
|
|
33
|
-
import "./download-2Zu2I_Og.js";
|
|
34
|
-
import "./setup-zzjtTy8k.js";
|
|
35
|
-
import { n as applyPulledChanges } from "./pull-F6pvO4To.js";
|
|
36
|
-
import { C as mintSourceAccess, c as resolveWorkspace, d as readBinding, f as readSourceFile, p as writeBinding, s as projectRoot } from "./resolve--GsHj0Q1.js";
|
|
37
|
-
import { r as WorkspaceError } from "./project-CP6hiHra.js";
|
|
38
|
-
import "./organization-BOECL3vZ.js";
|
|
39
|
-
import "./sdk-TvT0p_nO.js";
|
|
40
|
-
import { a as toSourceAccess } from "./push-D_l9KJZN.js";
|
|
41
|
-
import * as fs from "node:fs";
|
|
42
|
-
import * as path from "node:path";
|
|
43
|
-
|
|
44
|
-
//#region src/core/workspaces/pull.ts
|
|
45
|
-
const NOT_PUSHED = "Its source repo is empty: nobody has pushed yet. Run `superwall workspaces push` first.";
|
|
46
|
-
function report(ctx, slug, head, written, skipped) {
|
|
47
|
-
if (ctx.json) {
|
|
48
|
-
ctx.output.data({
|
|
49
|
-
slug,
|
|
50
|
-
head,
|
|
51
|
-
written,
|
|
52
|
-
skipped
|
|
53
|
-
});
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
ctx.ui.success(written.length === 0 ? "Already up to date." : `Pulled ${written.length} ${written.length === 1 ? "file" : "files"} of \`${slug}\`.`);
|
|
57
|
-
if (written.length > 0) ctx.ui.list({ items: written.map((label) => ({ label })) });
|
|
58
|
-
if (skipped.length > 0) ctx.ui.warn(`Not pulled, because a file of yours that git doesn't track is in the way: ${skipped.join(", ")}. Move it, then pull again.`);
|
|
59
|
-
}
|
|
60
|
-
function assertCloneTarget(root) {
|
|
61
|
-
if (!fs.existsSync(root)) return;
|
|
62
|
-
if (fs.readdirSync(root).length > 0) throw new WorkspaceError(`${root} already has files and isn't linked to this workspace. Pick an empty directory.`);
|
|
63
|
-
}
|
|
64
|
-
async function runWorkspacePull(ctx, input) {
|
|
65
|
-
const root = projectRoot(input.dir);
|
|
66
|
-
const linked = readBinding(root);
|
|
67
|
-
const workspace = await resolveWorkspace(ctx, input);
|
|
68
|
-
if (linked && linked.workspaceId !== String(workspace.id)) throw new WorkspaceError(`This project is linked to workspace ${linked.workspaceId}, not ${workspace.id}. Pull into an empty directory instead.`);
|
|
69
|
-
if (!linked) assertCloneTarget(root);
|
|
70
|
-
fs.mkdirSync(root, { recursive: true });
|
|
71
|
-
const collected = linked ? await collectSourceFiles(root, readSourceFile) : {
|
|
72
|
-
ok: true,
|
|
73
|
-
files: []
|
|
74
|
-
};
|
|
75
|
-
if (!collected.ok) throw new WorkspaceError(collected.reason);
|
|
76
|
-
const pulled = await pullSourceTree({
|
|
77
|
-
access: toSourceAccess(await mintSourceAccess(ctx.api, workspace.id)),
|
|
78
|
-
files: collected.files,
|
|
79
|
-
base: linked?.syncedCommit,
|
|
80
|
-
theirs: input.theirs,
|
|
81
|
-
derived: WORKSPACE_DERIVED_FILES
|
|
82
|
-
});
|
|
83
|
-
if (pulled.status === "empty") throw new WorkspaceError(NOT_PUSHED);
|
|
84
|
-
const { written, skipped } = applyPulledChanges(root, pulled.changes, new Set(collected.files.map((file) => file.path)));
|
|
85
|
-
writeBinding(root, {
|
|
86
|
-
workspaceId: String(workspace.id),
|
|
87
|
-
organizationId: String(workspace.organization_id),
|
|
88
|
-
slug: workspace.slug,
|
|
89
|
-
...skipped.length > 0 ? {
|
|
90
|
-
syncedCommit: linked?.syncedCommit,
|
|
91
|
-
reviewedCommit: linked?.reviewedCommit
|
|
92
|
-
} : {
|
|
93
|
-
syncedCommit: pulled.head,
|
|
94
|
-
reviewedCommit: pulled.head
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
report(ctx, workspace.slug, pulled.head, written, skipped);
|
|
98
|
-
if (linked && written.length > 0 && !ctx.json) ctx.ui.info("Read what came in before you push: your own copy runs all of it with your reads.");
|
|
99
|
-
if (!linked && !ctx.json) {
|
|
100
|
-
const where = path.relative(process.cwd(), root) || ".";
|
|
101
|
-
ctx.ui.info(`Next: cd ${where} && npm install && superwall workspaces dev`);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
//#endregion
|
|
106
|
-
export { runWorkspacePull };
|
package/dist/push-CJVfvFZq.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
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 "./orgs-D6Kk96mG.js";
|
|
14
|
-
import "./resources-BaP3p_LY.js";
|
|
15
|
-
import "./lookup-gjcKIZvh.js";
|
|
16
|
-
import "./login-PMoXUGqq.js";
|
|
17
|
-
import "./skills-2qYaUXGE.js";
|
|
18
|
-
import "./browser-Bp3yRKlU.js";
|
|
19
|
-
import "./assets-BrB9jQPQ.js";
|
|
20
|
-
import "./selection-BltBpyp5.js";
|
|
21
|
-
import "./types-JdxmnCko.js";
|
|
22
|
-
import "./session-D3fgXQBt.js";
|
|
23
|
-
import "./source-push-kAep4gPe.js";
|
|
24
|
-
import { i as timed, n as runPush, r as runPushPipeline, t as group } from "./push-BIFLhAiO.js";
|
|
25
|
-
import "./git-D7AVdugb.js";
|
|
26
|
-
import "./scope-CCb_7UvN.js";
|
|
27
|
-
import "./login-COmGHrU5.js";
|
|
28
|
-
|
|
29
|
-
export { group, runPush, runPushPipeline, timed };
|
package/dist/push-SVzv7fzE.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
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 "./types-JdxmnCko.js";
|
|
13
|
-
import "./git-D7AVdugb.js";
|
|
14
|
-
import "./scope-CCb_7UvN.js";
|
|
15
|
-
import "./download-2Zu2I_Og.js";
|
|
16
|
-
import "./resolve--GsHj0Q1.js";
|
|
17
|
-
import "./project-CP6hiHra.js";
|
|
18
|
-
import "./organization-BOECL3vZ.js";
|
|
19
|
-
import "./sdk-TvT0p_nO.js";
|
|
20
|
-
import { a as toSourceAccess, i as slugOfName, n as namesOf, o as waitForBuild, r as runWorkspacePush, t as IncomingCommitsRefused } from "./push-D_l9KJZN.js";
|
|
21
|
-
|
|
22
|
-
export { IncomingCommitsRefused, namesOf, runWorkspacePush, slugOfName, toSourceAccess, waitForBuild };
|