@eudiplo/sdk-core 5.1.0-main.c9c18f7 → 5.1.0-main.cb93d24

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/index.js CHANGED
@@ -2087,13 +2087,23 @@ async function submitDcApiResponse(options) {
2087
2087
 
2088
2088
  // src/config/derive.ts
2089
2089
  var JSON_SCHEMA_DRAFT_2020_12 = "https://json-schema.org/draft/2020-12/schema";
2090
- function resolveChildPath(parentPath, childPath) {
2090
+ function resolveChildPath(parentPath, parentType, childPath) {
2091
2091
  if (childPath.length >= parentPath.length) {
2092
2092
  const startsWithParent = parentPath.every((seg, i) => seg === childPath[i]);
2093
2093
  if (startsWithParent) {
2094
2094
  return childPath;
2095
2095
  }
2096
2096
  }
2097
+ if (parentType === "array" && childPath.length > 0) {
2098
+ if (childPath[0] === null) {
2099
+ throw new Error(
2100
+ "Relative child paths under array parents must not start with null. Use ['field'] instead of [null, 'field']."
2101
+ );
2102
+ }
2103
+ if (typeof childPath[0] !== "number") {
2104
+ return [...parentPath, null, ...childPath];
2105
+ }
2106
+ }
2097
2107
  return [...parentPath, ...childPath];
2098
2108
  }
2099
2109
  function flattenFields(fields) {
@@ -2104,7 +2114,7 @@ function flattenFields(fields) {
2104
2114
  if (children && children.length > 0) {
2105
2115
  const resolvedChildren = children.map((child) => ({
2106
2116
  ...child,
2107
- path: resolveChildPath(field.path, child.path)
2117
+ path: resolveChildPath(field.path, field.type, child.path)
2108
2118
  }));
2109
2119
  result.push(...flattenFields(resolvedChildren));
2110
2120
  }
package/dist/index.mjs CHANGED
@@ -2085,13 +2085,23 @@ async function submitDcApiResponse(options) {
2085
2085
 
2086
2086
  // src/config/derive.ts
2087
2087
  var JSON_SCHEMA_DRAFT_2020_12 = "https://json-schema.org/draft/2020-12/schema";
2088
- function resolveChildPath(parentPath, childPath) {
2088
+ function resolveChildPath(parentPath, parentType, childPath) {
2089
2089
  if (childPath.length >= parentPath.length) {
2090
2090
  const startsWithParent = parentPath.every((seg, i) => seg === childPath[i]);
2091
2091
  if (startsWithParent) {
2092
2092
  return childPath;
2093
2093
  }
2094
2094
  }
2095
+ if (parentType === "array" && childPath.length > 0) {
2096
+ if (childPath[0] === null) {
2097
+ throw new Error(
2098
+ "Relative child paths under array parents must not start with null. Use ['field'] instead of [null, 'field']."
2099
+ );
2100
+ }
2101
+ if (typeof childPath[0] !== "number") {
2102
+ return [...parentPath, null, ...childPath];
2103
+ }
2104
+ }
2095
2105
  return [...parentPath, ...childPath];
2096
2106
  }
2097
2107
  function flattenFields(fields) {
@@ -2102,7 +2112,7 @@ function flattenFields(fields) {
2102
2112
  if (children && children.length > 0) {
2103
2113
  const resolvedChildren = children.map((child) => ({
2104
2114
  ...child,
2105
- path: resolveChildPath(field.path, child.path)
2115
+ path: resolveChildPath(field.path, field.type, child.path)
2106
2116
  }));
2107
2117
  result.push(...flattenFields(resolvedChildren));
2108
2118
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eudiplo/sdk-core",
3
- "version": "5.1.0-main.c9c18f7",
3
+ "version": "5.1.0-main.cb93d24",
4
4
  "description": "Framework-agnostic EUDIPLO SDK for demos and integrations",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",