@madewithremy/admin 0.1.41 → 0.1.43

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);
@@ -1940,7 +2033,7 @@ Notes:
1940
2033
  can't be changed; they go when the connection is removed.`;
1941
2034
 
1942
2035
  // src/ops/users.ts
1943
- function list4(ctx, params = {}) {
2036
+ function list5(ctx, params = {}) {
1944
2037
  return call(
1945
2038
  ctx,
1946
2039
  "GET",
@@ -1994,7 +2087,7 @@ var usersSpecs = {
1994
2087
  };
1995
2088
  async function usersList(ctx, a) {
1996
2089
  out(
1997
- await list4(ctx, {
2090
+ await list5(ctx, {
1998
2091
  limit: a.num("limit"),
1999
2092
  offset: a.num("offset")
2000
2093
  })
@@ -2095,7 +2188,7 @@ Notes:
2095
2188
  a statement may safely begin with a '--' comment. Always quote the SQL.`;
2096
2189
 
2097
2190
  // src/ops/secrets.ts
2098
- function list5(ctx) {
2191
+ function list6(ctx) {
2099
2192
  return call(
2100
2193
  ctx,
2101
2194
  "GET",
@@ -2161,7 +2254,7 @@ var secretsSpecs = {
2161
2254
  }
2162
2255
  };
2163
2256
  async function secretsList(ctx) {
2164
- out(await list5(ctx));
2257
+ out(await list6(ctx));
2165
2258
  }
2166
2259
  async function secretsGet(ctx, a) {
2167
2260
  out(await get5(ctx, a.req("key")));
@@ -2406,7 +2499,7 @@ async function tailSseToStdout(ctx, apiPath) {
2406
2499
 
2407
2500
  // src/ops/methods.ts
2408
2501
  var METHOD_RUN_TIMEOUT_MS = 6e5;
2409
- async function list6(ctx) {
2502
+ async function list7(ctx) {
2410
2503
  const dashboard = await call(
2411
2504
  ctx,
2412
2505
  "GET",
@@ -2449,7 +2542,7 @@ var methodsSpecs = {
2449
2542
  }
2450
2543
  };
2451
2544
  async function methodsList(ctx) {
2452
- out(await list6(ctx));
2545
+ out(await list7(ctx));
2453
2546
  }
2454
2547
  async function methodsInvoke(ctx, a) {
2455
2548
  const methodId = a.req("methodId");
@@ -2656,7 +2749,7 @@ function listQuery(params) {
2656
2749
  cursor: params.cursor
2657
2750
  });
2658
2751
  }
2659
- function list7(ctx, params = {}) {
2752
+ function list8(ctx, params = {}) {
2660
2753
  return call(
2661
2754
  ctx,
2662
2755
  "GET",
@@ -2862,7 +2955,7 @@ function readStateFilter(a) {
2862
2955
  }
2863
2956
  async function issuesList(ctx, a) {
2864
2957
  out(
2865
- await list7(ctx, {
2958
+ await list8(ctx, {
2866
2959
  status: readStateFilter(a),
2867
2960
  labels: a.list("label"),
2868
2961
  originAppId: a.str("from-app"),
@@ -3586,7 +3679,7 @@ async function waitForCandidate(ctx, params) {
3586
3679
  const timeoutMs = params.timeoutMs ?? DEFAULT_WAIT_TIMEOUT_MS;
3587
3680
  const outcome = await pollUntil(
3588
3681
  async () => {
3589
- const { dataSources } = await list8(ctx);
3682
+ const { dataSources } = await list9(ctx);
3590
3683
  const source = dataSources.find((s) => s.slug === params.slug);
3591
3684
  if (!source) {
3592
3685
  throw new Error(`Data source "${params.slug}" not found.`);
@@ -3668,7 +3761,7 @@ async function allDocuments(ctx, params) {
3668
3761
  }
3669
3762
  return out2;
3670
3763
  }
3671
- function list8(ctx) {
3764
+ function list9(ctx) {
3672
3765
  return call(ctx, "GET", base(ctx.appId));
3673
3766
  }
3674
3767
  function search2(ctx, params) {
@@ -3787,7 +3880,7 @@ async function waitForMove(ctx, params) {
3787
3880
  const timeoutMs = params.timeoutMs ?? DEFAULT_WAIT_TIMEOUT_MS;
3788
3881
  const outcome = await pollUntil(
3789
3882
  async () => {
3790
- const { dataSources } = await list8(ctx);
3883
+ const { dataSources } = await list9(ctx);
3791
3884
  const source2 = dataSources.find((s) => s.slug === params.slug);
3792
3885
  if (!source2) {
3793
3886
  throw new Error(`Data source "${params.slug}" not found.`);
@@ -3988,7 +4081,7 @@ async function uploadManifest(ctx, params) {
3988
4081
  await uploadDirect(token.upload, params.content, "manifest.jsonl");
3989
4082
  return { key: token.key };
3990
4083
  }
3991
- function list9(ctx, params) {
4084
+ function list10(ctx, params) {
3992
4085
  return call(
3993
4086
  ctx,
3994
4087
  "GET",
@@ -4427,7 +4520,7 @@ async function waitForHydration(ctx, params) {
4427
4520
  const timeoutMs = params.timeoutMs ?? DEFAULT_WAIT_TIMEOUT_MS3;
4428
4521
  const outcome = await pollUntil(
4429
4522
  async () => {
4430
- const { dataSources } = await list8(ctx);
4523
+ const { dataSources } = await list9(ctx);
4431
4524
  const source2 = dataSources.find((s) => s.slug === params.slug);
4432
4525
  if (!source2) {
4433
4526
  throw new Error(`Data source "${params.slug}" not found.`);
@@ -5404,7 +5497,7 @@ async function jobsStart(ctx, a) {
5404
5497
  }
5405
5498
  async function jobsList(ctx, a) {
5406
5499
  const slug = a.str("source");
5407
- out(await list9(ctx, slug ? { slug } : void 0));
5500
+ out(await list10(ctx, slug ? { slug } : void 0));
5408
5501
  }
5409
5502
  async function jobsStatus(ctx, a) {
5410
5503
  const id = a.req("id");
@@ -6421,7 +6514,7 @@ async function dataSourcesAdd(ctx, a) {
6421
6514
  });
6422
6515
  }
6423
6516
  async function dataSourcesList(ctx) {
6424
- out(await list8(ctx));
6517
+ out(await list9(ctx));
6425
6518
  }
6426
6519
  async function dataSourcesStatus(ctx, a) {
6427
6520
  const slug = sourceOf(a);
@@ -6440,7 +6533,7 @@ async function dataSourcesStatus(ctx, a) {
6440
6533
  });
6441
6534
  return;
6442
6535
  }
6443
- const { dataSources: sources2 } = await list8(ctx);
6536
+ const { dataSources: sources2 } = await list9(ctx);
6444
6537
  const source = sources2.find((s) => s.slug === slug);
6445
6538
  if (!source) {
6446
6539
  out({ dataSource: slug, exists: false });
@@ -7414,7 +7507,7 @@ Notes:
7414
7507
  and error. Client tools run in the browser, so they have no requestId.`;
7415
7508
 
7416
7509
  // src/ops/tasks.ts
7417
- function list10(ctx, params = {}) {
7510
+ function list11(ctx, params = {}) {
7418
7511
  return call(
7419
7512
  ctx,
7420
7513
  "GET",
@@ -7443,9 +7536,9 @@ var tasksSpecs = {
7443
7536
  positionals: [{ name: "traceId", required: true }]
7444
7537
  }
7445
7538
  };
7446
- async function list11(ctx, a) {
7539
+ async function list12(ctx, a) {
7447
7540
  out(
7448
- await list10(ctx, {
7541
+ await list11(ctx, {
7449
7542
  limit: a.num("limit"),
7450
7543
  cursor: a.str("cursor")
7451
7544
  })
@@ -7455,7 +7548,7 @@ async function get10(ctx, a) {
7455
7548
  out(await get9(ctx, a.req("traceId")));
7456
7549
  }
7457
7550
  var tasksHandlers = {
7458
- "tasks list": list11,
7551
+ "tasks list": list12,
7459
7552
  "tasks get": get10
7460
7553
  };
7461
7554
  var tasksHelp = `remy-admin tasks \u2014 Log of the app's task agents (runTask), kept 90 days.
@@ -8434,7 +8527,7 @@ async function resolveDomainId(ctx, direction, domain) {
8434
8527
  }
8435
8528
  return match.id;
8436
8529
  }
8437
- function list12(ctx, params = {}) {
8530
+ function list13(ctx, params = {}) {
8438
8531
  return call(
8439
8532
  ctx,
8440
8533
  "GET",
@@ -8633,7 +8726,7 @@ var emailSpecs = {
8633
8726
  };
8634
8727
  async function emailList(ctx, a) {
8635
8728
  out(
8636
- await list12(ctx, {
8729
+ await list13(ctx, {
8637
8730
  status: a.str("status"),
8638
8731
  kind: a.str("kind"),
8639
8732
  recipient: a.str("recipient"),
@@ -8825,7 +8918,7 @@ Examples:
8825
8918
  `;
8826
8919
 
8827
8920
  // src/ops/cron.ts
8828
- function list13(ctx, params = {}) {
8921
+ function list14(ctx, params = {}) {
8829
8922
  return call(
8830
8923
  ctx,
8831
8924
  "GET",
@@ -8854,7 +8947,7 @@ var cronSpecs = {
8854
8947
  }
8855
8948
  };
8856
8949
  async function cronList(ctx, a) {
8857
- out(await list13(ctx, { runs: a.num("runs") }));
8950
+ out(await list14(ctx, { runs: a.num("runs") }));
8858
8951
  }
8859
8952
  async function cronRun(ctx, a) {
8860
8953
  out(await run2(ctx, a.req("route")));
@@ -8893,7 +8986,7 @@ var POLL_MS5 = 3e3;
8893
8986
  function base7(appId) {
8894
8987
  return `/_internal/v2/apps/${appId}/infra`;
8895
8988
  }
8896
- function list14(ctx, params) {
8989
+ function list15(ctx, params) {
8897
8990
  return call(
8898
8991
  ctx,
8899
8992
  "GET",
@@ -9085,7 +9178,7 @@ async function waitAndReport2(ctx, a, id, phases, summary2, until) {
9085
9178
  }
9086
9179
  }
9087
9180
  async function infraList(ctx, a) {
9088
- out(await list14(ctx, { includeDestroyed: a.bool("include-destroyed") }));
9181
+ out(await list15(ctx, { includeDestroyed: a.bool("include-destroyed") }));
9089
9182
  }
9090
9183
  async function infraGet(ctx, a) {
9091
9184
  out(await get12(ctx, { id: a.req("id") }));
@@ -9568,6 +9661,7 @@ var SPECS = {
9568
9661
  ...crashesSpecs,
9569
9662
  ...analyticsSpecs,
9570
9663
  ...releasesSpecs,
9664
+ ...previewsSpecs,
9571
9665
  ...diagnosticsSpecs,
9572
9666
  ...domainsSpecs,
9573
9667
  ...usersSpecs,
@@ -9601,6 +9695,7 @@ var HANDLERS = {
9601
9695
  ...crashesHandlers,
9602
9696
  ...analyticsHandlers,
9603
9697
  ...releasesHandlers,
9698
+ ...previewsHandlers,
9604
9699
  ...diagnosticsHandlers,
9605
9700
  ...domainsHandlers,
9606
9701
  ...usersHandlers,
@@ -9634,6 +9729,7 @@ var GROUP_HELP = {
9634
9729
  crashes: crashesHelp,
9635
9730
  analytics: analyticsHelp,
9636
9731
  releases: releasesHelp,
9732
+ previews: previewsHelp,
9637
9733
  diagnostics: diagnosticsHelp,
9638
9734
  domains: domainsHelp,
9639
9735
  users: usersHelp,
@@ -9718,6 +9814,7 @@ Commands:
9718
9814
  crashes View frontend (browser) crash groups and events
9719
9815
  analytics View traffic, top-N, geo, and AI-referral insights
9720
9816
  releases View and monitor releases
9817
+ previews Share links to a branch preview, for people and API clients
9721
9818
  diagnostics View the post-deploy Lighthouse audit (scores, issues, raw report)
9722
9819
  domains Subdomain, custom domains, and buying a domain
9723
9820
  users Manage app users and roles
@@ -9753,6 +9850,7 @@ var GROUPS = [
9753
9850
  "crashes",
9754
9851
  "analytics",
9755
9852
  "releases",
9853
+ "previews",
9756
9854
  "diagnostics",
9757
9855
  "domains",
9758
9856
  "users",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madewithremy/admin",
3
- "version": "0.1.41",
3
+ "version": "0.1.43",
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"