@resconet/qp-bridge 1.0.1-alpha.28 → 1.1.0-alpha.29
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/README.md +24 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -66,6 +66,8 @@ await setAnswer("numericQuestion", 42);
|
|
|
66
66
|
- [onSave](#onsave)
|
|
67
67
|
- [fetchEntities](#fetchentities)
|
|
68
68
|
- [getEntityById](#getentitybyid)
|
|
69
|
+
- [createNewEntity](#createnewentity)
|
|
70
|
+
- [saveEntity](#saveentity)
|
|
69
71
|
- [repeatGroup](#repeatgroup)
|
|
70
72
|
- [addNewGroup](#addnewgroup)
|
|
71
73
|
- [deleteGroup](#deletegroup)
|
|
@@ -729,6 +731,28 @@ console.log(contact.attributes.firstname); // Entity firstname attribute
|
|
|
729
731
|
```
|
|
730
732
|
|
|
731
733
|
|
|
734
|
+
### createNewEntity
|
|
735
|
+
|
|
736
|
+
Creates a new entity marker that can be enriched before saving.
|
|
737
|
+
The returned entity is flagged with `isNew` so the host can distinguish new records.
|
|
738
|
+
|
|
739
|
+
| Function | Type |
|
|
740
|
+
| ---------- | ---------- |
|
|
741
|
+
| `createNewEntity` | `() => Record<string, unknown>` |
|
|
742
|
+
|
|
743
|
+
### saveEntity
|
|
744
|
+
|
|
745
|
+
Persists an entity through the bridge. Supports both new and existing entities.
|
|
746
|
+
|
|
747
|
+
| Function | Type |
|
|
748
|
+
| ---------- | ---------- |
|
|
749
|
+
| `saveEntity` | `(entity: Record<string, unknown>) => Promise<void>` |
|
|
750
|
+
|
|
751
|
+
Parameters:
|
|
752
|
+
|
|
753
|
+
* `entity`: - Entity payload; include `isNew` for newly created entities.
|
|
754
|
+
|
|
755
|
+
|
|
732
756
|
### repeatGroup
|
|
733
757
|
|
|
734
758
|
Repeats a specific group within a repeatable group by creating a copy of the group at the specified index.
|