@madewithremy/admin 0.1.20 → 0.1.22

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
@@ -424,6 +424,10 @@ function renderProgress(p, start2, extra) {
424
424
  const rate = p.ratePerMinute !== null && p.ratePerMinute > 0 ? `${Math.round(p.ratePerMinute).toLocaleString()}/min` : null;
425
425
  const parts = [
426
426
  `${p.phase}\u2026`,
427
+ // The operation's own word on what it is doing when the count does not
428
+ // say (a settle building its full-text index); a failure's note is its
429
+ // error and prints on its own line instead.
430
+ p.phase !== "failed" ? p.note : null,
427
431
  count2,
428
432
  rate,
429
433
  describeEta(p.etaAt),
@@ -945,7 +949,7 @@ Examples:
945
949
  import { execFileSync } from "child_process";
946
950
 
947
951
  // src/config.ts
948
- var WORKSPACE_DIR = process.env["WORKSPACE_DIR"] || "/home/vercel-sandbox/workspace";
952
+ var WORKSPACE_DIR = process.env["WORKSPACE_DIR"] || "/home/remy/workspace";
949
953
 
950
954
  // src/ops/releases.ts
951
955
  function list3(ctx, params = {}) {
@@ -2167,12 +2171,15 @@ Examples:
2167
2171
  remy-admin methods invoke mth_abc123 --user-id user_abc --roles analyst,admin`;
2168
2172
 
2169
2173
  // src/ops/data.ts
2170
- function liftFromDev(ctx) {
2174
+ function liftFromDev(ctx, params = {}) {
2171
2175
  return call(
2172
2176
  ctx,
2173
2177
  "POST",
2174
2178
  `/_internal/v2/apps/${ctx.appId}/manage/lift-dev-to-live`,
2175
- { confirm: true }
2179
+ {
2180
+ confirm: true,
2181
+ ...params.releaseId ? { releaseId: params.releaseId } : {}
2182
+ }
2176
2183
  );
2177
2184
  }
2178
2185
  function liftFromLive(ctx, params = {}) {
@@ -2180,24 +2187,32 @@ function liftFromLive(ctx, params = {}) {
2180
2187
  ctx,
2181
2188
  "POST",
2182
2189
  `/_internal/v2/apps/${ctx.appId}/manage/lift-live-to-dev`,
2183
- { confirm: true, ...params.truncate ? { mode: "truncate" } : {} }
2190
+ {
2191
+ confirm: true,
2192
+ ...params.truncate ? { mode: "truncate" } : {},
2193
+ ...params.releaseId ? { releaseId: params.releaseId } : {}
2194
+ }
2184
2195
  );
2185
2196
  }
2186
2197
 
2187
2198
  // src/commands/data.ts
2188
2199
  var dataSpecs = {
2189
2200
  "data lift-from-dev": {
2190
- usage: "Usage: remy-admin data lift-from-dev <appId> --confirm\nRefusing to run without the exact appId and --confirm: this destructively replaces the live release's databases with a snapshot of dev. Wipes any rows live had \u2014 including signed-up users. Intended for first-publish / pre-launch data sync only.",
2201
+ usage: "Usage: remy-admin data lift-from-dev <appId> --confirm [--release-id <id>]\nRefusing to run without the exact appId and --confirm: this destructively replaces the live release's databases with a snapshot of dev. Wipes any rows live had \u2014 including signed-up users. Intended for first-publish / pre-launch data sync only.\n--release-id names which of your dev workspaces to lift from, and is required only when you have more than one open (a box and a laptop CLI). The ambiguity error lists the ids.",
2191
2202
  positionals: [{ name: "appId", required: true }],
2192
- flags: { confirm: { type: "boolean" } },
2203
+ flags: { confirm: { type: "boolean" }, "release-id": { type: "string" } },
2193
2204
  requireAnyOf: {
2194
2205
  flags: ["confirm"],
2195
2206
  message: "Refusing to run without --confirm."
2196
2207
  }
2197
2208
  },
2198
2209
  "data lift-from-live": {
2199
- usage: "Usage: remy-admin data lift-from-live [--truncate] --confirm\nRefusing to run without --confirm: this destructively replaces the dev release's databases with a snapshot of live (wiping local dev data). Live/prod data is never touched. With --truncate it instead empties the dev databases (keeps schema, no data pulled from live).",
2200
- flags: { truncate: { type: "boolean" }, confirm: { type: "boolean" } },
2210
+ usage: "Usage: remy-admin data lift-from-live [--truncate] --confirm [--release-id <id>]\nRefusing to run without --confirm: this destructively replaces the dev release's databases with a snapshot of live (wiping local dev data). Live/prod data is never touched. With --truncate it instead empties the dev databases (keeps schema, no data pulled from live).\n--release-id names which of your dev workspaces to overwrite, and is required only when you have more than one open.",
2211
+ flags: {
2212
+ truncate: { type: "boolean" },
2213
+ confirm: { type: "boolean" },
2214
+ "release-id": { type: "string" }
2215
+ },
2201
2216
  requireAnyOf: {
2202
2217
  flags: ["confirm"],
2203
2218
  message: "Refusing to run without --confirm."
@@ -2211,10 +2226,15 @@ async function dataLiftFromDev(ctx, a) {
2211
2226
  `appId "${given}" does not match this workspace's app \u2014 re-run with the exact appId from mindstudio.json.`
2212
2227
  );
2213
2228
  }
2214
- out(await liftFromDev(ctx));
2229
+ out(await liftFromDev(ctx, { releaseId: a.str("release-id") }));
2215
2230
  }
