@madewithremy/admin 0.1.42 → 0.1.44

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/dist/prod.js CHANGED
@@ -1313,6 +1313,99 @@ Examples:
1313
1313
  remy-admin releases wait --commit 91ca67a --timeout 600
1314
1314
  remy-admin releases list --limit 1`;
1315
1315
 
1316
+ // src/ops/previews.ts
1317
+ function share(ctx, params) {
1318
+ return call(
1319
+ ctx,
1320
+ "POST",
1321
+ `/_internal/v2/apps/${ctx.appId}/preview/shares`,
1322
+ { branch: params.branch, days: params.days, label: params.label }
1323
+ );
1324
+ }
1325
+ function list4(ctx, branch) {
1326
+ return call(
1327
+ ctx,
1328
+ "GET",
1329
+ `/_internal/v2/apps/${ctx.appId}/preview/shares${qs({ branch })}`
1330
+ );
1331
+ }
1332
+ function revoke(ctx, shareId) {
1333
+ return call(
1334
+ ctx,
1335
+ "POST",
1336
+ `/_internal/v2/apps/${ctx.appId}/preview/shares/${seg(shareId)}/revoke`
1337
+ );
1338
+ }
1339
+
1340
+ // src/commands/previews.ts
1341
+ var previewsSpecs = {
1342
+ "previews share": {
1343
+ usage: "Usage: remy-admin previews share <branch> [--days <n>] [--label <text>]",
1344
+ positionals: [{ name: "branch", required: true }],
1345
+ flags: {
1346
+ days: { type: "number", min: 1, max: 30 },
1347
+ label: { type: "string" }
1348
+ }
1349
+ },
1350
+ "previews list": {
1351
+ usage: "Usage: remy-admin previews list <branch>",
1352
+ positionals: [{ name: "branch", required: true }]
1353
+ },
1354
+ "previews revoke": {
1355
+ usage: "Usage: remy-admin previews revoke <shareId>",
1356
+ positionals: [{ name: "shareId", required: true }]
1357
+ }
1358
+ };
1359
+ async function previewsShare(ctx, a) {
1360
+ out(
1361
+ await share(ctx, {
1362
+ branch: a.req("branch"),
1363
+ days: a.num("days"),
1364
+ label: a.str("label")
1365
+ })
1366
+ );
1367
+ }
1368
+ async function previewsList(ctx, a) {
1369
+ out(await list4(ctx, a.req("branch")));
1370
+ }
1371
+ async function previewsRevoke(ctx, a) {
1372
+ out(await revoke(ctx, a.req("shareId")));
1373
+ }
1374
+ var previewsHandlers = {
1375
+ "previews share": previewsShare,
1376
+ "previews list": previewsList,
1377
+ "previews revoke": previewsRevoke
1378
+ };
1379
+ var previewsHelp = `remy-admin previews \u2014 Share links to a branch's preview, for people and for API clients.
1380
+
1381
+ Subcommands:
1382
+ share Make a share link to a branch's preview
1383
+ list A branch's share links (revoked and expired included)
1384
+ revoke Revoke a share link
1385
+
1386
+ Usage:
1387
+ remy-admin previews share <branch> [--days <n>] [--label <text>] --days 1-30 (default 14)
1388
+ remy-admin previews list <branch>
1389
+ remy-admin previews revoke <shareId> <shareId> is a link's id, from 'list'
1390
+
1391
+ Notes:
1392
+ - A preview runs on a copy of live data, so a link is a credential: make one only
1393
+ for what needs it, with the shortest --days that serves, and revoke it when done.
1394
+ - 'share' returns { link, url, token, previewUrl }, once. A person opens url. A
1395
+ client with no cookie jar (curl, git, CI, a test run) sends token as the
1396
+ X-Remy-Preview header on each request to previewUrl, beside the app's own
1397
+ Authorization where a route needs one. Neither can be shown again.
1398
+ - A link follows its branch: after another push, the same link shows the new preview.
1399
+ - 'revoke' shuts out the link and its token at once.
1400
+ - Errors: missing_branch, no_preview_for_branch (the branch has no preview build yet:
1401
+ push it first), share_link_not_found.
1402
+
1403
+ Examples:
1404
+ remy-admin previews share feature-x --days 1 --label "API smoke test"
1405
+ curl -H "X-Remy-Preview: <token>" -H "Authorization: Bearer sk_..." <previewUrl>/_/api/vendors
1406
+ remy-admin previews list feature-x
1407
+ remy-admin previews revoke 3f2c...`;
1408
+
1316
1409
  // src/ops/diagnostics.ts
1317
1410
  async function getLiveReleaseId(ctx) {
1318
1411
  const live2 = await dashboardLive(ctx);
@@ -1926,8 +2019,9 @@ Notes:
1926
2019
  domain's legal owner. ICANN emails that address to verify it within 15
1927
2020
  days, or the domain stops resolving; tell the user to watch for it.
1928
2021
  - Other refusals: registrant_contact_required, insufficient_credits/*,
1929
- entitlement_required:registered_domains (the plan holds no more domains:
1930
- a paid plan holds 20), domain_registration_rate (3 in any 30 days),
2022
+ entitlement_required:remy_build (the workspace doesn't build in Remy),
2023
+ domain_limit_reached (it holds as many as it may: 20 unless support
2024
+ raised it), domain_registration_rate (3 in any 30 days),
1931
2025
  domain_unavailable, tld_not_supported,
1932
2026
  trademark_claim, registrar_busy (try again), registrar_payment (temporarily
1933
2027
  unavailable), namecom_not_configured (this deployment doesn't sell domains).
@@ -1940,7 +2034,7 @@ Notes:
1940
2034
  can't be changed; they go when the connection is removed.`;
