@attlaz/client 1.88.0 → 1.89.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/dist/Catalog/Model/Catalog.d.ts +19 -0
- package/dist/Catalog/Model/Catalog.js +28 -0
- package/dist/Catalog/Model/CatalogId.d.ts +4 -0
- package/dist/Catalog/Model/CatalogId.js +4 -0
- package/dist/Catalog/Model/CatalogProduct.d.ts +21 -0
- package/dist/Catalog/Model/CatalogProduct.js +31 -0
- package/dist/Catalog/Service/CatalogEndpoint.d.ts +15 -0
- package/dist/Catalog/Service/CatalogEndpoint.js +21 -0
- package/dist/Catalog/Service/CatalogProductEndpoint.d.ts +16 -0
- package/dist/Catalog/Service/CatalogProductEndpoint.js +24 -0
- package/dist/Client.d.ts +35 -7
- package/dist/Client.js +77 -7
- package/dist/DataQuality/Model/QualityDataset.d.ts +17 -0
- package/dist/DataQuality/Model/QualityDataset.js +26 -0
- package/dist/DataQuality/Model/QualityEntity.d.ts +24 -0
- package/dist/DataQuality/Model/QualityEntity.js +41 -0
- package/dist/DataQuality/Model/QualityProblem.d.ts +25 -0
- package/dist/DataQuality/Model/QualityProblem.js +43 -0
- package/dist/DataQuality/Service/QualityEndpoint.d.ts +45 -0
- package/dist/DataQuality/Service/QualityEndpoint.js +89 -0
- package/dist/EnhanceData/Model/GenerateContentBatch.d.ts +22 -0
- package/dist/EnhanceData/Model/GenerateContentBatch.js +34 -0
- package/dist/EnhanceData/Service/GenerateContentEndpoint.d.ts +23 -0
- package/dist/EnhanceData/Service/GenerateContentEndpoint.js +21 -0
- package/dist/FeedManagement/Model/CatalogFeed.d.ts +26 -0
- package/dist/FeedManagement/Model/CatalogFeed.js +51 -0
- package/dist/FeedManagement/Service/CatalogFeedEndpoint.d.ts +14 -0
- package/dist/FeedManagement/Service/CatalogFeedEndpoint.js +19 -0
- package/dist/{Model/Flow → Flow/Model}/Flow.d.ts +3 -3
- package/dist/{Model/Flow → Flow/Model}/Flow.js +1 -1
- package/dist/{Model/Flow → Flow/Model}/FlowRun.d.ts +3 -3
- package/dist/{Model/Flow → Flow/Model}/FlowRun.js +1 -1
- package/dist/{Model/Flow → Flow/Model}/FlowRunHistory.d.ts +1 -1
- package/dist/{Model/Flow → Flow/Model}/FlowRunLifecycle.d.ts +1 -1
- package/dist/{Model/Flow → Flow/Model}/FlowRunStats.d.ts +1 -1
- package/dist/{Model/Flow → Flow/Model}/FlowRunSummary.d.ts +1 -1
- package/dist/{Model/Flow → Flow/Model}/FlowSummary.d.ts +1 -1
- package/dist/{Service → Flow/Service}/FlowEndpoint.d.ts +5 -5
- package/dist/{Service → Flow/Service}/FlowEndpoint.js +6 -6
- package/dist/{Service → Flow/Service}/FlowRunEndpoint.d.ts +8 -8
- package/dist/{Service → Flow/Service}/FlowRunEndpoint.js +6 -6
- package/dist/Flow/Service/FlowRunRequestEndpoint.d.ts +6 -0
- package/dist/{Service → Flow/Service}/FlowRunRequestEndpoint.js +2 -2
- package/dist/{Service → Flow/Service}/FlowRunStatsEndpoint.d.ts +2 -2
- package/dist/{Service → Flow/Service}/FlowRunStatsEndpoint.js +2 -2
- package/dist/{Model/Log → Logging/Model}/Log.d.ts +2 -2
- package/dist/{Model/Log → Logging/Model}/Log.js +1 -1
- package/dist/{Model/Log → Logging/Model}/LogQuery.d.ts +1 -1
- package/dist/{Model/Log → Logging/Model}/LogStreamId.d.ts +1 -1
- package/dist/{Model/Log → Logging/Model}/LogStreamId.js +1 -1
- package/dist/{Model/Log → Logging/Model}/LogStreamInformation.d.ts +2 -2
- package/dist/{Service → Logging/Service}/LogEndpoint.d.ts +9 -9
- package/dist/{Service → Logging/Service}/LogEndpoint.js +6 -6
- package/dist/Model/Messaging/Subscriber.d.ts +1 -1
- package/dist/Model/Messaging/Subscriber.js +1 -1
- package/dist/Model/Search/SearchResult.d.ts +2 -2
- package/dist/Model/Search/SearchResult.js +2 -2
- package/dist/Pulse/Model/CatalogProductWithMatches.d.ts +31 -0
- package/dist/Pulse/Model/CatalogProductWithMatches.js +50 -0
- package/dist/Pulse/Model/CompetingVendorProduct.d.ts +15 -0
- package/dist/Pulse/Model/CompetingVendorProduct.js +21 -0
- package/dist/Pulse/Model/Competitor.d.ts +27 -0
- package/dist/Pulse/Model/Competitor.js +43 -0
- package/dist/{Model/Pulse → Pulse/Model}/CrawlJob.d.ts +2 -2
- package/dist/Pulse/Model/IndexJob.d.ts +19 -0
- package/dist/Pulse/Model/IndexJob.js +29 -0
- package/dist/Pulse/Model/MatchedVendorProduct.d.ts +29 -0
- package/dist/Pulse/Model/MatchedVendorProduct.js +48 -0
- package/dist/Pulse/Model/PriceAlertConfig.d.ts +22 -0
- package/dist/Pulse/Model/PriceAlertConfig.js +34 -0
- package/dist/Pulse/Model/PriceAlertEvent.d.ts +20 -0
- package/dist/Pulse/Model/PriceAlertEvent.js +33 -0
- package/dist/Pulse/Model/PriceIndexSnapshotEntry.d.ts +16 -0
- package/dist/Pulse/Model/PriceIndexSnapshotEntry.js +23 -0
- package/dist/Pulse/Model/PriceSuggestion.d.ts +29 -0
- package/dist/Pulse/Model/PriceSuggestion.js +46 -0
- package/dist/Pulse/Model/PricingRule.d.ts +30 -0
- package/dist/Pulse/Model/PricingRule.js +49 -0
- package/dist/Pulse/Model/ProductGroup.d.ts +25 -0
- package/dist/Pulse/Model/ProductGroup.js +36 -0
- package/dist/Pulse/Model/ProductMatch.d.ts +21 -0
- package/dist/Pulse/Model/ProductMatch.js +28 -0
- package/dist/Pulse/Model/ProductMatchJob.d.ts +27 -0
- package/dist/Pulse/Model/ProductMatchJob.js +42 -0
- package/dist/Pulse/Model/ReviewMatch.d.ts +42 -0
- package/dist/Pulse/Model/ReviewMatch.js +55 -0
- package/dist/Pulse/Model/TopCompetitor.d.ts +23 -0
- package/dist/Pulse/Model/TopCompetitor.js +37 -0
- package/dist/Pulse/Model/Vendor.d.ts +12 -0
- package/dist/Pulse/Model/Vendor.js +18 -0
- package/dist/{Model/Pulse → Pulse/Model}/VendorProduct.d.ts +6 -1
- package/dist/{Model/Pulse → Pulse/Model}/VendorProduct.js +9 -1
- package/dist/Pulse/Model/VendorProductPriceHistoryEntry.d.ts +18 -0
- package/dist/Pulse/Model/VendorProductPriceHistoryEntry.js +36 -0
- package/dist/Pulse/Model/VendorStatus.d.ts +25 -0
- package/dist/Pulse/Model/VendorStatus.js +34 -0
- package/dist/Pulse/Service/CompetitorEndpoint.d.ts +15 -0
- package/dist/Pulse/Service/CompetitorEndpoint.js +23 -0
- package/dist/{Service/Pulse → Pulse/Service}/CrawlJobEndpoint.d.ts +13 -3
- package/dist/{Service/Pulse → Pulse/Service}/CrawlJobEndpoint.js +18 -5
- package/dist/Pulse/Service/IndexJobEndpoint.d.ts +20 -0
- package/dist/Pulse/Service/IndexJobEndpoint.js +31 -0
- package/dist/Pulse/Service/PriceAlertEndpoint.d.ts +31 -0
- package/dist/Pulse/Service/PriceAlertEndpoint.js +42 -0
- package/dist/Pulse/Service/PricingEndpoint.d.ts +40 -0
- package/dist/Pulse/Service/PricingEndpoint.js +51 -0
- package/dist/Pulse/Service/ProductGroupEndpoint.d.ts +18 -0
- package/dist/Pulse/Service/ProductGroupEndpoint.js +19 -0
- package/dist/Pulse/Service/ProductMatchEndpoint.d.ts +47 -0
- package/dist/Pulse/Service/ProductMatchEndpoint.js +66 -0
- package/dist/Pulse/Service/ProductMatchJobEndpoint.d.ts +19 -0
- package/dist/Pulse/Service/ProductMatchJobEndpoint.js +30 -0
- package/dist/Pulse/Service/PulseCatalogProductEndpoint.d.ts +40 -0
- package/dist/Pulse/Service/PulseCatalogProductEndpoint.js +54 -0
- package/dist/Pulse/Service/PulseStatisticsEndpoint.d.ts +32 -0
- package/dist/Pulse/Service/PulseStatisticsEndpoint.js +39 -0
- package/dist/Pulse/Service/VendorProductEndpoint.d.ts +32 -0
- package/dist/{Service/Pulse → Pulse/Service}/VendorProductEndpoint.js +37 -2
- package/dist/Service/Endpoint.js +5 -3
- package/dist/index.d.ts +67 -27
- package/dist/index.js +67 -27
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Service/FlowRunRequestEndpoint.d.ts +0 -6
- package/dist/Service/Pulse/VendorProductEndpoint.d.ts +0 -14
- /package/dist/{Model/Flow → Flow/Model}/FlowRunHistory.js +0 -0
- /package/dist/{Model/Flow → Flow/Model}/FlowRunHistoryStatus.d.ts +0 -0
- /package/dist/{Model/Flow → Flow/Model}/FlowRunHistoryStatus.js +0 -0
- /package/dist/{Model/Flow → Flow/Model}/FlowRunLifecycle.js +0 -0
- /package/dist/{Model/Flow → Flow/Model}/FlowRunPriority.d.ts +0 -0
- /package/dist/{Model/Flow → Flow/Model}/FlowRunPriority.js +0 -0
- /package/dist/{Model/Flow → Flow/Model}/FlowRunResponse.d.ts +0 -0
- /package/dist/{Model/Flow → Flow/Model}/FlowRunResponse.js +0 -0
- /package/dist/{Model/Flow → Flow/Model}/FlowRunStats.js +0 -0
- /package/dist/{Model/Flow → Flow/Model}/FlowRunStatus.d.ts +0 -0
- /package/dist/{Model/Flow → Flow/Model}/FlowRunStatus.js +0 -0
- /package/dist/{Model/Flow → Flow/Model}/FlowRunSummary.js +0 -0
- /package/dist/{Model/Flow → Flow/Model}/FlowSummary.js +0 -0
- /package/dist/{Model/Flow → Flow/Model}/FlowTemplate.d.ts +0 -0
- /package/dist/{Model/Flow → Flow/Model}/FlowTemplate.js +0 -0
- /package/dist/{Model/Log → Logging/Model}/LogLevel.d.ts +0 -0
- /package/dist/{Model/Log → Logging/Model}/LogLevel.js +0 -0
- /package/dist/{Model/Log → Logging/Model}/LogQuery.js +0 -0
- /package/dist/{Model/Log → Logging/Model}/LogStatus.d.ts +0 -0
- /package/dist/{Model/Log → Logging/Model}/LogStatus.js +0 -0
- /package/dist/{Model/Log → Logging/Model}/LogStream.d.ts +0 -0
- /package/dist/{Model/Log → Logging/Model}/LogStream.js +0 -0
- /package/dist/{Model/Log → Logging/Model}/LogStreamInformation.js +0 -0
- /package/dist/{Model/Pulse → Pulse/Model}/CrawlJob.js +0 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ApiRecord } from '../../Model/ApiRecord.js';
|
|
2
|
+
/** `dynamic` groups are evaluated from {@link ProductGroup.criteria}; `manual` ones hold a fixed list. */
|
|
3
|
+
export type ProductGroupType = 'dynamic' | 'manual';
|
|
4
|
+
/**
|
|
5
|
+
* A named subset of a catalog's products — the `/pulse/product-groups` resource. Pricing rules and
|
|
6
|
+
* price alerts are scoped to one, and the product list can be filtered by it.
|
|
7
|
+
*
|
|
8
|
+
* `criteria` is the raw rule object of a dynamic group (`{"brand": "Philips"}`,
|
|
9
|
+
* `{"sales_volume": {">": 100}}`); its shape is open, so it is passed through untouched.
|
|
10
|
+
*/
|
|
11
|
+
export declare class ProductGroup {
|
|
12
|
+
id: string;
|
|
13
|
+
catalogId: string;
|
|
14
|
+
name: string;
|
|
15
|
+
description: string | null;
|
|
16
|
+
groupType: ProductGroupType;
|
|
17
|
+
criteria: Record<string, unknown>;
|
|
18
|
+
/** Created from a built-in template rather than by hand. */
|
|
19
|
+
isTemplate: boolean;
|
|
20
|
+
templateKey: string | null;
|
|
21
|
+
createdAt: Date | null;
|
|
22
|
+
updatedAt: Date | null;
|
|
23
|
+
constructor(id: string, catalogId: string, name: string);
|
|
24
|
+
static parse(raw: ApiRecord): ProductGroup;
|
|
25
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A named subset of a catalog's products — the `/pulse/product-groups` resource. Pricing rules and
|
|
3
|
+
* price alerts are scoped to one, and the product list can be filtered by it.
|
|
4
|
+
*
|
|
5
|
+
* `criteria` is the raw rule object of a dynamic group (`{"brand": "Philips"}`,
|
|
6
|
+
* `{"sales_volume": {">": 100}}`); its shape is open, so it is passed through untouched.
|
|
7
|
+
*/
|
|
8
|
+
export class ProductGroup {
|
|
9
|
+
id;
|
|
10
|
+
catalogId;
|
|
11
|
+
name;
|
|
12
|
+
description = null;
|
|
13
|
+
groupType = 'dynamic';
|
|
14
|
+
criteria = {};
|
|
15
|
+
/** Created from a built-in template rather than by hand. */
|
|
16
|
+
isTemplate = false;
|
|
17
|
+
templateKey = null;
|
|
18
|
+
createdAt = null;
|
|
19
|
+
updatedAt = null;
|
|
20
|
+
constructor(id, catalogId, name) {
|
|
21
|
+
this.id = id;
|
|
22
|
+
this.catalogId = catalogId;
|
|
23
|
+
this.name = name;
|
|
24
|
+
}
|
|
25
|
+
static parse(raw) {
|
|
26
|
+
const group = new ProductGroup(raw.id, raw.catalog, raw.name ?? '');
|
|
27
|
+
group.description = raw.description ?? null;
|
|
28
|
+
group.groupType = raw.group_type ?? 'dynamic';
|
|
29
|
+
group.criteria = raw.criteria ?? {};
|
|
30
|
+
group.isTemplate = raw.is_template === true;
|
|
31
|
+
group.templateKey = raw.template_key ?? null;
|
|
32
|
+
group.createdAt = raw.created_at ? new Date(raw.created_at) : null;
|
|
33
|
+
group.updatedAt = raw.updated_at ? new Date(raw.updated_at) : null;
|
|
34
|
+
return group;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ApiRecord } from '../../Model/ApiRecord.js';
|
|
2
|
+
/** Where a match came from and what happened to it since. */
|
|
3
|
+
export type ProductMatchStatus = 'pending' | 'accepted' | 'declined';
|
|
4
|
+
/**
|
|
5
|
+
* The link between one of the catalog's products and a competitor's — the `/pulse/matches/:matchId`
|
|
6
|
+
* resource.
|
|
7
|
+
*
|
|
8
|
+
* This is the match *record*: how it was made (`matchType`), how sure the matcher was
|
|
9
|
+
* (`confidence`, 0-1) and whether a human has since accepted or declined it. The two products it
|
|
10
|
+
* joins are read through {@link MatchedVendorProduct} or {@link ReviewMatch}.
|
|
11
|
+
*/
|
|
12
|
+
export declare class ProductMatch {
|
|
13
|
+
id: string;
|
|
14
|
+
matchType: string;
|
|
15
|
+
confidence: number | null;
|
|
16
|
+
metadata: Record<string, unknown> | null;
|
|
17
|
+
status: ProductMatchStatus;
|
|
18
|
+
createdAt: Date | null;
|
|
19
|
+
constructor(id: string);
|
|
20
|
+
static parse(raw: ApiRecord): ProductMatch;
|
|
21
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The link between one of the catalog's products and a competitor's — the `/pulse/matches/:matchId`
|
|
3
|
+
* resource.
|
|
4
|
+
*
|
|
5
|
+
* This is the match *record*: how it was made (`matchType`), how sure the matcher was
|
|
6
|
+
* (`confidence`, 0-1) and whether a human has since accepted or declined it. The two products it
|
|
7
|
+
* joins are read through {@link MatchedVendorProduct} or {@link ReviewMatch}.
|
|
8
|
+
*/
|
|
9
|
+
export class ProductMatch {
|
|
10
|
+
id;
|
|
11
|
+
matchType = '';
|
|
12
|
+
confidence = null;
|
|
13
|
+
metadata = null;
|
|
14
|
+
status = 'pending';
|
|
15
|
+
createdAt = null;
|
|
16
|
+
constructor(id) {
|
|
17
|
+
this.id = id;
|
|
18
|
+
}
|
|
19
|
+
static parse(raw) {
|
|
20
|
+
const match = new ProductMatch(raw.id);
|
|
21
|
+
match.matchType = raw.match_type ?? '';
|
|
22
|
+
match.confidence = raw.confidence ?? null;
|
|
23
|
+
match.metadata = raw.metadata ?? null;
|
|
24
|
+
match.status = raw.status ?? 'pending';
|
|
25
|
+
match.createdAt = raw.created_at ? new Date(raw.created_at) : null;
|
|
26
|
+
return match;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ApiRecord } from '../../Model/ApiRecord.js';
|
|
2
|
+
export type ProductMatchJobStatus = 'pending' | 'started' | 'cancelled' | 'stopped' | 'finished';
|
|
3
|
+
/**
|
|
4
|
+
* One run of matching a catalog's products against a competitor's — the `/pulse/match-jobs`
|
|
5
|
+
* resource. `strategy` / `strategyVersion` identify the matching strategy that produced the
|
|
6
|
+
* matches, `matchesFound` is counted per job at read time.
|
|
7
|
+
*
|
|
8
|
+
* The list (`/pulse/catalogs/:catalogId/match-jobs`), the vendor list and the single-job endpoint
|
|
9
|
+
* all return this same shape.
|
|
10
|
+
*/
|
|
11
|
+
export declare class ProductMatchJob {
|
|
12
|
+
id: string;
|
|
13
|
+
catalogId: string;
|
|
14
|
+
vendorId: string;
|
|
15
|
+
strategy: string;
|
|
16
|
+
strategyVersion: string;
|
|
17
|
+
configuration: Record<string, unknown> | null;
|
|
18
|
+
status: ProductMatchJobStatus;
|
|
19
|
+
productsTotal: number | null;
|
|
20
|
+
productsProcessed: number | null;
|
|
21
|
+
matchesFound: number | null;
|
|
22
|
+
createdAt: Date | null;
|
|
23
|
+
startedAt: Date | null;
|
|
24
|
+
completedAt: Date | null;
|
|
25
|
+
constructor(id: string, catalogId: string, vendorId: string);
|
|
26
|
+
static parse(raw: ApiRecord): ProductMatchJob;
|
|
27
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One run of matching a catalog's products against a competitor's — the `/pulse/match-jobs`
|
|
3
|
+
* resource. `strategy` / `strategyVersion` identify the matching strategy that produced the
|
|
4
|
+
* matches, `matchesFound` is counted per job at read time.
|
|
5
|
+
*
|
|
6
|
+
* The list (`/pulse/catalogs/:catalogId/match-jobs`), the vendor list and the single-job endpoint
|
|
7
|
+
* all return this same shape.
|
|
8
|
+
*/
|
|
9
|
+
export class ProductMatchJob {
|
|
10
|
+
id;
|
|
11
|
+
catalogId;
|
|
12
|
+
vendorId;
|
|
13
|
+
strategy = '';
|
|
14
|
+
strategyVersion = '';
|
|
15
|
+
configuration = null;
|
|
16
|
+
status = 'pending';
|
|
17
|
+
productsTotal = null;
|
|
18
|
+
productsProcessed = null;
|
|
19
|
+
matchesFound = null;
|
|
20
|
+
createdAt = null;
|
|
21
|
+
startedAt = null;
|
|
22
|
+
completedAt = null;
|
|
23
|
+
constructor(id, catalogId, vendorId) {
|
|
24
|
+
this.id = id;
|
|
25
|
+
this.catalogId = catalogId;
|
|
26
|
+
this.vendorId = vendorId;
|
|
27
|
+
}
|
|
28
|
+
static parse(raw) {
|
|
29
|
+
const job = new ProductMatchJob(raw.id, raw.catalog, raw.vendor);
|
|
30
|
+
job.strategy = raw.strategy ?? '';
|
|
31
|
+
job.strategyVersion = raw.strategy_version ?? '';
|
|
32
|
+
job.configuration = raw.configuration ?? null;
|
|
33
|
+
job.status = raw.status ?? 'pending';
|
|
34
|
+
job.productsTotal = raw.products_total ?? null;
|
|
35
|
+
job.productsProcessed = raw.products_processed ?? null;
|
|
36
|
+
job.matchesFound = raw.matches_found ?? null;
|
|
37
|
+
job.createdAt = raw.created_at ? new Date(raw.created_at) : null;
|
|
38
|
+
job.startedAt = raw.started_at ? new Date(raw.started_at) : null;
|
|
39
|
+
job.completedAt = raw.completed_at ? new Date(raw.completed_at) : null;
|
|
40
|
+
return job;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ApiRecord } from '../../Model/ApiRecord.js';
|
|
2
|
+
import { ProductMatchStatus } from './ProductMatch.js';
|
|
3
|
+
/** One side of a match, reduced to what a reviewer needs to judge it. */
|
|
4
|
+
export type ReviewProduct = {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
brand: string | null;
|
|
8
|
+
gtin: string | null;
|
|
9
|
+
price: number | null;
|
|
10
|
+
url: string | null;
|
|
11
|
+
image: string | null;
|
|
12
|
+
category: string | null;
|
|
13
|
+
inStock: boolean | null;
|
|
14
|
+
};
|
|
15
|
+
/** The competitor side additionally names the vendor it came from. */
|
|
16
|
+
export type ReviewCompetitorProduct = ReviewProduct & {
|
|
17
|
+
vendor: {
|
|
18
|
+
id: string;
|
|
19
|
+
name: string;
|
|
20
|
+
icon: string | null;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* A match queued for human review — the `/pulse/catalogs/:catalogId/matches` resource.
|
|
25
|
+
*
|
|
26
|
+
* Both products are returned side by side so a reviewer can accept or decline without a second
|
|
27
|
+
* request; `confidence` is the matcher's own certainty (0-1).
|
|
28
|
+
*/
|
|
29
|
+
export declare class ReviewMatch {
|
|
30
|
+
/** The id of the match record — the value to pass to accept/decline. */
|
|
31
|
+
matchId: string;
|
|
32
|
+
status: ProductMatchStatus;
|
|
33
|
+
confidence: number | null;
|
|
34
|
+
createdAt: Date | null;
|
|
35
|
+
own: ReviewProduct;
|
|
36
|
+
competitor: ReviewCompetitorProduct;
|
|
37
|
+
constructor(matchId: string, own: ReviewProduct, competitor: ReviewCompetitorProduct);
|
|
38
|
+
/** Alias of {@link matchId}: collection helpers key rows on `id`. */
|
|
39
|
+
get id(): string;
|
|
40
|
+
static parse(raw: ApiRecord): ReviewMatch;
|
|
41
|
+
private static parseProduct;
|
|
42
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A match queued for human review — the `/pulse/catalogs/:catalogId/matches` resource.
|
|
3
|
+
*
|
|
4
|
+
* Both products are returned side by side so a reviewer can accept or decline without a second
|
|
5
|
+
* request; `confidence` is the matcher's own certainty (0-1).
|
|
6
|
+
*/
|
|
7
|
+
export class ReviewMatch {
|
|
8
|
+
/** The id of the match record — the value to pass to accept/decline. */
|
|
9
|
+
matchId;
|
|
10
|
+
status = 'pending';
|
|
11
|
+
confidence = null;
|
|
12
|
+
createdAt = null;
|
|
13
|
+
own;
|
|
14
|
+
competitor;
|
|
15
|
+
constructor(matchId, own, competitor) {
|
|
16
|
+
this.matchId = matchId;
|
|
17
|
+
this.own = own;
|
|
18
|
+
this.competitor = competitor;
|
|
19
|
+
}
|
|
20
|
+
/** Alias of {@link matchId}: collection helpers key rows on `id`. */
|
|
21
|
+
get id() {
|
|
22
|
+
return this.matchId;
|
|
23
|
+
}
|
|
24
|
+
static parse(raw) {
|
|
25
|
+
const rawCompetitor = raw.competitor;
|
|
26
|
+
const rawVendor = rawCompetitor.vendor;
|
|
27
|
+
const match = new ReviewMatch(
|
|
28
|
+
// The API strips the `_id` suffix, so `match_id` arrives as `match`.
|
|
29
|
+
raw.match, ReviewMatch.parseProduct(raw.own), {
|
|
30
|
+
...ReviewMatch.parseProduct(rawCompetitor),
|
|
31
|
+
vendor: {
|
|
32
|
+
id: rawVendor.id,
|
|
33
|
+
name: rawVendor.name,
|
|
34
|
+
icon: rawVendor.icon ?? null,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
match.status = raw.status ?? 'pending';
|
|
38
|
+
match.confidence = raw.confidence ?? null;
|
|
39
|
+
match.createdAt = raw.created_at ? new Date(raw.created_at) : null;
|
|
40
|
+
return match;
|
|
41
|
+
}
|
|
42
|
+
static parseProduct(raw) {
|
|
43
|
+
return {
|
|
44
|
+
id: raw.id,
|
|
45
|
+
name: raw.name,
|
|
46
|
+
brand: raw.brand ?? null,
|
|
47
|
+
gtin: raw.gtin ?? null,
|
|
48
|
+
price: raw.price ?? null,
|
|
49
|
+
url: raw.url ?? null,
|
|
50
|
+
image: raw.image ?? null,
|
|
51
|
+
category: raw.category ?? null,
|
|
52
|
+
inStock: typeof raw.in_stock === 'boolean' ? raw.in_stock : null,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ApiRecord } from '../../Model/ApiRecord.js';
|
|
2
|
+
/**
|
|
3
|
+
* A competitor in the "top competitors" ranking of a catalog — the
|
|
4
|
+
* `/pulse/catalogs/:catalogId/statistics/top-competitors` resource.
|
|
5
|
+
*
|
|
6
|
+
* A denormalised read model: it carries the vendor's display fields so a leaderboard renders from
|
|
7
|
+
* one request, and the previous price index so the trend can be shown without a second series.
|
|
8
|
+
*/
|
|
9
|
+
export declare class TopCompetitor {
|
|
10
|
+
competitorId: string;
|
|
11
|
+
vendorId: string;
|
|
12
|
+
vendorName: string;
|
|
13
|
+
vendorDomain: string;
|
|
14
|
+
vendorIcon: string | null;
|
|
15
|
+
matchCount: number;
|
|
16
|
+
productCount: number;
|
|
17
|
+
priceIndex: number | null;
|
|
18
|
+
previousPriceIndex: number | null;
|
|
19
|
+
constructor(competitorId: string, vendorId: string);
|
|
20
|
+
/** Alias of {@link competitorId}: collection helpers key rows on `id`. */
|
|
21
|
+
get id(): string;
|
|
22
|
+
static parse(raw: ApiRecord): TopCompetitor;
|
|
23
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A competitor in the "top competitors" ranking of a catalog — the
|
|
3
|
+
* `/pulse/catalogs/:catalogId/statistics/top-competitors` resource.
|
|
4
|
+
*
|
|
5
|
+
* A denormalised read model: it carries the vendor's display fields so a leaderboard renders from
|
|
6
|
+
* one request, and the previous price index so the trend can be shown without a second series.
|
|
7
|
+
*/
|
|
8
|
+
export class TopCompetitor {
|
|
9
|
+
competitorId;
|
|
10
|
+
vendorId;
|
|
11
|
+
vendorName = '';
|
|
12
|
+
vendorDomain = '';
|
|
13
|
+
vendorIcon = null;
|
|
14
|
+
matchCount = 0;
|
|
15
|
+
productCount = 0;
|
|
16
|
+
priceIndex = null;
|
|
17
|
+
previousPriceIndex = null;
|
|
18
|
+
constructor(competitorId, vendorId) {
|
|
19
|
+
this.competitorId = competitorId;
|
|
20
|
+
this.vendorId = vendorId;
|
|
21
|
+
}
|
|
22
|
+
/** Alias of {@link competitorId}: collection helpers key rows on `id`. */
|
|
23
|
+
get id() {
|
|
24
|
+
return this.competitorId;
|
|
25
|
+
}
|
|
26
|
+
static parse(raw) {
|
|
27
|
+
const competitor = new TopCompetitor(raw.competitor, raw.vendor);
|
|
28
|
+
competitor.vendorName = raw.vendor_name ?? '';
|
|
29
|
+
competitor.vendorDomain = raw.vendor_domain ?? '';
|
|
30
|
+
competitor.vendorIcon = raw.vendor_icon ?? null;
|
|
31
|
+
competitor.matchCount = Number(raw.match_count ?? 0);
|
|
32
|
+
competitor.productCount = Number(raw.product_count ?? 0);
|
|
33
|
+
competitor.priceIndex = raw.price_index ?? null;
|
|
34
|
+
competitor.previousPriceIndex = raw.previous_price_index ?? null;
|
|
35
|
+
return competitor;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ApiRecord } from '../../Model/ApiRecord.js';
|
|
2
|
+
/**
|
|
3
|
+
* A shop whose products Market Pulse tracks — your own or a competitor's. It is the same entity in
|
|
4
|
+
* both roles; a {@link Competitor} is a vendor as one catalog watches it.
|
|
5
|
+
*/
|
|
6
|
+
export declare class Vendor {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
icon: string | null;
|
|
10
|
+
constructor(id: string, name: string);
|
|
11
|
+
static parse(raw: ApiRecord): Vendor;
|
|
12
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A shop whose products Market Pulse tracks — your own or a competitor's. It is the same entity in
|
|
3
|
+
* both roles; a {@link Competitor} is a vendor as one catalog watches it.
|
|
4
|
+
*/
|
|
5
|
+
export class Vendor {
|
|
6
|
+
id;
|
|
7
|
+
name;
|
|
8
|
+
icon = null;
|
|
9
|
+
constructor(id, name) {
|
|
10
|
+
this.id = id;
|
|
11
|
+
this.name = name;
|
|
12
|
+
}
|
|
13
|
+
static parse(raw) {
|
|
14
|
+
const vendor = new Vendor(raw.id, raw.name ?? '');
|
|
15
|
+
vendor.icon = raw.icon ?? null;
|
|
16
|
+
return vendor;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiRecord } from '
|
|
1
|
+
import { ApiRecord } from '../../Model/ApiRecord.js';
|
|
2
2
|
/**
|
|
3
3
|
* A competitor's product as tracked by Market Pulse — the `/pulse/vendors/:vendorId/products`
|
|
4
4
|
* resource. `identifier` is the product's stable id on the competitor's site (the upsert key).
|
|
@@ -23,4 +23,9 @@ export declare class VendorProduct {
|
|
|
23
23
|
updatedAt: Date | null;
|
|
24
24
|
constructor(vendorId: string, identifier: string);
|
|
25
25
|
static parse(raw: ApiRecord): VendorProduct;
|
|
26
|
+
/**
|
|
27
|
+
* Read the fields every vendor-product response carries. Split out so a subclass can reuse it
|
|
28
|
+
* from its own `parse` without repeating them.
|
|
29
|
+
*/
|
|
30
|
+
protected fill(raw: ApiRecord): void;
|
|
26
31
|
}
|
|
@@ -26,6 +26,15 @@ export class VendorProduct {
|
|
|
26
26
|
}
|
|
27
27
|
static parse(raw) {
|
|
28
28
|
const product = new VendorProduct(raw.vendor, raw.identifier);
|
|
29
|
+
product.fill(raw);
|
|
30
|
+
return product;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Read the fields every vendor-product response carries. Split out so a subclass can reuse it
|
|
34
|
+
* from its own `parse` without repeating them.
|
|
35
|
+
*/
|
|
36
|
+
fill(raw) {
|
|
37
|
+
const product = this;
|
|
29
38
|
product.id = raw.id ?? null;
|
|
30
39
|
product.name = raw.name ?? null;
|
|
31
40
|
product.image = raw.image ?? null;
|
|
@@ -41,7 +50,6 @@ export class VendorProduct {
|
|
|
41
50
|
product.properties = raw.properties ?? null;
|
|
42
51
|
product.createdAt = raw.created_at ? new Date(raw.created_at) : null;
|
|
43
52
|
product.updatedAt = raw.updated_at ? new Date(raw.updated_at) : null;
|
|
44
|
-
return product;
|
|
45
53
|
}
|
|
46
54
|
}
|
|
47
55
|
function toNumber(value) {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ApiRecord } from '../../Model/ApiRecord.js';
|
|
2
|
+
/**
|
|
3
|
+
* One recorded price point of a competitor product — the `/pulse/vendor-products/:id/price-history`
|
|
4
|
+
* resource. Written when a crawl finds a price that differs from the last recorded one, so the
|
|
5
|
+
* entries are change points rather than a reading per crawl.
|
|
6
|
+
*/
|
|
7
|
+
export declare class VendorProductPriceHistoryEntry {
|
|
8
|
+
id: string;
|
|
9
|
+
vendorProductId: string;
|
|
10
|
+
price: number | null;
|
|
11
|
+
originalPrice: number | null;
|
|
12
|
+
shippingCost: number | null;
|
|
13
|
+
isInStock: boolean | null;
|
|
14
|
+
isPromotion: boolean | null;
|
|
15
|
+
recordedAt: Date | null;
|
|
16
|
+
constructor(id: string, vendorProductId: string);
|
|
17
|
+
static parse(raw: ApiRecord): VendorProductPriceHistoryEntry;
|
|
18
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One recorded price point of a competitor product — the `/pulse/vendor-products/:id/price-history`
|
|
3
|
+
* resource. Written when a crawl finds a price that differs from the last recorded one, so the
|
|
4
|
+
* entries are change points rather than a reading per crawl.
|
|
5
|
+
*/
|
|
6
|
+
export class VendorProductPriceHistoryEntry {
|
|
7
|
+
id;
|
|
8
|
+
vendorProductId;
|
|
9
|
+
price = null;
|
|
10
|
+
originalPrice = null;
|
|
11
|
+
shippingCost = null;
|
|
12
|
+
isInStock = null;
|
|
13
|
+
isPromotion = null;
|
|
14
|
+
recordedAt = null;
|
|
15
|
+
constructor(id, vendorProductId) {
|
|
16
|
+
this.id = id;
|
|
17
|
+
this.vendorProductId = vendorProductId;
|
|
18
|
+
}
|
|
19
|
+
static parse(raw) {
|
|
20
|
+
const entry = new VendorProductPriceHistoryEntry(raw.id, raw.vendor_product);
|
|
21
|
+
entry.price = toNumber(raw.price);
|
|
22
|
+
entry.originalPrice = toNumber(raw.original_price);
|
|
23
|
+
entry.shippingCost = toNumber(raw.shipping_cost);
|
|
24
|
+
entry.isInStock = typeof raw.is_in_stock === 'boolean' ? raw.is_in_stock : null;
|
|
25
|
+
entry.isPromotion = typeof raw.is_promotion === 'boolean' ? raw.is_promotion : null;
|
|
26
|
+
entry.recordedAt = raw.recorded_at ? new Date(raw.recorded_at) : null;
|
|
27
|
+
return entry;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function toNumber(value) {
|
|
31
|
+
if (value === null || value === undefined || value === '') {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
const parsed = Number(value);
|
|
35
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
36
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ApiRecord } from '../../Model/ApiRecord.js';
|
|
2
|
+
/** Progress of a match job that is running right now; null when none is. */
|
|
3
|
+
export type RunningMatch = {
|
|
4
|
+
productsTotal: number | null;
|
|
5
|
+
productsProcessed: number | null;
|
|
6
|
+
matchesFound: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* How fresh a competitor's data is within a catalog — the
|
|
10
|
+
* `/pulse/catalogs/:catalogId/vendors/:vendorId/status` resource.
|
|
11
|
+
*
|
|
12
|
+
* `shouldReindex` / `shouldRematch` are the API's judgement that the vendor's products have moved
|
|
13
|
+
* on since the last index or match run, so the UI can offer to re-run them.
|
|
14
|
+
*/
|
|
15
|
+
export declare class VendorStatus {
|
|
16
|
+
vendorId: string;
|
|
17
|
+
lastIndexedAt: Date | null;
|
|
18
|
+
lastImportedAt: Date | null;
|
|
19
|
+
lastMatchedAt: Date | null;
|
|
20
|
+
shouldReindex: boolean;
|
|
21
|
+
shouldRematch: boolean;
|
|
22
|
+
runningMatch: RunningMatch | null;
|
|
23
|
+
constructor(vendorId: string);
|
|
24
|
+
static parse(raw: ApiRecord): VendorStatus;
|
|
25
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How fresh a competitor's data is within a catalog — the
|
|
3
|
+
* `/pulse/catalogs/:catalogId/vendors/:vendorId/status` resource.
|
|
4
|
+
*
|
|
5
|
+
* `shouldReindex` / `shouldRematch` are the API's judgement that the vendor's products have moved
|
|
6
|
+
* on since the last index or match run, so the UI can offer to re-run them.
|
|
7
|
+
*/
|
|
8
|
+
export class VendorStatus {
|
|
9
|
+
vendorId;
|
|
10
|
+
lastIndexedAt = null;
|
|
11
|
+
lastImportedAt = null;
|
|
12
|
+
lastMatchedAt = null;
|
|
13
|
+
shouldReindex = false;
|
|
14
|
+
shouldRematch = false;
|
|
15
|
+
runningMatch = null;
|
|
16
|
+
constructor(vendorId) {
|
|
17
|
+
this.vendorId = vendorId;
|
|
18
|
+
}
|
|
19
|
+
static parse(raw) {
|
|
20
|
+
const status = new VendorStatus(raw.vendor);
|
|
21
|
+
status.lastIndexedAt = raw.last_indexed_at ? new Date(raw.last_indexed_at) : null;
|
|
22
|
+
status.lastImportedAt = raw.last_imported_at ? new Date(raw.last_imported_at) : null;
|
|
23
|
+
status.lastMatchedAt = raw.last_matched_at ? new Date(raw.last_matched_at) : null;
|
|
24
|
+
status.shouldReindex = raw.should_reindex === true;
|
|
25
|
+
status.shouldRematch = raw.should_rematch === true;
|
|
26
|
+
const running = raw.running_match ?? null;
|
|
27
|
+
status.runningMatch = running === null ? null : {
|
|
28
|
+
productsTotal: running.products_total ?? null,
|
|
29
|
+
productsProcessed: running.products_processed ?? null,
|
|
30
|
+
matchesFound: running.matches_found ?? 0,
|
|
31
|
+
};
|
|
32
|
+
return status;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CatalogId } from '../../Catalog/Model/CatalogId.js';
|
|
2
|
+
import { CursorPagination } from '../../Model/Pagination/CursorPagination.js';
|
|
3
|
+
import { CollectionResult } from '../../Model/Result/CollectionResult.js';
|
|
4
|
+
import { Endpoint } from '../../Service/Endpoint.js';
|
|
5
|
+
import { Competitor } from '../Model/Competitor.js';
|
|
6
|
+
/**
|
|
7
|
+
* The competitors a catalog is watched against — `/pulse/catalogs/:catalogId/competing-vendors`
|
|
8
|
+
* for the catalog's list, `/pulse/competing-vendors/:competitorId` for one.
|
|
9
|
+
*/
|
|
10
|
+
export declare class CompetitorEndpoint extends Endpoint {
|
|
11
|
+
getByCatalog(catalogId: CatalogId | string, pagination?: CursorPagination | null): Promise<CollectionResult<Competitor>>;
|
|
12
|
+
getById(competitorId: string): Promise<Competitor | null>;
|
|
13
|
+
/** Start watching a vendor as a competitor of this catalog. */
|
|
14
|
+
add(catalogId: CatalogId | string, vendorId: string): Promise<Competitor | null>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { QueryString } from '../../Http/Data/QueryString.js';
|
|
2
|
+
import { Endpoint } from '../../Service/Endpoint.js';
|
|
3
|
+
import { Competitor } from '../Model/Competitor.js';
|
|
4
|
+
/**
|
|
5
|
+
* The competitors a catalog is watched against — `/pulse/catalogs/:catalogId/competing-vendors`
|
|
6
|
+
* for the catalog's list, `/pulse/competing-vendors/:competitorId` for one.
|
|
7
|
+
*/
|
|
8
|
+
export class CompetitorEndpoint extends Endpoint {
|
|
9
|
+
async getByCatalog(catalogId, pagination = null) {
|
|
10
|
+
const queryString = new QueryString('/pulse/catalogs/' + catalogId.toString() + '/competing-vendors');
|
|
11
|
+
queryString.addPagination(pagination);
|
|
12
|
+
return await this.requestCollection(queryString, Competitor.parse);
|
|
13
|
+
}
|
|
14
|
+
async getById(competitorId) {
|
|
15
|
+
const result = await this.requestObject('/pulse/competing-vendors/' + competitorId, null, Competitor.parse, 'GET');
|
|
16
|
+
return result.getData();
|
|
17
|
+
}
|
|
18
|
+
/** Start watching a vendor as a competitor of this catalog. */
|
|
19
|
+
async add(catalogId, vendorId) {
|
|
20
|
+
const result = await this.requestObject('/pulse/catalogs/' + catalogId.toString() + '/competing-vendors', { vendor: vendorId }, Competitor.parse, 'POST');
|
|
21
|
+
return result.getData();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { CatalogId } from '../../Catalog/Model/CatalogId.js';
|
|
2
|
+
import { CursorPagination } from '../../Model/Pagination/CursorPagination.js';
|
|
3
|
+
import { CrawlJob, CrawlJobStatus } from '../Model/CrawlJob.js';
|
|
4
|
+
import { CollectionResult } from '../../Model/Result/CollectionResult.js';
|
|
5
|
+
import { Endpoint } from '../../Service/Endpoint.js';
|
|
3
6
|
/**
|
|
4
7
|
* Market Pulse crawl jobs — `/pulse/crawl-jobs`. Mirrors the PHP client's MarketPulse\CrawlJobEndpoint.
|
|
5
8
|
* A crawl job's lifecycle drives the vendor's "last scraped" timestamp and, on `finished`, triggers
|
|
@@ -11,7 +14,14 @@ export declare class CrawlJobEndpoint extends Endpoint {
|
|
|
11
14
|
/** Update a crawl job's status ('started', 'finished', 'cancelled'). */
|
|
12
15
|
updateStatus(crawlJobId: string, status: CrawlJobStatus): Promise<CrawlJob>;
|
|
13
16
|
/** A vendor's crawl jobs (newest first), each with progress (`total` / `processed`). */
|
|
14
|
-
getByVendor(vendorId: string): Promise<CrawlJob
|
|
17
|
+
getByVendor(vendorId: string, pagination?: CursorPagination | null): Promise<CollectionResult<CrawlJob>>;
|
|
18
|
+
/**
|
|
19
|
+
* Crawl jobs across every competitor of a catalog (newest first).
|
|
20
|
+
*
|
|
21
|
+
* A crawl job belongs to a vendor, not to a catalog — the API resolves the catalog's competitors
|
|
22
|
+
* and returns the jobs of their vendors.
|
|
23
|
+
*/
|
|
24
|
+
getByCatalog(catalogId: CatalogId | string, pagination?: CursorPagination | null): Promise<CollectionResult<CrawlJob>>;
|
|
15
25
|
/** The crawl job with this id, or null. */
|
|
16
26
|
getById(crawlJobId: string): Promise<CrawlJob | null>;
|
|
17
27
|
/** Register the pages this crawl will process (idempotent server-side). */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { QueryString } from '../../Http/Data/QueryString.js';
|
|
2
|
+
import { CrawlJob } from '../Model/CrawlJob.js';
|
|
3
|
+
import { Endpoint } from '../../Service/Endpoint.js';
|
|
3
4
|
/**
|
|
4
5
|
* Market Pulse crawl jobs — `/pulse/crawl-jobs`. Mirrors the PHP client's MarketPulse\CrawlJobEndpoint.
|
|
5
6
|
* A crawl job's lifecycle drives the vendor's "last scraped" timestamp and, on `finished`, triggers
|
|
@@ -25,9 +26,21 @@ export class CrawlJobEndpoint extends Endpoint {
|
|
|
25
26
|
return job;
|
|
26
27
|
}
|
|
27
28
|
/** A vendor's crawl jobs (newest first), each with progress (`total` / `processed`). */
|
|
28
|
-
async getByVendor(vendorId) {
|
|
29
|
-
const
|
|
30
|
-
|
|
29
|
+
async getByVendor(vendorId, pagination = null) {
|
|
30
|
+
const queryString = new QueryString('/pulse/vendors/' + vendorId + '/crawl-jobs');
|
|
31
|
+
queryString.addPagination(pagination);
|
|
32
|
+
return await this.requestCollection(queryString, CrawlJob.parse);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Crawl jobs across every competitor of a catalog (newest first).
|
|
36
|
+
*
|
|
37
|
+
* A crawl job belongs to a vendor, not to a catalog — the API resolves the catalog's competitors
|
|
38
|
+
* and returns the jobs of their vendors.
|
|
39
|
+
*/
|
|
40
|
+
async getByCatalog(catalogId, pagination = null) {
|
|
41
|
+
const queryString = new QueryString('/pulse/catalogs/' + catalogId.toString() + '/crawl-jobs');
|
|
42
|
+
queryString.addPagination(pagination);
|
|
43
|
+
return await this.requestCollection(queryString, CrawlJob.parse);
|
|
31
44
|
}
|
|
32
45
|
/** The crawl job with this id, or null. */
|
|
33
46
|
async getById(crawlJobId) {
|