zinkee 0.1.26 → 0.1.27
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/README.md +3 -0
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/api/records.ts +1 -0
- package/src/commands/records.test.ts +40 -0
- package/src/commands/records.ts +9 -0
- package/src/utils/examples.test.ts +6 -0
- package/src/utils/examples.ts +1 -1
package/README.md
CHANGED
|
@@ -266,6 +266,9 @@ zinkee records create projects \
|
|
|
266
266
|
zinkee --json records list projects --limit 50
|
|
267
267
|
zinkee --json records query projects --limit 10 --sort "_id:desc"
|
|
268
268
|
|
|
269
|
+
# Query with a free-text search term (matched across the schema's searchable fields)
|
|
270
|
+
zinkee --json records query projects --where "status in OPEN" --search "garcia" --limit 25
|
|
271
|
+
|
|
269
272
|
# Get
|
|
270
273
|
zinkee --json records get projects <record-uuid>
|
|
271
274
|
|
package/dist/index.js
CHANGED
|
@@ -2661,7 +2661,7 @@ var specificExamples = {
|
|
|
2661
2661
|
},
|
|
2662
2662
|
{
|
|
2663
2663
|
description: "Filter by status with a free-text search term.",
|
|
2664
|
-
command: `zinkee --json records query contacts --select id,contact-name,status --where "status in OPEN" --
|
|
2664
|
+
command: `zinkee --json records query contacts --select id,contact-name,status --where "status in OPEN" --search garcia --limit 25`,
|
|
2665
2665
|
raw: `{
|
|
2666
2666
|
"select": ["id", "contact-name", "status"],
|
|
2667
2667
|
"where": [
|
|
@@ -10951,6 +10951,9 @@ function buildRecordQueryInput(options, allowRaw) {
|
|
|
10951
10951
|
if (where && where.length > 0) {
|
|
10952
10952
|
input.where = where;
|
|
10953
10953
|
}
|
|
10954
|
+
if (options.search !== void 0) {
|
|
10955
|
+
input.search = { term: options.search };
|
|
10956
|
+
}
|
|
10954
10957
|
if (options.sort && options.sort.length > 0) {
|
|
10955
10958
|
input.sort = [...options.sort];
|
|
10956
10959
|
}
|
|
@@ -11089,7 +11092,10 @@ function registerRecordsCommands(program, options = {}) {
|
|
|
11089
11092
|
}
|
|
11090
11093
|
emitTable4(stdout, recordsData);
|
|
11091
11094
|
});
|
|
11092
|
-
records.command("query").description("Query records for a schema").argument("<schema>", "schema uuid or slug", parseUuidOrSlugSelector8).option("--select <fields>", "comma-separated field selection", (value) => parseCommaSeparatedValues(value, "--select")).option("--where <expression>", "where expression", collectWhereExpressions, []).option(
|
|
11095
|
+
records.command("query").description("Query records for a schema").argument("<schema>", "schema uuid or slug", parseUuidOrSlugSelector8).option("--select <fields>", "comma-separated field selection", (value) => parseCommaSeparatedValues(value, "--select")).option("--where <expression>", "where expression", collectWhereExpressions, []).option(
|
|
11096
|
+
"--search <term>",
|
|
11097
|
+
"free-text search term (matched across the schema's searchable fields)"
|
|
11098
|
+
).option("--sort <field:direction>", "sort field(s)", collectSortValues, []).option("--limit <number>", "limit results", parseNonNegativeInteger2).option("--offset <number>", "offset results", parseNonNegativeInteger2).option("--raw <json>", "raw JSON object payload").option("--raw-file <path>", "path to a raw JSON object payload").action(async function action(schema, commandOptions) {
|
|
11093
11099
|
const { api, schemasApi, json } = createRecordsApi(this, filePath);
|
|
11094
11100
|
const resolvedSchema = await resolveSchemaSelector(schemasApi, schema);
|
|
11095
11101
|
const data = await api.queryRecords(
|