@superwall/cli 2.1.1 → 2.2.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.
Files changed (68) hide show
  1. package/README.md +9 -0
  2. package/dist/{apple-BHbX0jbn.js → apple-Bcr_PteR.js} +13 -13
  3. package/dist/auth.d.ts +1 -1
  4. package/dist/auth.js +3 -3
  5. package/dist/{billing-4zhIBFRQ.js → billing-CWM1ds3K.js} +3 -3
  6. package/dist/{bind-CHLHmxgA.js → bind-DEYxsnZD.js} +4 -4
  7. package/dist/{build-5PQeSnNN.js → build--oQKfZU6.js} +6 -6
  8. package/dist/{client-BIvOmWPC.js → client-CimFymxG.js} +3 -3
  9. package/dist/{create-VK-pNfN7.js → create-BG9n4fvs.js} +22 -22
  10. package/dist/{create-BSNIFsnN.js → create-DTAyHkxb.js} +6 -6
  11. package/dist/create-kT2C9k4h.js +19 -0
  12. package/dist/{doctor-9JS96QkX.js → doctor-BkygMUe2.js} +6 -6
  13. package/dist/{drivers-BamBJ10Y.js → drivers-C6eXj5-r.js} +3 -3
  14. package/dist/entry.js +19 -19
  15. package/dist/{environment-eV7LEnSN.js → environment-CQn323uB.js} +1 -1
  16. package/dist/{existing-C8dSYHGk.js → existing-CvOluc9U.js} +2 -2
  17. package/dist/held-Bwkhufdj.js +16 -0
  18. package/dist/{held-BMisHn8F.js → held-QM7yfrXq.js} +6 -6
  19. package/dist/{integrate-VWtTNPCr.js → integrate-Ci_MLkQG.js} +21 -21
  20. package/dist/{login-BimbukE5.js → login-BIAWgdzM.js} +256 -33
  21. package/dist/{login-BmwG14LC.js → login-DLi71nJq.js} +1 -1
  22. package/dist/login-Dy9N5ZDH.js +16 -0
  23. package/dist/{lookup-k9EeOiZr.js → lookup-DZFrfzO0.js} +2 -2
  24. package/dist/{migrate-C86h6jeF.js → migrate-BKF1WckS.js} +21 -21
  25. package/dist/{notification-url-BVaTgWZ5.js → notification-url-erXQ1edb.js} +2 -2
  26. package/dist/{open-0tDCQOXC.js → open-BjvGVwJf.js} +10 -10
  27. package/dist/{org-DUwdrKPV.js → org-CvPGVSBF.js} +2 -2
  28. package/dist/{paths-BCbjCLP5.js → paths-oRuC18Kt.js} +1 -1
  29. package/dist/{playbook-oov9yV0q.js → playbook-CtTj1HBK.js} +10 -10
  30. package/dist/{promote-DPGPamkE.js → promote-BkJYISza.js} +16 -16
  31. package/dist/push-BIizJJOn.js +22 -0
  32. package/dist/{push-Cz4lJ8Qd.js → push-Ul2SW87i.js} +4 -4
  33. package/dist/{registry-CTczUigi.js → registry-OmPZ6dj0.js} +77 -36
  34. package/dist/{resources-B1qKDVXd.js → resources-FIrK7pE9.js} +1 -1
  35. package/dist/{run-DTPsVmFw.js → run-CwEY1eu5.js} +2 -2
  36. package/dist/{scan-Bb48xZqB.js → scan-CpbfZ2ju.js} +1 -1
  37. package/dist/scan-DjyvuWel.js +4 -0
  38. package/dist/{scope-B6UYGuwn.js → scope-BSqVfZvy.js} +4 -4
  39. package/dist/{selection-BbNk9r1q.js → selection-CHnVk8uw.js} +3 -3
  40. package/dist/server-BTveynqC.js +22 -0
  41. package/dist/{server-EYBMKAG1.js → server-D5xl5iKO.js} +66 -16
  42. package/dist/{session-xG9E8J2N.js → session-6lnJ0shD.js} +1 -1
  43. package/dist/{session-Crg9X-FI.js → session-BFwasPVq.js} +9 -8
  44. package/dist/session-Ds6tLC19.js +6 -0
  45. package/dist/skills/superwall/references/data-analytics.md +7 -8
  46. package/dist/skills/superwall-framework/references/migrate-from-editor.md +2 -1
  47. package/dist/{skills-Dg3k6TRC.js → skills-B8uSuanf.js} +8 -8
  48. package/dist/{skills-BdMKE2uO.js → skills-D7sG0xom.js} +4 -4
  49. package/dist/{spinner-Ba3XhlMb.js → spinner-TZeZEeVv.js} +3 -3
  50. package/dist/{storage-CerJ5KLP.d.ts → storage-BbJF7z3l.d.ts} +1 -0
  51. package/dist/{storage-DIkYajce.js → storage-DqKJe13V.js} +12 -2
  52. package/dist/storekit-C_LFh8qy.js +16 -0
  53. package/dist/{storekit-C2UzIIMs.js → storekit-uyT3DWo4.js} +3 -3
  54. package/dist/{telemetry-CVP8O6Y3.js → telemetry-D_uIIuSk.js} +1 -1
  55. package/dist/{token-IWv2httm.js → token-BJsLGoSX.js} +1 -1
  56. package/dist/tools.d.ts +8 -8
  57. package/dist/tools.js +14 -4
  58. package/dist/{upgrade-1t3aQUxh.js → upgrade-BRM51As6.js} +1 -1
  59. package/dist/{upgrade-DLf0LJDh.js → upgrade-DV_rmhyV.js} +2 -2
  60. package/package.json +2 -2
  61. package/dist/create-oj3zXvHZ.js +0 -19
  62. package/dist/held-DeJW2gUk.js +0 -16
  63. package/dist/login-2JHCG6c1.js +0 -16
  64. package/dist/push-Chp21y3a.js +0 -22
  65. package/dist/scan-B1SkkUi7.js +0 -4
  66. package/dist/server-CwrZ-I1r.js +0 -22
  67. package/dist/session-DItGa4z0.js +0 -6
  68. package/dist/storekit-DHNxDDpA.js +0 -16
