@madewithremy/admin 0.1.11 → 0.1.12

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
@@ -3339,7 +3339,7 @@ function waitForJob(ctx, params) {
3339
3339
  return settle(
3340
3340
  ctx,
3341
3341
  params,
3342
- (job) => !["planning", "planned", "running"].includes(job.state) || job.state === "planned" && (job.error !== null || !job.autoApprove)
3342
+ (job) => !["planning", "planned", "running", "paused"].includes(job.state) || job.state === "planned" && (job.error !== null || !job.autoApprove) || job.state === "paused" && !job.autoResumeAt
3343
3343
  );
3344
3344
  }
3345
3345
  async function settle(ctx, params, isSettled) {
@@ -3661,6 +3661,14 @@ function hydrate(ctx, params) {
3661
3661
  { slug: params.slug }
3662
3662
  );
3663
3663
  }
3664
+ function reindex(ctx, params) {
3665
+ return call(
3666
+ ctx,
3667
+ "POST",
3668
+ `${base4(ctx.appId)}/reindex`,
3669
+ { slug: params.slug }
3670
+ );
3671
+ }
3664
3672
  async function waitForHydration(ctx, params) {
3665
3673
  const timeoutMs = params.timeoutMs ?? DEFAULT_WAIT_TIMEOUT_MS3;
3666
3674
  const outcome = await pollUntil(
@@ -3871,6 +3879,14 @@ var dataSourceEvalsSpecs = {
3871
3879
  timeout: { type: "string" }
3872
3880
  }
3873
3881
  },
3882
+ "datasources reindex": {
3883
+ usage: "Usage: remy-admin datasources reindex [--source <slug>] [--wait] [--timeout <sec>]",
3884
+ flags: {
3885
+ source: { type: "string" },
3886
+ wait: { type: "boolean" },
3887
+ timeout: { type: "string" }
3888
+ }
3889
+ },
3874
3890
  "datasources sample": {
3875
3891
  usage: "Usage: remy-admin datasources sample --source <slug> --size <n> [--as <slug>] [--filter <k=v,...|json>] [--stratify <metadata-key>] [--placement <resource-id|shared>] [--wait] [--timeout <sec>]",
3876
3892
  flags: {
@@ -4048,6 +4064,25 @@ async function hydrate2(ctx, a) {
4048
4064
  out({ dataSource: slug, action: "hydrate", ...result });
4049
4065
  failOnWait(result);
4050
4066
  }
4067
+ async function reindex2(ctx, a) {
4068
+ const slug = a.str("source") || DEFAULT_SOURCE;
4069
+ const started = await reindex(ctx, { slug });
4070
+ if (!a.bool("wait")) {
4071
+ out({
4072
+ dataSource: slug,
4073
+ ...started,
4074
+ note: "The collection was recreated and is refilling from stored vectors in the background. `datasources list` shows progress; re-run with --wait to block."
4075
+ });
4076
+ return;
4077
+ }
4078
+ const result = await waitForHydration(ctx, {
4079
+ slug,
4080
+ ...timeoutOf(a),
4081
+ onProgress: progress
4082
+ });
4083
+ out({ dataSource: slug, action: "reindex", ...result });
4084
+ failOnWait(result);
4085
+ }
4051
4086
  async function sampleCmd(ctx, a) {
4052
4087
  const slug = a.str("source");
4053
4088
  if (!slug) {
@@ -4288,6 +4323,7 @@ async function evalCompare(ctx, a) {
4288
4323
  }
4289
4324
  var dataSourceEvalsHandlers = {
4290
4325
  "datasources hydrate": hydrate2,
4326
+ "datasources reindex": reindex2,
4291
4327
  "datasources sample": sampleCmd,
4292
4328
  "datasources eval create": evalCreate,
4293
4329
  "datasources eval list": evalList,
@@ -5520,6 +5556,7 @@ Subcommands:
5520
5556
  map deploy Make a build's compiled mapper the source's active one (a branch build will do)
5521
5557
  remap Re-apply the active mapper to every raw copy the source holds
5522
5558
  hydrate Reload an evicted index ahead of the first search
5559
+ reindex Recreate a dedicated source's collection with the current shape, refilled from stored vectors
5523
5560
  sample Draw a sample of a source into a new one with the same config
5524
5561
  eval Query sets and runs: measure recall, MRR and latency, compare versions
5525
5562
  revectorize Rebuild a corpus under new settings, alongside the live one
@@ -5538,7 +5575,7 @@ Usage:
5538
5575
  remy-admin datasources move [--source <slug>] --to <resource-id|shared> [--wait] [--timeout <sec>]
5539
5576
  remy-admin datasources jobs start|list|status|approve|pause|resume|cancel \u2026 (see below)
5540
5577
  remy-admin datasources connect|sync|connector|disconnect \u2026 (see below)
5541
- remy-admin datasources hydrate|sample \u2026 (see below)
5578
+ remy-admin datasources hydrate|reindex|sample \u2026 (see below)
5542
5579
  remy-admin datasources eval create|list|get|add|import|queries|rm|delete|run|runs|result|compare \u2026 (see below)
5543
5580
  remy-admin datasources revectorize [--source <slug>] [settings...] [--wait]
5544
5581
  remy-admin datasources promote [--source <slug>] [--force]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madewithremy/admin",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Admin SDK + CLI for managing production Remy apps",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",