@madewithremy/admin 0.1.20 → 0.1.21

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),
@@ -3207,6 +3211,14 @@ function create2(ctx, params) {
3207
3211
  ...placement !== void 0 ? { placement } : {}
3208
3212
  });
3209
3213
  }
3214
+ function stopMove(ctx, params) {
3215
+ return call(
3216
+ ctx,
3217
+ "POST",
3218
+ `${base(ctx.appId)}/move/stop`,
3219
+ { slug: params.slug }
3220
+ );
3221
+ }
3210
3222
  function move(ctx, params) {
3211
3223
  return call(ctx, "POST", `${base(ctx.appId)}/move`, {
3212
3224
  slug: params.slug,
@@ -3232,8 +3244,10 @@ async function waitForMove(ctx, params) {
3232
3244
  pollMs: POLL_MS2,
3233
3245
  describe: (source2, start2) => renderProgress(source2.migration.progress, start2),
3234
3246
  // A corpus of any size moves as long as it keeps moving; the timeout
3235
- // bounds silence.
3236
- progressKey: (source2) => source2.migration?.copied ?? null,
3247
+ // bounds silence. The settle moves without copying — it builds the
3248
+ // target's full-text index and reports coverage — so its sample time
3249
+ // counts as movement too.
3250
+ progressKey: (source2) => source2.migration ? `${source2.migration.copied}|${source2.migration.progress.updatedAt ?? ""}` : null,
3237
3251
  onProgress: params.onProgress
3238
3252
  }
3239
3253
  );
@@ -5251,18 +5265,19 @@ var dataSourcesSpecs = {
5251
5265
  }
5252
5266
  },
5253
5267
  "datasources move": {
5254
- usage: "Usage: remy-admin datasources move [--source <slug>] --to <resource-id|shared> [--chains <n>] [--restart] [--wait] [--timeout <sec>]",
5268
+ usage: "Usage: remy-admin datasources move [--source <slug>] --to <resource-id|shared> [--chains <n>] [--restart] [--wait] [--timeout <sec>] | --stop",
5255
5269
  flags: {
5256
5270
  source: { type: "string" },
5257
5271
  to: { type: "string" },
5258
5272
  chains: { type: "number", min: 1 },
5259
5273
  restart: { type: "boolean" },
5274
+ stop: { type: "boolean" },
5260
5275
  wait: { type: "boolean" },
5261
5276
  timeout: { type: "string" }
5262
5277
  },
5263
5278
  requireAnyOf: {
5264
- flags: ["to"],
5265
- message: "--to is required: a resource id from `infra list`, or `shared`."
5279
+ flags: ["to", "stop"],
5280
+ message: "--to is required: a resource id from `infra list`, or `shared`. Or --stop to halt a move under way."
5266
5281
  }
5267
5282
  },
5268
5283
  "datasources revectorize": {
@@ -5628,6 +5643,14 @@ async function dataSourcesConfig(ctx, a) {
5628
5643
  }
5629
5644
  async function dataSourcesMove(ctx, a) {
5630
5645
  const slug = sourceOf(a);
5646
+ if (a.bool("stop")) {
5647
+ out({
5648
+ dataSource: slug,
5649
+ ...await stopMove(ctx, { slug }),
5650
+ note: "Stopped; the chains halt at their next checkpoint. Re-run `datasources move --to <same target>` to resume from where they were."
5651
+ });
5652
+ return;
5653
+ }
5631
5654
  const to = a.str("to");
5632
5655
  const placement = to === "shared" ? "shared" : { resourceId: to };
5633
5656
  const chains = a.num("chains");
@@ -5871,11 +5894,18 @@ Placement (shared pool vs dedicated capacity, see \`infra --help\`):
5871
5894
  (capacity_<phase>), or when it would not fit (capacity_exceeded).
5872
5895
  The copy runs as parallel chains, each a window of the corpus; the target
5873
5896
  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.
5897
+ overrides it, up to 128. Four chains run per worker, so this is the worker
5898
+ count times four; the --wait line's documents/min shows what it bought.
5899
+ Re-running \`move\` to the same target attaches to a running copy (--wait
5900
+ picks the watch back up), resumes a failed one from its chains' cursors,
5901
+ and queues the chains again for one that has made no progress for 30
5902
+ minutes; --restart cuts fresh windows instead (the count takes effect
5903
+ then), discarding progress so far. --stop halts a running copy at its
5904
+ chains' next checkpoint; a plain re-run resumes it.
5905
+ The copy paces itself to the target's optimizer: it waits while the target
5906
+ holds more unconverted points than its memory allows, so a large corpus
5907
+ lands at the rate the instance can index, and the target's full-text
5908
+ index is built once at the end rather than per page.
5879
5909
 
5880
5910
  Notes:
5881
5911
  --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.21",
4
4
  "description": "Admin SDK + CLI for managing production Remy apps",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",