@attlaz/client 1.133.0 → 1.135.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.
@@ -11,7 +11,9 @@ export declare class MarketPositionGroup {
11
11
  productCount: number;
12
12
  /** Of those, the ones with at least one counted competitor; the average and buckets cover only these. */
13
13
  comparedCount: number;
14
- /** Active products whose barcode a tracked competitor also sells: what could be compared at all. */
14
+ /** Products with at least one accepted match: what can be compared at all. */
15
+ matchedCount: number;
16
+ /** @deprecated Counts by barcode alone, which is not how matching decides; use `matchedCount`. */
15
17
  matchableCount: number;
16
18
  /** Our price against the median competitor price, averaged; −20 is 20% cheaper. Null when none compared. */
17
19
  avgPriceVsMedianPct: number | null;
@@ -10,7 +10,9 @@ export class MarketPositionGroup {
10
10
  productCount = 0;
11
11
  /** Of those, the ones with at least one counted competitor; the average and buckets cover only these. */
12
12
  comparedCount = 0;
13
- /** Active products whose barcode a tracked competitor also sells: what could be compared at all. */
13
+ /** Products with at least one accepted match: what can be compared at all. */
14
+ matchedCount = 0;
15
+ /** @deprecated Counts by barcode alone, which is not how matching decides; use `matchedCount`. */
14
16
  matchableCount = 0;
15
17
  /** Our price against the median competitor price, averaged; −20 is 20% cheaper. Null when none compared. */
16
18
  avgPriceVsMedianPct = null;
@@ -20,6 +22,7 @@ export class MarketPositionGroup {
20
22
  group.groupValue = raw.group_value ?? null;
21
23
  group.productCount = Number(raw.product_count ?? 0);
22
24
  group.comparedCount = Number(raw.compared_count ?? 0);
25
+ group.matchedCount = Number(raw.matched_count ?? 0);
23
26
  group.matchableCount = Number(raw.matchable_count ?? 0);
24
27
  group.avgPriceVsMedianPct = raw.avg_price_vs_median_pct === null || raw.avg_price_vs_median_pct === undefined ? null : Number(raw.avg_price_vs_median_pct);
25
28
  const buckets = raw.bucket_counts ?? {};
@@ -15,7 +15,14 @@ export declare class MarketPositionSummary {
15
15
  marketIndex: number | null;
16
16
  /** By value: the sum of our prices ÷ the sum of the median competitor prices × 100. */
17
17
  marketIndexByValue: number | null;
18
- /** Active products whose barcode a tracked competitor also sells: the ones that can be compared. */
18
+ /**
19
+ * Products with at least one accepted match: the ones that can be compared. The same products the
20
+ * Products list shows under "Has matches: accepted".
21
+ */
22
+ matchedCount: number;
23
+ /** Products with suggestions waiting in Match review and no accepted match yet. */
24
+ awaitingReviewCount: number;
25
+ /** @deprecated Counts by barcode alone, which is not how matching decides; use `matchedCount`. */
19
26
  matchableCount: number;
20
27
  /** The counted competitor prices, and how many of them a crawl saw within `recentDays`. */
21
28
  competitorPriceCount: number;
@@ -14,7 +14,14 @@ export class MarketPositionSummary {
14
14
  marketIndex = null;
15
15
  /** By value: the sum of our prices ÷ the sum of the median competitor prices × 100. */
16
16
  marketIndexByValue = null;
17
- /** Active products whose barcode a tracked competitor also sells: the ones that can be compared. */
17
+ /**
18
+ * Products with at least one accepted match: the ones that can be compared. The same products the
19
+ * Products list shows under "Has matches: accepted".
20
+ */
21
+ matchedCount = 0;
22
+ /** Products with suggestions waiting in Match review and no accepted match yet. */
23
+ awaitingReviewCount = 0;
24
+ /** @deprecated Counts by barcode alone, which is not how matching decides; use `matchedCount`. */
18
25
  matchableCount = 0;
19
26
  /** The counted competitor prices, and how many of them a crawl saw within `recentDays`. */
20
27
  competitorPriceCount = 0;
@@ -32,6 +39,8 @@ export class MarketPositionSummary {
32
39
  summary.computedAt = raw.computed_at ? new Date(raw.computed_at) : null;
33
40
  summary.marketIndex = raw.market_index === null || raw.market_index === undefined ? null : Number(raw.market_index);
34
41
  summary.marketIndexByValue = raw.market_index_by_value === null || raw.market_index_by_value === undefined ? null : Number(raw.market_index_by_value);
42
+ summary.matchedCount = Number(raw.matched_count ?? 0);
43
+ summary.awaitingReviewCount = Number(raw.awaiting_review_count ?? 0);
35
44
  summary.matchableCount = Number(raw.matchable_count ?? 0);
36
45
  summary.competitorPriceCount = Number(raw.competitor_price_count ?? 0);
37
46
  summary.recentCompetitorPriceCount = Number(raw.recent_competitor_price_count ?? 0);
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Which rule accepted a match without a person: an exact `barcode`, the same `manufacturer_number` under
3
+ * the same brand, or a `score` above the auto-accept threshold. Null on a person's decision and on
4
+ * anything not accepted, so filtering on one value finds every accept that rule made.
5
+ */
6
+ export type MatchDecisionRule = 'barcode' | 'manufacturer_number' | 'score';
@@ -0,0 +1 @@
1
+ export {};
@@ -43,6 +43,11 @@ export declare class ProductOpportunity {
43
43
  costPrice: number | null;
44
44
  /** The product's own currency. Never assume one — see DECISIONS.md (2026-08-08). */
45
45
  currency: string | null;
46
+ /**
47
+ * How many variants of the product this row stands for. Variants that agree on every value shown
48
+ * here are listed once, as one of them; 1 for a product listed on its own.
49
+ */
50
+ variantCount: number;
46
51
  constructor(id: string, catalogProductId: string, type: OpportunityType);
47
52
  static parse(raw: ApiRecord): ProductOpportunity;
48
53
  }
@@ -36,6 +36,11 @@ export class ProductOpportunity {
36
36
  costPrice = null;
37
37
  /** The product's own currency. Never assume one — see DECISIONS.md (2026-08-08). */
38
38
  currency = null;
39
+ /**
40
+ * How many variants of the product this row stands for. Variants that agree on every value shown
41
+ * here are listed once, as one of them; 1 for a product listed on its own.
42
+ */
43
+ variantCount = 1;
39
44
  constructor(id, catalogProductId, type) {
40
45
  this.id = id;
41
46
  this.catalogProductId = catalogProductId;
@@ -57,6 +62,7 @@ export class ProductOpportunity {
57
62
  opportunity.productBrand = raw.product_brand ?? null;
58
63
  opportunity.ownPrice = Number(raw.own_price ?? 0);
59
64
  opportunity.currency = raw.currency ?? null;
65
+ opportunity.variantCount = Number(raw.variant_count ?? 1);
60
66
  return opportunity;
61
67
  }
62
68
  }
@@ -1,4 +1,5 @@
1
1
  import { ApiRecord } from '../../Model/ApiRecord.js';
2
+ import { MatchDecisionRule } from './MatchDecisionRule.js';
2
3
  import { MatchDecisionSource } from './MatchDecisionSource.js';
3
4
  import { ProductMatchStatus } from './ProductMatch.js';
4
5
  /** One side of a match, reduced to what a reviewer needs to judge it. */
@@ -44,6 +45,8 @@ export declare class ReviewMatch {
44
45
  /** Who made the current decision; null only on rows that predate recording it. */
45
46
  decisionSource: MatchDecisionSource | null;
46
47
  decidedAt: Date | null;
48
+ /** Which rule accepted it without a person; null on a person's decision or when not accepted. */
49
+ decisionRule: MatchDecisionRule | null;
47
50
  own: ReviewProduct;
48
51
  competitor: ReviewCompetitorProduct;
49
52
  constructor(matchId: string, own: ReviewProduct, competitor: ReviewCompetitorProduct);
@@ -13,6 +13,8 @@ export class ReviewMatch {
13
13
  /** Who made the current decision; null only on rows that predate recording it. */
14
14
  decisionSource = null;
15
15
  decidedAt = null;
16
+ /** Which rule accepted it without a person; null on a person's decision or when not accepted. */
17
+ decisionRule = null;
16
18
  own;
17
19
  competitor;
18
20
  constructor(matchId, own, competitor) {
@@ -42,6 +44,7 @@ export class ReviewMatch {
42
44
  match.createdAt = raw.created_at ? new Date(raw.created_at) : null;
43
45
  match.decisionSource = raw.decision_source ?? null;
44
46
  match.decidedAt = raw.decided_at ? new Date(raw.decided_at) : null;
47
+ match.decisionRule = raw.decision_rule ?? null;
45
48
  return match;
46
49
  }
47
50
  static parseProduct(raw) {
@@ -1,3 +1,4 @@
1
+ import { MatchDecisionRule } from './MatchDecisionRule.js';
1
2
  import { MatchDecisionSource } from './MatchDecisionSource.js';
2
3
  /** Unknown confidence sorts last in both confidence orders. */
3
4
  export type ReviewMatchOrder = 'newest' | 'confidence_desc' | 'confidence_asc';
@@ -8,6 +9,7 @@ export type ReviewMatchOrder = 'newest' | 'confidence_desc' | 'confidence_asc';
8
9
  export type ReviewMatchFilters = {
9
10
  statuses?: string[];
10
11
  decisionSources?: MatchDecisionSource[];
12
+ decisionRules?: MatchDecisionRule[];
11
13
  competitor?: string;
12
14
  gtin?: string;
13
15
  search?: string;
@@ -27,6 +27,9 @@ export class ProductMatchEndpoint extends Endpoint {
27
27
  if (filters.decisionSources && filters.decisionSources.length > 0) {
28
28
  queryString.set('decision_source', filters.decisionSources.join(','));
29
29
  }
30
+ if (filters.decisionRules && filters.decisionRules.length > 0) {
31
+ queryString.set('decision_rule', filters.decisionRules.join(','));
32
+ }
30
33
  if (filters.order) {
31
34
  queryString.set('order', filters.order);
32
35
  }
package/dist/index.d.ts CHANGED
@@ -116,6 +116,7 @@ export { MatchHistoryBucket } from './MarketPulse/Model/MatchHistoryBucket.js';
116
116
  export { MatchHistoryInterval } from './MarketPulse/Model/MatchHistoryInterval.js';
117
117
  export { ReviewMatchFilters, ReviewMatchOrder } from './MarketPulse/Model/ReviewMatchFilters.js';
118
118
  export { MatchDecisionSource } from './MarketPulse/Model/MatchDecisionSource.js';
119
+ export { MatchDecisionRule } from './MarketPulse/Model/MatchDecisionRule.js';
119
120
  export { ProductMatchEndpoint } from './MarketPulse/Service/ProductMatchEndpoint.js';
120
121
  export { PulseCatalogProductFilterOptions } from './MarketPulse/Model/PulseCatalogProductFilterOptions.js';
121
122
  export { PulseCatalogProductFilters } from './MarketPulse/Model/PulseCatalogProductFilters.js';
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.132.0";
1
+ export declare const VERSION = "1.134.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "1.132.0";
1
+ export const VERSION = "1.134.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@attlaz/client",
3
- "version": "1.133.0",
3
+ "version": "1.135.0",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",