@madewithremy/admin 0.1.8 → 0.1.10

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
@@ -3473,7 +3473,9 @@ function disconnect(ctx, params) {
3473
3473
  function sync(ctx, params) {
3474
3474
  return call(ctx, "POST", `${base3(ctx.appId)}/sync`, {
3475
3475
  slug: params.slug,
3476
- ...params.budgetDollars !== void 0 ? { budgetDollars: params.budgetDollars } : {}
3476
+ ...params.budgetDollars !== void 0 ? { budgetDollars: params.budgetDollars } : {},
3477
+ ...params.limit !== void 0 ? { limit: params.limit } : {},
3478
+ ...params.concurrency !== void 0 ? { concurrency: params.concurrency } : {}
3477
3479
  });
3478
3480
  }
3479
3481
 
@@ -3502,10 +3504,12 @@ var dataSourceConnectorsSpecs = {
3502
3504
  flags: { source: { type: "string" } }
3503
3505
  },
3504
3506
  "datasources sync": {
3505
- usage: "Usage: remy-admin datasources sync [--source <slug>] [--budget <dollars>] [--wait] [--timeout <sec>]",
3507
+ usage: "Usage: remy-admin datasources sync [--source <slug>] [--budget <dollars>] [--limit <n>] [--concurrency <n>] [--wait] [--timeout <sec>]",
3506
3508
  flags: {
3507
3509
  source: { type: "string" },
3508
3510
  budget: { type: "number", min: 0.01 },
3511
+ limit: { type: "number", min: 1 },
3512
+ concurrency: { type: "number", min: 1 },
3509
3513
  wait: { type: "boolean" },
3510
3514
  timeout: { type: "string" }
3511
3515
  }
@@ -3575,9 +3579,13 @@ async function disconnect2(ctx, a) {
3575
3579
  async function sync2(ctx, a) {
3576
3580
  const slug = sourceOf(a);
3577
3581
  const budget = a.num("budget");
3582
+ const limit = a.num("limit");
3583
+ const concurrency = a.num("concurrency");
3578
3584
  const { job } = await sync(ctx, {
3579
3585
  slug,
3580
- ...budget !== void 0 ? { budgetDollars: budget } : {}
3586
+ ...budget !== void 0 ? { budgetDollars: budget } : {},
3587
+ ...limit !== void 0 ? { limit } : {},
3588
+ ...concurrency !== void 0 ? { concurrency } : {}
3581
3589
  });
3582
3590
  if (!a.bool("wait")) {
3583
3591
  out({
@@ -3602,7 +3610,7 @@ var dataSourceConnectorsHelp = `
3602
3610
  Following an S3 bucket (connectors):
3603
3611
  remy-admin datasources connect --source <slug> --bucket <name> --region <aws-region> [--prefix <p>] --access-key-secret <NAME> --secret-key-secret <NAME> [--deletions mirror|keep] [--budget-per-sync <dollars>]
3604
3612
  remy-admin datasources connector [--source <slug>]
3605
- remy-admin datasources sync [--source <slug>] [--budget <dollars>] [--wait] [--timeout <sec>]
3613
+ remy-admin datasources sync [--source <slug>] [--budget <dollars>] [--limit <n>] [--concurrency <n>] [--wait] [--timeout <sec>]
3606
3614
  remy-admin datasources disconnect --source <slug>
3607
3615
 
3608
3616
  A connector makes a bucket the customer owns the origin of a source. The
@@ -4543,7 +4551,7 @@ Bulk ingestion (jobs):
4543
4551
  Options on start:
4544
4552
  --approve Run as soon as the plan passes the gates, no separate approve
4545
4553
  --budget <dollars> Pause when estimated spend reaches this (default 1.5x the plan)
4546
- --concurrency <n> Batches in flight at once (default 8, max 64)
4554
+ --concurrency <n> Batches in flight at once (default 64, max 128)
4547
4555
  --limit <n> Only the first N objects: a cheap sample of the corpus
4548
4556
  --wait Block until the plan is ready (or, with --approve, until done)
4549
4557
 
@@ -4605,6 +4613,17 @@ function mapTest(ctx, params) {
4605
4613
  }
4606
4614
  );
4607
4615
  }
4616
+ function mapDeploy(ctx, params) {
4617
+ return call(
4618
+ ctx,
4619
+ "POST",
4620
+ `${base5(ctx.appId)}/mapper/deploy`,
4621
+ {
4622
+ slug: params.slug,
4623
+ ...params.releaseId ? { releaseId: params.releaseId } : {}
4624
+ }
4625
+ );
4626
+ }
4608
4627
  function remap(ctx, params) {
4609
4628
  return call(ctx, "POST", `${base5(ctx.appId)}/remap`, {
4610
4629
  slug: params.slug,
@@ -4668,6 +4687,13 @@ var dataSourceMappersSpecs = {
4668
4687
  message: "Name the objects: --store <name> [--prefix <p>], or --connector for the source's bucket."
4669
4688
  }
4670
4689
  },
4690
+ "datasources map deploy": {
4691
+ usage: "Usage: remy-admin datasources map deploy [--source <slug>] [--release <id>]",
4692
+ flags: {
4693
+ source: { type: "string" },
4694
+ release: { type: "string" }
4695
+ }
4696
+ },
4671
4697
  "datasources remap": {
4672
4698
  usage: "Usage: remy-admin datasources remap [--source <slug>] [--budget <dollars>] [--limit <n>] [--wait] [--timeout <sec>]",
4673
4699
  flags: {
@@ -4782,7 +4808,7 @@ async function mapTest2(ctx, a) {
4782
4808
  dataSource: slug,
4783
4809
  ...result,
4784
4810
  results,
4785
- note: result.dev ? "Ran the LOCAL mapper through the dev session. Nothing was ingested; deploy to make it live." : "Ran the live release's mapper. Nothing was ingested."
4811
+ note: result.dev ? "Ran the LOCAL mapper through the dev session. Nothing was ingested; push a branch, wait for its build, then `datasources map deploy` to make it the source's mapper." : "Ran the source's active mapper. Nothing was ingested."
4786
4812
  });
4787
4813
  if (result.counts.error > 0) {
4788
4814
  throw new CliError(
@@ -4791,6 +4817,22 @@ async function mapTest2(ctx, a) {
4791
4817
  );
4792
4818
  }
4793
4819
  }
4820
+ async function mapDeploy2(ctx, a) {
4821
+ const slug = sourceOf(a);
4822
+ const releaseId = a.str("release");
4823
+ const result = await mapDeploy(ctx, {
4824
+ slug,
4825
+ ...releaseId ? { releaseId } : {}
4826
+ });
4827
+ const { mapper } = result;
4828
+ const from = `${mapper.branch ?? "release"} @ ${(mapper.commitSha ?? "").slice(0, 7)}`;
4829
+ out({
4830
+ dataSource: slug,
4831
+ mapper,
4832
+ changed: result.changed,
4833
+ note: result.changed ? `Active: the mapper compiled by ${from}. Jobs, syncs and add() run it from now on; \`remap\` re-applies it to what is already loaded.` : `Already active: the mapper compiled by ${from}. Nothing changed.`
4834
+ });
4835
+ }
4794
4836
  async function remap2(ctx, a) {
4795
4837
  const slug = sourceOf(a);
4796
4838
  const budget = a.num("budget");
@@ -4830,7 +4872,7 @@ async function quarantine2(ctx, a) {
4830
4872
  });
4831
4873
  out({
4832
4874
  ...result,
4833
- note: result.counts.skipped + result.counts.errors === 0 ? "Nothing quarantined: the mapper produced documents (or deletions) for every object." : `Fix the mapper, deploy, then \`datasources jobs replay ${id}\` to run these through it again.`
4875
+ note: result.counts.skipped + result.counts.errors === 0 ? "Nothing quarantined: the mapper produced documents (or deletions) for every object." : `Fix the mapper, push, \`datasources map deploy\`, then \`datasources jobs replay ${id}\` to run these through it again.`
4834
4876
  });
4835
4877
  }
4836
4878
  async function replay2(ctx, a) {
@@ -4860,6 +4902,7 @@ async function replay2(ctx, a) {
4860
4902
  var dataSourceMappersHandlers = {
4861
4903
  "datasources inspect": inspect2,
4862
4904
  "datasources map test": mapTest2,
4905
+ "datasources map deploy": mapDeploy2,
4863
4906
  "datasources remap": remap2,
4864
4907
  "datasources jobs quarantine": quarantine2,
4865
4908
  "datasources jobs replay": replay2
@@ -4868,6 +4911,7 @@ var dataSourceMappersHelp = `
4868
4911
  Mapping raw objects into documents (mappers):
4869
4912
  remy-admin datasources inspect [--source <slug>] (--store <name> [--prefix <p>] | --connector) [--keys k1,k2] [--limit <n>]
4870
4913
  remy-admin datasources map test [--source <slug>] (--store <name> [--prefix <p>] | --connector) [--keys k1,k2] [--limit <n>] [--dev] [--full]
4914
+ remy-admin datasources map deploy [--source <slug>] [--release <id>]
4871
4915
  remy-admin datasources remap [--source <slug>] [--budget <dollars>] [--limit <n>] [--wait] [--timeout <sec>]
4872
4916
  remy-admin datasources jobs quarantine <id> [--kind skip|error] [--reason <text>] [--cursor <id>] [--limit <n>]
4873
4917
  remy-admin datasources jobs replay <id> [--kind skip|error] [--wait] [--timeout <sec>]
@@ -4889,11 +4933,18 @@ Mapping raw objects into documents (mappers):
4889
4933
  JSON key signatures of ten sampled heads) before a line is written;
4890
4934
  \`map test --dev\` runs the LOCAL mapper through the running dev session
4891
4935
  over real objects and prints every outcome without ingesting anything;
4892
- deploy; a job or sync runs the compiled mapper; \`jobs quarantine <id>\`
4893
- lists what it skipped or failed on, by reason; fix, deploy, \`jobs replay
4894
- <id>\` runs just those objects again; \`remap\` re-applies a changed mapper
4895
- to every raw copy the source holds \u2014 no origin traffic, unchanged markdown
4896
- skipped by hash, changed documents superseding their predecessors.
4936
+ push a branch and wait for its build (\`releases wait\`) \u2014 a mapper runs on
4937
+ the platform, so the platform has to compile it, and a private branch
4938
+ build is all it needs; \`map deploy\` makes that build's mapper the
4939
+ source's active one (publishing to main activates the mapper main declares
4940
+ too, so merge the branch before publishing); a job or sync runs it; \`jobs
4941
+ quarantine <id>\` lists what it skipped or failed on, by reason; fix, push,
4942
+ \`map deploy\`, \`jobs replay <id>\` runs just those objects again; \`remap\`
4943
+ re-applies a changed mapper to every raw copy the source holds \u2014 no origin
4944
+ traffic, unchanged markdown skipped by hash, changed documents superseding
4945
+ their predecessors. \`jobs start\` refuses (mapper_not_deployed) while the
4946
+ dev session declares a mapper that is not yet active: the job would have
4947
+ loaded the raw records as documents.
4897
4948
 
4898
4949
  externalId is the identity the platform replaces by: a later object
4899
4950
  producing the same id supersedes the earlier document; \`replaces\` names
@@ -5446,7 +5497,8 @@ Subcommands:
5446
5497
  disconnect Stop following the bucket; documents stay
5447
5498
  inspect Profile raw objects (key shapes, types, sizes, JSON keys) before writing a mapper
5448
5499
  map test Run a source's mapper over real objects and show the outcomes; nothing ingested
5449
- remap Re-apply the live mapper to every raw copy the source holds
5500
+ map deploy Make a build's compiled mapper the source's active one (a branch build will do)
5501
+ remap Re-apply the active mapper to every raw copy the source holds
5450
5502
  hydrate Reload an evicted index ahead of the first search
5451
5503
  sample Draw a sample of a source into a new one with the same config
5452
5504
  eval Query sets and runs: measure recall, MRR and latency, compare versions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madewithremy/admin",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "Admin SDK + CLI for managing production Remy apps",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",