@stonecrop/stonecrop 0.12.2 → 0.12.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stonecrop/stonecrop",
3
- "version": "0.12.2",
3
+ "version": "0.12.3",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "author": {
@@ -34,7 +34,7 @@
34
34
  "pinia-shared-state": "^1.0.1",
35
35
  "pinia-xstate": "^3.0.0",
36
36
  "xstate": "^5.25.0",
37
- "@stonecrop/schema": "0.12.2"
37
+ "@stonecrop/schema": "0.12.3"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "pinia": "^3.0.4",
@@ -60,9 +60,9 @@
60
60
  "vue-router": "^5.0.6",
61
61
  "vite": "^7.3.2",
62
62
  "vitest": "^4.1.5",
63
- "@stonecrop/atable": "0.12.2",
64
- "stonecrop-rig": "0.7.0",
65
- "@stonecrop/aform": "0.12.2"
63
+ "@stonecrop/aform": "0.12.3",
64
+ "@stonecrop/atable": "0.12.3",
65
+ "stonecrop-rig": "0.7.0"
66
66
  },
67
67
  "description": "Schema-driven framework with XState workflows and HST state management",
68
68
  "publishConfig": {
package/src/stonecrop.ts CHANGED
@@ -396,10 +396,10 @@ export class Stonecrop {
396
396
  throw new Error(`Doctype not found: ${typeof doctype === 'string' ? doctype : doctype.slug}`)
397
397
  }
398
398
 
399
- const record = await this._client.getRecord(resolved, recordId)
399
+ const result = await this._client.getRecord(resolved, recordId)
400
400
 
401
- if (record) {
402
- this.addRecord(resolved, recordId, record)
401
+ if (result?.record) {
402
+ this.addRecord(resolved, recordId, result.record)
403
403
  }
404
404
  }
405
405
 
@@ -593,11 +593,11 @@ export class Stonecrop {
593
593
  )
594
594
  }
595
595
 
596
- const record = await this._client.getRecord({ name: doctype.doctype }, recordId, {
596
+ const result = await this._client.getRecord({ name: doctype.doctype }, recordId, {
597
597
  includeNested: options?.includeNested ?? true,
598
598
  })
599
599
 
600
- if (!record) {
600
+ if (!result?.record) {
601
601
  throw createCodedError(`Record not found: ${doctype.doctype} ${recordId}`, 'RECORD_NOT_FOUND')
602
602
  }
603
603
 
@@ -611,7 +611,7 @@ export class Stonecrop {
611
611
  this.hstStore.set(`${slug}.${recordId}`, {}, 'system')
612
612
  }
613
613
 
614
- for (const [key, value] of Object.entries(record)) {
614
+ for (const [key, value] of Object.entries(result.record)) {
615
615
  this.hstStore.set(`${slug}.${recordId}.${key}`, value, 'system')
616
616
  }
617
617
  }