@adobe/spacecat-shared-data-access 2.3.0 → 2.4.0

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-data-access-v2.4.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v2.3.1...@adobe/spacecat-shared-data-access-v2.4.0) (2025-02-17)
2
+
3
+
4
+ ### Features
5
+
6
+ * introduce fetch config for site to use custom headers ([#585](https://github.com/adobe/spacecat-shared/issues/585)) ([10a2892](https://github.com/adobe/spacecat-shared/commit/10a28928c3946ea05c4644f16971ccff8d43e994))
7
+
8
+ # [@adobe/spacecat-shared-data-access-v2.3.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v2.3.0...@adobe/spacecat-shared-data-access-v2.3.1) (2025-02-17)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * add aem_ams delivery type ([#601](https://github.com/adobe/spacecat-shared/issues/601)) ([a6a08cf](https://github.com/adobe/spacecat-shared/commit/a6a08cf7c13678a682e564447b6662db5970ea06))
14
+
1
15
  # [@adobe/spacecat-shared-data-access-v2.3.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v2.2.2...@adobe/spacecat-shared-data-access-v2.3.0) (2025-02-17)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-data-access",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
4
4
  "description": "Shared modules of the Spacecat Services - Data Access",
5
5
  "type": "module",
6
6
  "engines": {
@@ -19,6 +19,9 @@ export const configSchema = Joi.object({
19
19
  invitedUserCount: Joi.number().integer().min(0),
20
20
  }),
21
21
  imports: Joi.array().items(Joi.object({ type: Joi.string() }).unknown(true)),
22
+ fetchConfig: Joi.object({
23
+ headers: Joi.object().pattern(Joi.string(), Joi.string()),
24
+ }).optional(),
22
25
  handlers: Joi.object().pattern(Joi.string(), Joi.object({
23
26
  mentions: Joi.object().pattern(Joi.string(), Joi.array().items(Joi.string())),
24
27
  excludedURLs: Joi.array().items(Joi.string()),
@@ -40,8 +43,7 @@ export const configSchema = Joi.object({
40
43
 
41
44
  export const DEFAULT_CONFIG = {
42
45
  slack: {},
43
- handlers: {
44
- },
46
+ handlers: {},
45
47
  };
46
48
 
47
49
  // Function to validate incoming configuration
@@ -71,6 +73,7 @@ export const Config = (data = {}) => {
71
73
  self.getFixedURLs = (type) => state?.handlers?.[type]?.fixedURLs;
72
74
  self.getIncludedURLs = (type) => state?.handlers?.[type]?.includedURLs;
73
75
  self.getGroupedURLs = (type) => state?.handlers?.[type]?.groupedURLs;
76
+ self.getFetchConfig = () => state?.fetchConfig;
74
77
 
75
78
  self.updateSlackConfig = (channel, workspace, invitedUserCount) => {
76
79
  state.slack = {
@@ -117,6 +120,10 @@ export const Config = (data = {}) => {
117
120
  validateConfiguration(state);
118
121
  };
119
122
 
123
+ self.updateFetchConfig = (fetchConfig) => {
124
+ state.fetchConfig = fetchConfig;
125
+ };
126
+
120
127
  return Object.freeze(self);
121
128
  };
122
129
 
@@ -126,4 +133,5 @@ Config.toDynamoItem = (config) => ({
126
133
  slack: config.getSlackConfig(),
127
134
  handlers: config.getHandlers(),
128
135
  imports: config.getImports(),
136
+ fetchConfig: config.getFetchConfig(),
129
137
  });
@@ -21,6 +21,7 @@ class Site extends BaseModel {
21
21
  static DELIVERY_TYPES = {
22
22
  AEM_CS: 'aem_cs',
23
23
  AEM_EDGE: 'aem_edge',
24
+ AEM_AMS: 'aem_ams',
24
25
  OTHER: 'other',
25
26
  };
26
27