@adobe/spacecat-shared-data-access 1.49.1 → 1.49.2
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,10 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-data-access-v1.49.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.49.1...@adobe/spacecat-shared-data-access-v1.49.2) (2024-10-29)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* configuration version should have numeric type ([e9b9dfc](https://github.com/adobe/spacecat-shared/commit/e9b9dfc6e35f9c1c383ec3941834b18a3179a237))
|
|
7
|
+
|
|
1
8
|
# [@adobe/spacecat-shared-data-access-v1.49.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.49.0...@adobe/spacecat-shared-data-access-v1.49.1) (2024-10-26)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -394,9 +394,9 @@ export interface Organization {
|
|
|
394
394
|
export interface Configuration {
|
|
395
395
|
/**
|
|
396
396
|
* Retrieves the configuration version.
|
|
397
|
-
* @returns {
|
|
397
|
+
* @returns {number} The configuration version.
|
|
398
398
|
*/
|
|
399
|
-
getVersion: () =>
|
|
399
|
+
getVersion: () => number;
|
|
400
400
|
|
|
401
401
|
/**
|
|
402
402
|
* Retrieves the queues configuration.
|
|
@@ -855,7 +855,7 @@ export interface DataAccess {
|
|
|
855
855
|
// configuration functions
|
|
856
856
|
getConfiguration: () => Promise<Readonly<Configuration>>
|
|
857
857
|
getConfigurations: () => Promise<Readonly<Configuration>[]>
|
|
858
|
-
getConfigurationByVersion: (version:
|
|
858
|
+
getConfigurationByVersion: (version: number) => Promise<Readonly<Configuration>>
|
|
859
859
|
updateConfiguration: (configurationData: object) => Promise<Readonly<Configuration>>
|
|
860
860
|
|
|
861
861
|
// key events functions
|
|
@@ -142,7 +142,7 @@ const Configuration = (data = {}) => {
|
|
|
142
142
|
|
|
143
143
|
export const checkConfiguration = (configuration) => {
|
|
144
144
|
const schema = Joi.object({
|
|
145
|
-
version: Joi.
|
|
145
|
+
version: Joi.number().required(),
|
|
146
146
|
queues: Joi.object().required(),
|
|
147
147
|
handlers: Joi.object().pattern(Joi.string(), Joi.object(
|
|
148
148
|
{
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import {
|
|
14
|
-
|
|
14
|
+
isInteger,
|
|
15
15
|
isObject,
|
|
16
16
|
} from '@adobe/spacecat-shared-utils';
|
|
17
17
|
|
|
@@ -88,10 +88,10 @@ export const getConfigurationByVersion = async (
|
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
function incrementVersion(version) {
|
|
91
|
-
if (!
|
|
91
|
+
if (!isInteger(version)) return 1;
|
|
92
92
|
|
|
93
|
-
const versionNumber = parseInt(version
|
|
94
|
-
return
|
|
93
|
+
const versionNumber = parseInt(version, 10);
|
|
94
|
+
return versionNumber + 1;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
/**
|