@statezero/core 0.1.85 → 0.1.87

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.
@@ -22,7 +22,7 @@ export function createTempPk(uuid) {
22
22
  * Register a real PK for a temporary PK
23
23
  */
24
24
  export function setRealPk(uuid, realPk) {
25
- const key = `TempPK_${uuid}`;
25
+ const key = `"TempPK_${uuid}"`;
26
26
  tempPkMap.set(key, realPk);
27
27
  }
28
28
  /**
@@ -16,7 +16,16 @@ export class EventPayload {
16
16
  this.operation_id = data.operation_id;
17
17
  this.pk_field_name = data.pk_field_name;
18
18
  this.configKey = data.configKey;
19
- this.instances = data.instances;
19
+ // Parse PK fields to numbers in instances
20
+ this.instances = data.instances?.map(instance => {
21
+ if (instance && this.pk_field_name && instance[this.pk_field_name] != null) {
22
+ return {
23
+ ...instance,
24
+ [this.pk_field_name]: Number(instance[this.pk_field_name])
25
+ };
26
+ }
27
+ return instance;
28
+ }) || data.instances;
20
29
  this._cachedInstances = null;
21
30
  }
22
31
  get modelClass() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@statezero/core",
3
- "version": "0.1.85",
3
+ "version": "0.1.87",
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",