zinkee 0.1.27 → 0.1.29

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,20 @@
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)",
56
+ "Bash(head -60 CLAUDE.md)",
57
+ "Bash(head -40 AGENTS.md)",
58
+ "Bash(xargs cat)",
59
+ "Bash(./gradlew :api:test --tests \"com.zinkee.api.service.v2.data.DataV2TranslatorTest\" --tests \"com.zinkee.api.service.v2.data.DataV2ServiceTest\" --tests \"com.zinkee.api.domain.model.v2.data.DataV2PatchRecordRequestTest\")",
60
+ "Bash(./gradlew :api:test --tests \"com.zinkee.api.service.v2.data.DataV2ServiceTest\" --tests \"com.zinkee.api.domain.model.v2.data.DataV2PatchRecordRequestTest\")",
61
+ "Bash(./gradlew :api:spotlessApply)",
62
+ "Bash(./gradlew :api:test :api:spotbugsMain spotlessCheck)",
63
+ "Bash(./gradlew :api:spotbugsMain)",
64
+ "Bash(./gradlew spotlessCheck)",
65
+ "Bash(git --no-pager diff --stat)",
66
+ "Bash(git --no-pager diff -- src/commands/records.ts src/api/records.ts)"
54
67
  ]
55
68
  }
56
69
  }
package/dist/index.js CHANGED
@@ -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)];
@@ -10978,40 +10984,14 @@ function buildRecordCreateInput(options) {
10978
10984
  }
10979
10985
  return { values };
10980
10986
  }
10981
- function readRawSetPayload2(raw) {
10982
- const setValue = raw.set;
10983
- if (setValue === void 0) {
10984
- return {};
10985
- }
10986
- if (!isJsonObject6(setValue)) {
10987
- throw new CliError(
10988
- "invalid_cli_usage",
10989
- 'Expected raw update payload field "set" to be a JSON object.'
10990
- );
10991
- }
10992
- return { ...setValue };
10993
- }
10994
- function readRawUnsetPayload2(raw) {
10995
- const unsetValue = raw.unset;
10996
- if (unsetValue === void 0) {
10997
- return [];
10998
- }
10999
- if (!Array.isArray(unsetValue) || !unsetValue.every((value) => typeof value === "string")) {
11000
- throw new CliError(
11001
- "invalid_cli_usage",
11002
- 'Expected raw update payload field "unset" to be an array of strings.'
11003
- );
11004
- }
11005
- return [...unsetValue];
11006
- }
11007
10987
  function buildRecordUpdateInput(options) {
11008
10988
  const raw = readRawObject3(options.raw, options.rawFile);
11009
- const input = { ...raw };
10989
+ const input = {};
11010
10990
  const setPayload = {
11011
- ...readRawSetPayload2(raw),
10991
+ ...raw,
11012
10992
  ...buildAssignmentObject(options.set, options.setJson)
11013
10993
  };
11014
- const unsetPayload = [...readRawUnsetPayload2(raw), ...options.unset ?? []];
10994
+ const unsetPayload = [...options.unset ?? []];
11015
10995
  for (const key of Object.keys(setPayload)) {
11016
10996
  const unsetIndex = unsetPayload.indexOf(key);
11017
10997
  if (unsetIndex !== -1) {
@@ -11092,7 +11072,7 @@ function registerRecordsCommands(program, options = {}) {
11092
11072
  }
11093
11073
  emitTable4(stdout, recordsData);
11094
11074
  });
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(
11075
+ 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(
11096
11076
  "--search <term>",
11097
11077
  "free-text search term (matched across the schema's searchable fields)"
11098
11078
  ).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) {
@@ -11139,7 +11119,7 @@ function registerRecordsCommands(program, options = {}) {
11139
11119
  }
11140
11120
  writeLine10(stdout, `Created record "${getRecordIdentifier(data)}".`);
11141
11121
  });
11142
- records.command("update").description("Update a record").argument("<schema>", "schema uuid or slug", parseUuidOrSlugSelector8).argument("<record>", "record uuid or slug", parseUuidOrSlugSelector8).option("--set <field=value>", "set a string field", collectKeyValueAssignments, []).option("--set-json <field=json>", "set a structured field", collectJsonAssignments, []).option("--unset <field>", "unset a field", collectStringValues, []).option("--raw <json>", "raw JSON object payload").option("--raw-file <path>", "path to a raw JSON object payload").action(async function action(schema, record, commandOptions) {
11122
+ records.command("update").description("Update a record").argument("<schema>", "schema uuid or slug", parseUuidOrSlugSelector8).argument("<record>", "record uuid or slug", parseUuidOrSlugSelector8).option("--set <field=value>", "set a string field", collectKeyValueAssignments, []).option("--set-json <field=json>", "set a structured field", collectJsonAssignments, []).option("--unset <field>", "unset a field", collectStringValues, []).option("--raw <json>", "raw JSON object of fields to set").option("--raw-file <path>", "path to a JSON object of fields to set").action(async function action(schema, record, commandOptions) {
11143
11123
  const { api, schemasApi, json, readOnly } = createRecordsApi(this, filePath);
11144
11124
  ensureWritable7("records update", readOnly, "write");
11145
11125
  const resolvedSchema = await resolveSchemaSelector(schemasApi, schema);