@madewithremy/admin 0.1.19 → 0.1.20
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 +36 -2
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/dist/prod.js +40 -2
- package/package.json +1 -1
package/dist/prod.js
CHANGED
|
@@ -420,11 +420,11 @@ function describeEta(eta, now = Date.now()) {
|
|
|
420
420
|
return `about ${hours} h left`;
|
|
421
421
|
}
|
|
422
422
|
function renderProgress(p, start2, extra) {
|
|
423
|
-
const
|
|
423
|
+
const count2 = p.total !== null ? `${p.done.toLocaleString()}/${p.total.toLocaleString()} ${p.unit}` : p.done > 0 ? `${p.done.toLocaleString()} ${p.unit}` : null;
|
|
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
|
-
|
|
427
|
+
count2,
|
|
428
428
|
rate,
|
|
429
429
|
describeEta(p.etaAt),
|
|
430
430
|
extra ?? null,
|
|
@@ -3169,6 +3169,14 @@ function search(ctx, params) {
|
|
|
3169
3169
|
}
|
|
3170
3170
|
);
|
|
3171
3171
|
}
|
|
3172
|
+
function count(ctx, params) {
|
|
3173
|
+
const { slug, filter, candidate } = params;
|
|
3174
|
+
return call(ctx, "POST", `${base(ctx.appId)}/count`, {
|
|
3175
|
+
slug,
|
|
3176
|
+
...filter ? { filter } : {},
|
|
3177
|
+
...candidate ? { candidate: true } : {}
|
|
3178
|
+
});
|
|
3179
|
+
}
|
|
3172
3180
|
function configGet(ctx, slug) {
|
|
3173
3181
|
return call(
|
|
3174
3182
|
ctx,
|
|
@@ -5232,6 +5240,16 @@ var dataSourcesSpecs = {
|
|
|
5232
5240
|
...CONFIG_FLAGS
|
|
5233
5241
|
}
|
|
5234
5242
|
},
|
|
5243
|
+
"datasources count": {
|
|
5244
|
+
usage: "Usage: remy-admin datasources count [--source <slug>] [--filter <k=v,...|json>] [--contains <words>] [--phrase <text>] [--candidate]",
|
|
5245
|
+
flags: {
|
|
5246
|
+
source: { type: "string" },
|
|
5247
|
+
filter: { type: "string" },
|
|
5248
|
+
contains: { type: "string" },
|
|
5249
|
+
phrase: { type: "string" },
|
|
5250
|
+
candidate: { type: "boolean" }
|
|
5251
|
+
}
|
|
5252
|
+
},
|
|
5235
5253
|
"datasources move": {
|
|
5236
5254
|
usage: "Usage: remy-admin datasources move [--source <slug>] --to <resource-id|shared> [--chains <n>] [--restart] [--wait] [--timeout <sec>]",
|
|
5237
5255
|
flags: {
|
|
@@ -5428,6 +5446,16 @@ async function dataSourcesSearch(ctx, a) {
|
|
|
5428
5446
|
})
|
|
5429
5447
|
);
|
|
5430
5448
|
}
|
|
5449
|
+
async function dataSourcesCount(ctx, a) {
|
|
5450
|
+
const filter = filterFromFlags(a);
|
|
5451
|
+
out(
|
|
5452
|
+
await count(ctx, {
|
|
5453
|
+
slug: sourceOf(a),
|
|
5454
|
+
...filter ? { filter } : {},
|
|
5455
|
+
...a.bool("candidate") ? { candidate: true } : {}
|
|
5456
|
+
})
|
|
5457
|
+
);
|
|
5458
|
+
}
|
|
5431
5459
|
function filterFromFlags(a) {
|
|
5432
5460
|
let filter = {};
|
|
5433
5461
|
const raw = a.str("filter");
|
|
@@ -5695,6 +5723,7 @@ var dataSourcesHandlers = {
|
|
|
5695
5723
|
"datasources search": dataSourcesSearch,
|
|
5696
5724
|
"datasources create": dataSourcesCreate,
|
|
5697
5725
|
"datasources config": dataSourcesConfig,
|
|
5726
|
+
"datasources count": dataSourcesCount,
|
|
5698
5727
|
"datasources move": dataSourcesMove,
|
|
5699
5728
|
"datasources revectorize": dataSourcesRevectorize,
|
|
5700
5729
|
"datasources promote": dataSourcesPromote,
|
|
@@ -5739,6 +5768,7 @@ Usage:
|
|
|
5739
5768
|
remy-admin datasources status [--source <slug>] [--status error] [--all]
|
|
5740
5769
|
remy-admin datasources rm [--source <slug>] (--document <id> | --filter <k=v,...|json>)
|
|
5741
5770
|
remy-admin datasources search [--source <slug>] [search options] <query>
|
|
5771
|
+
remy-admin datasources count [--source <slug>] [--filter <k=v,...|json>] [--contains <words>] [--phrase <text>] [--candidate]
|
|
5742
5772
|
remy-admin datasources create --source <slug> [--name <name>] [--placement <resource-id|shared>] [rebuild settings...]
|
|
5743
5773
|
remy-admin datasources config [--source <slug>] [--placement <resource-id|shared>] [settings...]
|
|
5744
5774
|
remy-admin datasources move [--source <slug>] --to <resource-id|shared> [--chains <n>] [--restart] [--wait] [--timeout <sec>]
|
|
@@ -5751,6 +5781,14 @@ Usage:
|
|
|
5751
5781
|
remy-admin datasources drop [--source <slug>] [--version <n>]
|
|
5752
5782
|
remy-admin datasources delete --source <slug>
|
|
5753
5783
|
|
|
5784
|
+
Count:
|
|
5785
|
+
\`count\` answers how many chunks match a filter, exactly, over the whole
|
|
5786
|
+
corpus, in the same grammar search narrows by: --contains for passages that
|
|
5787
|
+
hold all the words, --phrase for an exact sequence, --filter for metadata. No
|
|
5788
|
+
flags counts the whole corpus. It is a containment count, not a relevance
|
|
5789
|
+
count (none exists), and not the set search returns. The SDK's
|
|
5790
|
+
\`Source.count(filter)\` is the same call for an app.
|
|
5791
|
+
|
|
5754
5792
|
Search options:
|
|
5755
5793
|
--top-k <n> Results to return (default 5, max 50)
|
|
5756
5794
|
--mode <m> hybrid (default) | semantic | lexical. Lexical is
|