1941
2035
 
1942
2036
  // src/ops/users.ts
1943
- function list4(ctx, params = {}) {
2037
+ function list5(ctx, params = {}) {
1944
2038
  return call(
1945
2039
  ctx,
1946
2040
  "GET",
@@ -1994,7 +2088,7 @@ var usersSpecs = {
1994
2088
  };
1995
2089
  async function usersList(ctx, a) {
1996
2090
  out(
1997
- await list4(ctx, {
2091
+ await list5(ctx, {
1998
2092
  limit: a.num("limit"),
1999
2093
  offset: a.num("offset")
2000
2094
  })
@@ -2095,7 +2189,7 @@ Notes:
2095
2189
  a statement may safely begin with a '--' comment. Always quote the SQL.`;
2096
2190
 
2097
2191
  // src/ops/secrets.ts
2098
- function list5(ctx) {
2192
+ function list6(ctx) {
2099
2193
  return call(
2100
2194
  ctx,
2101
2195
  "GET",
@@ -2161,7 +2255,7 @@ var secretsSpecs = {
2161
2255
  }
2162
2256
  };
2163
2257
  async function secretsList(ctx) {
2164
- out(await list5(ctx));
2258
+ out(await list6(ctx));
2165
2259
  }
2166
2260
  async function secretsGet(ctx, a) {
2167
2261
  out(await get5(ctx, a.req("key")));
@@ -2406,7 +2500,7 @@ async function tailSseToStdout(ctx, apiPath) {
2406
2500
 
2407
2501
  // src/ops/methods.ts
2408
2502
  var METHOD_RUN_TIMEOUT_MS = 6e5;
2409
- async function list6(ctx) {
2503
+ async function list7(ctx) {
2410
2504
  const dashboard = await call(
2411
2505
  ctx,
2412
2506
  "GET",
@@ -2449,7 +2543,7 @@ var methodsSpecs = {
2449
2543
  }
2450
2544
  };
2451
2545
  async function methodsList(ctx) {
2452
- out(await list6(ctx));
2546
+ out(await list7(ctx));
2453
2547
  }
2454
2548
  async function methodsInvoke(ctx, a) {
2455
2549
  const methodId = a.req("methodId");
@@ -2656,7 +2750,7 @@ function listQuery(params) {
2656
2750
  cursor: params.cursor
2657
2751
  });
2658
2752
  }
2659
- function list7(ctx, params = {}) {
2753
+ function list8(ctx, params = {}) {
2660
2754
  return call(
2661
2755
  ctx,
2662
2756
  "GET",
@@ -2862,7 +2956,7 @@ function readStateFilter(a) {
2862
2956
  }
2863
2957
  async function issuesList(ctx, a) {
2864
2958
  out(
2865
- await list7(ctx, {
2959
+ await list8(ctx, {
2866
2960
  status: readStateFilter(a),
2867
2961
  labels: a.list("label"),
2868
2962
  originAppId: a.str("from-app"),
@@ -3586,7 +3680,7 @@ async function waitForCandidate(ctx, params) {
3586
3680
  const timeoutMs = params.timeoutMs ?? DEFAULT_WAIT_TIMEOUT_MS;
3587
3681
  const outcome = await pollUntil(
3588
3682
  async () => {
3589
- const { dataSources } = await list8(ctx);
3683
+ const { dataSources } = await list9(ctx);
3590
3684
  const source = dataSources.find((s) => s.slug === params.slug);
3591
3685
  if (!source) {
3592
3686
  throw new Error(`Data source "${params.slug}" not found.`);
@@ -3668,7 +3762,7 @@ async function allDocuments(ctx, params) {
3668
3762
  }
3669
3763
  return out2;
3670
3764
  }
3671
- function list8(ctx) {
3765
+ function list9(ctx) {
3672
3766
  return call(ctx, "GET", base(ctx.appId));
3673
3767
  }
3674
3768
  function search2(ctx, params) {
@@ -3787,7 +3881,7 @@ async function waitForMove(ctx, params) {
3787
3881
  const timeoutMs = params.timeoutMs ?? DEFAULT_WAIT_TIMEOUT_MS;
3788
3882
  const outcome = await pollUntil(
3789
3883
  async () => {
3790
- const { dataSources } = await list8(ctx);
3884
+ const { dataSources } = await list9(ctx);
3791
3885
  const source2 = dataSources.find((s) => s.slug === params.slug);
3792
3886
  if (!source2) {
3793
3887
  throw new Error(`Data source "${params.slug}" not found.`);
@@ -3988,7 +4082,7 @@ async function uploadManifest(ctx, params) {
3988
4082
  await uploadDirect(token.upload, params.content, "manifest.jsonl");
3989
4083
  return { key: token.key };
3990
4084
  }
3991
- function list9(ctx, params) {
4085
+ function list10(ctx, params) {
3992
4086
  return call(
3993
4087
  ctx,
3994
4088
  "GET",
@@ -4427,7 +4521,7 @@ async function waitForHydration(ctx, params) {
4427
4521
  const timeoutMs = params.timeoutMs ?? DEFAULT_WAIT_TIMEOUT_MS3;
4428
4522
  const outcome = await pollUntil(
4429
4523
  async () => {
4430
- const { dataSources } = await list8(ctx);
4524
+ const { dataSources } = await list9(ctx);
4431
4525
  const source2 = dataSources.find((s) => s.slug === params.slug);
4432
4526
  if (!source2) {
4433
4527
  throw new Error(`Data source "${params.slug}" not found.`);
@@ -5404,7 +5498,7 @@ async function jobsStart(ctx, a) {
5404
5498
  }
5405
5499
  async function jobsList(ctx, a) {
5406
5500
  const slug = a.str("source");
5407
- out(await list9(ctx, slug ? { slug } : void 0));
5501
+ out(await list10(ctx, slug ? { slug } : void 0));
5408
5502
  }
5409
5503
  async function jobsStatus(ctx, a) {
5410
5504
  const id = a.req("id");
@@ -6421,7 +6515,7 @@ async function dataSourcesAdd(ctx, a) {
6421
6515
  });
6422
6516
  }
6423
6517
  async function dataSourcesList(ctx) {
6424
- out(await list8(ctx));
6518
+ out(await list9(ctx));
6425
6519
  }
6426
6520
  async function dataSourcesStatus(ctx, a) {
6427
6521
  const slug = sourceOf(a);
@@ -6440,7 +6534,7 @@ async function dataSourcesStatus(ctx, a) {
6440
6534
  });
6441
6535
  return;
6442
6536
  }
6443
- const { dataSources: sources2 } = await list8(ctx);
6537
+ const { dataSources: sources2 } = await list9(ctx);
6444
6538
  const source = sources2.find((s) => s.slug === slug);
6445
6539
  if (!source) {
6446
6540
  out({ dataSource: slug, exists: false });
@@ -7414,7 +7508,7 @@ Notes:
7414
7508
  and error. Client tools run in the browser, so they have no requestId.`;
7415
7509
 
7416
7510
  // src/ops/tasks.ts
7417
- function list10(ctx, params = {}) {
7511
+ function list11(ctx, params = {}) {
7418
7512
  return call(
7419
7513
  ctx,
7420
7514
  "GET",
@@ -7443,9 +7537,9 @@ var tasksSpecs = {
7443
7537
  positionals: [{ name: "traceId", required: true }]
7444
7538
  }
7445
7539
  };
7446
- async function list11(ctx, a) {
7540
+ async function list12(ctx, a) {
7447
7541
  out(
7448
- await list10(ctx, {
7542
+ await list11(ctx, {
7449
7543
  limit: a.num("limit"),
7450
7544
  cursor: a.str("cursor")
7451
7545
  })
@@ -7455,7 +7549,7 @@ async function get10(ctx, a) {
7455
7549
  out(await get9(ctx, a.req("traceId")));
7456
7550
  }
7457
7551
  var tasksHandlers = {
7458
- "tasks list": list11,
7552
+ "tasks list": list12,
7459
7553
  "tasks get": get10
7460
7554
  };
7461
7555
  var tasksHelp = `remy-admin tasks \u2014 Log of the app's task agents (runTask), kept 90 days.
@@ -8434,7 +8528,7 @@ async function resolveDomainId(ctx, direction, domain) {
8434
8528
  }
8435
8529
  return match.id;
8436
8530
  }
8437
- function list12(ctx, params = {}) {
8531
+ function list13(ctx, params = {}) {
8438
8532
  return call(
8439
8533
  ctx,
8440
8534
  "GET",
@@ -8633,7 +8727,7 @@ var emailSpecs = {
8633
8727
  };
8634
8728
  async function emailList(ctx, a) {
8635
8729
  out(
8636
- await list12(ctx, {
8730
+ await list13(ctx, {
8637
8731
  status: a.str("status"),
8638
8732
  kind: a.str("kind"),
8639
8733
  recipient: a.str("recipient"),
@@ -8825,7 +8919,7 @@ Examples:
8825
8919
  `;
8826
8920
 
8827
8921
  // src/ops/cron.ts
8828
- function list13(ctx, params = {}) {
8922
+ function list14(ctx, params = {}) {
8829
8923
  return call(
8830
8924
  ctx,
8831
8925
  "GET",
@@ -8854,7 +8948,7 @@ var cronSpecs = {
8854
8948
  }
8855
8949
  };
8856
8950
  async function cronList(ctx, a) {
8857
- out(await list13(ctx, { runs: a.num("runs") }));
8951
+ out(await list14(ctx, { runs: a.num("runs") }));
8858
8952
  }
8859
8953
  async function cronRun(ctx, a) {
8860
8954
  out(await run2(ctx, a.req("route")));
@@ -8893,7 +8987,7 @@ var POLL_MS5 = 3e3;
8893
8987
  function base7(appId) {
8894
8988
  return `/_internal/v2/apps/${appId}/infra`;
8895
8989
  }
8896
- function list14(ctx, params) {
8990
+ function list15(ctx, params) {
8897
8991
  return call(
8898
8992
  ctx,
8899
8993
  "GET",
@@ -9085,7 +9179,7 @@ async function waitAndReport2(ctx, a, id, phases, summary2, until) {
9085
9179
  }
9086
9180
  }
9087
9181
  async function infraList(ctx, a) {
9088
- out(await list14(ctx, { includeDestroyed: a.bool("include-destroyed") }));
9182
+ out(await list15(ctx, { includeDestroyed: a.bool("include-destroyed") }));
9089
9183
  }
9090
9184
  async function infraGet(ctx, a) {
9091
9185
  out(await get12(ctx, { id: a.req("id") }));
@@ -9568,6 +9662,7 @@ var SPECS = {
9568
9662
  ...crashesSpecs,
9569
9663
  ...analyticsSpecs,
9570
9664
  ...releasesSpecs,
9665
+ ...previewsSpecs,
9571
9666
  ...diagnosticsSpecs,
9572
9667
  ...domainsSpecs,
9573
9668
  ...usersSpecs,
@@ -9601,6 +9696,7 @@ var HANDLERS = {
9601
9696
  ...crashesHandlers,
9602
9697
  ...analyticsHandlers,
9603
9698
  ...releasesHandlers,
9699
+ ...previewsHandlers,
9604
9700
  ...diagnosticsHandlers,
9605
9701
  ...domainsHandlers,
9606
9702
  ...usersHandlers,
@@ -9634,6 +9730,7 @@ var GROUP_HELP = {
9634
9730
  crashes: crashesHelp,
9635
9731
  analytics: analyticsHelp,
9636
9732
  releases: releasesHelp,
9733
+ previews: previewsHelp,
9637
9734
  diagnostics: diagnosticsHelp,
9638
9735
  domains: domainsHelp,
9639
9736
  users: usersHelp,
@@ -9718,6 +9815,7 @@ Commands:
9718
9815
  crashes View frontend (browser) crash groups and events
9719
9816
  analytics View traffic, top-N, geo, and AI-referral insights
9720
9817
  releases View and monitor releases
9818
+ previews Share links to a branch preview, for people and API clients
9721
9819
  diagnostics View the post-deploy Lighthouse audit (scores, issues, raw report)
9722
9820
  domains Subdomain, custom domains, and buying a domain
9723
9821
  users Manage app users and roles
@@ -9753,6 +9851,7 @@ var GROUPS = [
9753
9851
  "crashes",
9754
9852
  "analytics",
9755
9853
  "releases",
9854
+ "previews",
9756
9855
  "diagnostics",
9757
9856
  "domains",
9758
9857
  "users",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madewithremy/admin",
3
- "version": "0.1.42",
3
+ "version": "0.1.44",
4
4
  "description": "Admin SDK + CLI for managing production Remy apps",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -53,7 +53,7 @@
53
53
  "json5": "^2.2.3"
54
54
  },
55
55
  "devDependencies": {
56
- "@types/node": "^26.6.1",
56
+ "@types/node": "^26.6.4",
57
57
  "@typescript/native": "npm:typescript@^7.0.2",
58
58
  "tsup": "^8",
59
59
  "typescript": "npm:@typescript/typescript6@^6.0.2"