@adobe/spacecat-shared-content-client 1.1.9 → 1.1.11

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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [@adobe/spacecat-shared-content-client-v1.1.11](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-content-client-v1.1.10...@adobe/spacecat-shared-content-client-v1.1.11) (2024-10-15)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * latest helix sdk ([1b7f29e](https://github.com/adobe/spacecat-shared/commit/1b7f29e07de02d15791a986761056febf8006b86))
7
+
8
+ # [@adobe/spacecat-shared-content-client-v1.1.10](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-content-client-v1.1.9...@adobe/spacecat-shared-content-client-v1.1.10) (2024-10-12)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** update external fixes ([#402](https://github.com/adobe/spacecat-shared/issues/402)) ([9a5acba](https://github.com/adobe/spacecat-shared/commit/9a5acba2773b83ce26f4ac97e04d8ad24b00d8ce))
14
+
1
15
  # [@adobe/spacecat-shared-content-client-v1.1.9](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-content-client-v1.1.8...@adobe/spacecat-shared-content-client-v1.1.9) (2024-10-10)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-content-client",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
4
4
  "description": "Shared modules of the Spacecat Services - Content Client",
5
5
  "type": "module",
6
6
  "engines": {
@@ -47,6 +47,6 @@
47
47
  "nock": "13.5.4",
48
48
  "sinon": "19.0.2",
49
49
  "sinon-chai": "4.0.0",
50
- "typescript": "5.6.2"
50
+ "typescript": "5.6.3"
51
51
  }
52
52
  }
@@ -236,7 +236,8 @@ export default class ContentClient {
236
236
  this.log.info(`Getting page metadata for ${this.site.getId()} and path ${path}`);
237
237
 
238
238
  const docPath = this.#resolveDocPath(path);
239
- const metadata = await this.rawClient.getPageMetadata(docPath);
239
+ const document = await this.rawClient.read(docPath);
240
+ const metadata = document.getMetadata();
240
241
 
241
242
  this.#logDuration('getPageMetadata', startTime);
242
243
 
@@ -255,7 +256,8 @@ export default class ContentClient {
255
256
  this.log.info(`Updating page metadata for ${this.site.getId()} and path ${path}`);
256
257
 
257
258
  const docPath = this.#resolveDocPath(path);
258
- const originalMetadata = await this.getPageMetadata(path);
259
+ const document = await this.rawClient.read(docPath);
260
+ const originalMetadata = document.getMetadata();
259
261
 
260
262
  let mergedMetadata;
261
263
  if (overwrite) {
@@ -264,9 +266,12 @@ export default class ContentClient {
264
266
  mergedMetadata = new Map([...metadata, ...originalMetadata]);
265
267
  }
266
268
 
267
- const response = await this.rawClient.updatePageMetadata(docPath, mergedMetadata);
268
- if (response.status !== 200) {
269
- throw new Error(`Failed to update metadata for path ${path}`);
269
+ const response = await document.updateMetadata(mergedMetadata);
270
+ if (response?.status !== 200) {
271
+ const saveResponse = await this.rawClient.save(document);
272
+ if (saveResponse.status !== 200) {
273
+ throw new Error(`Failed to update metadata for path ${path}`);
274
+ }
270
275
  }
271
276
 
272
277
  this.#logDuration('updatePageMetadata', startTime);