zinkee 0.1.26 → 0.1.28

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.
@@ -50,7 +50,9 @@
50
50
  "Bash(grep -rn \"navigation resources move.*--type\\\\|resourceType\" docs/ README.md)",
51
51
  "Bash(zinkee --version)",
52
52
  "Bash(zinkee --json profiles list)",
53
- "Bash(zinkee displays *)"
53
+ "Bash(zinkee displays *)",
54
+ "Bash(chmod +x /tmp/audit_search.sh)",
55
+ "Bash(/tmp/audit_search.sh)"
54
56
  ]
55
57
  }
56
58
  }
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" --limit 25 --raw '{"search":{"term":"garcia"}}'`,
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": [
@@ -10857,11 +10857,17 @@ function parseJsonKeyValueAssignment(input) {
10857
10857
  throw new InvalidArgumentError8(message);
10858
10858
  }
10859
10859
  }
10860
+ function dedupeStrings(values) {
10861
+ return [...new Set(values)];
10862
+ }
10860
10863
  function collectStringValues(value, previous = []) {
10861
10864
  return [...previous, value];
10862
10865
  }
10866
+ function collectSelectValues(value, previous = []) {
10867
+ return dedupeStrings([...previous, ...parseCommaSeparatedValues(value, "--select")]);
10868
+ }
10863
10869
  function collectSortValues(value, previous = []) {
10864
- return [...previous, ...parseCommaSeparatedValues(value, "--sort")];
10870
+ return dedupeStrings([...previous, ...parseCommaSeparatedValues(value, "--sort")]);
10865
10871
  }
10866
10872
  function collectWhereExpressions(value, previous = []) {
10867
10873
  return [...previous, parseExpressionValue(value)];
@@ -10951,6 +10957,9 @@ function buildRecordQueryInput(options, allowRaw) {
10951
10957
  if (where && where.length > 0) {
10952
10958
  input.where = where;
10953
10959
  }
10960
+ if (options.search !== void 0) {
10961
+ input.search = { term: options.search };
10962
+ }
10954
10963
  if (options.sort && options.sort.length > 0) {
10955
10964
  input.sort = [...options.sort];
10956
10965
  }
@@ -11089,7 +11098,10 @@ function registerRecordsCommands(program, options = {}) {
11089
11098
  }
11090
11099
  emitTable4(stdout, recordsData);
11091
11100
  });
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("--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) {
11101
+ records.command("query").description("Query records for a schema").argument("<schema>", "schema uuid or slug", parseUuidOrSlugSelector8).option("--select <fields>", "field selection (comma-separated, repeatable)", collectSelectValues, []).option("--where <expression>", "where expression", collectWhereExpressions, []).option(
11102
+ "--search <term>",
11103
+ "free-text search term (matched across the schema's searchable fields)"
11104
+ ).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
11105
  const { api, schemasApi, json } = createRecordsApi(this, filePath);
11094
11106
  const resolvedSchema = await resolveSchemaSelector(schemasApi, schema);
11095
11107
  const data = await api.queryRecords(