@adobe/spacecat-shared-data-access 1.51.0 → 1.53.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 +14 -0
- package/package.json +1 -1
- package/src/models/api-key/api-key.js +3 -2
- package/src/models/site/config.js +13 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-data-access-v1.53.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.52.0...@adobe/spacecat-shared-data-access-v1.53.0) (2024-11-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* Introduce configurable grouping patterns ([#439](https://github.com/adobe/spacecat-shared/issues/439)) ([bd2ad3b](https://github.com/adobe/spacecat-shared/commit/bd2ad3b39379f66ccdb8e20bfd4ef013c6230f79))
|
|
7
|
+
|
|
8
|
+
# [@adobe/spacecat-shared-data-access-v1.52.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.51.0...@adobe/spacecat-shared-data-access-v1.52.0) (2024-11-13)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* SITES-26835 [Import Assistant] Introduce imports.assistant api key scope ([#438](https://github.com/adobe/spacecat-shared/issues/438)) ([0cb0d35](https://github.com/adobe/spacecat-shared/commit/0cb0d357b11be588ab1bc00ed71745cc6052a321))
|
|
14
|
+
|
|
1
15
|
# [@adobe/spacecat-shared-data-access-v1.51.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.50.1...@adobe/spacecat-shared-data-access-v1.51.0) (2024-11-12)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -28,6 +28,7 @@ const scopeNames = [
|
|
|
28
28
|
'imports.delete',
|
|
29
29
|
'imports.read_all',
|
|
30
30
|
'imports.all_domains',
|
|
31
|
+
'imports.assistant',
|
|
31
32
|
];
|
|
32
33
|
|
|
33
34
|
const ApiKey = (data) => {
|
|
@@ -121,8 +122,8 @@ const ApiKey = (data) => {
|
|
|
121
122
|
* @param {Object} apiKeyData - The data for the ApiKey object.
|
|
122
123
|
* @returns {ApiKey} The new ApiKey object.
|
|
123
124
|
*/
|
|
124
|
-
export const createApiKey = (
|
|
125
|
-
const newState = { ...
|
|
125
|
+
export const createApiKey = (apiKeyData) => {
|
|
126
|
+
const newState = { ...apiKeyData };
|
|
126
127
|
|
|
127
128
|
if (!hasText(newState.hashedApiKey)) {
|
|
128
129
|
throw new Error(`Invalid Hashed API Key: ${newState.hashedApiKey}`);
|
|
@@ -31,6 +31,10 @@ export const configSchema = Joi.object({
|
|
|
31
31
|
targetURL: Joi.string().optional(),
|
|
32
32
|
})).optional(),
|
|
33
33
|
includedURLs: Joi.array().items(Joi.string()),
|
|
34
|
+
groupedURLs: Joi.array().items(Joi.object({
|
|
35
|
+
name: Joi.string(),
|
|
36
|
+
pattern: Joi.string(),
|
|
37
|
+
})).optional(),
|
|
34
38
|
}).unknown(true)).unknown(true),
|
|
35
39
|
}).unknown(true);
|
|
36
40
|
|
|
@@ -66,6 +70,7 @@ export const Config = (data = {}) => {
|
|
|
66
70
|
self.getManualOverwrites = (type) => state?.handlers?.[type]?.manualOverwrites;
|
|
67
71
|
self.getFixedURLs = (type) => state?.handlers?.[type]?.fixedURLs;
|
|
68
72
|
self.getIncludedURLs = (type) => state?.handlers?.[type]?.includedURLs;
|
|
73
|
+
self.getGroupedURLs = (type) => state?.handlers?.[type]?.groupedURLs;
|
|
69
74
|
|
|
70
75
|
self.updateSlackConfig = (channel, workspace, invitedUserCount) => {
|
|
71
76
|
state.slack = {
|
|
@@ -104,6 +109,14 @@ export const Config = (data = {}) => {
|
|
|
104
109
|
state.handlers[type].fixedURLs = fixedURLs;
|
|
105
110
|
};
|
|
106
111
|
|
|
112
|
+
self.updateGroupedURLs = (type, groupedURLs) => {
|
|
113
|
+
state.handlers = state.handlers || {};
|
|
114
|
+
state.handlers[type] = state.handlers[type] || {};
|
|
115
|
+
state.handlers[type].groupedURLs = groupedURLs;
|
|
116
|
+
|
|
117
|
+
validateConfiguration(state);
|
|
118
|
+
};
|
|
119
|
+
|
|
107
120
|
return Object.freeze(self);
|
|
108
121
|
};
|
|
109
122
|
|