@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,16 +1,16 @@
|
|
|
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 "./orgs-
|
|
8
|
-
import "./
|
|
9
|
-
import "./
|
|
10
|
-
import
|
|
11
|
-
import
|
|
7
|
+
import "./orgs-Z0H9WOs1.js";
|
|
8
|
+
import { C as listVersions, S as listMembers, T as requestDeploy, a as newestFirst, d as visibilityOf, i as latestManifest, l as resolveArtifact, n as awaitingInstall, o as openLink, s as pickVersion, u as roleCanApprove, v as getBuild, y as getMe } from "./resolve-DpOSDDdr.js";
|
|
9
|
+
import { t as ArtifactError } from "./project-NoMtbMyl.js";
|
|
10
|
+
import "./lock-DgSx-p8Y.js";
|
|
11
|
+
import "./scope-ehZ7L1nj.js";
|
|
12
12
|
|
|
13
|
-
//#region src/core/
|
|
13
|
+
//#region src/core/artifacts/status.ts
|
|
14
14
|
const SHOWN_VERSIONS = 3;
|
|
15
15
|
const STATE_LABEL = {
|
|
16
16
|
active: "Live",
|
|
@@ -28,7 +28,7 @@ const versionMeta = (version, activeId, authorId) => [
|
|
|
28
28
|
const isUnfinished = (version) => version.build_status === "PENDING" || version.build_status === "BUILDING";
|
|
29
29
|
async function settle(ctx, version) {
|
|
30
30
|
try {
|
|
31
|
-
return await getBuild(ctx.api, version.
|
|
31
|
+
return await getBuild(ctx.api, version.artifact_id, version.id);
|
|
32
32
|
} catch (error) {
|
|
33
33
|
if (error instanceof ApiError && [
|
|
34
34
|
403,
|
|
@@ -38,44 +38,47 @@ async function settle(ctx, version) {
|
|
|
38
38
|
throw error;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
async function
|
|
42
|
-
const
|
|
43
|
-
let versions = newestFirst(await listVersions(ctx.api,
|
|
41
|
+
async function runArtifactStatus(ctx, input) {
|
|
42
|
+
const artifact = await resolveArtifact(ctx, input);
|
|
43
|
+
let versions = newestFirst(await listVersions(ctx.api, artifact.id));
|
|
44
44
|
const [latest] = versions;
|
|
45
45
|
const build = latest && isUnfinished(latest) ? await settle(ctx, latest) : void 0;
|
|
46
46
|
if (build) versions = versions.map((version) => version.id === build.version.id ? build.version : version);
|
|
47
|
-
const { url } = await openLink(ctx,
|
|
47
|
+
const { url } = await openLink(ctx, artifact, latestManifest(versions));
|
|
48
|
+
const live = versions.find((version) => version.id === artifact.active_version_id);
|
|
49
|
+
const notInstalled = artifact.state === "active" && await awaitingInstall(ctx.api, artifact.id, live?.manifest);
|
|
48
50
|
if (ctx.json) {
|
|
49
51
|
ctx.output.data({
|
|
50
|
-
|
|
52
|
+
artifact,
|
|
51
53
|
url,
|
|
52
54
|
versions,
|
|
53
|
-
build: build ?? null
|
|
55
|
+
build: build ?? null,
|
|
56
|
+
awaiting_install: notInstalled
|
|
54
57
|
});
|
|
55
58
|
return;
|
|
56
59
|
}
|
|
57
|
-
|
|
60
|
+
const label = notInstalled ? "Approved, but nothing is installed yet, so only its author can see it" : STATE_LABEL[artifact.state];
|
|
61
|
+
ctx.ui.success(`${artifact.name} (\`${artifact.slug}\`, id ${artifact.id}): ${label}`);
|
|
58
62
|
ctx.ui.info(`Open ${url}`);
|
|
59
63
|
const newest = input.all ? versions : versions.slice(0, SHOWN_VERSIONS);
|
|
60
|
-
const
|
|
61
|
-
const shown = active && !newest.includes(active) ? [...newest, active] : newest;
|
|
64
|
+
const shown = live && !newest.includes(live) ? [...newest, live] : newest;
|
|
62
65
|
ctx.ui.list({
|
|
63
|
-
empty: "No versions yet. Run `superwall
|
|
66
|
+
empty: "No versions yet. Run `superwall artifacts push`.",
|
|
64
67
|
items: shown.map((version) => ({
|
|
65
68
|
label: `Version ${version.id}`,
|
|
66
|
-
meta: versionMeta(version,
|
|
69
|
+
meta: versionMeta(version, artifact.active_version_id, artifact.author_version_id)
|
|
67
70
|
}))
|
|
68
71
|
});
|
|
69
72
|
const hidden = versions.length - shown.length;
|
|
70
73
|
if (hidden > 0) ctx.ui.info(`And ${hidden} older ${hidden === 1 ? "version" : "versions"}. See them all with --all.`);
|
|
71
74
|
if (build?.step) ctx.ui.info(`Version ${build.version_id} is at ${build.step}.`);
|
|
72
75
|
const failed = versions.find((version) => version.build_status === "FAILED" && version.id === latest?.id);
|
|
73
|
-
if (failed) ctx.ui.warn(`Version ${failed.id} didn't build: ${failed.build_error ?? "see `superwall
|
|
76
|
+
if (failed) ctx.ui.warn(`Version ${failed.id} didn't build: ${failed.build_error ?? "see `superwall artifacts logs`."}`);
|
|
74
77
|
}
|
|
75
|
-
async function
|
|
76
|
-
const
|
|
77
|
-
const { version } = await pickVersion(ctx,
|
|
78
|
-
const build = await getBuild(ctx.api,
|
|
78
|
+
async function runArtifactLogs(ctx, input) {
|
|
79
|
+
const artifact = await resolveArtifact(ctx, input);
|
|
80
|
+
const { version } = await pickVersion(ctx, artifact, input.version);
|
|
81
|
+
const build = await getBuild(ctx.api, artifact.id, version.id);
|
|
79
82
|
if (ctx.json) {
|
|
80
83
|
ctx.output.data({
|
|
81
84
|
version_id: build.version_id,
|
|
@@ -100,10 +103,10 @@ async function runWorkspaceLogs(ctx, input) {
|
|
|
100
103
|
}
|
|
101
104
|
const NAMES_SHOWN = 5;
|
|
102
105
|
const canApprove = (member) => member.status === "active" && (member.role === "OWNER" || member.role === "ADMIN") && member.project_access_mode !== "RESTRICTED";
|
|
103
|
-
async function approvers(ctx,
|
|
104
|
-
const [members, me] = await Promise.all([listMembers(ctx.api,
|
|
106
|
+
async function approvers(ctx, artifact) {
|
|
107
|
+
const [members, me] = await Promise.all([listMembers(ctx.api, artifact.organization_id).catch(() => []), getMe(ctx.api).catch(() => void 0)]);
|
|
105
108
|
const mine = me?.email ? members.find((member) => member.email === me.email) : void 0;
|
|
106
|
-
const admin = mine ? canApprove(mine) : await roleCanApprove(ctx,
|
|
109
|
+
const admin = mine ? canApprove(mine) : await roleCanApprove(ctx, artifact);
|
|
107
110
|
const names = members.filter(canApprove).map((member) => member.name || member.email).filter((name) => Boolean(name));
|
|
108
111
|
return {
|
|
109
112
|
admin,
|
|
@@ -114,13 +117,13 @@ function askLine(names) {
|
|
|
114
117
|
if (names.length === 0) return "Ask an organization owner or admin to approve it.";
|
|
115
118
|
return `Ask one of the people who can approve it: ${names.slice(0, NAMES_SHOWN).join(", ")}${names.length > NAMES_SHOWN ? ` or ${names.length - NAMES_SHOWN} more` : ""}.`;
|
|
116
119
|
}
|
|
117
|
-
async function
|
|
118
|
-
const
|
|
119
|
-
const { version } = await pickVersion(ctx,
|
|
120
|
-
if (version.id ===
|
|
121
|
-
const requested = await requestDeploy(ctx.api,
|
|
122
|
-
const { admin, names } = await approvers(ctx,
|
|
123
|
-
const { visibleTo, sentence } = await visibilityOf(ctx,
|
|
120
|
+
async function runArtifactShare(ctx, input) {
|
|
121
|
+
const artifact = await resolveArtifact(ctx, input);
|
|
122
|
+
const { version } = await pickVersion(ctx, artifact, input.version, (candidate) => candidate.build_status === "SUCCEEDED");
|
|
123
|
+
if (version.id === artifact.active_version_id) throw new ArtifactError(`Version ${version.id} is already live. Push a new version to ask for review.`);
|
|
124
|
+
const requested = await requestDeploy(ctx.api, artifact.id, version.id);
|
|
125
|
+
const { admin, names } = await approvers(ctx, artifact);
|
|
126
|
+
const { visibleTo, sentence } = await visibilityOf(ctx, artifact.id, version.id, version.manifest);
|
|
124
127
|
if (ctx.json) {
|
|
125
128
|
ctx.output.data({
|
|
126
129
|
...requested,
|
|
@@ -132,8 +135,8 @@ async function runWorkspaceShare(ctx, input) {
|
|
|
132
135
|
}
|
|
133
136
|
ctx.ui.success(`Version ${version.id} is marked for review. ${sentence}`);
|
|
134
137
|
if (!admin) ctx.ui.info(`Nobody is told automatically. ${askLine(names)}`);
|
|
135
|
-
ctx.ui.info(`An admin approves it with \`superwall
|
|
138
|
+
ctx.ui.info(`An admin approves it with \`superwall artifacts approve ${version.id} --artifact ${artifact.id}\`.`);
|
|
136
139
|
}
|
|
137
140
|
|
|
138
141
|
//#endregion
|
|
139
|
-
export {
|
|
142
|
+
export { runArtifactLogs, runArtifactShare, runArtifactStatus };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { l as readJson, r as formatJson, u as state } from "./output-Ggzq5_-t.js";
|
|
2
|
-
import { n as API_HOST_OVERRIDE, t as API_HOST } from "./environment-
|
|
2
|
+
import { n as API_HOST_OVERRIDE, t as API_HOST } from "./environment-BocmdvZ-.js";
|
|
3
3
|
|
|
4
4
|
//#region src/core/account/storage.ts
|
|
5
5
|
const sessionOrgName = (session) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as formatJson } from "./output-Ggzq5_-t.js";
|
|
2
|
-
import { t as apiCall } from "./spinner-
|
|
3
|
-
import { h as listResource } from "./resources-
|
|
4
|
-
import { a as pickScope } from "./scope-
|
|
2
|
+
import { t as apiCall } from "./spinner-DPdBlZe2.js";
|
|
3
|
+
import { h as listResource } from "./resources-CptT7HD6.js";
|
|
4
|
+
import { a as pickScope } from "./scope-l1qGLsgz.js";
|
|
5
5
|
import { r as textOf } from "./input-MDd67UIp.js";
|
|
6
6
|
import { writeFileSync } from "node:fs";
|
|
7
7
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "./token-Bu3FaRkv.js";
|
|
2
|
+
import "./output-Ggzq5_-t.js";
|
|
3
|
+
import "./environment-BocmdvZ-.js";
|
|
4
|
+
import "./storage-DT_wxwJ8.js";
|
|
5
|
+
import "./client-CyrYJzBF.js";
|
|
6
|
+
import "./config-CGcG7GOt.js";
|
|
7
|
+
import "./spinner-DPdBlZe2.js";
|
|
8
|
+
import "./ui-D_qf3Gvw.js";
|
|
9
|
+
import "./orgs-Z0H9WOs1.js";
|
|
10
|
+
import "./resources-CptT7HD6.js";
|
|
11
|
+
import "./org-Dud1rF9f.js";
|
|
12
|
+
import "./lookup-CWzVfPpq.js";
|
|
13
|
+
import "./scope-l1qGLsgz.js";
|
|
14
|
+
import "./input-MDd67UIp.js";
|
|
15
|
+
import { n as writeStoreKit, t as generateStoreKit } from "./storekit-B9M2raxe.js";
|
|
16
|
+
|
|
17
|
+
export { generateStoreKit, writeStoreKit };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as isNonInteractive, v as TELEMETRY_HOST, x as VERSION, y as TELEMETRY_KEY } from "./environment-
|
|
1
|
+
import { T as isNonInteractive, v as TELEMETRY_HOST, x as VERSION, y as TELEMETRY_KEY } from "./environment-BocmdvZ-.js";
|
|
2
2
|
import { _ as writeTelemetryNoticeShown, t as readAnonymousId, u as telemetryNoticeShown } from "./config-CGcG7GOt.js";
|
|
3
3
|
|
|
4
4
|
//#region src/core/support/telemetry.ts
|
package/dist/tools.d.ts
CHANGED