@adobe/spacecat-shared-data-access 2.53.0 → 2.55.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 CHANGED
@@ -1,3 +1,17 @@
1
+ # [@adobe/spacecat-shared-data-access-v2.55.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v2.54.0...@adobe/spacecat-shared-data-access-v2.55.0) (2025-08-20)
2
+
3
+
4
+ ### Features
5
+
6
+ * add scrape-client destination ([#913](https://github.com/adobe/spacecat-shared/issues/913)) ([e208a87](https://github.com/adobe/spacecat-shared/commit/e208a87214874a2708ac2d7614fcfd4c0770fe17))
7
+
8
+ # [@adobe/spacecat-shared-data-access-v2.54.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v2.53.0...@adobe/spacecat-shared-data-access-v2.54.0) (2025-08-13)
9
+
10
+
11
+ ### Features
12
+
13
+ * add isOriginal field to scrapeUrl ([#908](https://github.com/adobe/spacecat-shared/issues/908)) ([03dfd59](https://github.com/adobe/spacecat-shared/commit/03dfd59c94f91204ac995aeeac53d4e128317dd5))
14
+
1
15
  # [@adobe/spacecat-shared-data-access-v2.53.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v2.52.0...@adobe/spacecat-shared-data-access-v2.53.0) (2025-08-12)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-data-access",
3
- "version": "2.53.0",
3
+ "version": "2.55.0",
4
4
  "description": "Shared modules of the Spacecat Services - Data Access",
5
5
  "type": "module",
6
6
  "engines": {
@@ -73,6 +73,7 @@ class Audit extends BaseModel {
73
73
  static AUDIT_STEP_DESTINATIONS = {
74
74
  CONTENT_SCRAPER: 'content-scraper',
75
75
  IMPORT_WORKER: 'import-worker',
76
+ SCRAPE_CLIENT: 'scrape-client',
76
77
  };
77
78
 
78
79
  /**
@@ -86,7 +87,9 @@ class Audit extends BaseModel {
86
87
  * [Audit.AUDIT_STEP_DESTINATIONS.IMPORT_WORKER]: {
87
88
  * getQueueUrl: function,
88
89
  * formatPayload: function
89
- * }
90
+ * },
91
+ * [Audit.AUDIT_STEP_DESTINATIONS.SCRAPE_CLIENT]: {
92
+ * formatPayload: function
90
93
  * }}
91
94
  */
92
95
  static AUDIT_STEP_DESTINATION_CONFIGS = {
@@ -153,6 +156,26 @@ class Audit extends BaseModel {
153
156
  auditContext,
154
157
  }),
155
158
  },
159
+ [Audit.AUDIT_STEP_DESTINATIONS.SCRAPE_CLIENT]: {
160
+ /**
161
+ *
162
+ * @param stepResult - The result of the audit step.
163
+ * @param auditContext - The audit context.
164
+ * @param context - The context object.
165
+ * @returns {object} - The formatted payload for the scrape client.
166
+ */
167
+ formatPayload: (stepResult, auditContext, context) => ({
168
+ urls: stepResult.urls.map((urlObj) => urlObj.url),
169
+ processingType: stepResult.processingType || 'default',
170
+ options: stepResult.options || {},
171
+ maxScrapeAge: stepResult.maxScrapeAge || 24,
172
+ auditData: {
173
+ siteId: stepResult.siteId,
174
+ completionQueueUrl: stepResult.completionQueueUrl || context.env?.AUDIT_JOBS_QUEUE_URL,
175
+ auditContext,
176
+ },
177
+ }),
178
+ },
156
179
  };
157
180
 
158
181
  /**
@@ -20,12 +20,14 @@ export interface ScrapeUrl extends BaseModel {
20
20
  getReason(): string,
21
21
  getStatus(): string,
22
22
  getUrl(): string,
23
+ getIsOriginal(): boolean,
23
24
  setFile(file: string): void,
24
25
  setScrapeJobId(ScrapeJobId: string): void,
25
26
  setPath(path: string): void,
26
27
  setReason(reason: string): void,
27
28
  setStatus(status: string): void,
28
29
  setUrl(url: string): void,
30
+ setIsOriginal(isOriginal: boolean): void,
29
31
  }
30
32
 
31
33
  export interface ScrapeUrlCollection extends BaseCollection<ScrapeUrl> {
@@ -45,6 +45,10 @@ const schema = new SchemaBuilder(ScrapeUrl, ScrapeUrlCollection)
45
45
  type: 'string',
46
46
  required: true,
47
47
  validate: (value) => isValidUrl(value),
48
+ })
49
+ .addAttribute('isOriginal', {
50
+ type: 'boolean',
51
+ default: true,
48
52
  });
49
53
 
50
54
  export default schema.build();