@madewithremy/admin 0.1.8 → 0.1.9
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/index.d.ts +47 -6
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/prod.js +52 -8
- package/package.json +1 -1
package/dist/prod.js
CHANGED
|
@@ -4605,6 +4605,17 @@ function mapTest(ctx, params) {
|
|
|
4605
4605
|
}
|
|
4606
4606
|
);
|
|
4607
4607
|
}
|
|
4608
|
+
function mapDeploy(ctx, params) {
|
|
4609
|
+
return call(
|
|
4610
|
+
ctx,
|
|
4611
|
+
"POST",
|
|
4612
|
+
`${base5(ctx.appId)}/mapper/deploy`,
|
|
4613
|
+
{
|
|
4614
|
+
slug: params.slug,
|
|
4615
|
+
...params.releaseId ? { releaseId: params.releaseId } : {}
|
|
4616
|
+
}
|
|
4617
|
+
);
|
|
4618
|
+
}
|
|
4608
4619
|
function remap(ctx, params) {
|
|
4609
4620
|
return call(ctx, "POST", `${base5(ctx.appId)}/remap`, {
|
|
4610
4621
|
slug: params.slug,
|
|
@@ -4668,6 +4679,13 @@ var dataSourceMappersSpecs = {
|
|
|
4668
4679
|
message: "Name the objects: --store <name> [--prefix <p>], or --connector for the source's bucket."
|
|
4669
4680
|
}
|
|
4670
4681
|
},
|
|
4682
|
+
"datasources map deploy": {
|
|
4683
|
+
usage: "Usage: remy-admin datasources map deploy [--source <slug>] [--release <id>]",
|
|
4684
|
+
flags: {
|
|
4685
|
+
source: { type: "string" },
|
|
4686
|
+
release: { type: "string" }
|
|
4687
|
+
}
|
|
4688
|
+
},
|
|
4671
4689
|
"datasources remap": {
|
|
4672
4690
|
usage: "Usage: remy-admin datasources remap [--source <slug>] [--budget <dollars>] [--limit <n>] [--wait] [--timeout <sec>]",
|
|
4673
4691
|
flags: {
|
|
@@ -4782,7 +4800,7 @@ async function mapTest2(ctx, a) {
|
|
|
4782
4800
|
dataSource: slug,
|
|
4783
4801
|
...result,
|
|
4784
4802
|
results,
|
|
4785
|
-
note: result.dev ? "Ran the LOCAL mapper through the dev session. Nothing was ingested; deploy to make it
|
|
4803
|
+
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
4804
|
});
|
|
4787
4805
|
if (result.counts.error > 0) {
|
|
4788
4806
|
throw new CliError(
|
|
@@ -4791,6 +4809,22 @@ async function mapTest2(ctx, a) {
|
|
|
4791
4809
|
);
|
|
4792
4810
|
}
|
|
4793
4811
|
}
|
|
4812
|
+
async function mapDeploy2(ctx, a) {
|
|
4813
|
+
const slug = sourceOf(a);
|
|
4814
|
+
const releaseId = a.str("release");
|
|
4815
|
+
const result = await mapDeploy(ctx, {
|
|
4816
|
+
slug,
|
|
4817
|
+
...releaseId ? { releaseId } : {}
|
|
4818
|
+
});
|
|
4819
|
+
const { mapper } = result;
|
|
4820
|
+
const from = `${mapper.branch ?? "release"} @ ${(mapper.commitSha ?? "").slice(0, 7)}`;
|
|
4821
|
+
out({
|
|
4822
|
+
dataSource: slug,
|
|
4823
|
+
mapper,
|
|
4824
|
+
changed: result.changed,
|
|
4825
|
+
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.`
|
|
4826
|
+
});
|
|
4827
|
+
}
|
|
4794
4828
|
async function remap2(ctx, a) {
|
|
4795
4829
|
const slug = sourceOf(a);
|
|
4796
4830
|
const budget = a.num("budget");
|
|
@@ -4830,7 +4864,7 @@ async function quarantine2(ctx, a) {
|
|
|
4830
4864
|
});
|
|
4831
4865
|
out({
|
|
4832
4866
|
...result,
|
|
4833
|
-
note: result.counts.skipped + result.counts.errors === 0 ? "Nothing quarantined: the mapper produced documents (or deletions) for every object." : `Fix the mapper,
|
|
4867
|
+
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
4868
|
});
|
|
4835
4869
|
}
|
|
4836
4870
|
async function replay2(ctx, a) {
|
|
@@ -4860,6 +4894,7 @@ async function replay2(ctx, a) {
|
|
|
4860
4894
|
var dataSourceMappersHandlers = {
|
|
4861
4895
|
"datasources inspect": inspect2,
|
|
4862
4896
|
"datasources map test": mapTest2,
|
|
4897
|
+
"datasources map deploy": mapDeploy2,
|
|
4863
4898
|
"datasources remap": remap2,
|
|
4864
4899
|
"datasources jobs quarantine": quarantine2,
|
|
4865
4900
|
"datasources jobs replay": replay2
|
|
@@ -4868,6 +4903,7 @@ var dataSourceMappersHelp = `
|
|
|
4868
4903
|
Mapping raw objects into documents (mappers):
|
|
4869
4904
|
remy-admin datasources inspect [--source <slug>] (--store <name> [--prefix <p>] | --connector) [--keys k1,k2] [--limit <n>]
|
|
4870
4905
|
remy-admin datasources map test [--source <slug>] (--store <name> [--prefix <p>] | --connector) [--keys k1,k2] [--limit <n>] [--dev] [--full]
|
|
4906
|
+
remy-admin datasources map deploy [--source <slug>] [--release <id>]
|
|
4871
4907
|
remy-admin datasources remap [--source <slug>] [--budget <dollars>] [--limit <n>] [--wait] [--timeout <sec>]
|
|
4872
4908
|
remy-admin datasources jobs quarantine <id> [--kind skip|error] [--reason <text>] [--cursor <id>] [--limit <n>]
|
|
4873
4909
|
remy-admin datasources jobs replay <id> [--kind skip|error] [--wait] [--timeout <sec>]
|
|
@@ -4889,11 +4925,18 @@ Mapping raw objects into documents (mappers):
|
|
|
4889
4925
|
JSON key signatures of ten sampled heads) before a line is written;
|
|
4890
4926
|
\`map test --dev\` runs the LOCAL mapper through the running dev session
|
|
4891
4927
|
over real objects and prints every outcome without ingesting anything;
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4928
|
+
push a branch and wait for its build (\`releases wait\`) \u2014 a mapper runs on
|
|
4929
|
+
the platform, so the platform has to compile it, and a private branch
|
|
4930
|
+
build is all it needs; \`map deploy\` makes that build's mapper the
|
|
4931
|
+
source's active one (publishing to main activates the mapper main declares
|
|
4932
|
+
too, so merge the branch before publishing); a job or sync runs it; \`jobs
|
|
4933
|
+
quarantine <id>\` lists what it skipped or failed on, by reason; fix, push,
|
|
4934
|
+
\`map deploy\`, \`jobs replay <id>\` runs just those objects again; \`remap\`
|
|
4935
|
+
re-applies a changed mapper to every raw copy the source holds \u2014 no origin
|
|
4936
|
+
traffic, unchanged markdown skipped by hash, changed documents superseding
|
|
4937
|
+
their predecessors. \`jobs start\` refuses (mapper_not_deployed) while the
|
|
4938
|
+
dev session declares a mapper that is not yet active: the job would have
|
|
4939
|
+
loaded the raw records as documents.
|
|
4897
4940
|
|
|
4898
4941
|
externalId is the identity the platform replaces by: a later object
|
|
4899
4942
|
producing the same id supersedes the earlier document; \`replaces\` names
|
|
@@ -5446,7 +5489,8 @@ Subcommands:
|
|
|
5446
5489
|
disconnect Stop following the bucket; documents stay
|
|
5447
5490
|
inspect Profile raw objects (key shapes, types, sizes, JSON keys) before writing a mapper
|
|
5448
5491
|
map test Run a source's mapper over real objects and show the outcomes; nothing ingested
|
|
5449
|
-
|
|
5492
|
+
map deploy Make a build's compiled mapper the source's active one (a branch build will do)
|
|
5493
|
+
remap Re-apply the active mapper to every raw copy the source holds
|
|
5450
5494
|
hydrate Reload an evicted index ahead of the first search
|
|
5451
5495
|
sample Draw a sample of a source into a new one with the same config
|
|
5452
5496
|
eval Query sets and runs: measure recall, MRR and latency, compare versions
|