2216
2231
  async function dataLiftFromLive(ctx, a) {
2217
- out(await liftFromLive(ctx, { truncate: a.bool("truncate") }));
2232
+ out(
2233
+ await liftFromLive(ctx, {
2234
+ truncate: a.bool("truncate"),
2235
+ releaseId: a.str("release-id")
2236
+ })
2237
+ );
2218
2238
  }
2219
2239
  var dataHandlers = {
2220
2240
  "data lift-from-dev": dataLiftFromDev,
@@ -3207,6 +3227,14 @@ function create2(ctx, params) {
3207
3227
  ...placement !== void 0 ? { placement } : {}
3208
3228
  });
3209
3229
  }
3230
+ function stopMove(ctx, params) {
3231
+ return call(
3232
+ ctx,
3233
+ "POST",
3234
+ `${base(ctx.appId)}/move/stop`,
3235
+ { slug: params.slug }
3236
+ );
3237
+ }
3210
3238
  function move(ctx, params) {
3211
3239
  return call(ctx, "POST", `${base(ctx.appId)}/move`, {
3212
3240
  slug: params.slug,
@@ -3232,8 +3260,10 @@ async function waitForMove(ctx, params) {
3232
3260
  pollMs: POLL_MS2,
3233
3261
  describe: (source2, start2) => renderProgress(source2.migration.progress, start2),
3234
3262
  // A corpus of any size moves as long as it keeps moving; the timeout
3235
- // bounds silence.
3236
- progressKey: (source2) => source2.migration?.copied ?? null,
3263
+ // bounds silence. The settle moves without copying — it builds the
3264
+ // target's full-text index and reports coverage — so its sample time
3265
+ // counts as movement too.
3266
+ progressKey: (source2) => source2.migration ? `${source2.migration.copied}|${source2.migration.progress.updatedAt ?? ""}` : null,
3237
3267
  onProgress: params.onProgress
3238
3268
  }
3239
3269
  );
@@ -5251,18 +5281,19 @@ var dataSourcesSpecs = {
5251
5281
  }
5252
5282
  },
5253
5283
  "datasources move": {
5254
- usage: "Usage: remy-admin datasources move [--source <slug>] --to <resource-id|shared> [--chains <n>] [--restart] [--wait] [--timeout <sec>]",
5284
+ usage: "Usage: remy-admin datasources move [--source <slug>] --to <resource-id|shared> [--chains <n>] [--restart] [--wait] [--timeout <sec>] | --stop",
5255
5285
  flags: {
5256
5286
  source: { type: "string" },
5257
5287
  to: { type: "string" },
5258
5288
  chains: { type: "number", min: 1 },
5259
5289
  restart: { type: "boolean" },
5290
+ stop: { type: "boolean" },
5260
5291
  wait: { type: "boolean" },
5261
5292
  timeout: { type: "string" }
5262
5293
  },
5263
5294
  requireAnyOf: {
5264
- flags: ["to"],
5265
- message: "--to is required: a resource id from `infra list`, or `shared`."
5295
+ flags: ["to", "stop"],
5296
+ message: "--to is required: a resource id from `infra list`, or `shared`. Or --stop to halt a move under way."
5266
5297
  }
5267
5298
  },
5268
5299
  "datasources revectorize": {
@@ -5628,6 +5659,14 @@ async function dataSourcesConfig(ctx, a) {
5628
5659
  }
5629
5660
  async function dataSourcesMove(ctx, a) {
5630
5661
  const slug = sourceOf(a);
5662
+ if (a.bool("stop")) {
5663
+ out({
5664
+ dataSource: slug,
5665
+ ...await stopMove(ctx, { slug }),
5666
+ note: "Stopped; the chains halt at their next checkpoint. Re-run `datasources move --to <same target>` to resume from where they were."
5667
+ });
5668
+ return;
5669
+ }
5631
5670
  const to = a.str("to");
5632
5671
  const placement = to === "shared" ? "shared" : { resourceId: to };
5633
5672
  const chains = a.num("chains");
@@ -5871,11 +5910,18 @@ Placement (shared pool vs dedicated capacity, see \`infra --help\`):
5871
5910
  (capacity_<phase>), or when it would not fit (capacity_exceeded).
5872
5911
  The copy runs as parallel chains, each a window of the corpus; the target
5873
5912
  size sets the default (XL 32, Large 16, Medium 8, Small 4) and --chains <n>
5874
- overrides it, up to 128. Eight chains run per worker, so this is the worker
5875
- count times eight; the --wait line's documents/min shows what it bought.
5876
- Re-running \`move\` to the same target resumes a failed or running copy from
5877
- its chains' cursors; --restart cuts fresh windows instead (the count takes
5878
- effect then), discarding progress so far.
5913
+ overrides it, up to 128. Four chains run per worker, so this is the worker
5914
+ count times four; the --wait line's documents/min shows what it bought.
5915
+ Re-running \`move\` to the same target attaches to a running copy (--wait
5916
+ picks the watch back up), resumes a failed one from its chains' cursors,
5917
+ and queues the chains again for one that has made no progress for 30
5918
+ minutes; --restart cuts fresh windows instead (the count takes effect
5919
+ then), discarding progress so far. --stop halts a running copy at its
5920
+ chains' next checkpoint; a plain re-run resumes it.
5921
+ The copy paces itself to the target's optimizer: it waits while the target
5922
+ holds more unconverted points than its memory allows, so a large corpus
5923
+ lands at the rate the instance can index, and the target's full-text
5924
+ index is built once at the end rather than per page.
5879
5925
 
5880
5926
  Notes:
5881
5927
  --wait blocks until processing finishes, so you can search immediately after.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madewithremy/admin",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "description": "Admin SDK + CLI for managing production Remy apps",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",