Skip to content

Commit 56617b8

Browse files
Adding updated docs
1 parent 5a3c34e commit 56617b8

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

docs/_sidebar.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@
6262
- [getUserOrganizations](api/woqlClient.js?id=getUserOrganizations)
6363
- [userOrganizations](api/woqlClient.js?id=userOrganizations)
6464
- [getDiff](api/woqlClient.js?id=getDiff)
65+
- [getVersionObjectDiff](api/woqlClient.js?id=getVersionObjectDiff)
66+
- [getVersionDiff](api/woqlClient.js?id=getVersionDiff)
6567
- [patch](api/woqlClient.js?id=patch)
6668
- [WOQL](api/woql.js?id=WOQL)
6769
- [eval](api/woql.js?id=eval)

docs/api/woqlclient.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,6 +1137,48 @@ const diff = await client.getDiff(
11371137
);
11381138
```
11391139
1140+
## getVersionObjectDiff
1141+
##### woqlClient.getVersionObjectDiff(id, beforeVersion, after) ⇒ <code>Promise</code>
1142+
Get the patch of difference between two documents.
1143+
1144+
**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected.
1145+
1146+
| Param | Type | Description |
1147+
| --- | --- | --- |
1148+
| id | <code>string</code> | The object id to be diffed |
1149+
| beforeVersion | <code>string</code> | The version from which to compare the object |
1150+
| after | <code>object</code> | The updated state of JSON document |
1151+
1152+
**Example**
1153+
```javascript
1154+
const diff = await client.getVersionObjectDiff(
1155+
"Person/Jane",
1156+
"branch:a73ssscfx0kke7z76083cgswszdxy6l",
1157+
{ "@id": "Person/Jane", "@type": "Person", name: "Janine" }
1158+
);
1159+
```
1160+
1161+
## getVersionDiff
1162+
##### woqlClient.getVersionDiff(id, beforeVersion, afterVersion) ⇒ <code>Promise</code>
1163+
Get the patch of difference between two documents.
1164+
1165+
**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected.
1166+
1167+
| Param | Type | Description |
1168+
| --- | --- | --- |
1169+
| id | <code>string</code> | The object id to be diffed |
1170+
| beforeVersion | <code>string</code> | The version from which to compare the object |
1171+
| afterVersion | <code>object</code> | The version to which to compare the object |
1172+
1173+
**Example**
1174+
```javascript
1175+
const diff = await client.getVersionDiff(
1176+
"Person/Jane",
1177+
"branch:a73ssscfx0kke7z76083cgswszdxy6l",
1178+
"branch:73rqpooz65kbsheuno5dsayh71x7wf4"
1179+
);
1180+
```
1181+
11401182
## patch
11411183
##### woqlClient.patch(before, patch) ⇒ <code>Promise</code>
11421184
Patch the difference between two documents.

0 commit comments

Comments
 (0)