@attlaz/client 1.107.0 → 1.108.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.
|
@@ -12,6 +12,11 @@ export declare class CrawlJob {
|
|
|
12
12
|
requestedAt: Date | null;
|
|
13
13
|
startedAt: Date | null;
|
|
14
14
|
finishedAt: Date | null;
|
|
15
|
+
/**
|
|
16
|
+
* This crawl looked at only part of the catalogue, so it is excluded from the delisting window:
|
|
17
|
+
* it never looked for most products, so its silence about them proves nothing.
|
|
18
|
+
*/
|
|
19
|
+
isPartial: boolean;
|
|
15
20
|
/** Progress (populated by list endpoints): total pages and how many have been processed. */
|
|
16
21
|
total: number;
|
|
17
22
|
processed: number;
|
|
@@ -10,6 +10,11 @@ export class CrawlJob {
|
|
|
10
10
|
requestedAt;
|
|
11
11
|
startedAt;
|
|
12
12
|
finishedAt;
|
|
13
|
+
/**
|
|
14
|
+
* This crawl looked at only part of the catalogue, so it is excluded from the delisting window:
|
|
15
|
+
* it never looked for most products, so its silence about them proves nothing.
|
|
16
|
+
*/
|
|
17
|
+
isPartial = false;
|
|
13
18
|
/** Progress (populated by list endpoints): total pages and how many have been processed. */
|
|
14
19
|
total = 0;
|
|
15
20
|
processed = 0;
|
|
@@ -27,6 +32,7 @@ export class CrawlJob {
|
|
|
27
32
|
job.requestedAt = raw.requested_at ? new Date(raw.requested_at) : null;
|
|
28
33
|
job.startedAt = raw.started_at ? new Date(raw.started_at) : null;
|
|
29
34
|
job.finishedAt = raw.finished_at ? new Date(raw.finished_at) : null;
|
|
35
|
+
job.isPartial = raw.is_partial === true;
|
|
30
36
|
job.total = Number(raw.total ?? 0);
|
|
31
37
|
job.processed = Number(raw.processed ?? 0);
|
|
32
38
|
return job;
|
|
@@ -10,8 +10,14 @@ import { Endpoint } from '../../Service/Endpoint.js';
|
|
|
10
10
|
* post-crawl processing (price history, product matching, price-index snapshots).
|
|
11
11
|
*/
|
|
12
12
|
export declare class CrawlJobEndpoint extends Endpoint {
|
|
13
|
-
/**
|
|
14
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Create a new (pending) crawl job for a vendor.
|
|
15
|
+
*
|
|
16
|
+
* @param isPartial This crawl will deliberately look at only part of the catalogue. Such a crawl
|
|
17
|
+
* is excluded from the delisting window: it never looked for most products, so its
|
|
18
|
+
* silence about them is not evidence they are gone.
|
|
19
|
+
*/
|
|
20
|
+
create(vendorId: string, isPartial?: boolean): Promise<CrawlJob>;
|
|
15
21
|
/** Update a crawl job's status ('started', 'finished', 'cancelled'). */
|
|
16
22
|
updateStatus(crawlJobId: string, status: CrawlJobStatus): Promise<CrawlJob>;
|
|
17
23
|
/** A vendor's crawl jobs (newest first), each with progress (`total` / `processed`). */
|
|
@@ -9,9 +9,15 @@ import { Endpoint } from '../../Service/Endpoint.js';
|
|
|
9
9
|
* post-crawl processing (price history, product matching, price-index snapshots).
|
|
10
10
|
*/
|
|
11
11
|
export class CrawlJobEndpoint extends Endpoint {
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Create a new (pending) crawl job for a vendor.
|
|
14
|
+
*
|
|
15
|
+
* @param isPartial This crawl will deliberately look at only part of the catalogue. Such a crawl
|
|
16
|
+
* is excluded from the delisting window: it never looked for most products, so its
|
|
17
|
+
* silence about them is not evidence they are gone.
|
|
18
|
+
*/
|
|
19
|
+
async create(vendorId, isPartial = false) {
|
|
20
|
+
const result = await this.requestObject('/pulse/crawl-jobs', { vendor: vendorId, isPartial }, CrawlJob.parse, 'POST');
|
|
15
21
|
const job = result.getData();
|
|
16
22
|
if (job === null) {
|
|
17
23
|
throw new Error('Unable to create crawl job: empty response');
|