@adobe/spacecat-shared-data-access 2.14.1 → 2.15.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 CHANGED
@@ -1,3 +1,22 @@
1
+ # [@adobe/spacecat-shared-data-access-v2.15.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v2.15.0...@adobe/spacecat-shared-data-access-v2.15.1) (2025-04-17)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * completion queue url for audit jobs ([#697](https://github.com/adobe/spacecat-shared/issues/697)) ([5987a4c](https://github.com/adobe/spacecat-shared/commit/5987a4cda6f682e12270e202d5bfd262b156d104))
7
+
8
+ # [@adobe/spacecat-shared-data-access-v2.15.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v2.14.1...@adobe/spacecat-shared-data-access-v2.15.0) (2025-04-17)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * completionUrl not sent to content scraper and introduce skip property ([#685](https://github.com/adobe/spacecat-shared/issues/685)) ([4d89a29](https://github.com/adobe/spacecat-shared/commit/4d89a297495fa69ebbcc0429ed879b2edafbd760))
14
+
15
+
16
+ ### Features
17
+
18
+ * Add contentAiConfig validation to Config class ([#686](https://github.com/adobe/spacecat-shared/issues/686)) ([077fbbd](https://github.com/adobe/spacecat-shared/commit/077fbbd583f5567c265fe47e724ea5ce9f1a722d))
19
+
1
20
  # [@adobe/spacecat-shared-data-access-v2.14.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v2.14.0...@adobe/spacecat-shared-data-access-v2.14.1) (2025-04-15)
2
21
 
3
22
 
package/README.md CHANGED
@@ -184,6 +184,28 @@ export const main = wrap(run)
184
184
 
185
185
  Contributions to `spacecat-shared-data-access` are welcome. Please adhere to the standard Git workflow and submit pull requests for proposed changes.
186
186
 
187
+ ## Local Development and Testing
188
+
189
+ ### Testing with Dependent Projects Before Merging
190
+
191
+ When making changes to this package, you can test them in dependent projects (like `spacecat-api-service`) before merging using the following approach:
192
+
193
+ 1. Commit and push your changes to a branch in this repository
194
+ 2. Get the commit ID of your push
195
+ 3. In your dependent project, temporarily modify the package.json dependency:
196
+
197
+ ```json
198
+ // From:
199
+ "@adobe/spacecat-shared-data-access": "2.13.1",
200
+
201
+ // To:
202
+ "@adobe/spacecat-shared-data-access": "https://gitpkg.now.sh/adobe/spacecat-shared/packages/spacecat-shared-data-access?YOUR_COMMIT_ID",
203
+ ```
204
+
205
+ 4. Run `npm install` in your dependent project
206
+ 5. Test your changes
207
+ 6. Once testing is complete and your PR is merged, update the dependent project to use the released version
208
+
187
209
  ## License
188
210
 
189
211
  Licensed under the Apache-2.0 License.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-data-access",
3
- "version": "2.14.1",
3
+ "version": "2.15.1",
4
4
  "description": "Shared modules of the Spacecat Services - Data Access",
5
5
  "type": "module",
6
6
  "engines": {
@@ -104,6 +104,7 @@ class Audit extends BaseModel {
104
104
  formatPayload: (stepResult, auditContext) => ({
105
105
  type: stepResult.type,
106
106
  siteId: stepResult.siteId,
107
+ allowCache: true,
107
108
  auditContext,
108
109
  }),
109
110
  },
@@ -117,6 +118,7 @@ class Audit extends BaseModel {
117
118
  * @param {string} stepResult.siteId - The site ID. Will be used as the job ID.
118
119
  * @param {string} stepResult.processingType - The scraping processing type to trigger.
119
120
  * @param {object} auditContext - The audit context.
121
+ * @param {object} context - The context object.
120
122
  * @param {object} auditContext.next - The next audit step to run.
121
123
  * @param {string} auditContext.auditId - The audit ID.
122
124
  * @param {string} auditContext.auditType - The audit type.
@@ -124,10 +126,13 @@ class Audit extends BaseModel {
124
126
  *
125
127
  * @returns {object} - The formatted payload.
126
128
  */
127
- formatPayload: (stepResult, auditContext) => ({
129
+ formatPayload: (stepResult, auditContext, context) => ({
128
130
  urls: stepResult.urls,
129
131
  jobId: stepResult.siteId,
130
132
  processingType: stepResult.processingType || 'default',
133
+ skipMessage: false,
134
+ allowCache: true,
135
+ completionQueueUrl: stepResult.completionQueueUrl || context.env?.AUDIT_JOBS_QUEUE_URL,
131
136
  auditContext,
132
137
  }),
133
138
  },
@@ -107,6 +107,9 @@ export const configSchema = Joi.object({
107
107
  headers: Joi.object().pattern(Joi.string(), Joi.string()),
108
108
  overrideBaseURL: Joi.string().uri().optional(),
109
109
  }).optional(),
110
+ contentAiConfig: Joi.object({
111
+ index: Joi.string().required(),
112
+ }).optional(),
110
113
  handlers: Joi.object().pattern(Joi.string(), Joi.object({
111
114
  mentions: Joi.object().pattern(Joi.string(), Joi.array().items(Joi.string())),
112
115
  excludedURLs: Joi.array().items(Joi.string()),
@@ -158,6 +161,7 @@ export const Config = (data = {}) => {
158
161
  self.isInternalCustomer = () => state?.slack?.workspace === 'internal';
159
162
  self.getSlackMentions = (type) => state?.handlers?.[type]?.mentions?.slack;
160
163
  self.getHandlerConfig = (type) => state?.handlers?.[type];
164
+ self.getContentAiConfig = () => state?.contentAiConfig;
161
165
  self.getHandlers = () => state.handlers;
162
166
  self.getImports = () => state.imports;
163
167
  self.getExcludedURLs = (type) => state?.handlers?.[type]?.excludedURLs;
@@ -277,6 +281,7 @@ Config.fromDynamoItem = (dynamoItem) => Config(dynamoItem);
277
281
  Config.toDynamoItem = (config) => ({
278
282
  slack: config.getSlackConfig(),
279
283
  handlers: config.getHandlers(),
284
+ contentAiConfig: config.getContentAiConfig(),
280
285
  imports: config.getImports(),
281
286
  fetchConfig: config.getFetchConfig(),
282
287
  brandConfig: config.getBrandConfig(),