Skip to content

Commit 1c55b81

Browse files
merge main
2 parents fd90995 + 101e332 commit 1c55b81

File tree

12 files changed

+336
-24
lines changed

12 files changed

+336
-24
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ $ npm install @adobe/spacecat-shared-http-utils
1414
$ npm install @adobe/spacecat-shared-utils
1515
```
1616

17-
## Usage
17+
## Usage
1818
See the [API documentation](docs/API.md).

packages/spacecat-shared-data-access/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## [@adobe/spacecat-shared-data-access-v3.29.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v3.28.0...@adobe/spacecat-shared-data-access-v3.29.0) (2026-03-23)
2+
3+
### Features
4+
5+
* **page-citability:** add UPDATED_BY_PRERENDER and UPDATED_BY_PAGE_CITABILITY constants ([#1460](https://github.com/adobe/spacecat-shared/issues/1460)) ([dcdf2b0](https://github.com/adobe/spacecat-shared/commit/dcdf2b0af9b9426631e9363949027a267ce7d015))
6+
7+
## [@adobe/spacecat-shared-data-access-v3.28.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v3.27.1...@adobe/spacecat-shared-data-access-v3.28.0) (2026-03-23)
8+
9+
### Features
10+
11+
* add commerceLlmoConfig to site configuration schema ([#1459](https://github.com/adobe/spacecat-shared/issues/1459)) ([8dd4bbf](https://github.com/adobe/spacecat-shared/commit/8dd4bbfda08343b37852d627c8528016358115c9))
12+
113
## [@adobe/spacecat-shared-data-access-v3.27.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v3.27.0...@adobe/spacecat-shared-data-access-v3.27.1) (2026-03-21)
214

315
### Bug Fixes

packages/spacecat-shared-data-access/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@adobe/spacecat-shared-data-access",
3-
"version": "3.27.1",
3+
"version": "3.29.0",
44
"description": "Shared modules of the Spacecat Services - Data Access",
55
"type": "module",
66
"engines": {

packages/spacecat-shared-data-access/src/models/page-citability/page-citability.model.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ class PageCitability extends BaseModel {
2323

2424
static DEFAULT_UPDATED_BY = 'spacecat';
2525

26+
static UPDATED_BY_PRERENDER = 'prerender';
27+
28+
static UPDATED_BY_PAGE_CITABILITY = 'page-citability';
29+
2630
// add any custom methods or overrides here
2731
}
2832

packages/spacecat-shared-data-access/src/models/site/config.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,18 @@ export const configSchema = Joi.object({
387387
lastProfile: Joi.string().optional(),
388388
lastStartTime: Joi.number().optional(),
389389
}).optional(),
390+
commerceLlmoConfig: Joi.object().pattern(
391+
Joi.string(),
392+
Joi.object({
393+
environmentId: Joi.string().optional(),
394+
websiteCode: Joi.string().optional(),
395+
storeCode: Joi.string().optional(),
396+
storeViewCode: Joi.string().optional(),
397+
hostName: Joi.string().optional(),
398+
magentoEndpoint: Joi.string().uri().optional(),
399+
magentoAPIKey: Joi.string().optional(),
400+
}),
401+
).optional(),
390402
contentAiConfig: Joi.object({
391403
index: Joi.string().optional(),
392404
}).optional(),
@@ -499,6 +511,7 @@ export const Config = (data = {}) => {
499511
self.getTokowakaConfig = () => state?.tokowakaConfig;
500512
self.getEdgeOptimizeConfig = () => state?.edgeOptimizeConfig;
501513
self.getOnboardConfig = () => state?.onboardConfig;
514+
self.getCommerceLlmoConfig = () => state?.commerceLlmoConfig;
502515
self.updateSlackConfig = (channel, workspace, invitedUserCount) => {
503516
state.slack = {
504517
channel,
@@ -820,7 +833,11 @@ export const Config = (data = {}) => {
820833
};
821834

822835
self.updateOnboardConfig = (onboardConfig) => {
823-
state.onboardConfig = { ...(state.onboardConfig || {}), ...onboardConfig };
836+
state.onboardConfig = onboardConfig;
837+
};
838+
839+
self.updateCommerceLlmoConfig = (commerceLlmoConfig) => {
840+
state.commerceLlmoConfig = commerceLlmoConfig;
824841
};
825842

826843
return Object.freeze(self);
@@ -841,4 +858,5 @@ Config.toDynamoItem = (config) => ({
841858
tokowakaConfig: config.getTokowakaConfig(),
842859
edgeOptimizeConfig: config.getEdgeOptimizeConfig(),
843860
onboardConfig: config.getOnboardConfig(),
861+
commerceLlmoConfig: config.getCommerceLlmoConfig?.(),
844862
});

packages/spacecat-shared-data-access/test/unit/models/page-citability/page-citability.collection.test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,12 @@ describe('PageCitabilityCollection', () => {
6565
expect(model).to.be.an('object');
6666
});
6767
});
68+
69+
describe('static constants', () => {
70+
it('exposes updatedBy source constants', () => {
71+
expect(PageCitability.DEFAULT_UPDATED_BY).to.equal('spacecat');
72+
expect(PageCitability.UPDATED_BY_PRERENDER).to.equal('prerender');
73+
expect(PageCitability.UPDATED_BY_PAGE_CITABILITY).to.equal('page-citability');
74+
});
75+
});
6876
});

packages/spacecat-shared-data-access/test/unit/models/site/config.test.js

Lines changed: 82 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2781,28 +2781,17 @@ describe('Config Tests', () => {
27812781
});
27822782

27832783
it('updates onboard config', () => {
2784-
const config = Config();
2785-
config.updateOnboardConfig({ lastProfile: 'paid' });
2786-
expect(config.getOnboardConfig()).to.deep.equal({ lastProfile: 'paid' });
2787-
});
2788-
2789-
it('merges lastStartTime into existing onboard config', () => {
27902784
const startTime = Date.now();
2791-
const config = Config({ onboardConfig: { lastProfile: 'paid' } });
2792-
config.updateOnboardConfig({ lastStartTime: startTime });
2785+
const config = Config();
2786+
config.updateOnboardConfig({ lastProfile: 'paid', lastStartTime: startTime });
27932787
expect(config.getOnboardConfig()).to.deep.equal({ lastProfile: 'paid', lastStartTime: startTime });
27942788
});
27952789

2796-
it('merges into existing onboard config', () => {
2797-
const config = Config({ onboardConfig: { lastProfile: 'demo' } });
2798-
config.updateOnboardConfig({ lastProfile: 'paid' });
2799-
expect(config.getOnboardConfig()).to.deep.equal({ lastProfile: 'paid' });
2800-
});
2801-
2802-
it('stores only lastStartTime when lastProfile is absent', () => {
2790+
it('overwrites existing onboard config', () => {
28032791
const startTime = Date.now();
2804-
const config = Config({ onboardConfig: { lastStartTime: startTime } });
2805-
expect(config.getOnboardConfig()).to.deep.equal({ lastStartTime: startTime });
2792+
const config = Config({ onboardConfig: { lastProfile: 'demo', lastStartTime: 1000 } });
2793+
config.updateOnboardConfig({ lastProfile: 'paid', lastStartTime: startTime });
2794+
expect(config.getOnboardConfig()).to.deep.equal({ lastProfile: 'paid', lastStartTime: startTime });
28062795
});
28072796

28082797
it('includes onboardConfig in toDynamoItem', () => {
@@ -2819,6 +2808,82 @@ describe('Config Tests', () => {
28192808
});
28202809
});
28212810

2811+
describe('Commerce LLMO Config', () => {
2812+
it('creates a Config with commerceLlmoConfig property', () => {
2813+
const data = {
2814+
commerceLlmoConfig: {
2815+
store1: {
2816+
environmentId: 'env-123',
2817+
websiteCode: 'base',
2818+
storeCode: 'main_store',
2819+
storeViewCode: 'default',
2820+
hostName: 'example.com',
2821+
magentoEndpoint: 'https://magento.example.com/graphql',
2822+
magentoAPIKey: 'api-key-123',
2823+
},
2824+
},
2825+
};
2826+
const config = Config(data);
2827+
expect(config.getCommerceLlmoConfig()).to.deep.equal(data.commerceLlmoConfig);
2828+
});
2829+
2830+
it('has undefined commerceLlmoConfig in default config', () => {
2831+
const config = Config();
2832+
expect(config.getCommerceLlmoConfig()).to.be.undefined;
2833+
});
2834+
2835+
it('should return undefined for commerceLlmoConfig if not provided', () => {
2836+
const config = Config({});
2837+
expect(config.getCommerceLlmoConfig()).to.be.undefined;
2838+
});
2839+
2840+
it('should be able to update commerceLlmoConfig', () => {
2841+
const data = {
2842+
commerceLlmoConfig: {
2843+
store1: {
2844+
environmentId: 'env-456',
2845+
websiteCode: 'base',
2846+
},
2847+
},
2848+
};
2849+
const config = Config({});
2850+
config.updateCommerceLlmoConfig(data.commerceLlmoConfig);
2851+
expect(config.getCommerceLlmoConfig()).to.deep.equal(data.commerceLlmoConfig);
2852+
});
2853+
2854+
it('should be able to update commerceLlmoConfig with different values', () => {
2855+
const config = Config({
2856+
commerceLlmoConfig: {
2857+
store1: {
2858+
environmentId: 'env-123',
2859+
},
2860+
},
2861+
});
2862+
2863+
const newConfig = {
2864+
store2: {
2865+
environmentId: 'env-789',
2866+
hostName: 'new.example.com',
2867+
},
2868+
};
2869+
config.updateCommerceLlmoConfig(newConfig);
2870+
expect(config.getCommerceLlmoConfig()).to.deep.equal(newConfig);
2871+
});
2872+
2873+
it('includes commerceLlmoConfig in toDynamoItem conversion', () => {
2874+
const data = Config({
2875+
commerceLlmoConfig: {
2876+
store1: {
2877+
environmentId: 'env-123',
2878+
magentoEndpoint: 'https://magento.example.com/graphql',
2879+
},
2880+
},
2881+
});
2882+
const dynamoItem = Config.toDynamoItem(data);
2883+
expect(dynamoItem.commerceLlmoConfig).to.deep.equal(data.getCommerceLlmoConfig());
2884+
});
2885+
});
2886+
28222887
describe('LLMO Well Known Tags', () => {
28232888
const { extractWellKnownTags } = Config();
28242889

packages/spacecat-shared-utils/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [@adobe/spacecat-shared-utils-v1.106.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.105.1...@adobe/spacecat-shared-utils-v1.106.0) (2026-03-23)
2+
3+
### Features
4+
5+
* strategy schema update ([#1452](https://github.com/adobe/spacecat-shared/issues/1452)) ([bcc9404](https://github.com/adobe/spacecat-shared/commit/bcc9404aca3d297de64e23442c8ec5186671275e))
6+
17
## [@adobe/spacecat-shared-utils-v1.105.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.105.0...@adobe/spacecat-shared-utils-v1.105.1) (2026-03-21)
28

39
### Bug Fixes

packages/spacecat-shared-utils/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@adobe/spacecat-shared-utils",
3-
"version": "1.105.1",
3+
"version": "1.106.0",
44
"description": "Shared modules of the Spacecat Services - utils",
55
"type": "module",
66
"exports": {

packages/spacecat-shared-utils/src/strategy-schema.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,11 @@ const strategy = z.object({
7676
id: nonEmptyString,
7777
name: nonEmptyString,
7878
status: workflowStatus,
79-
url: z.string(),
79+
url: z.union([z.string(), z.array(z.string())]),
8080
description: z.string(),
81-
topic: z.string(),
82-
topicId: z.uuid().optional(),
81+
topic: z.union([z.string(), z.array(z.string())]),
82+
topicId: z.union([z.uuid(), z.array(z.uuid())]).optional(),
83+
metadata: z.record(z.string(), z.any()).optional(),
8384
selectedPrompts: z.array(strategyPromptSelection).optional(),
8485
platform: nonEmptyString.optional(),
8586
opportunities: z.array(strategyOpportunity),

0 commit comments

Comments
 (0)