@statezero/core 0.2.26 → 0.2.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.
@@ -164,7 +164,18 @@ function processFieldPath(fieldPath, value, ModelClass, options = {}) {
164
164
  if (isLastPart) {
165
165
  break;
166
166
  }
167
- // If it's not the last part but it's a regular field,
167
+ // Check if this is a JSON field - if so, we can traverse into it
168
+ const fieldSchema = currentModel.schema?.properties?.[part];
169
+ if (fieldSchema && fieldSchema.format === 'json') {
170
+ // This is a JSON field - add remaining parts as nested key access
171
+ // e.g., json_field__nested__active becomes json_field.nested.active
172
+ const remainingParts = fieldParts.slice(i + 1);
173
+ processedPath.push(...remainingParts);
174
+ // The final field name for schema lookup is still the JSON field itself
175
+ // (remaining parts are just keys within the JSON)
176
+ break;
177
+ }
178
+ // If it's not the last part and not a JSON field,
168
179
  // we can't continue traversal
169
180
  throw new Error(`Field '${part}' in '${fieldPath}' is not a relationship field and cannot be traversed.`);
170
181
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@statezero/core",
3
- "version": "0.2.26",
3
+ "version": "0.2.27",
4
4
  "type": "module",
5
5
  "module": "ESNext",
6
6
  "description": "The type-safe frontend client for StateZero - connect directly to your backend models with zero boilerplate",