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