@adobe/spacecat-shared-content-client 1.1.6 → 1.1.7
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 +7 -0
- package/package.json +2 -1
- package/src/clients/content-client.js +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-content-client-v1.1.7](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-content-client-v1.1.6...@adobe/spacecat-shared-content-client-v1.1.7) (2024-10-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* content client should use the hlxConfig ([8e74827](https://github.com/adobe/spacecat-shared/commit/8e74827613421828eaef29cf1372d329433526cc))
|
|
7
|
+
|
|
1
8
|
# [@adobe/spacecat-shared-content-client-v1.1.6](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-content-client-v1.1.5...@adobe/spacecat-shared-content-client-v1.1.6) (2024-10-01)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/spacecat-shared-content-client",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.7",
|
|
4
4
|
"description": "Shared modules of the Spacecat Services - Content Client",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"graph-data-structure": "4.0.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
+
"@adobe/spacecat-shared-data-access": "1.45.5",
|
|
43
44
|
"chai": "5.1.1",
|
|
44
45
|
"chai-as-promised": "8.0.0",
|
|
45
46
|
"esmock": "2.6.7",
|
|
@@ -58,7 +58,7 @@ const validateSite = (site) => {
|
|
|
58
58
|
throw new Error('Site is required');
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
const contentSource = site.
|
|
61
|
+
const contentSource = site.getHlxConfig()?.content?.source;
|
|
62
62
|
if (!isObject(contentSource)) {
|
|
63
63
|
throw new Error('Site must have a valid content source');
|
|
64
64
|
}
|
|
@@ -181,7 +181,7 @@ export default class ContentClient {
|
|
|
181
181
|
const { log = console, env } = context;
|
|
182
182
|
|
|
183
183
|
const config = {};
|
|
184
|
-
const contentSourceType = site.
|
|
184
|
+
const contentSourceType = site.getHlxConfig()?.content?.source?.type;
|
|
185
185
|
const envMapping = SUPPORTED_CONTENT_SOURCES.get(contentSourceType);
|
|
186
186
|
|
|
187
187
|
if (envMapping) {
|
|
@@ -195,11 +195,11 @@ export default class ContentClient {
|
|
|
195
195
|
|
|
196
196
|
constructor(config, site, log) {
|
|
197
197
|
validateSite(site);
|
|
198
|
-
validateConfiguration(config, site.
|
|
198
|
+
validateConfiguration(config, site.getHlxConfig()?.content.source?.type);
|
|
199
199
|
|
|
200
200
|
this.log = log;
|
|
201
201
|
this.config = config;
|
|
202
|
-
this.contentSource = site.
|
|
202
|
+
this.contentSource = site.getHlxConfig()?.content?.source;
|
|
203
203
|
this.site = site;
|
|
204
204
|
this.rawClient = null;
|
|
205
205
|
}
|