@graph8/sdk 0.13.0 → 0.13.1

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/dist/react.mjs CHANGED
@@ -1319,12 +1319,12 @@ var createObjectsClient = (apiKey, apiUrl) => {
1319
1319
  * Values are versioned rather than overwritten, so the previous value stays
1320
1320
  * readable through `history`.
1321
1321
  */
1322
- async updateRecord(objectSlug, recordId, values) {
1322
+ async updateRecord(objectSlug, recordId, values, options) {
1323
1323
  const resp = await request(
1324
1324
  baseUrl,
1325
1325
  `/api/v1/objects/${encode(objectSlug)}/records/${encode(recordId)}`,
1326
1326
  apiKey,
1327
- { method: "PATCH", body: { values } }
1327
+ { method: "PATCH", body: { values, ...options?.expectedRevision === void 0 ? {} : { expected_revision: options.expectedRevision } } }
1328
1328
  );
1329
1329
  return resp.data ?? resp;
1330
1330
  },
@@ -1341,6 +1341,16 @@ var createObjectsClient = (apiKey, apiUrl) => {
1341
1341
  );
1342
1342
  return resp.data ?? resp;
1343
1343
  },
1344
+ /** Restore archived values under current constraints. Conflicts leave the record archived. */
1345
+ async restoreRecord(objectSlug, recordId) {
1346
+ const resp = await request(
1347
+ baseUrl,
1348
+ `/api/v1/objects/${encode(objectSlug)}/records/${encode(recordId)}/restore`,
1349
+ apiKey,
1350
+ { method: "POST" }
1351
+ );
1352
+ return resp.data ?? resp;
1353
+ },
1344
1354
  /**
1345
1355
  * A record's value timeline, newest first. An entry whose `active_until` is
1346
1356
  * null is the value currently in force.