@adobe/spacecat-shared-data-access 1.17.2 → 1.18.1
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 +4 -4
- package/src/dto/organization.js +2 -0
- package/src/index.d.ts +10 -0
- package/src/models/organization.js +13 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-data-access-v1.18.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.18.0...@adobe/spacecat-shared-data-access-v1.18.1) (2024-02-24)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **deps:** update external fixes ([#161](https://github.com/adobe/spacecat-shared/issues/161)) ([532976a](https://github.com/adobe/spacecat-shared/commit/532976adecead566dac4659be916cd26f2350ba0))
|
|
7
|
+
|
|
8
|
+
# [@adobe/spacecat-shared-data-access-v1.18.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.17.2...@adobe/spacecat-shared-data-access-v1.18.0) (2024-02-23)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* fulfillable items support on Organization ([#160](https://github.com/adobe/spacecat-shared/issues/160)) ([7bc5bfc](https://github.com/adobe/spacecat-shared/commit/7bc5bfc596171f6007eb759c282681b29b138672))
|
|
14
|
+
|
|
1
15
|
# [@adobe/spacecat-shared-data-access-v1.17.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.17.1...@adobe/spacecat-shared-data-access-v1.17.2) (2024-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": "1.
|
|
3
|
+
"version": "1.18.1",
|
|
4
4
|
"description": "Shared modules of the Spacecat Services - Data Access",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@adobe/spacecat-shared-dynamo": "1.2.5",
|
|
33
33
|
"@adobe/spacecat-shared-utils": "1.2.0",
|
|
34
|
-
"@aws-sdk/client-dynamodb": "3.
|
|
35
|
-
"@aws-sdk/lib-dynamodb": "3.
|
|
34
|
+
"@aws-sdk/client-dynamodb": "3.521.0",
|
|
35
|
+
"@aws-sdk/lib-dynamodb": "3.521.0",
|
|
36
36
|
"@types/joi": "17.2.3",
|
|
37
|
-
"joi": "17.12.
|
|
37
|
+
"joi": "17.12.2",
|
|
38
38
|
"uuid": "9.0.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
package/src/dto/organization.js
CHANGED
|
@@ -30,6 +30,7 @@ export const OrganizationDto = {
|
|
|
30
30
|
updatedAt: organization.getUpdatedAt(),
|
|
31
31
|
GSI1PK: 'ALL_ORGANIZATIONS',
|
|
32
32
|
config: Config.toDynamoItem(organization.getConfig()),
|
|
33
|
+
fulfillableItems: organization.getFulfillableItems(),
|
|
33
34
|
}),
|
|
34
35
|
|
|
35
36
|
/**
|
|
@@ -45,6 +46,7 @@ export const OrganizationDto = {
|
|
|
45
46
|
createdAt: dynamoItem.createdAt,
|
|
46
47
|
updatedAt: dynamoItem.updatedAt,
|
|
47
48
|
config: dynamoItem.config,
|
|
49
|
+
fulfillableItems: dynamoItem.fulfillableItems,
|
|
48
50
|
};
|
|
49
51
|
|
|
50
52
|
return createOrganization(organizationData);
|
package/src/index.d.ts
CHANGED
|
@@ -100,6 +100,10 @@ export interface Config {
|
|
|
100
100
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
export interface FulfillableItems {
|
|
104
|
+
items: string[];
|
|
105
|
+
}
|
|
106
|
+
|
|
103
107
|
/**
|
|
104
108
|
* AuditConfig defines the structure for the overall audit configuration of a site.
|
|
105
109
|
*/
|
|
@@ -313,6 +317,12 @@ export interface Organization {
|
|
|
313
317
|
* @returns {Config} The current audit configuration.
|
|
314
318
|
*/
|
|
315
319
|
getConfig: () => Config;
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Retrieves the fulfillable items object for the org.
|
|
323
|
+
* @returns {FulfillableItems} The current fulfillable items object.
|
|
324
|
+
*/
|
|
325
|
+
getFulfillableItems: () => FulfillableItems;
|
|
316
326
|
}
|
|
317
327
|
|
|
318
328
|
export interface Configuration {
|
|
@@ -29,6 +29,7 @@ const Organization = (data = {}) => {
|
|
|
29
29
|
self.getConfig = () => self.state.config;
|
|
30
30
|
self.getName = () => self.state.name;
|
|
31
31
|
self.getImsOrgId = () => self.state.imsOrgId;
|
|
32
|
+
self.getFulfillableItems = () => self.state.fulfillableItems;
|
|
32
33
|
|
|
33
34
|
/**
|
|
34
35
|
* Updates the IMS Org ID belonging to the organization.
|
|
@@ -77,6 +78,18 @@ const Organization = (data = {}) => {
|
|
|
77
78
|
|
|
78
79
|
return self;
|
|
79
80
|
};
|
|
81
|
+
|
|
82
|
+
self.updateFulfillableItems = (fulfillableItems) => {
|
|
83
|
+
if (!isObject(fulfillableItems)) {
|
|
84
|
+
throw new Error('Fulfillable items object must be provided');
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
self.state.fulfillableItems = fulfillableItems;
|
|
88
|
+
self.touch();
|
|
89
|
+
|
|
90
|
+
return self;
|
|
91
|
+
};
|
|
92
|
+
|
|
80
93
|
return Object.freeze(self);
|
|
81
94
|
};
|
|
82
95
|
|