@flowrunner/cli 0.1.18-dev.3 → 0.1.19-dev.1

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/cli.js CHANGED
@@ -14508,7 +14508,7 @@ var require_package = __commonJS({
14508
14508
  "package.json"(exports2, module2) {
14509
14509
  module2.exports = {
14510
14510
  name: "@flowrunner/cli",
14511
- version: "0.1.18-dev.3",
14511
+ version: "0.1.19-dev.1",
14512
14512
  publishConfig: {
14513
14513
  access: "public"
14514
14514
  },
@@ -17156,6 +17156,8 @@ function resolveTarget(plan2, segments, fieldValue) {
17156
17156
  let label = plan2.label;
17157
17157
  let found = true;
17158
17158
  for (const segment of segments) {
17159
+ const branch = schema && inspect(schema).branches?.find((candidate) => isIndex(segment) ? inspect(candidate).coreType === "array" : shapeEntries(inspect(candidate).core).some(([name]) => name === segment));
17160
+ schema = branch ?? schema;
17159
17161
  const core = schema ? inspect(schema).core : void 0;
17160
17162
  const coreType = core ? inspect(schema).coreType : void 0;
17161
17163
  value = value == null ? void 0 : value[segment];
@@ -17194,7 +17196,7 @@ function toFieldIssue(plan2, issue, fieldValue) {
17194
17196
  if (isAuthored(issue)) {
17195
17197
  return { path: path23, code, message: issue.message };
17196
17198
  }
17197
- if (code !== "invalid_union" && target.schema && inspect(target.schema).branches) {
17199
+ if (code === "invalid_format" && target.schema && inspect(target.schema).branches) {
17198
17200
  const combined = unionPhrases(target.schema, target.value);
17199
17201
  if (combined.length > 1) {
17200
17202
  return { path: path23, code: "invalid_union", message: `\xAB${target.label}\xBB must be ${combined.join(", or ")}` };
@@ -17224,6 +17226,9 @@ function toFieldIssue(plan2, issue, fieldValue) {
17224
17226
  return described ? { path: path23, code, message: `\xAB${target.label}\xBB is invalid \u2014 ${described.replace(/^Expects /, "expects ")}` } : { path: path23, code, message: `\xAB${target.label}\xBB has an invalid format` };
17225
17227
  }
17226
17228
  if (code === "invalid_union") {
17229
+ if (segments.length && target.found && target.value == null) {
17230
+ return { path: path23, code, message: requiredMessage(named) };
17231
+ }
17227
17232
  const combined = unionIssue(plan2, issue, target.schema, target.value, fieldValue);
17228
17233
  if (combined) {
17229
17234
  return combined.path ? combined : { path: path23, code, message: `\xAB${target.label}\xBB ${combined.message}` };