@superwall/cli 1.2.0 → 1.3.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -4
- package/dist/{actions-DYQTxMXS.js → actions-DvHycH3X.js} +2 -2
- package/dist/{api-B2Zsf08U.js → api-B50i89j0.js} +9 -9
- package/dist/{api-output-B5hh0q4V.js → api-output-D9ggXQIr.js} +1 -1
- package/dist/{app-rYAP19Jo.js → app-FiC9SQVp.js} +11 -11
- package/dist/{asa-DlM6dlPD.js → asa-B5hrBL3t.js} +11 -11
- package/dist/{asc-D6qBCfuj.js → asc-CRtRYv17.js} +12 -12
- package/dist/{auth-BEnVvJlK.js → auth-CYognaF4.js} +10 -10
- package/dist/auth.js +2 -2
- package/dist/{billing-DO-gNWvW.js → billing-CSOUhWso.js} +1 -1
- package/dist/{bind-KZhPLTdC.js → bind-BbzBenoP.js} +4 -4
- package/dist/{command-B12qooZb.js → command-B7Te31wp.js} +93 -102
- package/dist/{create-BTEvRC1X.js → create--Q8nPgoa.js} +18 -18
- package/dist/{dev-CwfCGm36.js → dev-Dr6gXH-o.js} +37 -19
- package/dist/{doctor-DIxs8i8A.js → doctor-Cf0qNjbq.js} +10 -10
- package/dist/{drivers-D6Ka26e2.js → drivers-ItOmKzrw.js} +2 -2
- package/dist/entry.js +523 -467
- package/dist/{existing-CECenoHS.js → existing-B-e22WOr.js} +2 -2
- package/dist/{feedback-CV2coV73.js → feedback-C3UtAxye.js} +9 -9
- package/dist/{git-CCJwXufi.js → git-2wRxiwOc.js} +10 -10
- package/dist/{hosted-BCwzTTEw.js → hosted-vk05ZF6w.js} +3 -3
- package/dist/{integrate-Bhq0wkU0.js → integrate-Cv8r_i2l.js} +28 -27
- package/dist/{login-D5TjqsXJ.js → login-DOES7Kup.js} +8 -7
- package/dist/{migrate-Cz7VqQNj.js → migrate-C7R29RPH.js} +20 -20
- package/dist/{org-B2gy9Pmu.js → org-Cg25bcsj.js} +3 -3
- package/dist/output-D2Ax_hHL.js +123 -0
- package/dist/{params-Bvq0iqQK.js → params-B1zeElGa.js} +1 -2
- package/dist/{pipeline-ChRDxU9b.js → pipeline-BVeUA6Ig.js} +105 -98
- package/dist/{print-skill-BPePCjy4.js → print-skill-D-R81bno.js} +7 -7
- package/dist/{promote-C54bfsg3.js → promote-CV_Lsmqd.js} +18 -18
- package/dist/publish-CSnNvHHi.js +35 -0
- package/dist/push-sjnRI6iL.js +35 -0
- package/dist/{query-CXjrBFow.js → query-CdcWSinl.js} +10 -10
- package/dist/{resource-CM2bIB5v.js → resource-PVg0uzSK.js} +13 -13
- package/dist/{resources-CVrWwA1K.js → resources-s64mBHaC.js} +1 -0
- package/dist/{run-CAIDPbwe.js → run-XIkrFIgw.js} +2 -2
- package/dist/{scan-BrikLKx5.js → scan-Dk0ZlCY6.js} +2 -2
- package/dist/{skills-BwXcAVIf.js → skills-B-mR2CqM.js} +4 -3
- package/dist/{skills-_TULXe09.js → skills-CoEIW0mE.js} +8 -8
- package/dist/{spinner-gOxIMz-V.js → spinner-B9dT3DBY.js} +1 -1
- package/dist/{telemetry-CpIXSAbQ.js → telemetry-yJs7t0rt.js} +6 -41
- package/dist/{token-DHRH8cxi.js → token-GcbyH6G8.js} +2 -2
- package/dist/{ui-C4ncRJqd.js → ui-Lqt_zFOr.js} +5 -1
- package/dist/update-B4hoLAN-.js +59 -0
- package/dist/{upgrade-BNPbzr5V.js → upgrade-ByCYDXgb.js} +6 -6
- package/package.json +4 -4
- package/dist/json-C3hPIMkI.js +0 -7
- package/dist/publish-NUNSIKri.js +0 -35
- package/dist/push-BjEpY9-h.js +0 -35
- package/dist/update-BdcpwRu_.js +0 -137
package/README.md
CHANGED
|
@@ -152,7 +152,7 @@ export default function PlusUpgrade() {
|
|
|
152
152
|
|
|
153
153
|
One concern each: `useProducts`, `usePurchase` (resolves `completed |
|
|
154
154
|
abandoned | failed`, never throws for flow outcomes), `useActions`,
|
|
155
|
-
`useHaptics`, `useColorScheme`, `useTranslation`, `
|
|
155
|
+
`useHaptics`, `useColorScheme`, `useTranslation`, `useIntroductoryOffer`,
|
|
156
156
|
`useDevice` / `useUser` / `useVariables`, `useLocalResource`,
|
|
157
157
|
`useSuperwallEvent`, `useGameController`.
|
|
158
158
|
|
|
@@ -179,9 +179,11 @@ checkout and in-app browsers hand a flow back where it left off.
|
|
|
179
179
|
and funnel as a live card, and an editor with a device-frame preview (nine
|
|
180
180
|
devices, iPhone SE to Desktop), light/dark, locale switching, and live
|
|
181
181
|
controls for the user, device, params, and product variables the SDK
|
|
182
|
-
reports.
|
|
183
|
-
|
|
184
|
-
|
|
182
|
+
reports. The studio hosts each preview the way the native SDK hosts a
|
|
183
|
+
webview: it answers the paywall's `ping` over the SDK protocol with products,
|
|
184
|
+
device, user and eligibility, and asks you for every purchase, restore,
|
|
185
|
+
permission and callback outcome. Product data is read from Superwall, never
|
|
186
|
+
invented, and the same build runs unchanged inside a real SDK webview.
|
|
185
187
|
|
|
186
188
|
### Push, promote, publish
|
|
187
189
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as loadBundledSkill } from "./skills-
|
|
1
|
+
import { d as Integration } from "./output-D2Ax_hHL.js";
|
|
2
|
+
import { i as loadBundledSkill } from "./skills-B-mR2CqM.js";
|
|
3
3
|
|
|
4
4
|
//#region src/core/agent/actions.ts
|
|
5
5
|
/** Skill reference file per framework, so an agent only sees its own platform's docs. */
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import "./update-
|
|
4
|
-
import "./token-
|
|
5
|
-
import { t as defineCommand } from "./command-
|
|
6
|
-
import "./ui-
|
|
7
|
-
import { C as rowName, h as listResource, m as listProjects, p as listOrganizations, w as titleCase, y as platformLabel } from "./resources-
|
|
8
|
-
import { t as parseParams } from "./params-
|
|
9
|
-
import { n as emitJson, t as apiCall } from "./api-output-
|
|
1
|
+
import "./output-D2Ax_hHL.js";
|
|
2
|
+
import "./telemetry-yJs7t0rt.js";
|
|
3
|
+
import "./update-B4hoLAN-.js";
|
|
4
|
+
import "./token-GcbyH6G8.js";
|
|
5
|
+
import { t as defineCommand } from "./command-B7Te31wp.js";
|
|
6
|
+
import "./ui-Lqt_zFOr.js";
|
|
7
|
+
import { C as rowName, h as listResource, m as listProjects, p as listOrganizations, w as titleCase, y as platformLabel } from "./resources-s64mBHaC.js";
|
|
8
|
+
import { t as parseParams } from "./params-B1zeElGa.js";
|
|
9
|
+
import { n as emitJson, t as apiCall } from "./api-output-D9ggXQIr.js";
|
|
10
10
|
import pc from "picocolors";
|
|
11
11
|
|
|
12
12
|
//#region src/commands/platform/api.ts
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { i as loadSession, r as clearSession } from "./token-
|
|
2
|
-
import {
|
|
3
|
-
import { n as ui } from "./ui-
|
|
4
|
-
import { n as performLogin, r as onboardingHooks } from "./login-
|
|
5
|
-
import { i as SUPPORTED_LABEL, t as scanProject } from "./scan-
|
|
6
|
-
import { r as getHostedStatus } from "./hosted-
|
|
7
|
-
import { t as withSpinner } from "./spinner-
|
|
8
|
-
import { n as resolveAppBinding, r as resolveScopeFromKey, t as platformForIntegration } from "./bind-
|
|
9
|
-
import { t as ACTIONS } from "./actions-
|
|
1
|
+
import { i as loadSession, r as clearSession } from "./token-GcbyH6G8.js";
|
|
2
|
+
import { i as superwallApi } from "./command-B7Te31wp.js";
|
|
3
|
+
import { n as ui } from "./ui-Lqt_zFOr.js";
|
|
4
|
+
import { n as performLogin, r as onboardingHooks } from "./login-DOES7Kup.js";
|
|
5
|
+
import { i as SUPPORTED_LABEL, t as scanProject } from "./scan-Dk0ZlCY6.js";
|
|
6
|
+
import { r as getHostedStatus } from "./hosted-vk05ZF6w.js";
|
|
7
|
+
import { t as withSpinner } from "./spinner-B9dT3DBY.js";
|
|
8
|
+
import { n as resolveAppBinding, r as resolveScopeFromKey, t as platformForIntegration } from "./bind-BbzBenoP.js";
|
|
9
|
+
import { t as ACTIONS } from "./actions-DvHycH3X.js";
|
|
10
10
|
|
|
11
11
|
//#region src/commands/workflow/integrate/app.ts
|
|
12
12
|
async function performLoginWithUi(app, onProvisioned) {
|
|
@@ -69,7 +69,7 @@ async function recoverUnmatchedScope(app, apiKey) {
|
|
|
69
69
|
if (choice === "relogin") {
|
|
70
70
|
clearSession();
|
|
71
71
|
if (!await performLoginWithUi(app)) return null;
|
|
72
|
-
const resolved = await withSpinner("Finding this app in Superwall", () => resolveScopeFromKey(
|
|
72
|
+
const resolved = await withSpinner("Finding this app in Superwall", () => resolveScopeFromKey(superwallApi(), apiKey).catch(() => null));
|
|
73
73
|
if (resolved) {
|
|
74
74
|
ui.success(`Found \`${resolved.appName ?? app.name}\``);
|
|
75
75
|
return {
|
|
@@ -84,7 +84,7 @@ async function recoverUnmatchedScope(app, apiKey) {
|
|
|
84
84
|
continue;
|
|
85
85
|
}
|
|
86
86
|
try {
|
|
87
|
-
const bound = await resolveAppBinding(
|
|
87
|
+
const bound = await resolveAppBinding(superwallApi(), {
|
|
88
88
|
platform: platformForIntegration(app.integration),
|
|
89
89
|
appName: app.name
|
|
90
90
|
});
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import "./update-
|
|
4
|
-
import "./token-
|
|
5
|
-
import { n as ApiError, t as defineCommand } from "./command-
|
|
6
|
-
import "./ui-
|
|
7
|
-
import "./spinner-
|
|
8
|
-
import { m as listProjects } from "./resources-
|
|
9
|
-
import { t as requireOrg } from "./org-
|
|
10
|
-
import { t as parseParams } from "./params-
|
|
11
|
-
import { n as emitJson, t as apiCall } from "./api-output-
|
|
1
|
+
import "./output-D2Ax_hHL.js";
|
|
2
|
+
import "./telemetry-yJs7t0rt.js";
|
|
3
|
+
import "./update-B4hoLAN-.js";
|
|
4
|
+
import "./token-GcbyH6G8.js";
|
|
5
|
+
import { n as ApiError, t as defineCommand } from "./command-B7Te31wp.js";
|
|
6
|
+
import "./ui-Lqt_zFOr.js";
|
|
7
|
+
import "./spinner-B9dT3DBY.js";
|
|
8
|
+
import { m as listProjects } from "./resources-s64mBHaC.js";
|
|
9
|
+
import { t as requireOrg } from "./org-Cg25bcsj.js";
|
|
10
|
+
import { t as parseParams } from "./params-B1zeElGa.js";
|
|
11
|
+
import { n as emitJson, t as apiCall } from "./api-output-D9ggXQIr.js";
|
|
12
12
|
import { readFileSync } from "node:fs";
|
|
13
13
|
|
|
14
14
|
//#region src/core/api/asa.ts
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import "./update-
|
|
4
|
-
import "./token-
|
|
5
|
-
import { t as defineCommand } from "./command-
|
|
6
|
-
import "./ui-
|
|
7
|
-
import "./spinner-
|
|
8
|
-
import { C as rowName } from "./resources-
|
|
9
|
-
import { t as requireOrg } from "./org-
|
|
10
|
-
import { t as parseParams } from "./params-
|
|
11
|
-
import { n as emitJson, t as apiCall } from "./api-output-
|
|
1
|
+
import { p as SUPERWALL_HOME } from "./output-D2Ax_hHL.js";
|
|
2
|
+
import "./telemetry-yJs7t0rt.js";
|
|
3
|
+
import "./update-B4hoLAN-.js";
|
|
4
|
+
import "./token-GcbyH6G8.js";
|
|
5
|
+
import { t as defineCommand } from "./command-B7Te31wp.js";
|
|
6
|
+
import "./ui-Lqt_zFOr.js";
|
|
7
|
+
import "./spinner-B9dT3DBY.js";
|
|
8
|
+
import { C as rowName } from "./resources-s64mBHaC.js";
|
|
9
|
+
import { t as requireOrg } from "./org-Cg25bcsj.js";
|
|
10
|
+
import { t as parseParams } from "./params-B1zeElGa.js";
|
|
11
|
+
import { n as emitJson, t as apiCall } from "./api-output-D9ggXQIr.js";
|
|
12
12
|
import { a as ascProxy, c as listAscConfigs, i as listAscApps, n as fetchUnimportedAscProducts, o as createAscConfig, r as findAscAppId, s as deleteAscConfig, t as ascTypeDisplay } from "./asc-products-C6MvSy8H.js";
|
|
13
13
|
import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
14
14
|
import { homedir } from "node:os";
|
|
@@ -20,7 +20,7 @@ import { inflateRawSync } from "node:zlib";
|
|
|
20
20
|
const SPEC_URL = "https://developer.apple.com/sample-code/app-store-connect/app-store-connect-openapi-specification.zip";
|
|
21
21
|
const REFRESH_TTL_MS = 10080 * 60 * 1e3;
|
|
22
22
|
function cachePath() {
|
|
23
|
-
return process.env.SUPERWALL_ASC_INDEX_PATH ?? join(homedir(), ".superwall", "asc-index.json");
|
|
23
|
+
return process.env.SUPERWALL_ASC_INDEX_PATH ?? join(SUPERWALL_HOME() ?? join(homedir(), ".superwall"), "asc-index.json");
|
|
24
24
|
}
|
|
25
25
|
let mem;
|
|
26
26
|
function readCachedIndex() {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
import "./update-
|
|
4
|
-
import { i as loadSession, r as clearSession } from "./token-
|
|
5
|
-
import { t as defineCommand } from "./command-
|
|
6
|
-
import "./ui-
|
|
7
|
-
import { n as ensureSkillsCurrent } from "./skills-
|
|
1
|
+
import { a as API_HOST } from "./output-D2Ax_hHL.js";
|
|
2
|
+
import { i as track } from "./telemetry-yJs7t0rt.js";
|
|
3
|
+
import "./update-B4hoLAN-.js";
|
|
4
|
+
import { i as loadSession, r as clearSession } from "./token-GcbyH6G8.js";
|
|
5
|
+
import { t as defineCommand } from "./command-B7Te31wp.js";
|
|
6
|
+
import "./ui-Lqt_zFOr.js";
|
|
7
|
+
import { n as ensureSkillsCurrent } from "./skills-B-mR2CqM.js";
|
|
8
8
|
import "./spawn-DSoTXy_j.js";
|
|
9
|
-
import { n as performLogin, r as onboardingHooks, t as loginWithApiKey } from "./login-
|
|
10
|
-
import { t as scanProject } from "./scan-
|
|
9
|
+
import { n as performLogin, r as onboardingHooks, t as loginWithApiKey } from "./login-DOES7Kup.js";
|
|
10
|
+
import { t as scanProject } from "./scan-Dk0ZlCY6.js";
|
|
11
11
|
|
|
12
12
|
//#region src/commands/account/auth.ts
|
|
13
13
|
const runLogin = defineCommand({
|
|
@@ -119,7 +119,7 @@ const runWhoami = defineCommand({
|
|
|
119
119
|
}
|
|
120
120
|
});
|
|
121
121
|
function effectiveHost(session) {
|
|
122
|
-
return process.env.SUPERWALL_API_HOST ?? session.host ?? API_HOST;
|
|
122
|
+
return process.env.SUPERWALL_API_HOST ?? session.host ?? API_HOST();
|
|
123
123
|
}
|
|
124
124
|
function sessionOutput(session) {
|
|
125
125
|
return {
|
package/dist/auth.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import { n as resolveAuthToken, o as NotLoggedInError, t as getOAuthAccessToken } from "./token-
|
|
1
|
+
import "./output-D2Ax_hHL.js";
|
|
2
|
+
import { n as resolveAuthToken, o as NotLoggedInError, t as getOAuthAccessToken } from "./token-GcbyH6G8.js";
|
|
3
3
|
|
|
4
4
|
export { NotLoggedInError, getOAuthAccessToken, resolveAuthToken };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as ui } from "./ui-
|
|
3
|
-
import { m as listProjects, n as createApplication, s as createProject, y as platformLabel } from "./resources-
|
|
4
|
-
import { t as requireOrg } from "./org-
|
|
1
|
+
import { d as Integration } from "./output-D2Ax_hHL.js";
|
|
2
|
+
import { n as ui } from "./ui-Lqt_zFOr.js";
|
|
3
|
+
import { m as listProjects, n as createApplication, s as createProject, y as platformLabel } from "./resources-s64mBHaC.js";
|
|
4
|
+
import { t as requireOrg } from "./org-Cg25bcsj.js";
|
|
5
5
|
|
|
6
6
|
//#region src/core/account/bind.ts
|
|
7
7
|
const NEW = "__new__";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
4
|
-
import {
|
|
1
|
+
import { a as API_HOST, i as writeJson, n as createCommandOutput, v as isNonInteractive } from "./output-D2Ax_hHL.js";
|
|
2
|
+
import { i as track, n as maybeShowTelemetryNotice } from "./telemetry-yJs7t0rt.js";
|
|
3
|
+
import { a as refreshUpdateCheck, i as maybeNotifyUpdate } from "./update-B4hoLAN-.js";
|
|
4
|
+
import { a as saveSession, i as loadSession, n as resolveAuthToken, o as NotLoggedInError } from "./token-GcbyH6G8.js";
|
|
5
|
+
import { r as useRenderer, t as selectRenderer } from "./ui-Lqt_zFOr.js";
|
|
5
6
|
import pc from "picocolors";
|
|
6
7
|
import { resolve } from "node:path";
|
|
7
8
|
|
|
@@ -57,47 +58,25 @@ var ApiUnreachableError = class extends Error {
|
|
|
57
58
|
this.cause = cause;
|
|
58
59
|
}
|
|
59
60
|
};
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
get userEmail() {
|
|
81
|
-
return this.session.userEmail;
|
|
82
|
-
}
|
|
83
|
-
setOrg(org) {
|
|
84
|
-
this.session = {
|
|
85
|
-
...this.session,
|
|
86
|
-
orgId: org.id,
|
|
87
|
-
orgName: org.name
|
|
88
|
-
};
|
|
89
|
-
saveSession(this.session);
|
|
90
|
-
}
|
|
91
|
-
get host() {
|
|
92
|
-
return process.env.SUPERWALL_API_HOST ?? this.session.host ?? API_HOST;
|
|
93
|
-
}
|
|
94
|
-
base() {
|
|
95
|
-
return this.host;
|
|
96
|
-
}
|
|
97
|
-
async request(method, path, body, options = {}) {
|
|
98
|
-
const { token, session } = await resolveAuthToken(this.session);
|
|
99
|
-
this.session = session;
|
|
100
|
-
const res = await this.fetch(`${this.base()}${path}`, {
|
|
61
|
+
const PAGE_LIMIT = 50;
|
|
62
|
+
const createSuperwallApi = (initial) => {
|
|
63
|
+
let session = initial;
|
|
64
|
+
const host = () => process.env.SUPERWALL_API_HOST ?? session.host ?? API_HOST();
|
|
65
|
+
const send = async (url, init) => {
|
|
66
|
+
try {
|
|
67
|
+
return await fetch(url, init);
|
|
68
|
+
} catch (error) {
|
|
69
|
+
throw new ApiUnreachableError(host(), error);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const authorized = async () => {
|
|
73
|
+
const resolved = await resolveAuthToken(session);
|
|
74
|
+
session = resolved.session;
|
|
75
|
+
return resolved.token;
|
|
76
|
+
};
|
|
77
|
+
const request = async (method, path, body, options = {}) => {
|
|
78
|
+
const token = await authorized();
|
|
79
|
+
const res = await send(`${host()}${path}`, {
|
|
101
80
|
method,
|
|
102
81
|
headers: {
|
|
103
82
|
...options.headers,
|
|
@@ -113,61 +92,73 @@ var SuperwallApi = class SuperwallApi {
|
|
|
113
92
|
}
|
|
114
93
|
if (res.status === 204) return void 0;
|
|
115
94
|
return await res.json();
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
out
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
95
|
+
};
|
|
96
|
+
const api = {
|
|
97
|
+
get org() {
|
|
98
|
+
const override = process.env.SUPERWALL_ORG_ID;
|
|
99
|
+
return {
|
|
100
|
+
id: override ?? session.orgId,
|
|
101
|
+
name: override ? void 0 : session.orgName,
|
|
102
|
+
count: session.orgCount ?? 1
|
|
103
|
+
};
|
|
104
|
+
},
|
|
105
|
+
get userEmail() {
|
|
106
|
+
return session.userEmail;
|
|
107
|
+
},
|
|
108
|
+
get host() {
|
|
109
|
+
return host();
|
|
110
|
+
},
|
|
111
|
+
setOrg(org) {
|
|
112
|
+
session = {
|
|
113
|
+
...session,
|
|
114
|
+
orgId: org.id,
|
|
115
|
+
orgName: org.name
|
|
116
|
+
};
|
|
117
|
+
saveSession(session);
|
|
118
|
+
},
|
|
119
|
+
get: (path, options) => request("GET", path, void 0, options),
|
|
120
|
+
post: (path, body, options) => request("POST", path, body, options),
|
|
121
|
+
put: (path, body, options) => request("PUT", path, body, options),
|
|
122
|
+
patch: (path, body, options) => request("PATCH", path, body, options),
|
|
123
|
+
del: (path, options) => request("DELETE", path, void 0, options),
|
|
124
|
+
async postText(path, body) {
|
|
125
|
+
const token = await authorized();
|
|
126
|
+
const res = await send(`${host()}${path}`, {
|
|
127
|
+
method: "POST",
|
|
128
|
+
headers: {
|
|
129
|
+
authorization: `Bearer ${token}`,
|
|
130
|
+
accept: "text/plain",
|
|
131
|
+
"content-type": "text/plain; charset=utf-8"
|
|
132
|
+
},
|
|
133
|
+
body
|
|
134
|
+
});
|
|
135
|
+
if (!res.ok) {
|
|
136
|
+
const text = await res.text().catch(() => "");
|
|
137
|
+
throw new ApiError(`POST ${path}`, res.status, text);
|
|
138
|
+
}
|
|
139
|
+
return res.text();
|
|
140
|
+
},
|
|
141
|
+
async list(path) {
|
|
142
|
+
const out = [];
|
|
143
|
+
let after;
|
|
144
|
+
for (let page = 0; page < PAGE_LIMIT; page++) {
|
|
145
|
+
const url = `${path}${path.includes("?") ? "&" : "?"}limit=100${after ? `&starting_after=${after}` : ""}`;
|
|
146
|
+
const batch = await api.get(url);
|
|
147
|
+
out.push(...batch.data);
|
|
148
|
+
if (!batch.has_more || batch.data.length === 0) break;
|
|
149
|
+
const last = batch.data[batch.data.length - 1];
|
|
150
|
+
if (last?.id == null) break;
|
|
151
|
+
after = String(last.id);
|
|
152
|
+
}
|
|
153
|
+
return out;
|
|
168
154
|
}
|
|
169
|
-
|
|
170
|
-
|
|
155
|
+
};
|
|
156
|
+
return api;
|
|
157
|
+
};
|
|
158
|
+
const superwallApi = () => {
|
|
159
|
+
const session = loadSession();
|
|
160
|
+
if (!session) throw new NotLoggedInError();
|
|
161
|
+
return createSuperwallApi(session);
|
|
171
162
|
};
|
|
172
163
|
|
|
173
164
|
//#endregion
|
|
@@ -184,7 +175,7 @@ async function executeCommand(definition, argv, runtime = {}) {
|
|
|
184
175
|
const outputMode = json ? "json" : environmentNonInteractive ? "text" : "rich";
|
|
185
176
|
const interactive = definition.interaction !== "none" && !json && !explicitNonInteractive && !environmentNonInteractive;
|
|
186
177
|
const installDir = resolve(argv.installDir ?? process.cwd());
|
|
187
|
-
const ui = runtime.renderer
|
|
178
|
+
const ui = runtime.renderer ? useRenderer(runtime.renderer(outputMode)) : selectRenderer({ mode: outputMode });
|
|
188
179
|
const stdout = runtime.stdout ?? process.stdout;
|
|
189
180
|
const output = createCommandOutput(outputMode, ui, { stdout });
|
|
190
181
|
if (json && definition.output !== "json" && definition.output !== "both") {
|
|
@@ -203,7 +194,7 @@ async function executeCommand(definition, argv, runtime = {}) {
|
|
|
203
194
|
track("workflow started", { workflow: definition.name });
|
|
204
195
|
}
|
|
205
196
|
try {
|
|
206
|
-
const api = resolveApi(definition.auth ?? "none", runtime.api ??
|
|
197
|
+
const api = resolveApi(definition.auth ?? "none", runtime.api ?? superwallApi);
|
|
207
198
|
const context = {
|
|
208
199
|
argv,
|
|
209
200
|
ui,
|
|
@@ -284,4 +275,4 @@ function normalizeError(error) {
|
|
|
284
275
|
}
|
|
285
276
|
|
|
286
277
|
//#endregion
|
|
287
|
-
export { ApiError as n,
|
|
278
|
+
export { superwallApi as i, ApiError as n, createSuperwallApi as r, defineCommand as t };
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import "./update-
|
|
4
|
-
import "./token-
|
|
5
|
-
import { t as defineCommand } from "./command-
|
|
6
|
-
import "./ui-
|
|
7
|
-
import "./skills-
|
|
1
|
+
import "./output-D2Ax_hHL.js";
|
|
2
|
+
import "./telemetry-yJs7t0rt.js";
|
|
3
|
+
import "./update-B4hoLAN-.js";
|
|
4
|
+
import "./token-GcbyH6G8.js";
|
|
5
|
+
import { t as defineCommand } from "./command-B7Te31wp.js";
|
|
6
|
+
import "./ui-Lqt_zFOr.js";
|
|
7
|
+
import "./skills-B-mR2CqM.js";
|
|
8
8
|
import "./spawn-DSoTXy_j.js";
|
|
9
|
-
import "./login-
|
|
10
|
-
import { n as allDeps, r as readPackageJson, t as scanProject } from "./scan-
|
|
11
|
-
import "./hosted-
|
|
12
|
-
import { t as detectExisting } from "./existing-
|
|
13
|
-
import "./spinner-
|
|
14
|
-
import { f as listApplications, m as listProjects, n as createApplication, y as platformLabel } from "./resources-
|
|
15
|
-
import "./org-
|
|
16
|
-
import { r as resolveScopeFromKey } from "./bind-
|
|
17
|
-
import { a as projectPackageName, i as requireApi, l as requirePlatform, m as writeApp, r as LoginRequiredError, t as gitAvailable } from "./git-
|
|
18
|
-
import "./actions-
|
|
19
|
-
import "./app-
|
|
9
|
+
import "./login-DOES7Kup.js";
|
|
10
|
+
import { n as allDeps, r as readPackageJson, t as scanProject } from "./scan-Dk0ZlCY6.js";
|
|
11
|
+
import "./hosted-vk05ZF6w.js";
|
|
12
|
+
import { t as detectExisting } from "./existing-B-e22WOr.js";
|
|
13
|
+
import "./spinner-B9dT3DBY.js";
|
|
14
|
+
import { f as listApplications, m as listProjects, n as createApplication, y as platformLabel } from "./resources-s64mBHaC.js";
|
|
15
|
+
import "./org-Cg25bcsj.js";
|
|
16
|
+
import { r as resolveScopeFromKey } from "./bind-BbzBenoP.js";
|
|
17
|
+
import { a as projectPackageName, i as requireApi, l as requirePlatform, m as writeApp, r as LoginRequiredError, t as gitAvailable } from "./git-2wRxiwOc.js";
|
|
18
|
+
import "./actions-DvHycH3X.js";
|
|
19
|
+
import "./app-FiC9SQVp.js";
|
|
20
20
|
import pc from "picocolors";
|
|
21
21
|
import { promisify } from "node:util";
|
|
22
22
|
import * as fs from "node:fs";
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
import "./update-
|
|
4
|
-
import "./token-
|
|
5
|
-
import { t as defineCommand } from "./command-
|
|
6
|
-
import { n as ui } from "./ui-
|
|
7
|
-
import "./skills-
|
|
1
|
+
import { g as VERSION } from "./output-D2Ax_hHL.js";
|
|
2
|
+
import "./telemetry-yJs7t0rt.js";
|
|
3
|
+
import "./update-B4hoLAN-.js";
|
|
4
|
+
import "./token-GcbyH6G8.js";
|
|
5
|
+
import { t as defineCommand } from "./command-B7Te31wp.js";
|
|
6
|
+
import { n as ui } from "./ui-Lqt_zFOr.js";
|
|
7
|
+
import "./skills-B-mR2CqM.js";
|
|
8
8
|
import "./spawn-DSoTXy_j.js";
|
|
9
|
-
import "./login-
|
|
10
|
-
import "./scan-
|
|
11
|
-
import "./hosted-
|
|
12
|
-
import "./spinner-
|
|
13
|
-
import { S as pushPaywallVersion, T as versionProducts, b as promotePaywallVersion, f as listApplications } from "./resources-
|
|
14
|
-
import "./org-
|
|
15
|
-
import "./bind-
|
|
16
|
-
import { f as readLock, i as requireApi, o as writeProjectScaffold, u as resolveApps } from "./git-
|
|
17
|
-
import "./actions-
|
|
18
|
-
import "./app-
|
|
19
|
-
import { C as syncAssets, D as writeProjectTypes, E as collectProjectDeclarations, S as requireAssets, T as loadFramework, _ as planTargets, a as
|
|
9
|
+
import "./login-DOES7Kup.js";
|
|
10
|
+
import "./scan-Dk0ZlCY6.js";
|
|
11
|
+
import "./hosted-vk05ZF6w.js";
|
|
12
|
+
import "./spinner-B9dT3DBY.js";
|
|
13
|
+
import { S as pushPaywallVersion, T as versionProducts, b as promotePaywallVersion, f as listApplications } from "./resources-s64mBHaC.js";
|
|
14
|
+
import "./org-Cg25bcsj.js";
|
|
15
|
+
import "./bind-BbzBenoP.js";
|
|
16
|
+
import { f as readLock, i as requireApi, o as writeProjectScaffold, u as resolveApps } from "./git-2wRxiwOc.js";
|
|
17
|
+
import "./actions-DvHycH3X.js";
|
|
18
|
+
import "./app-FiC9SQVp.js";
|
|
19
|
+
import { C as syncAssets, D as writeProjectTypes, E as collectProjectDeclarations, S as requireAssets, T as loadFramework, _ as planTargets, a as projectDir, b as resolveBinding, d as pushSource, f as collectSourceFiles, h as projectForApplication, l as LAYOUT_HINT, m as fetchProducts, o as projectDirs, p as warnNotPortable, s as requireProject, w as frameworkVersion, x as assetBaseUrl, y as wantedPlatforms } from "./pipeline-BVeUA6Ig.js";
|
|
20
20
|
import pc from "picocolors";
|
|
21
21
|
import * as fs from "node:fs";
|
|
22
22
|
import * as path from "node:path";
|
|
@@ -132,11 +132,29 @@ const detectLocalScheme = async (roots) => {
|
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
};
|
|
135
|
+
const APP_MARKERS = [
|
|
136
|
+
"package.json",
|
|
137
|
+
"app.json",
|
|
138
|
+
"app.config.json",
|
|
139
|
+
"Podfile",
|
|
140
|
+
"ios",
|
|
141
|
+
"android",
|
|
142
|
+
".git"
|
|
143
|
+
];
|
|
144
|
+
const looksLikeAppRoot = (dir) => {
|
|
145
|
+
if (APP_MARKERS.some((marker) => fs.existsSync(path.join(dir, marker)))) return true;
|
|
146
|
+
try {
|
|
147
|
+
return fs.readdirSync(dir).some((entry) => entry.endsWith(".xcodeproj") || entry.endsWith(".xcworkspace"));
|
|
148
|
+
} catch {
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
151
|
+
};
|
|
135
152
|
const schemeSearchRoots = (project) => {
|
|
136
153
|
const root = path.resolve(project.root);
|
|
137
154
|
const superwallDir = path.resolve(project.superwallDir);
|
|
138
155
|
const roots = [root];
|
|
139
|
-
|
|
156
|
+
const parent = path.dirname(root);
|
|
157
|
+
if (root === superwallDir && parent !== root && looksLikeAppRoot(parent)) roots.push(parent);
|
|
140
158
|
return roots;
|
|
141
159
|
};
|
|
142
160
|
const appScheme = async (roots, remote) => {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
import "./update-
|
|
4
|
-
import { i as loadSession } from "./token-
|
|
5
|
-
import { t as defineCommand } from "./command-
|
|
6
|
-
import { a as
|
|
1
|
+
import { _ as apiKeyFromEnv } from "./output-D2Ax_hHL.js";
|
|
2
|
+
import "./telemetry-yJs7t0rt.js";
|
|
3
|
+
import "./update-B4hoLAN-.js";
|
|
4
|
+
import { i as loadSession } from "./token-GcbyH6G8.js";
|
|
5
|
+
import { t as defineCommand } from "./command-B7Te31wp.js";
|
|
6
|
+
import { a as THEME, n as ui, o as fg } from "./ui-Lqt_zFOr.js";
|
|
7
7
|
import "./spawn-DSoTXy_j.js";
|
|
8
|
-
import { t as scanProject } from "./scan-
|
|
9
|
-
import { t as detectDrivers } from "./drivers-
|
|
10
|
-
import "./hosted-
|
|
11
|
-
import { t as detectExisting } from "./existing-
|
|
8
|
+
import { t as scanProject } from "./scan-Dk0ZlCY6.js";
|
|
9
|
+
import { t as detectDrivers } from "./drivers-ItOmKzrw.js";
|
|
10
|
+
import "./hosted-vk05ZF6w.js";
|
|
11
|
+
import { t as detectExisting } from "./existing-B-e22WOr.js";
|
|
12
12
|
|
|
13
13
|
//#region src/commands/account/doctor.ts
|
|
14
14
|
const runDoctor = defineCommand({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as VERSION } from "./output-D2Ax_hHL.js";
|
|
2
2
|
import { n as readVersion, r as spawnStream, t as onPath } from "./spawn-DSoTXy_j.js";
|
|
3
|
-
import { n as getHostedAuthToken, r as getHostedStatus, t as getHostedAnthropicBaseUrl } from "./hosted-
|
|
3
|
+
import { n as getHostedAuthToken, r as getHostedStatus, t as getHostedAnthropicBaseUrl } from "./hosted-vk05ZF6w.js";
|
|
4
4
|
import { tmpdir } from "node:os";
|
|
5
5
|
import { basename, join } from "node:path";
|
|
6
6
|
import { readFile, rm } from "node:fs/promises";
|