@@ -1,21 +1,21 @@
1
1
  import { a as stripAnsi, l as readJson, o as cache, r as formatJson, t as blocks } from "./output-Ggzq5_-t.js";
2
- import { a as CHANNEL, g as TELEMETRY_KEY, h as TELEMETRY_HOST, t as API_HOST, v as VERSION, x as detectAgent } from "./environment-eV7LEnSN.js";
3
- import { t as readSession } from "./storage-DIkYajce.js";
4
- import { a as withQuery$1, t as ApiError } from "./client-BIvOmWPC.js";
5
- import { C as listKeySources, S as listBundleIdSuggestions, T as replaceRevenueProvider, _ as checkServerNotifications, b as importAppKey, c as resolveAscOrgApi, d as runAscDocs, f as parseParams, h as REVENUE_INTEGRATIONS, i as savedKey, l as resolveAscTeam, m as KEY_LABEL, n as testModeWarning, p as KEY_KINDS, r as chooseKeyApp, t as upsertHeldKey, u as sendAscRequest, v as copyAppKey, w as removeAppKey, x as keyKind, y as findIntegrations } from "./held-BMisHn8F.js";
2
+ import { a as CHANNEL, g as TELEMETRY_KEY, h as TELEMETRY_HOST, t as API_HOST, v as VERSION, x as detectAgent } from "./environment-CQn323uB.js";
3
+ import { n as readSession } from "./storage-DqKJe13V.js";
4
+ import { a as withQuery$1, t as ApiError } from "./client-CimFymxG.js";
5
+ import { C as listKeySources, S as listBundleIdSuggestions, T as replaceRevenueProvider, _ as checkServerNotifications, b as importAppKey, c as resolveAscOrgApi, d as runAscDocs, f as parseParams, h as REVENUE_INTEGRATIONS, i as savedKey, l as resolveAscTeam, m as KEY_LABEL, n as testModeWarning, p as KEY_KINDS, r as chooseKeyApp, t as upsertHeldKey, u as sendAscRequest, v as copyAppKey, w as removeAppKey, x as keyKind, y as findIntegrations } from "./held-QM7yfrXq.js";
6
6
  import { n as readDefaultApp, r as readOnboardedApp, t as readAnonymousId, u as writeDefaultApp } from "./config-BO1Y87kV.js";
7
- import { a as defineCommand, d as readInput, i as defineCatalog, r as UsageError, t as apiCall } from "./spinner-Ba3XhlMb.js";
7
+ import { a as defineCommand, d as readInput, i as defineCatalog, r as UsageError, t as apiCall } from "./spinner-TZeZEeVv.js";
8
8
  import { n as fg, t as THEME } from "./theme-DUsCh-Vd.js";
9
- import { n as runWhoami } from "./session-xG9E8J2N.js";
10
- import { A as parseJson, M as listOrgGroups, O as isRecord, P as orgIdOf, i as createEntitlement, j as textField, l as isAppScoped, m as listResource, n as createApplication, o as createProduct, p as listProjects, r as createCampaign, s as createProject, t as RESOURCES, v as platformLabel, w as rowName } from "./resources-B1qKDVXd.js";
11
- import { n as orgForNewProject } from "./org-DUwdrKPV.js";
12
- import { n as findApplication, r as findProject, t as appNotFound } from "./lookup-k9EeOiZr.js";
13
- import { a as pickScope, i as pickProject, n as chooseApp, r as pickOrganization, t as boundOrganization } from "./scope-B6UYGuwn.js";
9
+ import { n as runWhoami } from "./session-6lnJ0shD.js";
10
+ import { A as parseJson, M as listOrgGroups, O as isRecord, P as orgIdOf, i as createEntitlement, j as textField, l as isAppScoped, m as listResource, n as createApplication, o as createProduct, p as listProjects, r as createCampaign, s as createProject, t as RESOURCES, v as platformLabel, w as rowName } from "./resources-FIrK7pE9.js";
11
+ import { n as orgForNewProject } from "./org-CvPGVSBF.js";
12
+ import { n as findApplication, r as findProject, t as appNotFound } from "./lookup-DZFrfzO0.js";
13
+ import { a as pickScope, i as pickProject, n as chooseApp, r as pickOrganization, t as boundOrganization } from "./scope-BSqVfZvy.js";
14
14
  import { a as listAscConfigs, i as findAppNotificationUrl, o as removeAscConfig, t as ascProxy } from "./client-BZ1UbpXz.js";
15
15
  import { i as listUnimportedAscProducts, n as findAscAppId, r as listAscApps, t as ascTypeDisplay } from "./products-DH_fK9tY.js";
16
16
  import { n as readResourceFlags, r as textOf, t as fieldName } from "./input-vi0bou04.js";
17
- import { a as runAscNotificationUrlSet, i as printServerNotifications, t as describeNotificationUrl } from "./notification-url-BVaTgWZ5.js";
18
- import { t as platformForIntegration } from "./bind-CHLHmxgA.js";
17
+ import { a as runAscNotificationUrlSet, i as printServerNotifications, t as describeNotificationUrl } from "./notification-url-erXQ1edb.js";
18
+ import { t as platformForIntegration } from "./bind-DEYxsnZD.js";
19
19
  import pc from "picocolors";
20
20
 
21
21
  //#region src/ui/help-layout.ts
