@meilisearch/cli 0.0.0-stage → 0.0.0
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/LICENSE +21 -0
- package/README.md +72 -2
- package/bin/run.js +15 -0
- package/dist/commands/add/documents.js +54 -0
- package/dist/commands/add/documents.js.map +1 -0
- package/dist/commands/add/indexes.js +39 -0
- package/dist/commands/add/indexes.js.map +1 -0
- package/dist/commands/add/keys.js +63 -0
- package/dist/commands/add/keys.js.map +1 -0
- package/dist/commands/add/projects.js +96 -0
- package/dist/commands/add/projects.js.map +1 -0
- package/dist/commands/auth/login.js +26 -0
- package/dist/commands/auth/login.js.map +1 -0
- package/dist/commands/auth/logout.js +31 -0
- package/dist/commands/auth/logout.js.map +1 -0
- package/dist/commands/auth/refresh.js +22 -0
- package/dist/commands/auth/refresh.js.map +1 -0
- package/dist/commands/auth/status.js +34 -0
- package/dist/commands/auth/status.js.map +1 -0
- package/dist/commands/cancel/tasks.js +24 -0
- package/dist/commands/cancel/tasks.js.map +1 -0
- package/dist/commands/config/list.js +18 -0
- package/dist/commands/config/list.js.map +1 -0
- package/dist/commands/config/set.js +48 -0
- package/dist/commands/config/set.js.map +1 -0
- package/dist/commands/config/sync-with-cloud.js +144 -0
- package/dist/commands/config/sync-with-cloud.js.map +1 -0
- package/dist/commands/config/unset.js +28 -0
- package/dist/commands/config/unset.js.map +1 -0
- package/dist/commands/config/update.js +53 -0
- package/dist/commands/config/update.js.map +1 -0
- package/dist/commands/delete/documents.js +81 -0
- package/dist/commands/delete/documents.js.map +1 -0
- package/dist/commands/delete/indexes.js +28 -0
- package/dist/commands/delete/indexes.js.map +1 -0
- package/dist/commands/delete/keys.js +28 -0
- package/dist/commands/delete/keys.js.map +1 -0
- package/dist/commands/delete/projects.js +40 -0
- package/dist/commands/delete/projects.js.map +1 -0
- package/dist/commands/delete/settings.js +28 -0
- package/dist/commands/delete/settings.js.map +1 -0
- package/dist/commands/delete/tasks.js +34 -0
- package/dist/commands/delete/tasks.js.map +1 -0
- package/dist/commands/export.js +67 -0
- package/dist/commands/export.js.map +1 -0
- package/dist/commands/facet-search.js +87 -0
- package/dist/commands/facet-search.js.map +1 -0
- package/dist/commands/get/batches.js +35 -0
- package/dist/commands/get/batches.js.map +1 -0
- package/dist/commands/get/documents.js +74 -0
- package/dist/commands/get/documents.js.map +1 -0
- package/dist/commands/get/health.js +17 -0
- package/dist/commands/get/health.js.map +1 -0
- package/dist/commands/get/indexes.js +33 -0
- package/dist/commands/get/indexes.js.map +1 -0
- package/dist/commands/get/keys.js +36 -0
- package/dist/commands/get/keys.js.map +1 -0
- package/dist/commands/get/projects.js +40 -0
- package/dist/commands/get/projects.js.map +1 -0
- package/dist/commands/get/settings.js +25 -0
- package/dist/commands/get/settings.js.map +1 -0
- package/dist/commands/get/stats.js +37 -0
- package/dist/commands/get/stats.js.map +1 -0
- package/dist/commands/get/tasks.js +35 -0
- package/dist/commands/get/tasks.js.map +1 -0
- package/dist/commands/get/version.js +16 -0
- package/dist/commands/get/version.js.map +1 -0
- package/dist/commands/multi-search.js +39 -0
- package/dist/commands/multi-search.js.map +1 -0
- package/dist/commands/schema.js +95 -0
- package/dist/commands/schema.js.map +1 -0
- package/dist/commands/search.js +164 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/commands/similar.js +86 -0
- package/dist/commands/similar.js.map +1 -0
- package/dist/commands/teleport.js +466 -0
- package/dist/commands/teleport.js.map +1 -0
- package/dist/commands/update/documents.js +56 -0
- package/dist/commands/update/documents.js.map +1 -0
- package/dist/commands/update/indexes.js +44 -0
- package/dist/commands/update/indexes.js.map +1 -0
- package/dist/commands/update/keys.js +42 -0
- package/dist/commands/update/keys.js.map +1 -0
- package/dist/commands/update/projects.js +62 -0
- package/dist/commands/update/projects.js.map +1 -0
- package/dist/commands/update/settings.js +145 -0
- package/dist/commands/update/settings.js.map +1 -0
- package/dist/lib/api-naming.js +435 -0
- package/dist/lib/api-naming.js.map +1 -0
- package/dist/lib/base-command.js +285 -0
- package/dist/lib/base-command.js.map +1 -0
- package/dist/lib/clients/management/generated/client/client.gen.js +217 -0
- package/dist/lib/clients/management/generated/client/client.gen.js.map +1 -0
- package/dist/lib/clients/management/generated/client/index.js +7 -0
- package/dist/lib/clients/management/generated/client/index.js.map +1 -0
- package/dist/lib/clients/management/generated/client/types.gen.js +3 -0
- package/dist/lib/clients/management/generated/client/types.gen.js.map +1 -0
- package/dist/lib/clients/management/generated/client/utils.gen.js +229 -0
- package/dist/lib/clients/management/generated/client/utils.gen.js.map +1 -0
- package/dist/lib/clients/management/generated/client.gen.js +4 -0
- package/dist/lib/clients/management/generated/client.gen.js.map +1 -0
- package/dist/lib/clients/management/generated/core/auth.gen.js +15 -0
- package/dist/lib/clients/management/generated/core/auth.gen.js.map +1 -0
- package/dist/lib/clients/management/generated/core/bodySerializer.gen.js +58 -0
- package/dist/lib/clients/management/generated/core/bodySerializer.gen.js.map +1 -0
- package/dist/lib/clients/management/generated/core/params.gen.js +110 -0
- package/dist/lib/clients/management/generated/core/params.gen.js.map +1 -0
- package/dist/lib/clients/management/generated/core/pathSerializer.gen.js +107 -0
- package/dist/lib/clients/management/generated/core/pathSerializer.gen.js.map +1 -0
- package/dist/lib/clients/management/generated/core/queryKeySerializer.gen.js +93 -0
- package/dist/lib/clients/management/generated/core/queryKeySerializer.gen.js.map +1 -0
- package/dist/lib/clients/management/generated/core/serverSentEvents.gen.js +133 -0
- package/dist/lib/clients/management/generated/core/serverSentEvents.gen.js.map +1 -0
- package/dist/lib/clients/management/generated/core/types.gen.js +3 -0
- package/dist/lib/clients/management/generated/core/types.gen.js.map +1 -0
- package/dist/lib/clients/management/generated/core/utils.gen.js +88 -0
- package/dist/lib/clients/management/generated/core/utils.gen.js.map +1 -0
- package/dist/lib/clients/management/generated/index.js +3 -0
- package/dist/lib/clients/management/generated/index.js.map +1 -0
- package/dist/lib/clients/management/generated/sdk.gen.js +398 -0
- package/dist/lib/clients/management/generated/sdk.gen.js.map +1 -0
- package/dist/lib/clients/management/generated/types.gen.js +3 -0
- package/dist/lib/clients/management/generated/types.gen.js.map +1 -0
- package/dist/lib/clients/management.js +21 -0
- package/dist/lib/clients/management.js.map +1 -0
- package/dist/lib/clients/meilisearch.js +69 -0
- package/dist/lib/clients/meilisearch.js.map +1 -0
- package/dist/lib/clients/oauth.js +225 -0
- package/dist/lib/clients/oauth.js.map +1 -0
- package/dist/lib/clients/ping.js +26 -0
- package/dist/lib/clients/ping.js.map +1 -0
- package/dist/lib/clients/trace.js +69 -0
- package/dist/lib/clients/trace.js.map +1 -0
- package/dist/lib/cloud-sync.js +113 -0
- package/dist/lib/cloud-sync.js.map +1 -0
- package/dist/lib/config.js +317 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/errors.js +302 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/help.js +37 -0
- package/dist/lib/help.js.map +1 -0
- package/dist/lib/input.js +76 -0
- package/dist/lib/input.js.map +1 -0
- package/dist/lib/login.js +43 -0
- package/dist/lib/login.js.map +1 -0
- package/dist/lib/output.js +39 -0
- package/dist/lib/output.js.map +1 -0
- package/dist/lib/pagination.js +52 -0
- package/dist/lib/pagination.js.map +1 -0
- package/dist/lib/session.js +149 -0
- package/dist/lib/session.js.map +1 -0
- package/dist/lib/task-filters.js +118 -0
- package/dist/lib/task-filters.js.map +1 -0
- package/dist/lib/tasks.js +64 -0
- package/dist/lib/tasks.js.map +1 -0
- package/dist/lib/terminal.js +146 -0
- package/dist/lib/terminal.js.map +1 -0
- package/dist/lib/values.js +48 -0
- package/dist/lib/values.js.map +1 -0
- package/oclif.manifest.json +10470 -0
- package/package.json +81 -4
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Flags } from "@oclif/core";
|
|
2
|
+
import { BaseCommand } from "../lib/base-command.js";
|
|
3
|
+
import { triggerExport } from "../lib/clients/meilisearch.js";
|
|
4
|
+
import { projectOf } from "../lib/config.js";
|
|
5
|
+
import { readBodyWithFields } from "../lib/input.js";
|
|
6
|
+
import { asJson, asText } from "../lib/values.js";
|
|
7
|
+
/** The flags that describe the instance the data is sent to, apart in `--help`. */
|
|
8
|
+
const DESTINATION = "DESTINATION";
|
|
9
|
+
export default class Export extends BaseCommand {
|
|
10
|
+
static api = "meilisearch";
|
|
11
|
+
static routes = ["POST /export"];
|
|
12
|
+
static keyActions = ["export"];
|
|
13
|
+
static description = `Send the documents and the settings of the source instance to the destination instance, and answer the task that does it.
|
|
14
|
+
|
|
15
|
+
The source is the project this command connects to, named by --project, --project-url and --project-api-key as on every command: it receives the request and does the export. The destination is --url with --api-key, or --project-destination, an entry of the config file. --indexes narrows the export to the indexes those patterns match.`;
|
|
16
|
+
static examples = [
|
|
17
|
+
"<%= config.bin %> <%= command.id %> --project prod --url https://ms-1234.heaven.meilisearch.com --api-key <key>",
|
|
18
|
+
"<%= config.bin %> <%= command.id %> --project prod --url https://ms-1234.heaven.meilisearch.com --api-key <key> --output json",
|
|
19
|
+
"<%= config.bin %> <%= command.id %> --project staging --project-destination prod",
|
|
20
|
+
`<%= config.bin %> <%= command.id %> --project prod --url http://localhost:7701 --indexes '{"movies":{"filter":"rating > 4"}}' --wait`,
|
|
21
|
+
"<%= config.bin %> <%= command.id %> --project prod --url http://localhost:7701 --payload-size 24MiB",
|
|
22
|
+
`<%= config.bin %> <%= command.id %> --project prod --data '{"url":"http://localhost:7701","indexes":{"*":{"overrideSettings":true}}}'`,
|
|
23
|
+
];
|
|
24
|
+
static flags = {
|
|
25
|
+
...BaseCommand.connectionFlags,
|
|
26
|
+
url: Flags.string({
|
|
27
|
+
description: "URL of the destination instance, the one the data is sent to.",
|
|
28
|
+
helpValue: "<url>",
|
|
29
|
+
helpGroup: DESTINATION,
|
|
30
|
+
}),
|
|
31
|
+
"api-key": Flags.string({
|
|
32
|
+
description: "API key of the destination instance, the one the export writes with. --project-api-key stays the key of the source.",
|
|
33
|
+
helpValue: "<key>",
|
|
34
|
+
helpGroup: DESTINATION,
|
|
35
|
+
}),
|
|
36
|
+
"project-destination": Flags.string({
|
|
37
|
+
description: "A project of the config file, the destination: its URL and its key stand for --url and --api-key. Cannot be combined with --url. --api-key replaces its key.",
|
|
38
|
+
helpValue: "<name>",
|
|
39
|
+
helpGroup: DESTINATION,
|
|
40
|
+
exclusive: ["url"],
|
|
41
|
+
}),
|
|
42
|
+
"payload-size": Flags.string({
|
|
43
|
+
description: "Maximum size of one request sent to the destination, for example 24MiB.",
|
|
44
|
+
helpValue: "<size>",
|
|
45
|
+
helpGroup: DESTINATION,
|
|
46
|
+
}),
|
|
47
|
+
indexes: Flags.string({
|
|
48
|
+
description: 'The indexes to export and how, as JSON: an index pattern per key, its filter and overrideSettings as value. Every index by default, `{"*":{}}`.',
|
|
49
|
+
helpValue: "<json>",
|
|
50
|
+
}),
|
|
51
|
+
...BaseCommand.bodyInputFlags,
|
|
52
|
+
...BaseCommand.waitFlags,
|
|
53
|
+
};
|
|
54
|
+
async run() {
|
|
55
|
+
const { flags } = await this.parse(Export);
|
|
56
|
+
const name = flags["project-destination"];
|
|
57
|
+
const destination = name === undefined ? undefined : projectOf(this.configFile(), name);
|
|
58
|
+
const body = readBodyWithFields(flags, {
|
|
59
|
+
url: asText(flags.url ?? destination?.url),
|
|
60
|
+
apiKey: asText(flags["api-key"] ?? destination?.apiKey),
|
|
61
|
+
payloadSize: asText(flags["payload-size"]),
|
|
62
|
+
indexes: asJson(flags.indexes),
|
|
63
|
+
});
|
|
64
|
+
await this.outputTask(await triggerExport(this.meilisearch, body), flags);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=export.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.js","sourceRoot":"","sources":["../../src/commands/export.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAY,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAA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C;QACF,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC;YACpB,WAAW,EACT,iJAAiJ;YACnJ,SAAS,EAAE,QAAQ;SACpB,CAAC;QACF,GAAG,WAAW,CAAC,cAAc;QAC7B,GAAG,WAAW,CAAC,SAAS;KACzB,CAAC;IAEF,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC3C,MAAM,IAAI,GAAG,KAAK,CAAC,qBAAqB,CAAC,CAAC;QAC1C,MAAM,WAAW,GAAG,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,CAAC,CAAC;QACxF,MAAM,IAAI,GAAG,kBAAkB,CAAC,KAAK,EAAE;YACrC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,WAAW,EAAE,GAAG,CAAC;YAC1C,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,WAAW,EAAE,MAAM,CAAC;YACvD,WAAW,EAAE,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;YAC1C,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC;SAC/B,CAAC,CAAC;QACH,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,aAAa,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;IAC5E,CAAC;CACF"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Flags } from "@oclif/core";
|
|
2
|
+
import { BaseCommand } from "../lib/base-command.js";
|
|
3
|
+
import { readBodyWithFields } from "../lib/input.js";
|
|
4
|
+
import { asJson, asNumber } from "../lib/values.js";
|
|
5
|
+
export default class FacetSearch extends BaseCommand {
|
|
6
|
+
static api = "meilisearch";
|
|
7
|
+
static routes = ["POST /indexes/{index_uid}/facet-search"];
|
|
8
|
+
static keyActions = ["search"];
|
|
9
|
+
static description = "Search the values of one facet attribute of an index, counted on the documents --q and --filter keep.";
|
|
10
|
+
static examples = [
|
|
11
|
+
"<%= config.bin %> <%= command.id %> --project prod --index movies --facet-name genres --facet-query ac",
|
|
12
|
+
"<%= config.bin %> <%= command.id %> --project prod --index movies --facet-name genres --facet-query ac --output json",
|
|
13
|
+
"<%= config.bin %> <%= command.id %> --project prod --index movies --facet-name genres --q horror --filter 'rating > 4'",
|
|
14
|
+
'<%= config.bin %> <%= command.id %> --project prod --index movies --data \'{"facetName":"genres","facetQuery":"ac"}\'',
|
|
15
|
+
];
|
|
16
|
+
static flags = {
|
|
17
|
+
...BaseCommand.connectionFlags,
|
|
18
|
+
index: Flags.string({
|
|
19
|
+
required: true,
|
|
20
|
+
description: "The index to search the facet values in.",
|
|
21
|
+
helpValue: "<index>",
|
|
22
|
+
}),
|
|
23
|
+
"facet-name": Flags.string({
|
|
24
|
+
description: "The facet attribute to search in. It must be one of the filterable attributes of the index.",
|
|
25
|
+
helpValue: "<attribute>",
|
|
26
|
+
}),
|
|
27
|
+
"facet-query": Flags.string({
|
|
28
|
+
description: "The terms the facet values are matched against, the first word only. Omit it to return every value, up to 100.",
|
|
29
|
+
helpValue: "<query>",
|
|
30
|
+
}),
|
|
31
|
+
q: Flags.string({
|
|
32
|
+
description: "The search terms that narrow the documents the facet values are computed on, not the values themselves.",
|
|
33
|
+
helpValue: "<query>",
|
|
34
|
+
}),
|
|
35
|
+
filter: Flags.string({
|
|
36
|
+
description: "Filter expression, for example `rating > 4`. Its array-of-arrays form goes through --data.",
|
|
37
|
+
helpValue: "<filter>",
|
|
38
|
+
}),
|
|
39
|
+
"matching-strategy": Flags.option({
|
|
40
|
+
options: ["last", "all", "frequency"],
|
|
41
|
+
description: "How the terms of --q are relaxed when there are not enough results.",
|
|
42
|
+
})(),
|
|
43
|
+
"attributes-to-search-on": Flags.string({
|
|
44
|
+
description: "Restrict the search of --q to these searchable attributes, comma-separated.",
|
|
45
|
+
helpValue: "<fields>",
|
|
46
|
+
}),
|
|
47
|
+
"ranking-score-threshold": Flags.string({
|
|
48
|
+
description: "Count only the documents whose ranking score reaches this value, between 0.0 and 1.0.",
|
|
49
|
+
helpValue: "<number>",
|
|
50
|
+
}),
|
|
51
|
+
locales: Flags.string({
|
|
52
|
+
description: "ISO-639 locales of the query, comma-separated, instead of auto-detection.",
|
|
53
|
+
helpValue: "<locales>",
|
|
54
|
+
}),
|
|
55
|
+
hybrid: Flags.string({
|
|
56
|
+
description: 'Hybrid search as JSON, for example `{"embedder":"default","semanticRatio":0.5}`.',
|
|
57
|
+
helpValue: "<json>",
|
|
58
|
+
}),
|
|
59
|
+
vector: Flags.string({
|
|
60
|
+
description: "Query vector for a user-provided embedder, comma-separated numbers.",
|
|
61
|
+
helpValue: "<numbers>",
|
|
62
|
+
}),
|
|
63
|
+
"exhaustive-facet-count": Flags.boolean({
|
|
64
|
+
description: "Count the facet values exhaustively instead of estimating the counts.",
|
|
65
|
+
}),
|
|
66
|
+
...BaseCommand.bodyInputFlags,
|
|
67
|
+
};
|
|
68
|
+
async run() {
|
|
69
|
+
const { flags } = await this.parse(FacetSearch);
|
|
70
|
+
const fromFlags = {
|
|
71
|
+
facetName: flags["facet-name"],
|
|
72
|
+
facetQuery: flags["facet-query"],
|
|
73
|
+
q: flags.q,
|
|
74
|
+
filter: flags.filter,
|
|
75
|
+
matchingStrategy: flags["matching-strategy"],
|
|
76
|
+
attributesToSearchOn: flags["attributes-to-search-on"]?.split(","),
|
|
77
|
+
rankingScoreThreshold: asNumber(flags["ranking-score-threshold"]),
|
|
78
|
+
locales: flags.locales?.split(","),
|
|
79
|
+
hybrid: asJson(flags.hybrid),
|
|
80
|
+
vector: flags.vector?.split(",").map(asNumber),
|
|
81
|
+
exhaustiveFacetCount: flags["exhaustive-facet-count"] ? true : undefined,
|
|
82
|
+
};
|
|
83
|
+
const params = readBodyWithFields(flags, fromFlags);
|
|
84
|
+
await this.output(await this.meilisearch.index(flags.index).searchForFacetValues(params));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=facet-search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"facet-search.js","sourceRoot":"","sources":["../../src/commands/facet-search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAY,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,WAAW;IAClD,MAAM,CAAC,GAAG,GAAQ,aAAa,CAAC;IAEhC,MAAM,CAAC,MAAM,GAAG,CAAC,wCAAwC,CAAC,CAAC;IAE3D,MAAM,CAAC,UAAU,GAAG,CAAC,QAAQ,CAAC,CAAC;IAE/B,MAAM,CAAU,WAAW,GACzB,uGAAuG,CAAC;IAE1G,MAAM,CAAU,QAAQ,GAAG;QACzB,wGAAwG;QACxG,sHAAsH;QACtH,wHAAwH;QACxH,uHAAuH;KACxH,CAAC;IAEF,MAAM,CAAU,KAAK,GAAG;QACtB,GAAG,WAAW,CAAC,eAAe;QAC9B,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC;YAClB,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,0CAA0C;YACvD,SAAS,EAAE,SAAS;SACrB,CAAC;QACF,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC;YACzB,WAAW,EACT,6FAA6F;YAC/F,SAAS,EAAE,aAAa;SACzB,CAAC;QACF,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC;YAC1B,WAAW,EACT,gHAAgH;YAClH,SAAS,EAAE,SAAS;SACrB,CAAC;QACF,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC;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KAAK,CAAC,MAAM;YACpB,gBAAgB,EAAE,KAAK,CAAC,mBAAmB,CAAC;YAC5C,oBAAoB,EAAE,KAAK,CAAC,yBAAyB,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC;YAClE,qBAAqB,EAAE,QAAQ,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAuB;YACvF,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC;YAClC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAA6B;YACxD,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAyB;YACtE,oBAAoB,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;SACzE,CAAC;QAEF,MAAM,MAAM,GAAG,kBAAkB,CAAC,KAAK,EAAE,SAAS,CAA+B,CAAC;QAElF,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5F,CAAC;CACF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Flags } from "@oclif/core";
|
|
2
|
+
import { BaseCommand } from "../../lib/base-command.js";
|
|
3
|
+
import { nextFromQuery } from "../../lib/pagination.js";
|
|
4
|
+
import { batchFilterFlags, batchFilterQuery } from "../../lib/task-filters.js";
|
|
5
|
+
export default class GetBatches extends BaseCommand {
|
|
6
|
+
static api = "meilisearch";
|
|
7
|
+
static routes = ["GET /batches"];
|
|
8
|
+
static keyActions = ["tasks.get"];
|
|
9
|
+
static description = "List the batches of tasks the instance processed, narrowed by --ids, --task-ids, --statuses and the other filters of the route.";
|
|
10
|
+
static examples = [
|
|
11
|
+
"<%= config.bin %> <%= command.id %> --project prod",
|
|
12
|
+
"<%= config.bin %> <%= command.id %> --project prod --output json",
|
|
13
|
+
"<%= config.bin %> <%= command.id %> --project prod --ids 7",
|
|
14
|
+
"<%= config.bin %> <%= command.id %> --project prod --task-ids 42",
|
|
15
|
+
"<%= config.bin %> <%= command.id %> --project prod --statuses failed --index-ids movies --limit 5",
|
|
16
|
+
"<%= config.bin %> <%= command.id %> --project prod --all --output ndjson",
|
|
17
|
+
];
|
|
18
|
+
static flags = {
|
|
19
|
+
...BaseCommand.connectionFlags,
|
|
20
|
+
...batchFilterFlags,
|
|
21
|
+
reverse: Flags.boolean({
|
|
22
|
+
description: "Return the batches from the oldest uid up, instead of the newest down.",
|
|
23
|
+
}),
|
|
24
|
+
...BaseCommand.fromPaginationFlags,
|
|
25
|
+
};
|
|
26
|
+
async run() {
|
|
27
|
+
const { flags } = await this.parse(GetBatches);
|
|
28
|
+
const filters = {
|
|
29
|
+
...batchFilterQuery(flags),
|
|
30
|
+
reverse: flags.reverse ? true : undefined,
|
|
31
|
+
};
|
|
32
|
+
await this.outputList((page) => this.meilisearch.batches.getBatches({ ...filters, ...page }), { limit: flags.limit, from: flags.from }, flags.all, nextFromQuery);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=batches.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batches.js","sourceRoot":"","sources":["../../../src/commands/get/batches.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAY,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE/E,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAAW;IACjD,MAAM,CAAC,GAAG,GAAQ,aAAa,CAAC;IAEhC,MAAM,CAAC,MAAM,GAAG,CAAC,cAAc,CAAC,CAAC;IAEjC,MAAM,CAAC,UAAU,GAAG,CAAC,WAAW,CAAC,CAAC;IAElC,MAAM,CAAU,WAAW,GACzB,iIAAiI,CAAC;IAEpI,MAAM,CAAU,QAAQ,GAAG;QACzB,oDAAoD;QACpD,kEAAkE;QAClE,4DAA4D;QAC5D,kEAAkE;QAClE,mGAAmG;QACnG,0EAA0E;KAC3E,CAAC;IAEF,MAAM,CAAU,KAAK,GAAG;QACtB,GAAG,WAAW,CAAC,eAAe;QAC9B,GAAG,gBAAgB;QACnB,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC;YACrB,WAAW,EAAE,wEAAwE;SACtF,CAAC;QACF,GAAG,WAAW,CAAC,mBAAmB;KACnC,CAAC;IAEF,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAC/C,MAAM,OAAO,GAAG;YACd,GAAG,gBAAgB,CAAC,KAAK,CAAC;YAC1B,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;SAC1C,CAAC;QACF,MAAM,IAAI,CAAC,UAAU,CACnB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,GAAG,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC,EACtE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,EACxC,KAAK,CAAC,GAAG,EACT,aAAa,CACd,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Flags } from "@oclif/core";
|
|
2
|
+
import { BaseCommand } from "../../lib/base-command.js";
|
|
3
|
+
import { fetchDocuments } from "../../lib/clients/meilisearch.js";
|
|
4
|
+
import { MeiliCliError } from "../../lib/errors.js";
|
|
5
|
+
import { isJsonObject, readJsonBody } from "../../lib/input.js";
|
|
6
|
+
import { nextOffsetQuery } from "../../lib/pagination.js";
|
|
7
|
+
export default class GetDocuments extends BaseCommand {
|
|
8
|
+
static api = "meilisearch";
|
|
9
|
+
static routes = ["POST /indexes/{index_uid}/documents/fetch"];
|
|
10
|
+
static keyActions = ["documents.get"];
|
|
11
|
+
static description = "List the documents of an index, narrowed by --ids or by --filter.";
|
|
12
|
+
static examples = [
|
|
13
|
+
"<%= config.bin %> <%= command.id %> --project prod --index movies",
|
|
14
|
+
"<%= config.bin %> <%= command.id %> --project prod --index movies --output json",
|
|
15
|
+
"<%= config.bin %> <%= command.id %> --project prod --index movies --ids 42,1344 --fields id,title",
|
|
16
|
+
"<%= config.bin %> <%= command.id %> --project prod --index movies --filter 'rating > 4' --sort rating:desc",
|
|
17
|
+
"<%= config.bin %> <%= command.id %> --project prod --index movies --all --output ndjson",
|
|
18
|
+
];
|
|
19
|
+
static flags = {
|
|
20
|
+
...BaseCommand.connectionFlags,
|
|
21
|
+
index: Flags.string({
|
|
22
|
+
required: true,
|
|
23
|
+
description: "The index to read the documents from.",
|
|
24
|
+
helpValue: "<index>",
|
|
25
|
+
}),
|
|
26
|
+
ids: Flags.string({
|
|
27
|
+
aliases: ["id"],
|
|
28
|
+
description: "Document identifiers to return, comma-separated.",
|
|
29
|
+
helpValue: "<ids>",
|
|
30
|
+
}),
|
|
31
|
+
filter: Flags.string({
|
|
32
|
+
description: "Filter expression, for example `rating > 4`. Its array-of-arrays form goes through --data.",
|
|
33
|
+
helpValue: "<filter>",
|
|
34
|
+
}),
|
|
35
|
+
fields: Flags.string({
|
|
36
|
+
description: "Document attributes to return, comma-separated. Defaults to all of them.",
|
|
37
|
+
helpValue: "<fields>",
|
|
38
|
+
}),
|
|
39
|
+
sort: Flags.string({
|
|
40
|
+
description: "Attributes to sort on, comma-separated, each as `attribute:asc` or `:desc`.",
|
|
41
|
+
helpValue: "<sort>",
|
|
42
|
+
}),
|
|
43
|
+
"retrieve-vectors": Flags.boolean({
|
|
44
|
+
description: "Include the vector embeddings of the documents that have them.",
|
|
45
|
+
}),
|
|
46
|
+
...BaseCommand.paginationFlags,
|
|
47
|
+
...BaseCommand.bodyInputFlags,
|
|
48
|
+
};
|
|
49
|
+
async run() {
|
|
50
|
+
const { flags } = await this.parse(GetDocuments);
|
|
51
|
+
const given = readJsonBody(flags);
|
|
52
|
+
if (given !== undefined && !isJsonObject(given)) {
|
|
53
|
+
throw new MeiliCliError("cli_input_invalid", "The body of `get documents` is the query object of POST /indexes/{index_uid}/documents/fetch, not an array.", { hint: "Pass the identifiers as `--data '{\"ids\":[42,1344]}'` or as `--ids 42,1344`." });
|
|
54
|
+
}
|
|
55
|
+
const query = { ...given };
|
|
56
|
+
if (flags.ids !== undefined)
|
|
57
|
+
query.ids = flags.ids.split(",");
|
|
58
|
+
if (flags.filter !== undefined)
|
|
59
|
+
query.filter = flags.filter;
|
|
60
|
+
if (flags.fields !== undefined)
|
|
61
|
+
query.fields = flags.fields.split(",");
|
|
62
|
+
if (flags.sort !== undefined)
|
|
63
|
+
query.sort = flags.sort.split(",");
|
|
64
|
+
if (flags["retrieve-vectors"])
|
|
65
|
+
query.retrieveVectors = true;
|
|
66
|
+
if (flags.limit !== undefined)
|
|
67
|
+
query.limit = flags.limit;
|
|
68
|
+
if (flags.offset !== undefined)
|
|
69
|
+
query.offset = flags.offset;
|
|
70
|
+
const { limit, offset, ...rest } = query;
|
|
71
|
+
await this.outputList((page) => fetchDocuments(this.meilisearch, flags.index, { ...rest, ...page }), { limit, offset }, flags.all, nextOffsetQuery);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=documents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documents.js","sourceRoot":"","sources":["../../../src/commands/get/documents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAY,WAAW,EAAE,MAAM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AC;QACzD,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS;YAAE,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAE5D,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;QACzC,MAAM,IAAI,CAAC,UAAU,CACnB,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,KAAK,EAAE,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,EAAE,CAAC,EAC7E,EAAE,KAAK,EAAE,MAAM,EAAE,EACjB,KAAK,CAAC,GAAG,EACT,eAAe,CAChB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseCommand } from "../../lib/base-command.js";
|
|
2
|
+
export default class GetHealth extends BaseCommand {
|
|
3
|
+
static api = "meilisearch";
|
|
4
|
+
static routes = ["GET /health"];
|
|
5
|
+
static description = "Check that the Meilisearch instance is available.";
|
|
6
|
+
static examples = [
|
|
7
|
+
"<%= config.bin %> <%= command.id %> --project prod",
|
|
8
|
+
"<%= config.bin %> <%= command.id %> --project prod --output json",
|
|
9
|
+
"<%= config.bin %> <%= command.id %> --project-url http://localhost:7700",
|
|
10
|
+
];
|
|
11
|
+
static flags = { ...BaseCommand.connectionFlags };
|
|
12
|
+
async run() {
|
|
13
|
+
const health = await this.meilisearch.health();
|
|
14
|
+
await this.output(health);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=health.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.js","sourceRoot":"","sources":["../../../src/commands/get/health.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAElE,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,WAAW;IAChD,MAAM,CAAC,GAAG,GAAQ,aAAa,CAAC;IAEhC,MAAM,CAAC,MAAM,GAAG,CAAC,aAAa,CAAC,CAAC;IAEhC,MAAM,CAAU,WAAW,GAAG,mDAAmD,CAAC;IAElF,MAAM,CAAU,QAAQ,GAAG;QACzB,oDAAoD;QACpD,kEAAkE;QAClE,yEAAyE;KAC1E,CAAC;IAEF,MAAM,CAAU,KAAK,GAAG,EAAE,GAAG,WAAW,CAAC,eAAe,EAAE,CAAC;IAE3D,KAAK,CAAC,GAAG;QACP,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;QAC/C,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;CACF"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Flags } from "@oclif/core";
|
|
2
|
+
import { BaseCommand } from "../../lib/base-command.js";
|
|
3
|
+
import { nextOffsetQuery } from "../../lib/pagination.js";
|
|
4
|
+
export default class GetIndexes extends BaseCommand {
|
|
5
|
+
static api = "meilisearch";
|
|
6
|
+
static routes = ["GET /indexes", "GET /indexes/{index_uid}"];
|
|
7
|
+
static keyActions = ["indexes.get"];
|
|
8
|
+
static description = "List the indexes of the instance, or get one with --id.";
|
|
9
|
+
static examples = [
|
|
10
|
+
"<%= config.bin %> <%= command.id %> --project prod",
|
|
11
|
+
"<%= config.bin %> <%= command.id %> --project prod --output json",
|
|
12
|
+
"<%= config.bin %> <%= command.id %> --project prod --id movies",
|
|
13
|
+
"<%= config.bin %> <%= command.id %> --project prod --limit 5 --offset 10",
|
|
14
|
+
"<%= config.bin %> <%= command.id %> --project prod --all --output ndjson",
|
|
15
|
+
];
|
|
16
|
+
static flags = {
|
|
17
|
+
...BaseCommand.connectionFlags,
|
|
18
|
+
id: Flags.string({
|
|
19
|
+
description: "The index to get. Without it, the command lists the indexes.",
|
|
20
|
+
helpValue: "<index>",
|
|
21
|
+
}),
|
|
22
|
+
...BaseCommand.paginationFlags,
|
|
23
|
+
};
|
|
24
|
+
async run() {
|
|
25
|
+
const { flags } = await this.parse(GetIndexes);
|
|
26
|
+
if (flags.id !== undefined) {
|
|
27
|
+
await this.output(await this.meilisearch.getRawIndex(flags.id));
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
await this.outputList((query) => this.meilisearch.getRawIndexes(query), { limit: flags.limit, offset: flags.offset }, flags.all, nextOffsetQuery);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=indexes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indexes.js","sourceRoot":"","sources":["../../../src/commands/get/indexes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAY,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAAW;IACjD,MAAM,CAAC,GAAG,GAAQ,aAAa,CAAC;IAEhC,MAAM,CAAC,MAAM,GAAG,CAAC,cAAc,EAAE,0BAA0B,CAAC,CAAC;IAE7D,MAAM,CAAC,UAAU,GAAG,CAAC,aAAa,CAAC,CAAC;IAEpC,MAAM,CAAU,WAAW,GAAG,yDAAyD,CAAC;IAExF,MAAM,CAAU,QAAQ,GAAG;QACzB,oDAAoD;QACpD,kEAAkE;QAClE,gEAAgE;QAChE,0EAA0E;QAC1E,0EAA0E;KAC3E,CAAC;IAEF,MAAM,CAAU,KAAK,GAAG;QACtB,GAAG,WAAW,CAAC,eAAe;QAC9B,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC;YACf,WAAW,EAAE,8DAA8D;YAC3E,SAAS,EAAE,SAAS;SACrB,CAAC;QACF,GAAG,WAAW,CAAC,eAAe;KAC/B,CAAC;IAEF,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAC/C,IAAI,KAAK,CAAC,EAAE,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;YAChE,OAAO;QACT,CAAC;QACD,MAAM,IAAI,CAAC,UAAU,CACnB,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,EAChD,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,EAC5C,KAAK,CAAC,GAAG,EACT,eAAe,CAChB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Flags } from "@oclif/core";
|
|
2
|
+
import { BaseCommand } from "../../lib/base-command.js";
|
|
3
|
+
import { fetchKeys } from "../../lib/clients/meilisearch.js";
|
|
4
|
+
import { nextOffsetQuery } from "../../lib/pagination.js";
|
|
5
|
+
export default class GetKeys extends BaseCommand {
|
|
6
|
+
static api = "meilisearch";
|
|
7
|
+
static routes = ["GET /keys", "GET /keys/{key}"];
|
|
8
|
+
static keyActions = ["keys.get"];
|
|
9
|
+
static description = `List the API keys of the instance, or get one with --id.
|
|
10
|
+
|
|
11
|
+
The answer is the API body as it is, so it carries the \`key\` field of every key it returns: credentials that work, on stdout, like any other data.`;
|
|
12
|
+
static examples = [
|
|
13
|
+
"<%= config.bin %> <%= command.id %> --project prod",
|
|
14
|
+
"<%= config.bin %> <%= command.id %> --project prod --output json",
|
|
15
|
+
"<%= config.bin %> <%= command.id %> --project prod --id 52787ccd-48ff-48e5-9c4b-03cd76978a60",
|
|
16
|
+
"<%= config.bin %> <%= command.id %> --project prod --limit 5 --offset 10",
|
|
17
|
+
"<%= config.bin %> <%= command.id %> --project prod --all --output ndjson",
|
|
18
|
+
];
|
|
19
|
+
static flags = {
|
|
20
|
+
...BaseCommand.connectionFlags,
|
|
21
|
+
id: Flags.string({
|
|
22
|
+
description: "The key to get, by its uid or by its key value. Without it, the command lists the keys.",
|
|
23
|
+
helpValue: "<key>",
|
|
24
|
+
}),
|
|
25
|
+
...BaseCommand.paginationFlags,
|
|
26
|
+
};
|
|
27
|
+
async run() {
|
|
28
|
+
const { flags } = await this.parse(GetKeys);
|
|
29
|
+
if (flags.id !== undefined) {
|
|
30
|
+
await this.output(await this.meilisearch.getKey(flags.id));
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
await this.outputList((query) => fetchKeys(this.meilisearch, query), { limit: flags.limit, offset: flags.offset }, flags.all, nextOffsetQuery);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../../../src/commands/get/keys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAY,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,WAAW;IAC9C,MAAM,CAAC,GAAG,GAAQ,aAAa,CAAC;IAEhC,MAAM,CAAC,MAAM,GAAG,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;IAEjD,MAAM,CAAC,UAAU,GAAG,CAAC,UAAU,CAAC,CAAC;IAEjC,MAAM,CAAU,WAAW,GAAG;;qJAEqH,CAAC;IAEpJ,MAAM,CAAU,QAAQ,GAAG;QACzB,oDAAoD;QACpD,kEAAkE;QAClE,8FAA8F;QAC9F,0EAA0E;QAC1E,0EAA0E;KAC3E,CAAC;IAEF,MAAM,CAAU,KAAK,GAAG;QACtB,GAAG,WAAW,CAAC,eAAe;QAC9B,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC;YACf,WAAW,EACT,yFAAyF;YAC3F,SAAS,EAAE,OAAO;SACnB,CAAC;QACF,GAAG,WAAW,CAAC,eAAe;KAC/B,CAAC;IAEF,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC5C,IAAI,KAAK,CAAC,EAAE,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;YAC3D,OAAO;QACT,CAAC;QACD,MAAM,IAAI,CAAC,UAAU,CACnB,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,EAC7C,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,EAC5C,KAAK,CAAC,GAAG,EACT,eAAe,CAChB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Flags } from "@oclif/core";
|
|
2
|
+
import { BaseCommand } from "../../lib/base-command.js";
|
|
3
|
+
import { getApiV2Projects, getApiV2ProjectsById, } from "../../lib/clients/management/generated/sdk.gen.js";
|
|
4
|
+
export default class GetProjects extends BaseCommand {
|
|
5
|
+
static api = "management";
|
|
6
|
+
static routes = ["GET /api/v2/projects", "GET /api/v2/projects/{id}"];
|
|
7
|
+
static description = "List the Meilisearch Cloud projects the token sees, or get one with --id or --project.";
|
|
8
|
+
static examples = [
|
|
9
|
+
"<%= config.bin %> <%= command.id %>",
|
|
10
|
+
"<%= config.bin %> <%= command.id %> --output json",
|
|
11
|
+
"<%= config.bin %> <%= command.id %> --team-id 12",
|
|
12
|
+
"<%= config.bin %> <%= command.id %> --id 343",
|
|
13
|
+
"<%= config.bin %> <%= command.id %> --project prod",
|
|
14
|
+
"<%= config.bin %> <%= command.id %> --output ndjson",
|
|
15
|
+
];
|
|
16
|
+
static flags = {
|
|
17
|
+
...BaseCommand.cloudProjectFlags,
|
|
18
|
+
id: Flags.integer({
|
|
19
|
+
description: "The project to get, or give --project <name> and its cloud.id from the config file. Without either, the command lists the projects.",
|
|
20
|
+
helpValue: "<id>",
|
|
21
|
+
}),
|
|
22
|
+
"team-id": Flags.integer({
|
|
23
|
+
description: "Only the projects of this team. Ignored with --id.",
|
|
24
|
+
helpValue: "<id>",
|
|
25
|
+
}),
|
|
26
|
+
};
|
|
27
|
+
async run() {
|
|
28
|
+
const { flags } = await this.parse(GetProjects);
|
|
29
|
+
if (flags.id === undefined && flags.project === undefined) {
|
|
30
|
+
// One page and no paging flags yet (output.md, "Pagination").
|
|
31
|
+
await this.outputList((query) => getApiV2Projects({ client: this.managementClient, query }), { teamId: flags["team-id"] }, false, () => undefined);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
await this.output(await getApiV2ProjectsById({
|
|
35
|
+
client: this.managementClient,
|
|
36
|
+
path: { id: this.cloudProjectId(flags.id) },
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=projects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../../../src/commands/get/projects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAY,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EACL,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,mDAAmD,CAAC;AAE3D,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,WAAW;IAClD,MAAM,CAAC,GAAG,GAAQ,YAAY,CAAC;IAE/B,MAAM,CAAC,MAAM,GAAG,CAAC,sB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|
|
1
|
+
import { Flags } from "@oclif/core";
|
|
2
|
+
import { BaseCommand } from "../../lib/base-command.js";
|
|
3
|
+
export default class GetSettings extends BaseCommand {
|
|
4
|
+
static api = "meilisearch";
|
|
5
|
+
static routes = ["GET /indexes/{index_uid}/settings"];
|
|
6
|
+
static keyActions = ["settings.get"];
|
|
7
|
+
static description = "Get every setting of an index, each with its current value or its default.";
|
|
8
|
+
static examples = [
|
|
9
|
+
"<%= config.bin %> <%= command.id %> --project prod --index movies",
|
|
10
|
+
"<%= config.bin %> <%= command.id %> --project prod --index movies --output json",
|
|
11
|
+
];
|
|
12
|
+
static flags = {
|
|
13
|
+
...BaseCommand.connectionFlags,
|
|
14
|
+
index: Flags.string({
|
|
15
|
+
required: true,
|
|
16
|
+
description: "The index to read the settings of.",
|
|
17
|
+
helpValue: "<index>",
|
|
18
|
+
}),
|
|
19
|
+
};
|
|
20
|
+
async run() {
|
|
21
|
+
const { flags } = await this.parse(GetSettings);
|
|
22
|
+
await this.output(await this.meilisearch.index(flags.index).getSettings());
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../src/commands/get/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAY,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAElE,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,WAAW;IAClD,MAAM,CAAC,GAAG,GAAQ,aAAa,CAAC;IAEhC,MAAM,CAAC,MAAM,GAAG,CAAC,mCAAmC,CAAC,CAAC;IAEtD,MAAM,CAAC,UAAU,GAAG,CAAC,cAAc,CAAC,CAAC;IAErC,MAAM,CAAU,WAAW,GACzB,4EAA4E,CAAC;IAE/E,MAAM,CAAU,QAAQ,GAAG;QACzB,mEAAmE;QACnE,iFAAiF;KAClF,CAAC;IAEF,MAAM,CAAU,KAAK,GAAG;QACtB,GAAG,WAAW,CAAC,eAAe;QAC9B,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC;YAClB,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,oCAAoC;YACjD,SAAS,EAAE,SAAS;SACrB,CAAC;KACH,CAAC;IAEF,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAChD,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IAC7E,CAAC;CACF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Flags } from "@oclif/core";
|
|
2
|
+
import { BaseCommand } from "../../lib/base-command.js";
|
|
3
|
+
import { fetchStats } from "../../lib/clients/meilisearch.js";
|
|
4
|
+
export default class GetStats extends BaseCommand {
|
|
5
|
+
static api = "meilisearch";
|
|
6
|
+
static routes = ["GET /stats", "GET /indexes/{index_uid}/stats"];
|
|
7
|
+
static keyActions = ["stats.get"];
|
|
8
|
+
static description = "Get the statistics of the whole instance, or those of one index with --index.";
|
|
9
|
+
static examples = [
|
|
10
|
+
"<%= config.bin %> <%= command.id %> --project prod",
|
|
11
|
+
"<%= config.bin %> <%= command.id %> --project prod --output json",
|
|
12
|
+
"<%= config.bin %> <%= command.id %> --project prod --index movies",
|
|
13
|
+
"<%= config.bin %> <%= command.id %> --project prod --index movies --size-format human --show-internal-database-sizes",
|
|
14
|
+
];
|
|
15
|
+
static flags = {
|
|
16
|
+
...BaseCommand.connectionFlags,
|
|
17
|
+
index: Flags.string({
|
|
18
|
+
description: "The index to read the statistics of. Without it, the whole instance.",
|
|
19
|
+
helpValue: "<index>",
|
|
20
|
+
}),
|
|
21
|
+
"show-internal-database-sizes": Flags.boolean({
|
|
22
|
+
description: "Add internalDatabaseSizes to the response, the size of each internal database.",
|
|
23
|
+
}),
|
|
24
|
+
"size-format": Flags.option({
|
|
25
|
+
options: ["raw", "human"],
|
|
26
|
+
description: "How the sizes are written: raw (default), a number of bytes, or human, a string with its unit.",
|
|
27
|
+
})(),
|
|
28
|
+
};
|
|
29
|
+
async run() {
|
|
30
|
+
const { flags } = await this.parse(GetStats);
|
|
31
|
+
await this.output(await fetchStats(this.meilisearch, flags.index, {
|
|
32
|
+
showInternalDatabaseSizes: flags["show-internal-database-sizes"] ? true : undefined,
|
|
33
|
+
sizeFormat: flags["size-format"],
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=stats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats.js","sourceRoot":"","sources":["../../../src/commands/get/stats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAY,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAE9D,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,WAAW;IAC/C,MAAM,CAAC,GAAG,GAAQ,aAAa,CAAC;IAEhC,MAAM,CAAC,MAAM,GAAG,CAAC,YAAY,EAAE,gCAAgC,CAAC,CAAC;IAEjE,MAAM,CAAC,UAAU,GAAG,CAAC,WAAW,CAAC,CAAC;IAElC,MAAM,CAAU,WAAW,GACzB,+EAA+E,CAAC;IAElF,MAAM,CAAU,QAAQ,GAAG;QACzB,oDAAoD;QACpD,kEAAkE;QAClE,mEAAmE;QACnE,sHAAsH;KACvH,CAAC;IAEF,MAAM,CAAU,KAAK,GAAG;QACtB,GAAG,WAAW,CAAC,eAAe;QAC9B,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC;YAClB,WAAW,EAAE,sEAAsE;YACnF,SAAS,EAAE,SAAS;SACrB,CAAC;QACF,8BAA8B,EAAE,KAAK,CAAC,OAAO,CAAC;YAC5C,WAAW,EAAE,gFAAgF;SAC9F,CAAC;QACF,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC;YAC1B,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,CAAU;YAClC,WAAW,EACT,gGAAgG;SACnG,CAAC,EAAE;KACL,CAAC;IAEF,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC7C,MAAM,IAAI,CAAC,MAAM,CACf,MAAM,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,KAAK,EAAE;YAC9C,yBAAyB,EAAE,KAAK,CAAC,8BAA8B,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;YACnF,UAAU,EAAE,KAAK,CAAC,aAAa,CAAC;SACjC,CAAC,CACH,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Flags } from "@oclif/core";
|
|
2
|
+
import { BaseCommand } from "../../lib/base-command.js";
|
|
3
|
+
import { nextFromQuery } from "../../lib/pagination.js";
|
|
4
|
+
import { taskFilterFlags, taskFilterQuery } from "../../lib/task-filters.js";
|
|
5
|
+
export default class GetTasks extends BaseCommand {
|
|
6
|
+
static api = "meilisearch";
|
|
7
|
+
static routes = ["GET /tasks"];
|
|
8
|
+
static keyActions = ["tasks.get"];
|
|
9
|
+
static description = "List the tasks of the instance, narrowed by --ids, --statuses, --types and the other filters of the route.";
|
|
10
|
+
static examples = [
|
|
11
|
+
"<%= config.bin %> <%= command.id %> --project prod",
|
|
12
|
+
"<%= config.bin %> <%= command.id %> --project prod --output json",
|
|
13
|
+
"<%= config.bin %> <%= command.id %> --project prod --ids 42",
|
|
14
|
+
"<%= config.bin %> <%= command.id %> --project prod --statuses failed,canceled --limit 5",
|
|
15
|
+
"<%= config.bin %> <%= command.id %> --project prod --index-ids movies --types documentAdditionOrUpdate",
|
|
16
|
+
"<%= config.bin %> <%= command.id %> --project prod --all --output ndjson",
|
|
17
|
+
];
|
|
18
|
+
static flags = {
|
|
19
|
+
...BaseCommand.connectionFlags,
|
|
20
|
+
...taskFilterFlags,
|
|
21
|
+
reverse: Flags.boolean({
|
|
22
|
+
description: "Return the tasks from the oldest uid up, instead of the newest down.",
|
|
23
|
+
}),
|
|
24
|
+
...BaseCommand.fromPaginationFlags,
|
|
25
|
+
};
|
|
26
|
+
async run() {
|
|
27
|
+
const { flags } = await this.parse(GetTasks);
|
|
28
|
+
const filters = {
|
|
29
|
+
...taskFilterQuery(flags),
|
|
30
|
+
reverse: flags.reverse ? true : undefined,
|
|
31
|
+
};
|
|
32
|
+
await this.outputList((page) => this.meilisearch.tasks.getTasks({ ...filters, ...page }), { limit: flags.limit, from: flags.from }, flags.all, nextFromQuery);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=tasks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../../src/commands/get/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAY,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE7E,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,WAAW;IAC/C,MAAM,CAAC,GAAG,GAAQ,aAAa,CAAC;IAEhC,MAAM,CAAC,MAAM,GAAG,CAAC,YAAY,CAAC,CAAC;IAE/B,MAAM,CAAC,UAAU,GAAG,CAAC,WAAW,CAAC,CAAC;IAElC,MAAM,CAAU,WAAW,GACzB,4GAA4G,CAAC;IAE/G,MAAM,CAAU,QAAQ,GAAG;QACzB,oDAAoD;QACpD,kEAAkE;QAClE,6DAA6D;QAC7D,yFAAyF;QACzF,wGAAwG;QACxG,0EAA0E;KAC3E,CAAC;IAEF,MAAM,CAAU,KAAK,GAAG;QACtB,GAAG,WAAW,CAAC,eAAe;QAC9B,GAAG,eAAe;QAClB,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC;YACrB,WAAW,EAAE,sEAAsE;SACpF,CAAC;QACF,GAAG,WAAW,CAAC,mBAAmB;KACnC,CAAC;IAEF,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC7C,MAAM,OAAO,GAAG;YACd,GAAG,eAAe,CAAC,KAAK,CAAC;YACzB,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;SAC1C,CAAC;QACF,MAAM,IAAI,CAAC,UAAU,CACnB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,GAAG,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC,EAClE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,EACxC,KAAK,CAAC,GAAG,EACT,aAAa,CACd,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseCommand } from "../../lib/base-command.js";
|
|
2
|
+
export default class GetVersion extends BaseCommand {
|
|
3
|
+
static api = "meilisearch";
|
|
4
|
+
static routes = ["GET /version"];
|
|
5
|
+
static keyActions = ["version"];
|
|
6
|
+
static description = "Get the version of the Meilisearch instance, with the commit it was built from.";
|
|
7
|
+
static examples = [
|
|
8
|
+
"<%= config.bin %> <%= command.id %> --project prod",
|
|
9
|
+
"<%= config.bin %> <%= command.id %> --project prod --output json",
|
|
10
|
+
];
|
|
11
|
+
static flags = { ...BaseCommand.connectionFlags };
|
|
12
|
+
async run() {
|
|
13
|
+
await this.output(await this.meilisearch.getVersion());
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/commands/get/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAElE,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAAW;IACjD,MAAM,CAAC,GAAG,GAAQ,aAAa,CAAC;IAEhC,MAAM,CAAC,MAAM,GAAG,CAAC,cAAc,CAAC,CAAC;IAEjC,MAAM,CAAC,UAAU,GAAG,CAAC,SAAS,CAAC,CAAC;IAEhC,MAAM,CAAU,WAAW,GACzB,iFAAiF,CAAC;IAEpF,MAAM,CAAU,QAAQ,GAAG;QACzB,oDAAoD;QACpD,kEAAkE;KACnE,CAAC;IAEF,MAAM,CAAU,KAAK,GAAG,EAAE,GAAG,WAAW,CAAC,eAAe,EAAE,CAAC;IAE3D,KAAK,CAAC,GAAG;QACP,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC,CAAC;IACzD,CAAC;CACF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Flags } from "@oclif/core";
|
|
2
|
+
import { BaseCommand } from "../lib/base-command.js";
|
|
3
|
+
import { readJsonObjectBody } from "../lib/input.js";
|
|
4
|
+
import { asJson } from "../lib/values.js";
|
|
5
|
+
export default class MultiSearch extends BaseCommand {
|
|
6
|
+
static api = "meilisearch";
|
|
7
|
+
static routes = ["POST /multi-search"];
|
|
8
|
+
static keyActions = ["search"];
|
|
9
|
+
static description = "Run several search queries in one request, each naming its index in --queries, returned side by side or merged into one ranked list with --federation.";
|
|
10
|
+
static examples = [
|
|
11
|
+
'<%= config.bin %> <%= command.id %> --project prod --queries \'[{"indexUid":"movies","q":"nosferatu"},{"indexUid":"books","q":"nosferatu"}]\'',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> --project prod --queries \'[{"indexUid":"movies","q":"nosferatu"}]\' --output json',
|
|
13
|
+
'<%= config.bin %> <%= command.id %> --project prod --queries \'[{"indexUid":"movies","q":"horror"},{"indexUid":"books","q":"horror"}]\' --federation \'{"limit":5}\'',
|
|
14
|
+
"cat queries.json | <%= config.bin %> <%= command.id %> --project prod --file -",
|
|
15
|
+
];
|
|
16
|
+
static flags = {
|
|
17
|
+
...BaseCommand.connectionFlags,
|
|
18
|
+
queries: Flags.string({
|
|
19
|
+
description: 'The search queries as a JSON array, each one an index to search and its search parameters: `[{"indexUid":"movies","q":"nosferatu"}]`.',
|
|
20
|
+
helpValue: "<json>",
|
|
21
|
+
}),
|
|
22
|
+
federation: Flags.string({
|
|
23
|
+
description: 'Merge the hits of every query into one ranked list, as JSON: `{}` for the defaults, `{"limit":5}` to narrow it. Without it each query answers its own envelope.',
|
|
24
|
+
helpValue: "<json>",
|
|
25
|
+
}),
|
|
26
|
+
...BaseCommand.bodyInputFlags,
|
|
27
|
+
};
|
|
28
|
+
async run() {
|
|
29
|
+
const { flags } = await this.parse(MultiSearch);
|
|
30
|
+
// The body of --file or --data first, then the flags, which override a field of it (rule 8).
|
|
31
|
+
const params = { ...readJsonObjectBody(flags) };
|
|
32
|
+
if (flags.queries !== undefined)
|
|
33
|
+
params.queries = asJson(flags.queries);
|
|
34
|
+
if (flags.federation !== undefined)
|
|
35
|
+
params.federation = asJson(flags.federation);
|
|
36
|
+
await this.output(await this.meilisearch.multiSearch(params));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=multi-search.js.map
|