@superwall/cli 2.6.0-beta.1 → 2.6.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 +47 -16
- package/dist/{apple-Bmt_iywx.js → apple-D-rfsuDA.js} +17 -19
- package/dist/{approve-D2UgqaRx.js → approve-aPc5RoXB.js} +14 -13
- package/dist/{assets-B_quADds.js → assets-PyuXe45Y.js} +3 -3
- package/dist/auth.d.ts +11 -4
- package/dist/auth.js +4 -5
- package/dist/base-CAU0hWoI.js +82 -0
- package/dist/{billing-ZIETn0j4.js → billing-Dt6L_l9R.js} +3 -3
- package/dist/{build-BWjXurjs.js → build-CY5FnMNY.js} +35 -16
- package/dist/config-DOp5oChe.js +377 -0
- package/dist/{create-C3uklw-U.js → create-BZL5VH4L.js} +41 -41
- package/dist/{create-BCIgjRHn.js → create-D6w3UL0m.js} +9 -9
- package/dist/create-DM5Y1Pyk.js +18 -0
- package/dist/{doctor-D2Q1EZe8.js → doctor-C9FR0qw3.js} +50 -10
- package/dist/entry.js +45 -40
- package/dist/{environment-BocmdvZ-.js → environment-sE2wZYdg.js} +1 -1
- package/dist/{drivers-BQkO5tHs.js → existing--peXpOZj.js} +305 -8
- package/dist/framework-DW5fqjh4.js +65 -0
- package/dist/{source-BccdO4aL.js → git-Hf9Wc7Hp.js} +34 -92
- package/dist/{held-Bykbwy-m.js → held-CUBCOCGP.js} +8 -8
- package/dist/held-DVxvPMSG.js +15 -0
- package/dist/{install-dXZZ79Oe.js → install-C5d82gZF.js} +15 -17
- package/dist/{integrate-DiSjlOjC.js → integrate-D8J_X1bj.js} +33 -38
- package/dist/{login-5sWIKDI2.js → login-C6X7JrhM.js} +8 -9
- package/dist/{login-Jp6E6d2e.js → login-DXhm9L0F.js} +3 -3
- package/dist/login-et319ESO.js +13 -0
- package/dist/{lookup-CWzVfPpq.js → lookup-DqmIbUkv.js} +28 -4
- package/dist/{migrate-BKiOUsMY.js → migrate-BYF6hKZ2.js} +66 -45
- package/dist/{notification-url-BDBxbwZq.js → notification-url-Bo54nkXv.js} +4 -4
- package/dist/{open-DNd49kT-.js → open-xdgXUzaF.js} +2 -2
- package/dist/{org-Dud1rF9f.js → org-BD8U3D1_.js} +4 -4
- package/dist/{organization-7vJA3uy1.js → organization-D-ZlB3qU.js} +4 -4
- package/dist/{orgs-Z0H9WOs1.js → orgs-DQQJ3sw_.js} +1 -2
- package/dist/{paths-CzTJVpfi.js → paths-CIlyzF2I.js} +1 -1
- package/dist/{playbook-DJ__edOW.js → playbook-ecggWGFi.js} +10 -14
- package/dist/{products-Cqq59DBQ.js → products-CJq_iXv5.js} +1 -1
- package/dist/{promote-DLtPSvmL.js → promote-QVMLGYlU.js} +27 -28
- package/dist/{pull-AoUmaiMK.js → pull-CCXhb2a7.js} +72 -26
- package/dist/{pull-D-YuT3e0.js → pull-CrdsfsAl.js} +33 -39
- package/dist/pull-h71pL3r_.js +30 -0
- package/dist/push-BIq6R8Ro.js +29 -0
- package/dist/push-D6pJM_vv.js +21 -0
- package/dist/{push-BMblzg_6.js → push-DJMGG7zW.js} +23 -12
- package/dist/{push-BrzMFd4Z.js → push-DiMDwGfe.js} +15 -8
- package/dist/{registry-DDU10_Ix.js → registry-BSnQXft4.js} +1288 -901
- package/dist/registry-YwzTfCNc.js +22 -0
- package/dist/{resolve-DpOSDDdr.js → resolve-DO7bPota.js} +52 -6
- package/dist/{resources-CptT7HD6.js → resources-XwvXA20E.js} +15 -2
- package/dist/{run-r3foWfhV.js → run-B-YvxfRc.js} +15 -17
- package/dist/scan-B36wkZmI.js +4 -0
- package/dist/{scan-nVQO7JLx.js → scan-ViBhmrB7.js} +1 -1
- package/dist/{scope-l1qGLsgz.js → scope-BLLUxbrA.js} +24 -18
- package/dist/{scope-ehZ7L1nj.js → scope-Cg1AdAfO.js} +33 -3
- package/dist/screenshot-file-Dix2Qynm.js +127 -0
- package/dist/{sdk-DEfQttek.js → sdk-BFunw4Hc.js} +1 -1
- package/dist/{framework-CLmf4swr.js → selection-C07e_GGY.js} +4 -54
- package/dist/{series-D2ZpZ8cx.js → series-B8NJK4yS.js} +1 -1
- package/dist/{server-DLARhh1k.js → server-CBtHzl9y.js} +40 -18
- package/dist/server-CZwSfzKe.js +33 -0
- package/dist/{base-ChTi42M0.js → session-BfVx50iA.js} +8 -83
- package/dist/{session-Z0BeaJPf.js → session-BlrwAdGN.js} +1 -1
- package/dist/session-Cip4j99n.js +5 -0
- package/dist/{migration-Z69tLeHC.js → setup-a4B72xJ8.js} +290 -28
- package/dist/skills/superwall/SKILL.md +37 -10
- package/dist/skills/superwall/references/api.md +66 -21
- package/dist/skills/superwall/references/asa.md +109 -64
- package/dist/skills/superwall/references/dashboard-links.md +65 -28
- package/dist/skills/superwall/references/data-analytics.md +1 -1
- package/dist/skills/superwall/workflows/dashboard/setup.md +15 -5
- package/dist/skills/superwall/workflows/integrate/flutter.md +9 -7
- package/dist/skills/superwall-artifacts/SKILL.md +7 -2
- package/dist/skills/superwall-artifacts/references/cli.md +4 -1
- package/dist/skills/superwall-framework/SKILL.md +197 -14
- package/dist/skills/superwall-framework/references/cli.md +98 -7
- package/dist/skills/superwall-framework/references/examples.md +2 -2
- package/dist/skills/superwall-framework/references/migrate-from-editor.md +5 -0
- package/dist/skills/superwall-framework/references/migrate-from-native.md +5 -0
- package/dist/{skills-421SFEyF.js → skills-BB1uIt8t.js} +139 -9
- package/dist/{skills-CdKwaTRS.js → skills-SnxFa2in.js} +8 -12
- package/dist/source-DQs6iLtC.js +82 -0
- package/dist/{source-push-B4s6r9bB.js → source-push-w7miTr6m.js} +38 -14
- package/dist/{spinner-DPdBlZe2.js → spinner-BQp7fQvK.js} +7 -5
- package/dist/{starter-0OdVPH4l.js → starter-BlJ_InZJ.js} +16 -6
- package/dist/{status-Dsc7d3z2.js → status-DxsIw9zq.js} +9 -11
- package/dist/{output-Ggzq5_-t.js → storage-BR6imSqm.js} +40 -1
- package/dist/storekit-BqyujKQ_.js +203 -0
- package/dist/storekit-ELVCMF0X.js +15 -0
- package/dist/{bind-ClFjTt0U.js → theme-Ed0gz6hr.js} +29 -6
- package/dist/token-CWQ6tdva.js +100 -0
- package/dist/tools-skills/animate-onboarding/SKILL.md +1 -1
- package/dist/tools-skills/mobile-design/SKILL.md +1 -1
- package/dist/tools-skills/onboarding-questions/SKILL.md +1 -1
- package/dist/tools-skills/superwall/SKILL.md +43 -17
- package/dist/tools-skills/superwall/references/api.md +74 -24
- package/dist/tools-skills/superwall/references/asa.md +109 -64
- package/dist/tools-skills/superwall/references/dashboard-links.md +65 -28
- package/dist/tools-skills/superwall/references/data-analytics.md +1 -1
- package/dist/tools-skills/superwall/workflows/dashboard/playbook.md +4 -3
- package/dist/tools-skills/superwall/workflows/dashboard/setup.md +21 -8
- package/dist/tools-skills/superwall/workflows/integrate/flutter.md +9 -7
- package/dist/tools-skills/superwall/workflows/migrate/adapty.md +4 -3
- package/dist/tools-skills/superwall/workflows/migrate/playbook.md +2 -2
- package/dist/tools-skills/superwall/workflows/migrate/qonversion.md +4 -3
- package/dist/tools-skills/superwall/workflows/migrate/revenuecat.md +4 -3
- package/dist/tools-skills/superwall-editor/SKILL.md +2 -3
- package/dist/tools.d.ts +6 -1
- package/dist/tools.js +1290 -747
- package/dist/{try-B8FYkTvQ.js → try-C3HW3hPZ.js} +20 -22
- package/dist/{lock-DgSx-p8Y.js → types-Dc9U_4kp.js} +86 -80
- package/dist/upgrade-Cw9jVt-r.js +348 -0
- package/dist/upgrade-DVsonzDF.js +27 -0
- package/package.json +11 -3
- package/dist/client-CyrYJzBF.js +0 -180
- package/dist/config-CGcG7GOt.js +0 -113
- package/dist/create-7HDW3DCl.js +0 -20
- package/dist/existing-Cl5x6_5u.js +0 -97
- package/dist/held-Chw3BtBV.js +0 -17
- package/dist/log-C0MDCfA2.js +0 -62
- package/dist/login-DZ8Pipf6.js +0 -17
- package/dist/pull-C1xm2zqG.js +0 -36
- package/dist/push-B42D8fKf.js +0 -22
- package/dist/push-Co5jk6Kr.js +0 -30
- package/dist/run-c1O2_8pp.js +0 -100
- package/dist/scan-D86kLtM7.js +0 -4
- package/dist/screenshot-file-XAS0Xy0e.js +0 -16
- package/dist/server-BEcsQaPu.js +0 -29
- package/dist/session-Csuaw6RU.js +0 -6
- package/dist/setup-C6NFy14d.js +0 -217
- package/dist/spawn-DmmmHIP-.js +0 -71
- package/dist/storage-DT_wxwJ8.js +0 -41
- package/dist/storekit-B9M2raxe.js +0 -47
- package/dist/storekit-BWZf-fNE.js +0 -17
- package/dist/telemetry-ovPiseFm.js +0 -56
- package/dist/theme-DUsCh-Vd.js +0 -25
- package/dist/token-Bu3FaRkv.js +0 -70
- package/dist/upgrade-B7TmvEPP.js +0 -206
- package/dist/upgrade-CAHyrWUL.js +0 -7
- /package/dist/{browser-Bp3yRKlU.js → browser-BVjaf98V.js} +0 -0
- /package/dist/{client-BJQXl62Q.js → client-BwYhzITp.js} +0 -0
- /package/dist/{design-lint-CiFc78aM.js → design-lint-mgO-2SGS.js} +0 -0
- /package/dist/{devtools-ByZ6XYnn.js → devtools-B6Vp6HMy.js} +0 -0
- /package/dist/{input-MDd67UIp.js → input-DOT_2Zvb.js} +0 -0
- /package/dist/{project-NoMtbMyl.js → project-BomArwSj.js} +0 -0
- /package/dist/{reports-HYVp169R.js → reports-hbxsd3Zo.js} +0 -0
- /package/dist/{storage-Bdz5AmqS.d.ts → storage-Bh3wT1Rn.d.ts} +0 -0
- /package/dist/{timing-Ca0TXY-A.js → timing-BKEEIBij.js} +0 -0
- /package/dist/{ui-D_qf3Gvw.js → ui-hFgji1e8.js} +0 -0
package/README.md
CHANGED
|
@@ -40,8 +40,18 @@ create its first app too. `BROWSER=none` stops the CLI from opening a browser
|
|
|
40
40
|
itself.
|
|
41
41
|
There are no organizations to pick: `superwall apps list` shows every app you
|
|
42
42
|
can open, grouped by organization, and commands take `--app <id|dashboard link>`.
|
|
43
|
-
Upgrade any time with `superwall upgrade
|
|
44
|
-
|
|
43
|
+
Upgrade any time with `superwall upgrade`. When a newer release is out, the CLI
|
|
44
|
+
says so on stderr after each command (and when `superwall dev` starts), with
|
|
45
|
+
the exact command to run: `superwall upgrade`, or the project's own bump such as
|
|
46
|
+
`cd superwall && pnpm add superwall@latest` when the project pins `superwall`.
|
|
47
|
+
A patch or minor gets one line; a major gets a warning that it may contain
|
|
48
|
+
breaking changes and a link to its release notes. A beta compares against the
|
|
49
|
+
newest beta (`superwall@next`). The check reads a once-a-day cache, so it never
|
|
50
|
+
slows a command, and stdout stays clean under `--json`. The studio
|
|
51
|
+
`superwall dev` opens shows the same update as a banner you can dismiss for
|
|
52
|
+
that version. Its Copy prompt button copies instructions for your coding agent:
|
|
53
|
+
read the release notes (for a major, list what will break first), run the
|
|
54
|
+
update command, then rebuild your paywalls.
|
|
45
55
|
|
|
46
56
|
## Set up your app
|
|
47
57
|
|
|
@@ -59,6 +69,10 @@ headless) to install and configure the SDK. Then it walks you through the
|
|
|
59
69
|
rest: products, campaigns, placements, paywalls, and verifying it all on a
|
|
60
70
|
real device.
|
|
61
71
|
|
|
72
|
+
With neither Claude Code nor Codex installed, it can run the bundled Superwall
|
|
73
|
+
Agent instead, which needs one more package:
|
|
74
|
+
`npm install @anthropic-ai/claude-agent-sdk@0.3.201`.
|
|
75
|
+
|
|
62
76
|
Prefer to drive the agent yourself? Add `--skill` to `integrate`, `migrate`,
|
|
63
77
|
or `review` and the CLI prints the full playbook for your project's framework
|
|
64
78
|
instead of running it — paste it into any agent.
|
|
@@ -95,6 +109,11 @@ you in, pick an app, or create one on the spot. `--yes` accepts the defaults;
|
|
|
95
109
|
specific Superwall app (the dashboard's **Copy Prompt** passes it) instead of
|
|
96
110
|
detecting or asking.
|
|
97
111
|
|
|
112
|
+
In a folder that is not inside a git repository yet, `create` also runs
|
|
113
|
+
`git init` and commits everything in that folder — your app included — as
|
|
114
|
+
"New superwall project". `--no-git` skips that step, so nothing is initialized,
|
|
115
|
+
staged or committed; a folder already under git is never touched either way.
|
|
116
|
+
|
|
98
117
|
### A project is a directory
|
|
99
118
|
|
|
100
119
|
```
|
|
@@ -239,6 +258,12 @@ landed stays pending, so `promote` still won't ship it. With no project,
|
|
|
239
258
|
`superwall pull --app <id> [dir]` creates `superwall/` from the app's source,
|
|
240
259
|
so you can work on an app's paywalls without its codebase or GitHub.
|
|
241
260
|
|
|
261
|
+
`pull` needs superwall 2.3.0 or later. Inside a project, the `superwall` your
|
|
262
|
+
project depends on is the one that runs, whichever copy you start (global,
|
|
263
|
+
`npx superwall@…`). When that copy is older, the CLI says so on stderr with the
|
|
264
|
+
command that updates it, such as `cd superwall && npm i superwall@latest`;
|
|
265
|
+
`superwall upgrade` and `superwall doctor` name it too.
|
|
266
|
+
|
|
242
267
|
A change to the shared design system (`DESIGN.md`, `design/`, `components/`)
|
|
243
268
|
reaches every paywall that imports it. `publish --existing --source` ships it:
|
|
244
269
|
`--existing` rebuilds only the paywalls already on Superwall and never creates
|
|
@@ -369,6 +394,7 @@ fails names the reference entry to read:
|
|
|
369
394
|
```bash
|
|
370
395
|
superwall get /v2/products
|
|
371
396
|
superwall post /v2/products -d name="Pro Monthly" -d price:=9.99
|
|
397
|
+
superwall put /v2/campaigns/123/audiences/456/weights -d 'weights:=[{"variant_id":"789","percentage":100}]'
|
|
372
398
|
superwall delete /v2/products/prod_123
|
|
373
399
|
```
|
|
374
400
|
|
|
@@ -574,23 +600,25 @@ and name the replacement.
|
|
|
574
600
|
|
|
575
601
|
## Apple Search Ads
|
|
576
602
|
|
|
577
|
-
The **entire** Apple Ads
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
`--
|
|
603
|
+
The **entire** Apple Ads Platform API (v1), proxied by Superwall — no client
|
|
604
|
+
secret, OAuth token, or account id to manage locally. It uses the credentials
|
|
605
|
+
you connect in the dashboard (app → Integrations → Apple Search Ads →
|
|
606
|
+
Advanced); the CLI finds the connected app on its own, or takes `--app <id>`.
|
|
607
|
+
Without `--ad-account-id`, requests go to the only ad account the key reaches; when it reaches several, pass `--ad-account-id`.
|
|
582
608
|
|
|
583
609
|
```bash
|
|
584
610
|
superwall asa campaigns list
|
|
585
|
-
superwall asa campaigns
|
|
611
|
+
superwall asa campaigns list --field status --op EQUALS --values ENABLED --all
|
|
612
|
+
superwall asa keywords list --adgroup 456 --order-by text:asc --limit 50
|
|
586
613
|
superwall asa keywords create --campaign 123 --adgroup 456 \
|
|
587
614
|
--text "grammar checker" --match-type EXACT --bid 1.25
|
|
588
615
|
superwall asa reports campaigns --start 2025-01-01 --end 2025-01-31 --group-by countryOrRegion
|
|
589
616
|
```
|
|
590
617
|
|
|
591
|
-
Every resource follows the same shape — `asa <resource> <action> [id]
|
|
592
|
-
|
|
593
|
-
|
|
618
|
+
Every resource follows the same shape — `asa <resource> <action> [id]` — and
|
|
619
|
+
lists are Apple queries: `--campaign` / `--adgroup` / `--adam-id` narrow them,
|
|
620
|
+
`--field --op --values` and `--order-by` add a filter and a sort, and `--query`
|
|
621
|
+
takes Apple's whole query request. The catalog is the documentation:
|
|
594
622
|
|
|
595
623
|
```bash
|
|
596
624
|
superwall asa docs # every endpoint, grouped
|
|
@@ -598,10 +626,13 @@ superwall asa docs keywords # one resource: usage, flags, Apple
|
|
|
598
626
|
superwall asa docs campaigns create # Apple's own page: fields, enums, examples
|
|
599
627
|
```
|
|
600
628
|
|
|
601
|
-
Writes take typed flags (money flags pick up the account's currency),
|
|
602
|
-
`-d key=value` for any other field, or `--body` for the whole payload
|
|
603
|
-
|
|
604
|
-
|
|
629
|
+
Writes take typed flags (money flags pick up the ad account's currency),
|
|
630
|
+
`-d key=value` for any other field, or `--body` for the whole payload; several
|
|
631
|
+
keyword ids or an array body go to Apple's bulk endpoints. Anything not covered
|
|
632
|
+
is `asa get|post|put|delete /path`, sent straight to Apple with your access
|
|
633
|
+
token and ad account context attached. A path without a version gets `/v1`;
|
|
634
|
+
one that starts with `/v1` or `/api/` is sent as written. Asset upload
|
|
635
|
+
(`POST /v1/assets/upload`) takes form data and isn't supported.
|
|
605
636
|
|
|
606
637
|
## For agents and scripts
|
|
607
638
|
|
|
@@ -664,7 +695,7 @@ packages/cli/
|
|
|
664
695
|
│ │ ├── paywalls/ create, dev, build, push, promote, publish, pull
|
|
665
696
|
│ │ ├── main/ bootstrap, apps, products, entitlements, campaigns, paywalls, users, webhooks, events, annotations
|
|
666
697
|
│ │ ├── analytics/ query
|
|
667
|
-
│ │ ├── api/ docs, get, post, patch, delete
|
|
698
|
+
│ │ ├── api/ docs, get, post, put, patch, delete
|
|
668
699
|
│ │ ├── app-store-connect/ setup/, keys/, notification-url/, store/ (apps, products, …), api/ (get, post, …, docs)
|
|
669
700
|
│ │ ├── apple-search-ads/ asa (the catalog), keys, api/ (get, post, put, delete, docs)
|
|
670
701
|
│ │ ├── account/ login, logout, whoami
|
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
import "./token-
|
|
2
|
-
import {
|
|
3
|
-
import "./environment-
|
|
4
|
-
import "./
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import "./
|
|
8
|
-
import
|
|
9
|
-
import "./
|
|
10
|
-
import "./
|
|
11
|
-
import "./
|
|
12
|
-
import "./
|
|
13
|
-
import "./
|
|
14
|
-
import "./
|
|
15
|
-
import "./
|
|
16
|
-
import "./
|
|
17
|
-
import "./
|
|
18
|
-
import { n as ensureNotificationUrl, r as environmentLines, t as describeNotificationUrl } from "./notification-url-BDBxbwZq.js";
|
|
19
|
-
import { a as chooseTeam, n as keyAccess, o as signIn, r as keyRole, s as appleDeps, t as createAndSaveKey } from "./create-BCIgjRHn.js";
|
|
1
|
+
import "./token-CWQ6tdva.js";
|
|
2
|
+
import { u as blocks } from "./storage-BR6imSqm.js";
|
|
3
|
+
import "./environment-sE2wZYdg.js";
|
|
4
|
+
import { y as ApiError } from "./config-DOp5oChe.js";
|
|
5
|
+
import { E as updateBundleId, a as chooseAppIntent, g as RefusedByApi, i as savedKey, m as KEY_LABEL, n as testModeWarning, p as KEY_KINDS, s as resolveApp, y as findIntegrations } from "./held-CUBCOCGP.js";
|
|
6
|
+
import "./resources-XwvXA20E.js";
|
|
7
|
+
import "./orgs-DQQJ3sw_.js";
|
|
8
|
+
import "./ui-hFgji1e8.js";
|
|
9
|
+
import { t as apiCall } from "./spinner-BQp7fQvK.js";
|
|
10
|
+
import "./org-BD8U3D1_.js";
|
|
11
|
+
import "./lookup-DqmIbUkv.js";
|
|
12
|
+
import "./paths-CIlyzF2I.js";
|
|
13
|
+
import "./scope-BLLUxbrA.js";
|
|
14
|
+
import "./client-BwYhzITp.js";
|
|
15
|
+
import "./timing-BKEEIBij.js";
|
|
16
|
+
import { n as ensureNotificationUrl, r as environmentLines, t as describeNotificationUrl } from "./notification-url-Bo54nkXv.js";
|
|
17
|
+
import { a as chooseTeam, n as keyAccess, o as signIn, r as keyRole, s as appleDeps, t as createAndSaveKey } from "./create-D6w3UL0m.js";
|
|
20
18
|
|
|
21
19
|
//#region src/core/app-store-connect/setup/apple.ts
|
|
22
20
|
const STEPS = [
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import "./token-
|
|
2
|
-
import "./
|
|
3
|
-
import "./environment-
|
|
4
|
-
import "./
|
|
5
|
-
import
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
8
|
-
import {
|
|
9
|
-
import { t as ArtifactError } from "./project-
|
|
10
|
-
import "./lock-DgSx-p8Y.js";
|
|
11
|
-
import "./scope-ehZ7L1nj.js";
|
|
1
|
+
import "./token-CWQ6tdva.js";
|
|
2
|
+
import "./storage-BR6imSqm.js";
|
|
3
|
+
import "./environment-sE2wZYdg.js";
|
|
4
|
+
import { y as ApiError } from "./config-DOp5oChe.js";
|
|
5
|
+
import "./orgs-DQQJ3sw_.js";
|
|
6
|
+
import "./types-Dc9U_4kp.js";
|
|
7
|
+
import "./scope-Cg1AdAfO.js";
|
|
8
|
+
import { _ as approveVersion, d as resolveArtifact, f as roleCanApprove, i as installHints, l as pickVersion, n as awaitingInstall, s as notInstalledOf } from "./resolve-DO7bPota.js";
|
|
9
|
+
import { t as ArtifactError } from "./project-BomArwSj.js";
|
|
12
10
|
|
|
13
11
|
//#region src/core/artifacts/approve.ts
|
|
14
12
|
const SECTIONS = [
|
|
@@ -174,16 +172,19 @@ async function runArtifactApprove(ctx, input) {
|
|
|
174
172
|
refuse("forbidden", error.message);
|
|
175
173
|
return;
|
|
176
174
|
}
|
|
175
|
+
const hints = await installHints(ctx.api, artifact, version.manifest, { artifactFlag: input.artifact !== void 0 });
|
|
177
176
|
if (ctx.json) {
|
|
178
177
|
ctx.output.data({
|
|
179
178
|
approved: true,
|
|
180
179
|
...details,
|
|
181
|
-
version: approved
|
|
180
|
+
version: approved,
|
|
181
|
+
not_installed: hints.map(notInstalledOf)
|
|
182
182
|
});
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
185
|
ctx.ui.success(await awaitingInstall(ctx.api, artifact.id, version.manifest) ? `Approved version ${version.id}. Nothing is installed yet, so only its author can see it until you choose where it shows.` : `Approved version ${version.id}. It's live for everyone it's installed for.`);
|
|
186
|
-
ctx.ui.info(`Choose where it shows with \`superwall artifacts install <entrypoint> --artifact ${artifact.id}\`.`);
|
|
186
|
+
if (hints.length === 0) ctx.ui.info(`Choose where it shows with \`superwall artifacts install <entrypoint> --artifact ${artifact.id}\`.`);
|
|
187
|
+
for (const hint of hints) ctx.ui.info(hint.sentence);
|
|
187
188
|
}
|
|
188
189
|
|
|
189
190
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as ASSET_HOST } from "./environment-
|
|
2
|
-
import {
|
|
3
|
-
import { S as pushPaywallAssets } from "./resources-
|
|
1
|
+
import { r as ASSET_HOST } from "./environment-sE2wZYdg.js";
|
|
2
|
+
import { y as ApiError } from "./config-DOp5oChe.js";
|
|
3
|
+
import { S as pushPaywallAssets } from "./resources-XwvXA20E.js";
|
|
4
4
|
import * as fs from "node:fs";
|
|
5
5
|
|
|
6
6
|
//#region src/core/paywalls/assets.ts
|
package/dist/auth.d.ts
CHANGED
|
@@ -1,15 +1,22 @@
|
|
|
1
|
-
import { t as Session } from "./storage-
|
|
1
|
+
import { t as Session } from "./storage-Bh3wT1Rn.js";
|
|
2
2
|
|
|
3
3
|
//#region src/core/account/errors.d.ts
|
|
4
4
|
declare class NotLoggedInError extends Error {
|
|
5
5
|
constructor();
|
|
6
6
|
}
|
|
7
|
+
declare class LoginUnreachableError extends Error {
|
|
8
|
+
readonly timedOut: boolean;
|
|
9
|
+
constructor(endpoint: string, cause: unknown, timeoutMs?: number);
|
|
10
|
+
}
|
|
7
11
|
//#endregion
|
|
8
12
|
//#region src/core/account/token.d.ts
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
interface RefreshOptions {
|
|
14
|
+
timeoutMs?: number;
|
|
15
|
+
}
|
|
16
|
+
declare function getOAuthAccessToken(options?: RefreshOptions): Promise<string | null>;
|
|
17
|
+
declare function resolveAuthToken(session: Session, options?: RefreshOptions): Promise<{
|
|
11
18
|
token: string;
|
|
12
19
|
session: Session;
|
|
13
20
|
}>;
|
|
14
21
|
//#endregion
|
|
15
|
-
export { NotLoggedInError, getOAuthAccessToken, resolveAuthToken };
|
|
22
|
+
export { LoginUnreachableError, NotLoggedInError, RefreshOptions, getOAuthAccessToken, resolveAuthToken };
|
package/dist/auth.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { n as resolveAuthToken, r as
|
|
2
|
-
import "./
|
|
3
|
-
import "./environment-
|
|
4
|
-
import "./storage-DT_wxwJ8.js";
|
|
1
|
+
import { i as NotLoggedInError, n as resolveAuthToken, r as LoginUnreachableError, t as getOAuthAccessToken } from "./token-CWQ6tdva.js";
|
|
2
|
+
import "./storage-BR6imSqm.js";
|
|
3
|
+
import "./environment-sE2wZYdg.js";
|
|
5
4
|
|
|
6
|
-
export { NotLoggedInError, getOAuthAccessToken, resolveAuthToken };
|
|
5
|
+
export { LoginUnreachableError, NotLoggedInError, getOAuthAccessToken, resolveAuthToken };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { k as isRecord } from "./resources-XwvXA20E.js";
|
|
2
|
+
import { b as writeSources, d as parseSources, f as readLock } from "./types-Dc9U_4kp.js";
|
|
3
|
+
import { o as describePlatforms, s as platformFor } from "./session-BfVx50iA.js";
|
|
4
|
+
import * as fs from "node:fs";
|
|
5
|
+
import * as path from "node:path";
|
|
6
|
+
|
|
7
|
+
//#region src/core/paywalls/binding/targets.ts
|
|
8
|
+
var TargetError = class extends Error {};
|
|
9
|
+
const surfaceKey = (surface) => `${surface.kind}/${surface.id}`;
|
|
10
|
+
const targetLabel = (target, multi) => multi ? `${target.surface.id} · ${target.platform}` : target.surface.id;
|
|
11
|
+
function wantedPlatforms(surfaces, declared) {
|
|
12
|
+
const wanted = /* @__PURE__ */ new Set();
|
|
13
|
+
for (const surface of surfaces) for (const platform of declared[surfaceKey(surface)] ?? []) wanted.add(platform);
|
|
14
|
+
return [...wanted];
|
|
15
|
+
}
|
|
16
|
+
function parsePlatformFlags(value) {
|
|
17
|
+
return (Array.isArray(value) ? value : value === void 0 ? [] : [value]).flatMap((entry) => typeof entry === "string" ? entry.split(",") : []).map((entry) => entry.trim()).filter((entry) => entry.length > 0);
|
|
18
|
+
}
|
|
19
|
+
function planTargets(input) {
|
|
20
|
+
const { surfaces, declared, apps } = input;
|
|
21
|
+
const known = Object.keys(apps);
|
|
22
|
+
const only = (input.only ?? []).map((entry) => {
|
|
23
|
+
const platform = platformFor(apps, entry);
|
|
24
|
+
if (platform === void 0) throw new TargetError(`This project has no app for "${entry}" — its platforms are ${describePlatforms(apps) || "none"} (the keys under \`apps\` in superwall.lock). Declare it in a config.ts with \`platforms: [...]\` to bind one.`);
|
|
25
|
+
return platform;
|
|
26
|
+
});
|
|
27
|
+
const targets = [];
|
|
28
|
+
for (const surface of surfaces) {
|
|
29
|
+
const wanted = declared[surfaceKey(surface)];
|
|
30
|
+
let platforms;
|
|
31
|
+
if (wanted !== void 0) {
|
|
32
|
+
if (wanted.length === 0) throw new TargetError(`${surface.kind} \`${surface.id}\` declares \`platforms: []\` — list at least one, or remove the field.`);
|
|
33
|
+
for (const platform of wanted) if (!(platform in apps)) throw new TargetError(`${surface.kind} \`${surface.id}\` targets \`${platform}\`, which superwall.lock does not bind to an app.`);
|
|
34
|
+
platforms = [...new Set(wanted)];
|
|
35
|
+
} else if (known.length === 1 && known[0] !== void 0) platforms = [known[0]];
|
|
36
|
+
else if (known.length === 0) throw new TargetError("This project is not bound to an app yet — run `superwall push` to pick one.");
|
|
37
|
+
else throw new TargetError(`${surface.kind} \`${surface.id}\` doesn't say which platforms it's for, and this project pushes to several (${describePlatforms(apps)}). Add \`platforms: [...]\` to ${surface.kind}s/${surface.id}/config.ts.`);
|
|
38
|
+
for (const platform of platforms) {
|
|
39
|
+
if (only.length > 0 && !only.includes(platform)) continue;
|
|
40
|
+
const applicationId = apps[platform];
|
|
41
|
+
if (applicationId === void 0) continue;
|
|
42
|
+
targets.push({
|
|
43
|
+
surface,
|
|
44
|
+
platform,
|
|
45
|
+
applicationId
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (targets.length === 0 && only.length > 0) throw new TargetError(`No paywall or funnel targets ${only.map((platform) => `\`${platform}\``).join(", ")}.`);
|
|
50
|
+
return targets;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region src/core/paywalls/source/base.ts
|
|
55
|
+
const LEGACY_FILE = path.join(".superwall", "source.json");
|
|
56
|
+
function readLegacyBases(superwallDir) {
|
|
57
|
+
const file = path.join(superwallDir, LEGACY_FILE);
|
|
58
|
+
if (!fs.existsSync(file)) return {};
|
|
59
|
+
let parsed;
|
|
60
|
+
try {
|
|
61
|
+
parsed = JSON.parse(fs.readFileSync(file, "utf8"));
|
|
62
|
+
} catch (error) {
|
|
63
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
64
|
+
throw new Error(`Can't read ${file} (${reason}) — fix or delete it, then push again.`);
|
|
65
|
+
}
|
|
66
|
+
if (!isRecord(parsed) || !isRecord(parsed.repos)) throw new Error(`${file} isn't a source sync record — fix or delete it, then push again.`);
|
|
67
|
+
return parseSources(parsed.repos);
|
|
68
|
+
}
|
|
69
|
+
function readSourceBase(superwallDir, repo) {
|
|
70
|
+
return readLock(superwallDir).sources?.[repo] ?? readLegacyBases(superwallDir)[repo];
|
|
71
|
+
}
|
|
72
|
+
function writeSourceBase(superwallDir, repo, commitSha) {
|
|
73
|
+
writeSources(superwallDir, {
|
|
74
|
+
...readLegacyBases(superwallDir),
|
|
75
|
+
...readLock(superwallDir).sources,
|
|
76
|
+
[repo]: commitSha
|
|
77
|
+
});
|
|
78
|
+
fs.rmSync(path.join(superwallDir, LEGACY_FILE), { force: true });
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
//#endregion
|
|
82
|
+
export { surfaceKey as a, planTargets as i, writeSourceBase as n, targetLabel as o, parsePlatformFlags as r, wantedPlatforms as s, readSourceBase as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { h as Integration } from "./environment-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { h as Integration } from "./environment-sE2wZYdg.js";
|
|
2
|
+
import { d as readBundledSkill } from "./skills-BB1uIt8t.js";
|
|
3
|
+
import { i as readPackageJson, r as allDeps } from "./scan-ViBhmrB7.js";
|
|
4
4
|
import { readFileSync } from "node:fs";
|
|
5
5
|
import fg from "fast-glob";
|
|
6
6
|
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import "./token-
|
|
2
|
-
import "./
|
|
3
|
-
import { x as VERSION } from "./environment-
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import "./
|
|
7
|
-
import { n as ui } from "./ui-
|
|
8
|
-
import "./
|
|
9
|
-
import "./
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { t as
|
|
13
|
-
import { n as lintDesignTokens, t as formatTokenFinding } from "./design-lint-CiFc78aM.js";
|
|
1
|
+
import "./token-CWQ6tdva.js";
|
|
2
|
+
import "./storage-BR6imSqm.js";
|
|
3
|
+
import { x as VERSION } from "./environment-sE2wZYdg.js";
|
|
4
|
+
import "./config-DOp5oChe.js";
|
|
5
|
+
import "./resources-XwvXA20E.js";
|
|
6
|
+
import "./orgs-DQQJ3sw_.js";
|
|
7
|
+
import { n as ui } from "./ui-hFgji1e8.js";
|
|
8
|
+
import { f as readLock, n as collectProjectDeclarations, r as writeProjectTypes } from "./types-Dc9U_4kp.js";
|
|
9
|
+
import { i as resolveFramework } from "./framework-DW5fqjh4.js";
|
|
10
|
+
import { a as resolveProjectDir, d as kb, h as took, i as requireProject, n as parseIds, s as selectSurfaces } from "./selection-C07e_GGY.js";
|
|
11
|
+
import { t as assetBaseUrl } from "./assets-PyuXe45Y.js";
|
|
12
|
+
import { n as lintDesignTokens, t as formatTokenFinding } from "./design-lint-mgO-2SGS.js";
|
|
14
13
|
import * as fs from "node:fs";
|
|
15
14
|
import * as path from "node:path";
|
|
16
15
|
import pc from "picocolors";
|
|
@@ -26,6 +25,12 @@ function parseBuildPlatforms(values) {
|
|
|
26
25
|
for (const platform of platforms) if (!PLATFORMS.has(platform)) throw new Error(`Unknown platform "${platform}" — use ios, android or web.`);
|
|
27
26
|
return platforms.length === 0 ? [void 0] : platforms;
|
|
28
27
|
}
|
|
28
|
+
function unbuiltTeleportPages(surface, route) {
|
|
29
|
+
return `${surface.kind}/${surface.id} teleports from "${route}", but its teleport pages are pre-rendered per platform: run \`superwall build --id ${surface.id} --platform ios\` to build them.`;
|
|
30
|
+
}
|
|
31
|
+
function teleportPageFile(file, key) {
|
|
32
|
+
return path.join(path.dirname(file), "teleport", `${key}.html`);
|
|
33
|
+
}
|
|
29
34
|
function outputFile(out, surface, platform) {
|
|
30
35
|
return path.join(out, surface.kind, surface.id, ...platform ? [platform] : [], "index.html");
|
|
31
36
|
}
|
|
@@ -61,18 +66,32 @@ async function runBuildPipeline(context, options = {}) {
|
|
|
61
66
|
const file = outputFile(out, surface, platform);
|
|
62
67
|
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
63
68
|
fs.writeFileSync(file, built.html);
|
|
69
|
+
const pages = built.teleportPages ?? [];
|
|
70
|
+
fs.rmSync(path.join(path.dirname(file), "teleport"), {
|
|
71
|
+
recursive: true,
|
|
72
|
+
force: true
|
|
73
|
+
});
|
|
74
|
+
for (const page of pages) {
|
|
75
|
+
const pageFile = teleportPageFile(file, page.key);
|
|
76
|
+
fs.mkdirSync(path.dirname(pageFile), { recursive: true });
|
|
77
|
+
fs.writeFileSync(pageFile, page.html);
|
|
78
|
+
}
|
|
64
79
|
outcomes.push({
|
|
65
80
|
kind: surface.kind,
|
|
66
81
|
id: surface.id,
|
|
67
82
|
platform: platform ?? null,
|
|
68
83
|
file,
|
|
69
84
|
bytes: built.bytes,
|
|
70
|
-
snapshotId: built.snapshotId
|
|
85
|
+
snapshotId: built.snapshotId,
|
|
86
|
+
teleportPages: pages.map((page) => page.key)
|
|
71
87
|
});
|
|
88
|
+
const teleport = pages.length === 0 ? "" : ` · ${pages.length} teleport ${pages.length === 1 ? "page" : "pages"}`;
|
|
72
89
|
context.output.render({
|
|
73
90
|
kind: "step",
|
|
74
|
-
text: `${surface.kind}/${surface.id}${platform ? ` ${platform}` : ""} ${pc.dim(`${kb(built.bytes)} · ${built.snapshotId.slice(0, 8)}`)} → ${path.relative(process.cwd(), file)}`
|
|
91
|
+
text: `${surface.kind}/${surface.id}${platform ? ` ${platform}` : ""} ${pc.dim(`${kb(built.bytes)} · ${built.snapshotId.slice(0, 8)}${teleport}`)} → ${path.relative(process.cwd(), file)}`
|
|
75
92
|
});
|
|
93
|
+
for (const warning of built.warnings ?? []) ui.warn(warning);
|
|
94
|
+
if (platform === void 0 && built.teleportRoute !== void 0) ui.info(unbuiltTeleportPages(surface, built.teleportRoute));
|
|
76
95
|
}
|
|
77
96
|
context.output.render({
|
|
78
97
|
kind: "outro",
|
|
@@ -83,4 +102,4 @@ async function runBuildPipeline(context, options = {}) {
|
|
|
83
102
|
}
|
|
84
103
|
|
|
85
104
|
//#endregion
|
|
86
|
-
export { outputFile, parseBuildPlatforms, runBuildPipeline };
|
|
105
|
+
export { outputFile, parseBuildPlatforms, runBuildPipeline, teleportPageFile, unbuiltTeleportPages };
|