@@ -76,12 +76,47 @@ function renderPage(page) {
76
76
  const command = defineCommand({
77
77
  name: "login",
78
78
  summary: "Log in to Superwall in your browser, or with an API key",
79
+ details: "Without a terminal (a coding agent, --json), login prints the link and code and returns at once; once the link is approved, `superwall login --poll` finishes it. A new account needs --org-name, and --app-name with --platform also creates its first app.",
79
80
  flags: {
80
81
  apiKey: {
81
82
  type: "string",
82
83
  value: "key",
83
84
  describe: "Log in with an API key instead of the browser, for CI"
84
85
  },
86
+ poll: {
87
+ type: "boolean",
88
+ describe: "Finish a login started without a terminal, once it's approved in the browser"
89
+ },
90
+ timeout: {
91
+ type: "number",
92
+ value: "seconds",
93
+ describe: "With --poll, seconds to wait for approval before returning (default 60)"
94
+ },
95
+ orgName: {
96
+ type: "string",
97
+ value: "name",
98
+ describe: "Create this organization if the account has none"
99
+ },
100
+ appName: {
101
+ type: "string",
102
+ value: "name",
103
+ describe: "With --org-name, also create this app as the organization's first"
104
+ },
105
+ platform: {
106
+ type: "string",
107
+ value: "platform",
108
+ choices: [
109
+ "ios",
110
+ "android",
111
+ "web"
112
+ ],
113
+ describe: "Platform of the --app-name app"
114
+ },
115
+ bundleId: {
116
+ type: "string",
117
+ value: "id",
118
+ describe: "Bundle ID of the --app-name app"
119
+ },
85
120
  host: {
86
121
  type: "string",
87
122
  value: "url",
@@ -95,13 +130,19 @@ const command = defineCommand({
95
130
  hidden: true
96
131
  }
97
132
  },
98
- examples: [["login", "Approve the login in your browser"], ["login --api-key <key>", "Log in on a server or in CI"]],
133
+ examples: [
134
+ ["login", "Approve the login in your browser"],
135
+ ["login --api-key <key>", "Log in on a server or in CI"],
136
+ ["login --json", "From an agent: print the link to approve and return"],
137
+ ["login --poll --json", "From an agent: finish the login once it's approved"],
138
+ ["login --poll --org-name Acme --app-name Acme --platform ios", "From an agent: finish a new account's login and create its first app"]
139
+ ],
99
140
  auth: "none",
100
141
  json: true,
101
142
  prompts: true,
102
143
  mcp: false,
103
144
  async run(ctx, input) {
104
- const { runLogin } = await import("./login-2JHCG6c1.js");
145
+ const { runLogin } = await import("./login-Dy9N5ZDH.js");
105
146
  return runLogin(ctx, input);
106
147
  }
107
148
  });
@@ -117,7 +158,7 @@ const command$1 = defineCommand({
117
158
  prompts: true,
118
159
  mcp: false,
119
160
  async run(ctx) {
120
- const { runLogout } = await import("./session-DItGa4z0.js");
161
+ const { runLogout } = await import("./session-Ds6tLC19.js");
121
162
  return runLogout(ctx);
122
163
  }
123
164
  });
@@ -3429,7 +3470,7 @@ A purchase_key is for the app's bundle ID; an app with none gets --bundle-id sav
3429
3470
  prompts: true,
3430
3471
  mcp: false,
3431
3472
  async run(ctx, input) {
3432
- const { runAscKeysCreate } = await import("./create-oj3zXvHZ.js");
3473
+ const { runAscKeysCreate } = await import("./create-kT2C9k4h.js");
3433
3474
  return runAscKeysCreate(ctx, input);
3434
3475
  }
3435
3476
  });
@@ -3816,7 +3857,7 @@ With --app it saves the key you hold on that app instead, as asc keys create --k
3816
3857
  prompts: true,
3817
3858
  mcp: false,
3818
3859
  async run(ctx, { args, flags }) {
3819
- const { upsertHeldKey: upsertHeldKey$1 } = await import("./held-DeJW2gUk.js");
3860
+ const { upsertHeldKey: upsertHeldKey$1 } = await import("./held-Bwkhufdj.js");
3820
3861
  return upsertHeldKey$1(ctx, {
3821
3862
  action: "update",
3822
3863
  key: {
@@ -5069,7 +5110,7 @@ Exit codes
5069
5110
  prompts: true,
5070
5111
  mcp: false,
5071
5112
  async run(ctx, input) {
5072
- const { runSetupApple } = await import("./apple-BHbX0jbn.js");
5113
+ const { runSetupApple } = await import("./apple-Bcr_PteR.js");
5073
5114
  return runSetupApple(ctx, input);
5074
5115
  }
5075
5116
  });
@@ -7702,7 +7743,7 @@ const command$45 = defineCommand({
7702
7743
  mcp: false,
7703
7744
  channel: "next",
7704
7745
  async run(ctx, { args, flags }) {
7705
- const { runBuildPipeline } = await import("./build-5PQeSnNN.js");
7746
+ const { runBuildPipeline } = await import("./build--oQKfZU6.js");
7706
7747
  await runBuildPipeline({
7707
7748
  output: ctx.output,
7708
7749
  json: ctx.json
@@ -7764,7 +7805,7 @@ const command$46 = defineCommand({
7764
7805
  mcp: false,
7765
7806
  channel: "next",
7766
7807
  async run(ctx, { args, flags }) {
7767
- const { runCreate } = await import("./create-VK-pNfN7.js");
7808
+ const { runCreate } = await import("./create-BG9n4fvs.js");
7768
7809
  return runCreate(ctx, {
7769
7810
  dir: args.dir,
7770
7811
  ...flags
@@ -7808,7 +7849,7 @@ const command$47 = defineCommand({
7808
7849
  mcp: false,
7809
7850
  channel: "next",
7810
7851
  async run(ctx, { args, flags }) {
7811
- const { runStudio } = await import("./server-CwrZ-I1r.js");
7852
+ const { runStudio } = await import("./server-BTveynqC.js");
7812
7853
  await runStudio({
7813
7854
  dirs: args.dir,
7814
7855
  port: flags.port,
@@ -7849,7 +7890,7 @@ const command$48 = defineCommand({
7849
7890
  mcp: false,
7850
7891
  channel: "next",
7851
7892
  async run(ctx, input) {
7852
- const { runPromote } = await import("./promote-DPGPamkE.js");
7893
+ const { runPromote } = await import("./promote-BkJYISza.js");
7853
7894
  return runPromote(ctx, input);
7854
7895
  }
7855
7896
  });
@@ -7894,7 +7935,7 @@ const command$49 = defineCommand({
7894
7935
  mcp: false,
7895
7936
  channel: "next",
7896
7937
  async run(ctx, input) {
7897
- const { runPush } = await import("./push-Chp21y3a.js");
7938
+ const { runPush } = await import("./push-BIizJJOn.js");
7898
7939
  return runPush(ctx, input, true);
7899
7940
  }
7900
7941
  });
@@ -7939,7 +7980,7 @@ const command$50 = defineCommand({
7939
7980
  mcp: false,
7940
7981
  channel: "next",
7941
7982
  async run(ctx, input) {
7942
- const { runPush } = await import("./push-Chp21y3a.js");
7983
+ const { runPush } = await import("./push-BIizJJOn.js");
7943
7984
  return runPush(ctx, input, false);
7944
7985
  }
7945
7986
  });
@@ -8328,7 +8369,7 @@ async function createApp(context, api, nameArg, fields) {
8328
8369
  let name = nameArg;
8329
8370
  let platform = textOf(fields.platform);
8330
8371
  if (interactive && (!name || !platform)) {
8331
- const { scanProject } = await import("./scan-B1SkkUi7.js");
8372
+ const { scanProject } = await import("./scan-DjyvuWel.js");
8332
8373
  const detected = (await scanProject(context.installDir).catch(() => null))?.apps[0];
8333
8374
  if (detected && !name && !platform) {
8334
8375
  ui.info(`Detected \`${detected.framework.name}\`` + (detected.details ? ` · \`${detected.details}\`` : ""));
@@ -8567,7 +8608,7 @@ async function runResource(ctx, resource, action, value$1, value2, flags) {
8567
8608
  if (action === "create") return create(ctx, ctx.api, resource, value$1, value2, flags);
8568
8609
  if (action === "use" && resource === "apps") return useApp(ctx, ctx.api, value$1);
8569
8610
  if (action === "storekit" && resource === "products") {
8570
- const { writeStoreKit } = await import("./storekit-DHNxDDpA.js");
8611
+ const { writeStoreKit } = await import("./storekit-C_LFh8qy.js");
8571
8612
  return writeStoreKit(ctx, ctx.api, flags.fields.out);
8572
8613
  }
8573
8614
  throw new Error(`Unknown action "${action}" for ${resource}.`);
@@ -9305,7 +9346,7 @@ const command$54 = defineResource({
9305
9346
  {
9306
9347
  name: "update",
9307
9348
  summary: "Change a campaign",
9308
- details: "Overwrites supplied campaign fields, including description, notes and delivery mode.",
9349
+ details: "Overwrites supplied campaign description and notes. To change delivery mode, use placement update tools.",
9309
9350
  effect: "destructive",
9310
9351
  method: "PATCH",
9311
9352
  path: "/v2/campaigns/{id}"
@@ -9917,7 +9958,7 @@ const command$61 = defineCommand({
9917
9958
  prompts: true,
9918
9959
  mcp: false,
9919
9960
  async run(ctx) {
9920
- const { runDoctor } = await import("./doctor-9JS96QkX.js");
9961
+ const { runDoctor } = await import("./doctor-BkygMUe2.js");
9921
9962
  return runDoctor(ctx);
9922
9963
  }
9923
9964
  });
@@ -10153,7 +10194,7 @@ const command$63 = defineCommand({
10153
10194
  prompts: true,
10154
10195
  mcp: false,
10155
10196
  async run(ctx, input) {
10156
- const { runSkills } = await import("./skills-Dg3k6TRC.js");
10197
+ const { runSkills } = await import("./skills-B8uSuanf.js");
10157
10198
  return runSkills(ctx, input);
10158
10199
  }
10159
10200
  });
@@ -10169,7 +10210,7 @@ const command$64 = defineCommand({
10169
10210
  prompts: true,
10170
10211
  mcp: false,
10171
10212
  async run(ctx) {
10172
- const { runUpgrade } = await import("./upgrade-DLf0LJDh.js");
10213
+ const { runUpgrade } = await import("./upgrade-DV_rmhyV.js");
10173
10214
  return runUpgrade(ctx);
10174
10215
  }
10175
10216
  });
@@ -10208,8 +10249,8 @@ const command$65 = defineCommand({
10208
10249
  prompts: true,
10209
10250
  mcp: false,
10210
10251
  async run(ctx, { flags }) {
10211
- const { runIntegrate } = await import("./integrate-VWtTNPCr.js");
10212
- const { printPlaybook } = await import("./playbook-oov9yV0q.js");
10252
+ const { runIntegrate } = await import("./integrate-Ci_MLkQG.js");
10253
+ const { printPlaybook } = await import("./playbook-CtTj1HBK.js");
10213
10254
  if (flags.skill) return printPlaybook(ctx.installDir, "integrate");
10214
10255
  await runIntegrate({
10215
10256
  ...ctx,
@@ -10269,8 +10310,8 @@ const command$66 = defineCommand({
10269
10310
  prompts: true,
10270
10311
  mcp: false,
10271
10312
  async run(ctx, { args, flags }) {
10272
- const { runPaywallMigration, runProviderMigration, runScreenMigration } = await import("./migrate-C86h6jeF.js");
10273
- const { printPlaybook } = await import("./playbook-oov9yV0q.js");
10313
+ const { runPaywallMigration, runProviderMigration, runScreenMigration } = await import("./migrate-BKF1WckS.js");
10314
+ const { printPlaybook } = await import("./playbook-CtTj1HBK.js");
10274
10315
  if (flags.screen !== void 0) return runScreenMigration(ctx, {
10275
10316
  path: flags.screen,
10276
10317
  screenshot: flags.screenshot
@@ -10304,8 +10345,8 @@ const command$67 = defineCommand({
10304
10345
  prompts: true,
10305
10346
  mcp: false,
10306
10347
  async run(ctx, { flags }) {
10307
- const { runReview } = await import("./integrate-VWtTNPCr.js");
10308
- const { printPlaybook } = await import("./playbook-oov9yV0q.js");
10348
+ const { runReview } = await import("./integrate-Ci_MLkQG.js");
10349
+ const { printPlaybook } = await import("./playbook-CtTj1HBK.js");
10309
10350
  if (flags.skill) return printPlaybook(ctx.installDir, flags.fix ? "review-fix" : "review");
10310
10351
  await runReview(ctx, flags.fix);
10311
10352
  }
@@ -1,4 +1,4 @@
1
- import { n as ApiUnreachableError, t as ApiError } from "./client-BIvOmWPC.js";
1
+ import { n as ApiUnreachableError, t as ApiError } from "./client-CimFymxG.js";
2
2
  import { o as readOpenedOrgs, p as writeOpenedOrgs } from "./config-BO1Y87kV.js";
3
3
 
4
4
  //#region src/core/api/orgs.ts
@@ -1,5 +1,5 @@
1
- import { c as DASHBOARD_URL } from "./environment-eV7LEnSN.js";
2
- import { i as packagedDir } from "./paths-BCbjCLP5.js";
1
+ import { c as DASHBOARD_URL } from "./environment-CQn323uB.js";
2
+ import { i as packagedDir } from "./paths-oRuC18Kt.js";
3
3
  import { spawn } from "node:child_process";
4
4
  import { readFileSync } from "node:fs";
5
5
  import { join } from "node:path";
@@ -1,4 +1,4 @@
1
- import { f as Integration } from "./environment-eV7LEnSN.js";
1
+ import { f as Integration } from "./environment-CQn323uB.js";
2
2
  import { existsSync, readFileSync } from "node:fs";
3
3
  import { basename, dirname, join, relative, sep } from "node:path";
4
4
  import fg from "fast-glob";
@@ -0,0 +1,4 @@
1
+ import "./environment-CQn323uB.js";
2
+ import { t as scanProject } from "./scan-CpbfZ2ju.js";
3
+
4
+ export { scanProject };
@@ -1,8 +1,8 @@
1
1
  import { n as readDefaultApp, u as writeDefaultApp } from "./config-BO1Y87kV.js";
2
- import { t as apiCall, u as currentHost } from "./spinner-Ba3XhlMb.js";
3
- import { I as organizationOf, M as listOrgGroups, P as orgIdOf, c as findPaywall, p as listProjects, v as platformLabel } from "./resources-B1qKDVXd.js";
4
- import { t as chooseOrgOfApps } from "./org-DUwdrKPV.js";
5
- import { n as findApplication, r as findProject, t as appNotFound } from "./lookup-k9EeOiZr.js";
2
+ import { t as apiCall, u as currentHost } from "./spinner-TZeZEeVv.js";
3
+ import { I as organizationOf, M as listOrgGroups, P as orgIdOf, c as findPaywall, p as listProjects, v as platformLabel } from "./resources-FIrK7pE9.js";
4
+ import { t as chooseOrgOfApps } from "./org-CvPGVSBF.js";
5
+ import { n as findApplication, r as findProject, t as appNotFound } from "./lookup-DZFrfzO0.js";
6
6
 
7
7
  //#region src/core/account/scope.ts
8
8
  function moveFirst(items, match) {
@@ -1,6 +1,6 @@
1
- import { r as ASSET_HOST } from "./environment-eV7LEnSN.js";
2
- import { t as ApiError } from "./client-BIvOmWPC.js";
3
- import { x as pushPaywallAssets } from "./resources-B1qKDVXd.js";
1
+ import { r as ASSET_HOST } from "./environment-CQn323uB.js";
2
+ import { t as ApiError } from "./client-CimFymxG.js";
3
+ import { x as pushPaywallAssets } from "./resources-FIrK7pE9.js";
4
4
  import { createRequire } from "node:module";
5
5
  import * as fs from "node:fs";
6
6
  import { globSync, readFileSync, statSync } from "node:fs";
@@ -0,0 +1,22 @@
1
+ import "./token-BJsLGoSX.js";
2
+ import "./output-Ggzq5_-t.js";
3
+ import "./environment-CQn323uB.js";
4
+ import "./storage-DqKJe13V.js";
5
+ import "./client-CimFymxG.js";
6
+ import "./config-BO1Y87kV.js";
7
+ import "./telemetry-D_uIIuSk.js";
8
+ import "./spawn-DmmmHIP-.js";
9
+ import "./spinner-TZeZEeVv.js";
10
+ import "./ui-D_qf3Gvw.js";
11
+ import "./scan-CpbfZ2ju.js";
12
+ import "./paths-oRuC18Kt.js";
13
+ import "./resources-FIrK7pE9.js";
14
+ import "./lookup-DZFrfzO0.js";
15
+ import "./login-BIAWgdzM.js";
16
+ import "./skills-D7sG0xom.js";
17
+ import "./selection-CHnVk8uw.js";
18
+ import "./session-BFwasPVq.js";
19
+ import "./login-DLi71nJq.js";
20
+ import { t as runStudio } from "./server-D5xl5iKO.js";
21
+
22
+ export { runStudio };
@@ -1,10 +1,10 @@
1
- import { v as VERSION } from "./environment-eV7LEnSN.js";
2
- import { t as ApiError } from "./client-BIvOmWPC.js";
1
+ import { v as VERSION } from "./environment-CQn323uB.js";
2
+ import { t as ApiError } from "./client-CimFymxG.js";
3
3
  import { n as ui } from "./ui-D_qf3Gvw.js";
4
- import { E as versionProducts, S as pushPaywallVersion, b as promotePaywallVersion, f as listApplications } from "./resources-B1qKDVXd.js";
5
- import { i as openBrowser } from "./login-BimbukE5.js";
6
- import { F as requireAssets, I as syncAssets, M as frameworkVersion, N as resolveFramework, P as assetBaseUrl, i as requireProject, o as resolveProjectDirs, u as LAYOUT_HINT, v as collectProjectDeclarations, w as readLock, y as writeProjectTypes } from "./selection-BbNk9r1q.js";
7
- import { f as listProjectProducts, g as planTargets, i as pushSource, l as writeProjectScaffold, n as requireApi, o as collectSourceFiles, p as projectForApplication, s as warnNotPortable, u as listApplicationCatalogue, v as wantedPlatforms, x as resolveApps, y as resolveBinding } from "./session-Crg9X-FI.js";
4
+ import { E as versionProducts, S as pushPaywallVersion, b as promotePaywallVersion, f as listApplications } from "./resources-FIrK7pE9.js";
5
+ import { o as openBrowser } from "./login-BIAWgdzM.js";
6
+ import { F as requireAssets, I as syncAssets, M as frameworkVersion, N as resolveFramework, P as assetBaseUrl, i as requireProject, o as resolveProjectDirs, u as LAYOUT_HINT, v as collectProjectDeclarations, w as readLock, y as writeProjectTypes } from "./selection-CHnVk8uw.js";
7
+ import { f as listProjectProducts, g as planTargets, i as pushSource, l as writeProjectScaffold, n as requireApi, o as collectSourceFiles, p as projectForApplication, s as warnNotPortable, u as listApplicationCatalogue, v as wantedPlatforms, x as resolveApps, y as resolveBinding } from "./session-BFwasPVq.js";
8
8
  import { execFile } from "node:child_process";
9
9
  import * as fs from "node:fs";
10
10
  import * as path from "node:path";
@@ -191,11 +191,63 @@ const allowLocalNetworking = async (plist) => {
191
191
 
192
192
  //#endregion
193
193
  //#region src/core/paywalls/studio/actions.ts
194
+ const resolveScreenshots = (session) => {
195
+ const pages = session.pages ?? [];
196
+ const reviewUrl = session.apple_review_image?.url;
197
+ const regular = pages.filter((page) => page.kind !== "overlay");
198
+ const reviewed = reviewUrl === void 0 ? void 0 : [...regular].reverse().find((page) => page.page_index === session.apple_review_image?.page_index) ?? regular.at(-1);
199
+ const hosts = /* @__PURE__ */ new Map();
200
+ const shots = [];
201
+ let ordinal = 0;
202
+ for (const page of pages) {
203
+ const url = page.app_store_image?.url ?? (page === reviewed ? reviewUrl : page.url);
204
+ if (page.kind === "overlay") {
205
+ const host = hosts.get(page.page_index) ?? {
206
+ label: `Page ${(page.page_index ?? 0) + 1}`,
207
+ overlays: 0
208
+ };
209
+ host.overlays += 1;
210
+ hosts.set(page.page_index, host);
211
+ const label$1 = page.page_name?.trim() || `${host.label} · Overlay ${host.overlays}`;
212
+ if (url !== void 0) shots.push({
213
+ label: label$1,
214
+ url
215
+ });
216
+ continue;
217
+ }
218
+ ordinal += 1;
219
+ const label = page.page_name?.trim() || `Page ${ordinal}`;
220
+ hosts.set(page.page_index, {
221
+ label,
222
+ overlays: 0
223
+ });
224
+ if (url !== void 0) shots.push({
225
+ label,
226
+ url
227
+ });
228
+ }
229
+ if (reviewed === void 0 && reviewUrl !== void 0) shots.push({
230
+ label: `Page ${ordinal + 1}`,
231
+ url: reviewUrl
232
+ });
233
+ return shots;
234
+ };
194
235
  const reason = (error) => error instanceof Error ? error.message : String(error);
195
236
  const firstApp = (apps) => apps.ios ?? Object.values(apps)[0];
196
237
  function createStudioActions(framework, project) {
197
238
  let api;
198
239
  const ensureApi = async () => api ??= await requireApi(false);
240
+ const readPreviewImages = async (surface) => {
241
+ const lock = readLock(project.superwallDir);
242
+ const bindings = (surface.kind === "paywall" ? lock.paywalls : lock.funnels)[surface.id];
243
+ const bound = bindings === void 0 ? void 0 : Object.values(bindings)[0];
244
+ if (!bound) return void 0;
245
+ const session = await (await ensureApi()).get(`/v2/paywalls/${encodeURIComponent(bound.paywallId)}/preview-images`).catch((error) => {
246
+ if (error instanceof ApiError && error.status === 400) return void 0;
247
+ throw error;
248
+ });
249
+ return session?.status === "ready" ? session : void 0;
250
+ };
199
251
  const targetsFor = async (client, surface) => {
200
252
  const declared = (await collectProjectDeclarations(framework, project.root)).platforms;
201
253
  const apps = await resolveApps({
@@ -353,17 +405,15 @@ function createStudioActions(framework, project) {
353
405
  };
354
406
  }
355
407
  },
408
+ async screenshots(surface) {
409
+ const session = await readPreviewImages(surface);
410
+ if (session === void 0) return void 0;
411
+ const shots = resolveScreenshots(session);
412
+ return shots.length === 0 ? void 0 : shots;
413
+ },
356
414
  async screenshot(surface) {
357
- const lock = readLock(project.superwallDir);
358
- const bindings = (surface.kind === "paywall" ? lock.paywalls : lock.funnels)[surface.id];
359
- const bound = bindings === void 0 ? void 0 : Object.values(bindings)[0];
360
- if (!bound) return void 0;
361
- const session = await (await ensureApi()).get(`/v2/paywalls/${encodeURIComponent(bound.paywallId)}/preview-images`).catch((error) => {
362
- if (error instanceof ApiError && error.status === 400) return void 0;
363
- throw error;
364
- });
365
- if (session?.status !== "ready") return void 0;
366
- return session.apple_review_image?.url ?? session.pages?.[0]?.url;
415
+ const session = await readPreviewImages(surface);
416
+ return session?.apple_review_image?.url ?? session?.pages?.[0]?.url;
367
417
  },
368
418
  async status(surface) {
369
419
  try {
@@ -1,4 +1,4 @@
1
- import { a as sessionOrgName, i as serializeSession, n as removeSession, r as resolveApiHost, t as readSession } from "./storage-DIkYajce.js";
1
+ import { a as resolveApiHost, i as removeSession, n as readSession, o as serializeSession, s as sessionOrgName } from "./storage-DqKJe13V.js";
2
2
 
3
3
  //#region src/core/account/session.ts
4
4
  function runWhoami(ctx) {
@@ -1,11 +1,11 @@
1
- import { l as ENV_API_KEY, t as API_HOST, y as apiKeyFromEnv } from "./environment-eV7LEnSN.js";
2
- import { t as readSession } from "./storage-DIkYajce.js";
3
- import { n as ApiUnreachableError, r as createSuperwallApi, t as ApiError } from "./client-BIvOmWPC.js";
1
+ import { l as ENV_API_KEY, t as API_HOST, y as apiKeyFromEnv } from "./environment-CQn323uB.js";
2
+ import { n as readSession } from "./storage-DqKJe13V.js";
3
+ import { n as ApiUnreachableError, r as createSuperwallApi, t as ApiError } from "./client-CimFymxG.js";
4
4
  import { n as ui } from "./ui-D_qf3Gvw.js";
5
- import { O as isRecord, _ as mintSourceAccess, a as createHeadlessPaywall, d as listAppPaywalls, f as listApplications, u as linkSourceCommit, v as platformLabel } from "./resources-B1qKDVXd.js";
6
- import { n as findApplication } from "./lookup-k9EeOiZr.js";
7
- import { C as parseSources, D as writeBinding, E as writeApp, j as writeSources, w as readLock, x as formatSharedLock } from "./selection-BbNk9r1q.js";
8
- import { n as performLoginWithUi } from "./login-BmwG14LC.js";
5
+ import { O as isRecord, _ as mintSourceAccess, a as createHeadlessPaywall, d as listAppPaywalls, f as listApplications, u as linkSourceCommit, v as platformLabel } from "./resources-FIrK7pE9.js";
6
+ import { n as findApplication } from "./lookup-DZFrfzO0.js";
7
+ import { C as parseSources, D as writeBinding, E as writeApp, j as writeSources, w as readLock, x as formatSharedLock } from "./selection-CHnVk8uw.js";
8
+ import { n as performLoginWithUi } from "./login-DLi71nJq.js";
9
9
  import { execFile } from "node:child_process";
10
10
  import * as fs from "node:fs";
11
11
  import * as path from "node:path";
@@ -771,7 +771,8 @@ var LoginRequiredError = class extends Error {
771
771
  constructor() {
772
772
  super(`Pushing paywalls needs a Superwall account.
773
773
  Interactively: run \`superwall login\`.
774
- In CI or an agent: set ${ENV_API_KEY} to an org API key (sk_…).`);
774
+ In an agent: run \`superwall login\`, have the link it prints approved, then \`superwall login --poll\`.
775
+ In CI: set ${ENV_API_KEY} to an org API key (sk_…).`);
775
776
  this.name = "LoginRequiredError";
776
777
  }
777
778
  };
@@ -0,0 +1,6 @@
1
+ import "./output-Ggzq5_-t.js";
2
+ import "./environment-CQn323uB.js";
3
+ import "./storage-DqKJe13V.js";
4
+ import { n as runWhoami, t as runLogout } from "./session-6lnJ0shD.js";
5
+
6
+ export { runLogout, runWhoami };
@@ -846,13 +846,12 @@ GROUP BY variantId ORDER BY variantId
846
846
 
847
847
  # Related Tables (Not Documented Here But Referenced)
848
848
 
849
- | Table | Purpose |
850
- | -------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
851
- | `analytics.ps_applications` | App metadata replicated from PlanetScale, Superwall's application layer db. Use `applicationName` (not `name`). |
852
- | `open_revenue.attributed_events_by_experiment_rep` | Revenue by A/B experiment (use FINAL) |
853
- | `open_revenue.sdk_events_agg` | Pre-aggregated SDK events - prefer over `events_rep` for counts/uniques. Uses AggregateFunction columns. |
854
- | `sw.device_attributes_rep` | Device-level attributes (use FINAL, filter isDeleted=0) |
855
- | `sw.user_aliases_rep` | User ID to alias mappings (use FINAL, filter isDeleted=0) |
849
+ | Table | Purpose |
850
+ | ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
851
+ | `open_revenue.attributed_events_by_experiment_rep_next` | Revenue by A/B experiment (use FINAL) |
852
+ | `open_revenue.sdk_events_agg` | Pre-aggregated SDK events - prefer over `events_rep` for counts/uniques. Uses AggregateFunction columns. |
853
+ | `sw.device_attributes_rep` | Device-level attributes (use FINAL, filter isDeleted=0) |
854
+ | `sw.user_aliases_rep` | User ID to alias mappings (use FINAL, filter isDeleted=0) |
856
855
 
857
856
  #### `open_revenue.sdk_events_agg` Quick Reference
858
857
 
@@ -895,7 +894,7 @@ sw.applications_rep (applicationId)
895
894
 
896
895
  #### Finding an Application
897
896
 
898
- 1. Search `analytics.ps_applications` by name (or `sw.applications_rep`)
897
+ 1. Search `sw.applications_rep` by name
899
898
  2. If multiple results, check `sw.events_hr_agg` for recent event counts
900
899
  3. Show `applicationId` + link: `superwall.com/applications/:applicationId`
901
900
 
@@ -67,7 +67,8 @@ is whichever slot the selection state points at.
67
67
  | `set-state` | set the matching React state |
68
68
  | `set-attribute` | the setter of `useUserAttribute(key, parser)`, one hook per attribute (`useActions().setUserAttributes` is deprecated) |
69
69
  | `custom-placement` | `useActions().customPlacement(name, params)` |
70
- | `custom-in-app` | `useActions().requestCallback(...)` (docs: `actions`) |
70
+ | `custom-in-app` (Custom Action) | `useActions().customAction(data)`: the app's existing `handleCustomPaywallAction(withName:)` handler receives `data` as the name. Fire-and-forget, nothing comes back: when the paywall needs the app's answer (the handler's result decides what the paywall does next), use `useActions().requestCallback(name)` instead and register that callback in the app. A Liquid-rendered `data` becomes a string you build in code |
71
+ | `request-callback` (Custom Callback) | `useActions().requestCallback(name, { behavior, variables })`; `onSuccess`/`onFailure` become code on the resolved `status` (docs: `actions`) |
71
72
  | `request-permission` | `useActions().requestPermission(type)`; `onGranted`/`onDenied` become the resolved status |
72
73
  | `request-store-review` | `useActions().requestStoreReview()` |
73
74
  | `redeem-discount` | `useDiscount().redeem(code)` |
@@ -1,14 +1,14 @@
1
- import "./token-IWv2httm.js";
1
+ import "./token-BJsLGoSX.js";
2
2
  import "./output-Ggzq5_-t.js";
3
- import "./environment-eV7LEnSN.js";
4
- import "./storage-DIkYajce.js";
5
- import "./client-BIvOmWPC.js";
3
+ import "./environment-CQn323uB.js";
4
+ import "./storage-DqKJe13V.js";
5
+ import "./client-CimFymxG.js";
6
6
  import "./config-BO1Y87kV.js";
7
- import "./telemetry-CVP8O6Y3.js";
7
+ import "./telemetry-D_uIIuSk.js";
8
8
  import "./spawn-DmmmHIP-.js";
9
- import "./spinner-Ba3XhlMb.js";
9
+ import "./spinner-TZeZEeVv.js";
10
10
  import "./ui-D_qf3Gvw.js";
11
- import "./paths-BCbjCLP5.js";
12
- import { a as bundledSkills, c as knownSkills, d as readBundledSkill, f as runSkills, i as SUPERWALL_SKILLS_SOURCE, l as normalizeSkillFrontmatter, m as skillsRefFor, n as SKILLS_INSTALL_SOURCE, o as checkSkillsSync, p as skillSummary, r as SKILLS_REF, s as ensureSkillsCurrent, t as PLAYBOOKS, u as normalizeSkillsDir } from "./skills-BdMKE2uO.js";
11
+ import "./paths-oRuC18Kt.js";
12
+ import { a as bundledSkills, c as knownSkills, d as readBundledSkill, f as runSkills, i as SUPERWALL_SKILLS_SOURCE, l as normalizeSkillFrontmatter, m as skillsRefFor, n as SKILLS_INSTALL_SOURCE, o as checkSkillsSync, p as skillSummary, r as SKILLS_REF, s as ensureSkillsCurrent, t as PLAYBOOKS, u as normalizeSkillsDir } from "./skills-D7sG0xom.js";
13
13
 
14
14
  export { PLAYBOOKS, SKILLS_INSTALL_SOURCE, SKILLS_REF, SUPERWALL_SKILLS_SOURCE, bundledSkills, checkSkillsSync, ensureSkillsCurrent, knownSkills, normalizeSkillFrontmatter, normalizeSkillsDir, readBundledSkill, runSkills, skillSummary, skillsRefFor };
@@ -1,10 +1,10 @@
1
- import { a as CHANNEL, o as CHANNELS, v as VERSION } from "./environment-eV7LEnSN.js";
1
+ import { a as CHANNEL, o as CHANNELS, v as VERSION } from "./environment-CQn323uB.js";
2
2
  import { m as writeSkillsSync, s as readSkillsSync } from "./config-BO1Y87kV.js";
3
- import { r as track } from "./telemetry-CVP8O6Y3.js";
3
+ import { r as track } from "./telemetry-D_uIIuSk.js";
4
4
  import { r as spawnStream } from "./spawn-DmmmHIP-.js";
5
- import { n as withSpinner } from "./spinner-Ba3XhlMb.js";
5
+ import { n as withSpinner } from "./spinner-TZeZEeVv.js";
6
6
  import { n as ui } from "./ui-D_qf3Gvw.js";
7
- import { i as packagedDir, t as AGENT_SKILLS_DIR } from "./paths-BCbjCLP5.js";
7
+ import { i as packagedDir, t as AGENT_SKILLS_DIR } from "./paths-oRuC18Kt.js";
8
8
  import { existsSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
9
9
  import { join } from "node:path";
10
10
  import { tmpdir } from "node:os";
@@ -1,7 +1,7 @@
1
- import { r as NotLoggedInError } from "./token-IWv2httm.js";
1
+ import { r as NotLoggedInError } from "./token-BJsLGoSX.js";
2
2
  import { i as writeJson, n as createCommandOutput } from "./output-Ggzq5_-t.js";
3
- import { a as CHANNEL } from "./environment-eV7LEnSN.js";
4
- import { t as ApiError } from "./client-BIvOmWPC.js";
3
+ import { a as CHANNEL } from "./environment-CQn323uB.js";
4
+ import { t as ApiError } from "./client-CimFymxG.js";
5
5
  import { n as ui, r as useRenderer } from "./ui-D_qf3Gvw.js";
6
6
  import pc from "picocolors";
7
7
 
@@ -1,4 +1,5 @@
1
1
  //#region src/core/account/storage.d.ts
2
+
2
3
  interface Session {
3
4
  authMethod?: "oauth" | "api_key";
4
5
  apiKey?: string;