@adobe/spacecat-shared-data-access 1.46.1 → 1.47.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 +7 -0
- package/package.json +1 -1
- package/src/dto/configuration.js +2 -0
- package/src/index.d.ts +6 -0
- package/src/models/configuration.js +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-data-access-v1.47.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.46.1...@adobe/spacecat-shared-data-access-v1.47.0) (2024-10-07)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* added `slackRoles` access methods to configuration and model ([#393](https://github.com/adobe/spacecat-shared/issues/393)) ([269b911](https://github.com/adobe/spacecat-shared/commit/269b91158ed2977379aee2c53a06db3821b131f5))
|
|
7
|
+
|
|
1
8
|
# [@adobe/spacecat-shared-data-access-v1.46.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.46.0...@adobe/spacecat-shared-data-access-v1.46.1) (2024-10-05)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/dto/configuration.js
CHANGED
|
@@ -27,6 +27,7 @@ export const ConfigurationDto = {
|
|
|
27
27
|
queues: dynamoItem.queues,
|
|
28
28
|
jobs: dynamoItem.jobs,
|
|
29
29
|
handlers: dynamoItem.handlers,
|
|
30
|
+
slackRoles: dynamoItem.slackRoles,
|
|
30
31
|
};
|
|
31
32
|
|
|
32
33
|
return createConfiguration(configurationData);
|
|
@@ -43,5 +44,6 @@ export const ConfigurationDto = {
|
|
|
43
44
|
queues: configuration.getQueues(),
|
|
44
45
|
jobs: configuration.getJobs(),
|
|
45
46
|
handlers: configuration.getHandlers(),
|
|
47
|
+
slackRoles: configuration.getSlackRoles(),
|
|
46
48
|
}),
|
|
47
49
|
};
|
package/src/index.d.ts
CHANGED
|
@@ -421,6 +421,12 @@ export interface Configuration {
|
|
|
421
421
|
*/
|
|
422
422
|
getHandler: (type) => object;
|
|
423
423
|
|
|
424
|
+
/**
|
|
425
|
+
* Retrieves the slack roles configuration.
|
|
426
|
+
* @returns {object} The slack roles configuration.
|
|
427
|
+
*/
|
|
428
|
+
getSlackRoles: () => object;
|
|
429
|
+
|
|
424
430
|
/**
|
|
425
431
|
* Return true if a handler type is enabled for an organization.
|
|
426
432
|
* @param type handler type
|
|
@@ -15,6 +15,7 @@ import Joi from 'joi';
|
|
|
15
15
|
const Configuration = (data = {}) => {
|
|
16
16
|
const state = { ...data };
|
|
17
17
|
const self = { state };
|
|
18
|
+
self.getSlackRoles = () => self.state.slackRoles;
|
|
18
19
|
self.getJobs = () => self.state.jobs;
|
|
19
20
|
self.getVersion = () => self.state.version;
|
|
20
21
|
self.getQueues = () => self.state.queues;
|
|
@@ -24,6 +25,10 @@ const Configuration = (data = {}) => {
|
|
|
24
25
|
state.handlers = state.handlers || {};
|
|
25
26
|
state.handlers[type] = { ...handlerData };
|
|
26
27
|
};
|
|
28
|
+
self.getSlackRoleMembersByRole = (role) => {
|
|
29
|
+
const roles = self.getSlackRoles();
|
|
30
|
+
return roles ? roles[role] : [];
|
|
31
|
+
};
|
|
27
32
|
self.isHandlerEnabledForSite = (type, site) => {
|
|
28
33
|
const handler = state.handlers[type];
|
|
29
34
|
if (!handler) return false;
|