@attlaz/client 1.109.0 → 1.111.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/MarketPulse/Model/ProductOpportunity.d.ts +7 -0
- package/dist/MarketPulse/Model/ProductOpportunity.js +9 -0
- package/dist/MarketPulse/Service/CrawlJobEndpoint.d.ts +11 -4
- package/dist/MarketPulse/Service/CrawlJobEndpoint.js +16 -4
- package/dist/MarketPulse/Service/IndexJobEndpoint.d.ts +5 -4
- package/dist/MarketPulse/Service/IndexJobEndpoint.js +10 -8
- package/dist/MarketPulse/Service/OpportunityEndpoint.d.ts +6 -1
- package/dist/MarketPulse/Service/OpportunityEndpoint.js +7 -1
- package/dist/MarketPulse/Service/ProductMatchJobEndpoint.d.ts +5 -4
- package/dist/MarketPulse/Service/ProductMatchJobEndpoint.js +10 -8
- package/dist/index.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -33,7 +33,14 @@ export declare class ProductOpportunity {
|
|
|
33
33
|
productName: string;
|
|
34
34
|
productImage: string | null;
|
|
35
35
|
productBrand: string | null;
|
|
36
|
+
productSku: string | null;
|
|
36
37
|
ownPrice: number;
|
|
38
|
+
/**
|
|
39
|
+
* What the product costs you. **Null means unknown, not free** — the API resolves a stored zero
|
|
40
|
+
* to null where the catalog's source uses zero for "never entered". The same unknown is why
|
|
41
|
+
* `marginPct` can be null.
|
|
42
|
+
*/
|
|
43
|
+
costPrice: number | null;
|
|
37
44
|
/** The product's own currency. Never assume one — see DECISIONS.md (2026-08-08). */
|
|
38
45
|
currency: string | null;
|
|
39
46
|
constructor(id: string, catalogProductId: string, type: OpportunityType);
|
|
@@ -26,7 +26,14 @@ export class ProductOpportunity {
|
|
|
26
26
|
productName = '';
|
|
27
27
|
productImage = null;
|
|
28
28
|
productBrand = null;
|
|
29
|
+
productSku = null;
|
|
29
30
|
ownPrice = 0;
|
|
31
|
+
/**
|
|
32
|
+
* What the product costs you. **Null means unknown, not free** — the API resolves a stored zero
|
|
33
|
+
* to null where the catalog's source uses zero for "never entered". The same unknown is why
|
|
34
|
+
* `marginPct` can be null.
|
|
35
|
+
*/
|
|
36
|
+
costPrice = null;
|
|
30
37
|
/** The product's own currency. Never assume one — see DECISIONS.md (2026-08-08). */
|
|
31
38
|
currency = null;
|
|
32
39
|
constructor(id, catalogProductId, type) {
|
|
@@ -44,6 +51,8 @@ export class ProductOpportunity {
|
|
|
44
51
|
opportunity.computedAt = raw.computed_at ? new Date(raw.computed_at) : null;
|
|
45
52
|
opportunity.configVersion = Number(raw.config_version ?? 0);
|
|
46
53
|
opportunity.productName = raw.product_name ?? '';
|
|
54
|
+
opportunity.productSku = raw.product_sku ?? null;
|
|
55
|
+
opportunity.costPrice = raw.cost_price === null || raw.cost_price === undefined ? null : Number(raw.cost_price);
|
|
47
56
|
opportunity.productImage = raw.product_image ?? null;
|
|
48
57
|
opportunity.productBrand = raw.product_brand ?? null;
|
|
49
58
|
opportunity.ownPrice = Number(raw.own_price ?? 0);
|
|
@@ -20,15 +20,22 @@ export declare class CrawlJobEndpoint extends Endpoint {
|
|
|
20
20
|
create(vendorId: string, isPartial?: boolean): Promise<CrawlJob>;
|
|
21
21
|
/** Update a crawl job's status ('started', 'finished', 'cancelled'). */
|
|
22
22
|
updateStatus(crawlJobId: string, status: CrawlJobStatus): Promise<CrawlJob>;
|
|
23
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* A single vendor's crawl jobs, newest first.
|
|
25
|
+
*
|
|
26
|
+
* Kept alongside the catalog list because `crawl_job` records no catalog: the scraping flow asks
|
|
27
|
+
* "is this vendor already being crawled?" knowing only a vendor. Prefer {@link getByCatalog} for
|
|
28
|
+
* anything user-facing — it is scoped to a catalog the caller can see.
|
|
29
|
+
*/
|
|
24
30
|
getByVendor(vendorId: string, pagination?: CursorPagination | null): Promise<CollectionResult<CrawlJob>>;
|
|
25
31
|
/**
|
|
26
|
-
* Crawl jobs across every competitor of a catalog (newest first)
|
|
32
|
+
* Crawl jobs across every competitor of a catalog (newest first), each with progress
|
|
33
|
+
* (`total` / `processed`). Pass `vendorIds` to narrow to one or more competitors.
|
|
27
34
|
*
|
|
28
35
|
* A crawl job belongs to a vendor, not to a catalog — the API resolves the catalog's competitors
|
|
29
|
-
* and returns the jobs of their vendors.
|
|
36
|
+
* and returns the jobs of their vendors. A vendor outside this catalog is rejected.
|
|
30
37
|
*/
|
|
31
|
-
getByCatalog(catalogId: CatalogId | string, pagination?: CursorPagination | null): Promise<CollectionResult<CrawlJob>>;
|
|
38
|
+
getByCatalog(catalogId: CatalogId | string, pagination?: CursorPagination | null, vendorIds?: string[] | null): Promise<CollectionResult<CrawlJob>>;
|
|
32
39
|
/** The crawl job with this id, or null. */
|
|
33
40
|
getById(crawlJobId: string): Promise<CrawlJob | null>;
|
|
34
41
|
/** Register the pages this crawl will process (idempotent server-side). */
|
|
@@ -33,21 +33,33 @@ export class CrawlJobEndpoint extends Endpoint {
|
|
|
33
33
|
}
|
|
34
34
|
return job;
|
|
35
35
|
}
|
|
36
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* A single vendor's crawl jobs, newest first.
|
|
38
|
+
*
|
|
39
|
+
* Kept alongside the catalog list because `crawl_job` records no catalog: the scraping flow asks
|
|
40
|
+
* "is this vendor already being crawled?" knowing only a vendor. Prefer {@link getByCatalog} for
|
|
41
|
+
* anything user-facing — it is scoped to a catalog the caller can see.
|
|
42
|
+
*/
|
|
37
43
|
async getByVendor(vendorId, pagination = null) {
|
|
38
44
|
const queryString = new QueryString(path('/pulse/vendors/:vendorId/crawl-jobs', { vendorId }));
|
|
39
45
|
queryString.addPagination(pagination);
|
|
40
46
|
return await this.requestCollection(queryString, CrawlJob.parse);
|
|
41
47
|
}
|
|
42
48
|
/**
|
|
43
|
-
* Crawl jobs across every competitor of a catalog (newest first)
|
|
49
|
+
* Crawl jobs across every competitor of a catalog (newest first), each with progress
|
|
50
|
+
* (`total` / `processed`). Pass `vendorIds` to narrow to one or more competitors.
|
|
44
51
|
*
|
|
45
52
|
* A crawl job belongs to a vendor, not to a catalog — the API resolves the catalog's competitors
|
|
46
|
-
* and returns the jobs of their vendors.
|
|
53
|
+
* and returns the jobs of their vendors. A vendor outside this catalog is rejected.
|
|
47
54
|
*/
|
|
48
|
-
async getByCatalog(catalogId, pagination = null) {
|
|
55
|
+
async getByCatalog(catalogId, pagination = null, vendorIds = null) {
|
|
49
56
|
const queryString = new QueryString(path('/pulse/catalogs/:catalogId/crawl-jobs', { catalogId: catalogId.toString() }));
|
|
50
57
|
queryString.addPagination(pagination);
|
|
58
|
+
if (vendorIds !== null && vendorIds.length > 0) {
|
|
59
|
+
// Repeated param (`vendor=a&vendor=b`) — QueryString expands arrays, and the API reads it
|
|
60
|
+
// with getOptionalCollection.
|
|
61
|
+
queryString.set('vendor', vendorIds);
|
|
62
|
+
}
|
|
51
63
|
return await this.requestCollection(queryString, CrawlJob.parse);
|
|
52
64
|
}
|
|
53
65
|
/** The crawl job with this id, or null. */
|
|
@@ -9,10 +9,11 @@ import { VendorStatus } from '../Model/VendorStatus.js';
|
|
|
9
9
|
* can be matched — and the resulting per-vendor freshness status.
|
|
10
10
|
*/
|
|
11
11
|
export declare class IndexJobEndpoint extends Endpoint {
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Index jobs across every competitor of a catalog, newest first. Pass `vendorIds` to narrow to one or more
|
|
14
|
+
* competitors; a vendor outside this catalog is rejected.
|
|
15
|
+
*/
|
|
16
|
+
getByCatalog(catalogId: CatalogId | string, pagination?: CursorPagination | null, vendorIds?: string[] | null): Promise<CollectionResult<IndexJob>>;
|
|
16
17
|
/** Queue a re-index of a competitor's products, so later matching sees current data. */
|
|
17
18
|
requestReindex(catalogId: CatalogId | string, vendorId: string): Promise<void>;
|
|
18
19
|
/** How fresh a competitor's index and matches are, plus any match job running right now. */
|
|
@@ -8,16 +8,18 @@ import { VendorStatus } from '../Model/VendorStatus.js';
|
|
|
8
8
|
* can be matched — and the resulting per-vendor freshness status.
|
|
9
9
|
*/
|
|
10
10
|
export class IndexJobEndpoint extends Endpoint {
|
|
11
|
-
/**
|
|
12
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Index jobs across every competitor of a catalog, newest first. Pass `vendorIds` to narrow to one or more
|
|
13
|
+
* competitors; a vendor outside this catalog is rejected.
|
|
14
|
+
*/
|
|
15
|
+
async getByCatalog(catalogId, pagination = null, vendorIds = null) {
|
|
13
16
|
const queryString = new QueryString(path('/pulse/catalogs/:catalogId/index-jobs', { catalogId: catalogId.toString() }));
|
|
14
17
|
queryString.addPagination(pagination);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
queryString.addPagination(pagination);
|
|
18
|
+
if (vendorIds !== null && vendorIds.length > 0) {
|
|
19
|
+
// Repeated param (`vendor=a&vendor=b`) — QueryString expands arrays, and the API reads it
|
|
20
|
+
// with getOptionalCollection.
|
|
21
|
+
queryString.set('vendor', vendorIds);
|
|
22
|
+
}
|
|
21
23
|
return await this.requestCollection(queryString, IndexJob.parse);
|
|
22
24
|
}
|
|
23
25
|
/** Queue a re-index of a competitor's products, so later matching sees current data. */
|
|
@@ -3,6 +3,11 @@ import { CursorPagination } from '../../Model/Pagination/CursorPagination.js';
|
|
|
3
3
|
import { CollectionResult } from '../../Model/Result/CollectionResult.js';
|
|
4
4
|
import { Endpoint } from '../../Service/Endpoint.js';
|
|
5
5
|
import { OpportunityType, ProductOpportunity } from '../Model/ProductOpportunity.js';
|
|
6
|
+
/** Narrowing of the worklist. `brand` is an exact match; `sku` matches a fragment. */
|
|
7
|
+
export type OpportunityFilters = {
|
|
8
|
+
brand?: string;
|
|
9
|
+
sku?: string;
|
|
10
|
+
};
|
|
6
11
|
/**
|
|
7
12
|
* The pricing opportunity worklist — `/pulse/catalogs/:catalogId/opportunities`.
|
|
8
13
|
*/
|
|
@@ -13,5 +18,5 @@ export declare class OpportunityEndpoint extends Endpoint {
|
|
|
13
18
|
* Pass a `type`: the score means something different per type, so an unfiltered read interleaves
|
|
14
19
|
* four scales into one order. Unfiltered is an overview of what exists, not a ranked worklist.
|
|
15
20
|
*/
|
|
16
|
-
getOpportunities(catalogId: CatalogId | string, pagination?: CursorPagination | null, type?: OpportunityType | null): Promise<CollectionResult<ProductOpportunity>>;
|
|
21
|
+
getOpportunities(catalogId: CatalogId | string, pagination?: CursorPagination | null, type?: OpportunityType | null, filters?: OpportunityFilters | null): Promise<CollectionResult<ProductOpportunity>>;
|
|
17
22
|
}
|
|
@@ -12,11 +12,17 @@ export class OpportunityEndpoint extends Endpoint {
|
|
|
12
12
|
* Pass a `type`: the score means something different per type, so an unfiltered read interleaves
|
|
13
13
|
* four scales into one order. Unfiltered is an overview of what exists, not a ranked worklist.
|
|
14
14
|
*/
|
|
15
|
-
async getOpportunities(catalogId, pagination = null, type = null) {
|
|
15
|
+
async getOpportunities(catalogId, pagination = null, type = null, filters = null) {
|
|
16
16
|
const queryString = new QueryString(path('/pulse/catalogs/:catalogId/opportunities', { catalogId: catalogId.toString() }));
|
|
17
17
|
if (type !== null) {
|
|
18
18
|
queryString.set('type', type);
|
|
19
19
|
}
|
|
20
|
+
if (filters?.brand !== undefined) {
|
|
21
|
+
queryString.set('brand', filters.brand);
|
|
22
|
+
}
|
|
23
|
+
if (filters?.sku !== undefined) {
|
|
24
|
+
queryString.set('sku', filters.sku);
|
|
25
|
+
}
|
|
20
26
|
queryString.addPagination(pagination);
|
|
21
27
|
return await this.requestCollection(queryString, ProductOpportunity.parse);
|
|
22
28
|
}
|
|
@@ -8,10 +8,11 @@ import { Endpoint } from '../../Service/Endpoint.js';
|
|
|
8
8
|
* so they share {@link ProductMatchJob}.
|
|
9
9
|
*/
|
|
10
10
|
export declare class ProductMatchJobEndpoint extends Endpoint {
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Every match job of a catalog, newest first. Pass `vendorIds` to narrow to one or more of
|
|
13
|
+
* its competitors; a vendor outside this catalog is rejected.
|
|
14
|
+
*/
|
|
15
|
+
getByCatalog(catalogId: CatalogId | string, pagination?: CursorPagination | null, vendorIds?: string[] | null): Promise<CollectionResult<ProductMatchJob>>;
|
|
15
16
|
/** Queue a matching run of the catalog against one competitor. */
|
|
16
17
|
requestMatching(catalogId: CatalogId | string, vendorId: string): Promise<void>;
|
|
17
18
|
/** The match job with this id, or null. */
|
|
@@ -7,16 +7,18 @@ import { Endpoint } from '../../Service/Endpoint.js';
|
|
|
7
7
|
* so they share {@link ProductMatchJob}.
|
|
8
8
|
*/
|
|
9
9
|
export class ProductMatchJobEndpoint extends Endpoint {
|
|
10
|
-
/**
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Every match job of a catalog, newest first. Pass `vendorIds` to narrow to one or more of
|
|
12
|
+
* its competitors; a vendor outside this catalog is rejected.
|
|
13
|
+
*/
|
|
14
|
+
async getByCatalog(catalogId, pagination = null, vendorIds = null) {
|
|
12
15
|
const queryString = new QueryString(path('/pulse/catalogs/:catalogId/match-jobs', { catalogId: catalogId.toString() }));
|
|
13
16
|
queryString.addPagination(pagination);
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
queryString.addPagination(pagination);
|
|
17
|
+
if (vendorIds !== null && vendorIds.length > 0) {
|
|
18
|
+
// Repeated param (`vendor=a&vendor=b`) — QueryString expands arrays, and the API reads it
|
|
19
|
+
// with getOptionalCollection.
|
|
20
|
+
queryString.set('vendor', vendorIds);
|
|
21
|
+
}
|
|
20
22
|
return await this.requestCollection(queryString, ProductMatchJob.parse);
|
|
21
23
|
}
|
|
22
24
|
/** Queue a matching run of the catalog against one competitor. */
|
package/dist/index.d.ts
CHANGED
|
@@ -123,7 +123,7 @@ export { PriceSuggestion, PriceSuggestionStatus } from './MarketPulse/Model/Pric
|
|
|
123
123
|
export { PricingRuleData } from './MarketPulse/Model/PricingRuleData.js';
|
|
124
124
|
export { PricingEndpoint } from './MarketPulse/Service/PricingEndpoint.js';
|
|
125
125
|
export { ProductOpportunity, OpportunityType } from './MarketPulse/Model/ProductOpportunity.js';
|
|
126
|
-
export { OpportunityEndpoint } from './MarketPulse/Service/OpportunityEndpoint.js';
|
|
126
|
+
export { OpportunityEndpoint, OpportunityFilters } from './MarketPulse/Service/OpportunityEndpoint.js';
|
|
127
127
|
export { ProductGroup, ProductGroupType } from './MarketPulse/Model/ProductGroup.js';
|
|
128
128
|
export { ProductGroupData } from './MarketPulse/Model/ProductGroupData.js';
|
|
129
129
|
export { ProductGroupEndpoint } from './MarketPulse/Service/ProductGroupEndpoint.js';
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.110.0";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "1.
|
|
1
|
+
export const VERSION = "1.110.0";
|