@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.
Files changed (150) hide show
  1. package/dist/Catalog/Model/Catalog.d.ts +19 -0
  2. package/dist/Catalog/Model/Catalog.js +28 -0
  3. package/dist/Catalog/Model/CatalogId.d.ts +4 -0
  4. package/dist/Catalog/Model/CatalogId.js +4 -0
  5. package/dist/Catalog/Model/CatalogProduct.d.ts +21 -0
  6. package/dist/Catalog/Model/CatalogProduct.js +31 -0
  7. package/dist/Catalog/Service/CatalogEndpoint.d.ts +15 -0
  8. package/dist/Catalog/Service/CatalogEndpoint.js +21 -0
  9. package/dist/Catalog/Service/CatalogProductEndpoint.d.ts +16 -0
  10. package/dist/Catalog/Service/CatalogProductEndpoint.js +24 -0
  11. package/dist/Client.d.ts +35 -7
  12. package/dist/Client.js +77 -7
  13. package/dist/DataQuality/Model/QualityDataset.d.ts +17 -0
  14. package/dist/DataQuality/Model/QualityDataset.js +26 -0
  15. package/dist/DataQuality/Model/QualityEntity.d.ts +24 -0
  16. package/dist/DataQuality/Model/QualityEntity.js +41 -0
  17. package/dist/DataQuality/Model/QualityProblem.d.ts +25 -0
  18. package/dist/DataQuality/Model/QualityProblem.js +43 -0
  19. package/dist/DataQuality/Service/QualityEndpoint.d.ts +45 -0
  20. package/dist/DataQuality/Service/QualityEndpoint.js +89 -0
  21. package/dist/EnhanceData/Model/GenerateContentBatch.d.ts +22 -0
  22. package/dist/EnhanceData/Model/GenerateContentBatch.js +34 -0
  23. package/dist/EnhanceData/Service/GenerateContentEndpoint.d.ts +23 -0
  24. package/dist/EnhanceData/Service/GenerateContentEndpoint.js +21 -0
  25. package/dist/FeedManagement/Model/CatalogFeed.d.ts +26 -0
  26. package/dist/FeedManagement/Model/CatalogFeed.js +51 -0
  27. package/dist/FeedManagement/Service/CatalogFeedEndpoint.d.ts +14 -0
  28. package/dist/FeedManagement/Service/CatalogFeedEndpoint.js +19 -0
  29. package/dist/{Model/Flow → Flow/Model}/Flow.d.ts +3 -3
  30. package/dist/{Model/Flow → Flow/Model}/Flow.js +1 -1
  31. package/dist/{Model/Flow → Flow/Model}/FlowRun.d.ts +3 -3
  32. package/dist/{Model/Flow → Flow/Model}/FlowRun.js +1 -1
  33. package/dist/{Model/Flow → Flow/Model}/FlowRunHistory.d.ts +1 -1
  34. package/dist/{Model/Flow → Flow/Model}/FlowRunLifecycle.d.ts +1 -1
  35. package/dist/{Model/Flow → Flow/Model}/FlowRunStats.d.ts +1 -1
  36. package/dist/{Model/Flow → Flow/Model}/FlowRunSummary.d.ts +1 -1
  37. package/dist/{Model/Flow → Flow/Model}/FlowSummary.d.ts +1 -1
  38. package/dist/{Service → Flow/Service}/FlowEndpoint.d.ts +5 -5
  39. package/dist/{Service → Flow/Service}/FlowEndpoint.js +6 -6
  40. package/dist/{Service → Flow/Service}/FlowRunEndpoint.d.ts +8 -8
  41. package/dist/{Service → Flow/Service}/FlowRunEndpoint.js +6 -6
  42. package/dist/Flow/Service/FlowRunRequestEndpoint.d.ts +6 -0
  43. package/dist/{Service → Flow/Service}/FlowRunRequestEndpoint.js +2 -2
  44. package/dist/{Service → Flow/Service}/FlowRunStatsEndpoint.d.ts +2 -2
  45. package/dist/{Service → Flow/Service}/FlowRunStatsEndpoint.js +2 -2
  46. package/dist/{Model/Log → Logging/Model}/Log.d.ts +2 -2
  47. package/dist/{Model/Log → Logging/Model}/Log.js +1 -1
  48. package/dist/{Model/Log → Logging/Model}/LogQuery.d.ts +1 -1
  49. package/dist/{Model/Log → Logging/Model}/LogStreamId.d.ts +1 -1
  50. package/dist/{Model/Log → Logging/Model}/LogStreamId.js +1 -1
  51. package/dist/{Model/Log → Logging/Model}/LogStreamInformation.d.ts +2 -2
  52. package/dist/{Service → Logging/Service}/LogEndpoint.d.ts +9 -9
  53. package/dist/{Service → Logging/Service}/LogEndpoint.js +6 -6
  54. package/dist/Model/Messaging/Subscriber.d.ts +1 -1
  55. package/dist/Model/Messaging/Subscriber.js +1 -1
  56. package/dist/Model/Search/SearchResult.d.ts +2 -2
  57. package/dist/Model/Search/SearchResult.js +2 -2
  58. package/dist/Pulse/Model/CatalogProductWithMatches.d.ts +31 -0
  59. package/dist/Pulse/Model/CatalogProductWithMatches.js +50 -0
  60. package/dist/Pulse/Model/CompetingVendorProduct.d.ts +15 -0
  61. package/dist/Pulse/Model/CompetingVendorProduct.js +21 -0
  62. package/dist/Pulse/Model/Competitor.d.ts +27 -0
  63. package/dist/Pulse/Model/Competitor.js +43 -0
  64. package/dist/{Model/Pulse → Pulse/Model}/CrawlJob.d.ts +2 -2
  65. package/dist/Pulse/Model/IndexJob.d.ts +19 -0
  66. package/dist/Pulse/Model/IndexJob.js +29 -0
  67. package/dist/Pulse/Model/MatchedVendorProduct.d.ts +29 -0
  68. package/dist/Pulse/Model/MatchedVendorProduct.js +48 -0
  69. package/dist/Pulse/Model/PriceAlertConfig.d.ts +22 -0
  70. package/dist/Pulse/Model/PriceAlertConfig.js +34 -0
  71. package/dist/Pulse/Model/PriceAlertEvent.d.ts +20 -0
  72. package/dist/Pulse/Model/PriceAlertEvent.js +33 -0
  73. package/dist/Pulse/Model/PriceIndexSnapshotEntry.d.ts +16 -0
  74. package/dist/Pulse/Model/PriceIndexSnapshotEntry.js +23 -0
  75. package/dist/Pulse/Model/PriceSuggestion.d.ts +29 -0
  76. package/dist/Pulse/Model/PriceSuggestion.js +46 -0
  77. package/dist/Pulse/Model/PricingRule.d.ts +30 -0
  78. package/dist/Pulse/Model/PricingRule.js +49 -0
  79. package/dist/Pulse/Model/ProductGroup.d.ts +25 -0
  80. package/dist/Pulse/Model/ProductGroup.js +36 -0
  81. package/dist/Pulse/Model/ProductMatch.d.ts +21 -0
  82. package/dist/Pulse/Model/ProductMatch.js +28 -0
  83. package/dist/Pulse/Model/ProductMatchJob.d.ts +27 -0
  84. package/dist/Pulse/Model/ProductMatchJob.js +42 -0
  85. package/dist/Pulse/Model/ReviewMatch.d.ts +42 -0
  86. package/dist/Pulse/Model/ReviewMatch.js +55 -0
  87. package/dist/Pulse/Model/TopCompetitor.d.ts +23 -0
  88. package/dist/Pulse/Model/TopCompetitor.js +37 -0
  89. package/dist/Pulse/Model/Vendor.d.ts +12 -0
  90. package/dist/Pulse/Model/Vendor.js +18 -0
  91. package/dist/{Model/Pulse → Pulse/Model}/VendorProduct.d.ts +6 -1
  92. package/dist/{Model/Pulse → Pulse/Model}/VendorProduct.js +9 -1
  93. package/dist/Pulse/Model/VendorProductPriceHistoryEntry.d.ts +18 -0
  94. package/dist/Pulse/Model/VendorProductPriceHistoryEntry.js +36 -0
  95. package/dist/Pulse/Model/VendorStatus.d.ts +25 -0
  96. package/dist/Pulse/Model/VendorStatus.js +34 -0
  97. package/dist/Pulse/Service/CompetitorEndpoint.d.ts +15 -0
  98. package/dist/Pulse/Service/CompetitorEndpoint.js +23 -0
  99. package/dist/{Service/Pulse → Pulse/Service}/CrawlJobEndpoint.d.ts +13 -3
  100. package/dist/{Service/Pulse → Pulse/Service}/CrawlJobEndpoint.js +18 -5
  101. package/dist/Pulse/Service/IndexJobEndpoint.d.ts +20 -0
  102. package/dist/Pulse/Service/IndexJobEndpoint.js +31 -0
  103. package/dist/Pulse/Service/PriceAlertEndpoint.d.ts +31 -0
  104. package/dist/Pulse/Service/PriceAlertEndpoint.js +42 -0
  105. package/dist/Pulse/Service/PricingEndpoint.d.ts +40 -0
  106. package/dist/Pulse/Service/PricingEndpoint.js +51 -0
  107. package/dist/Pulse/Service/ProductGroupEndpoint.d.ts +18 -0
  108. package/dist/Pulse/Service/ProductGroupEndpoint.js +19 -0
  109. package/dist/Pulse/Service/ProductMatchEndpoint.d.ts +47 -0
  110. package/dist/Pulse/Service/ProductMatchEndpoint.js +66 -0
  111. package/dist/Pulse/Service/ProductMatchJobEndpoint.d.ts +19 -0
  112. package/dist/Pulse/Service/ProductMatchJobEndpoint.js +30 -0
  113. package/dist/Pulse/Service/PulseCatalogProductEndpoint.d.ts +40 -0
  114. package/dist/Pulse/Service/PulseCatalogProductEndpoint.js +54 -0
  115. package/dist/Pulse/Service/PulseStatisticsEndpoint.d.ts +32 -0
  116. package/dist/Pulse/Service/PulseStatisticsEndpoint.js +39 -0
  117. package/dist/Pulse/Service/VendorProductEndpoint.d.ts +32 -0
  118. package/dist/{Service/Pulse → Pulse/Service}/VendorProductEndpoint.js +37 -2
  119. package/dist/Service/Endpoint.js +5 -3
  120. package/dist/index.d.ts +67 -27
  121. package/dist/index.js +67 -27
  122. package/dist/version.d.ts +1 -1
  123. package/dist/version.js +1 -1
  124. package/package.json +1 -1
  125. package/dist/Service/FlowRunRequestEndpoint.d.ts +0 -6
  126. package/dist/Service/Pulse/VendorProductEndpoint.d.ts +0 -14
  127. /package/dist/{Model/Flow → Flow/Model}/FlowRunHistory.js +0 -0
  128. /package/dist/{Model/Flow → Flow/Model}/FlowRunHistoryStatus.d.ts +0 -0
  129. /package/dist/{Model/Flow → Flow/Model}/FlowRunHistoryStatus.js +0 -0
  130. /package/dist/{Model/Flow → Flow/Model}/FlowRunLifecycle.js +0 -0
  131. /package/dist/{Model/Flow → Flow/Model}/FlowRunPriority.d.ts +0 -0
  132. /package/dist/{Model/Flow → Flow/Model}/FlowRunPriority.js +0 -0
  133. /package/dist/{Model/Flow → Flow/Model}/FlowRunResponse.d.ts +0 -0
  134. /package/dist/{Model/Flow → Flow/Model}/FlowRunResponse.js +0 -0
  135. /package/dist/{Model/Flow → Flow/Model}/FlowRunStats.js +0 -0
  136. /package/dist/{Model/Flow → Flow/Model}/FlowRunStatus.d.ts +0 -0
  137. /package/dist/{Model/Flow → Flow/Model}/FlowRunStatus.js +0 -0
  138. /package/dist/{Model/Flow → Flow/Model}/FlowRunSummary.js +0 -0
  139. /package/dist/{Model/Flow → Flow/Model}/FlowSummary.js +0 -0
  140. /package/dist/{Model/Flow → Flow/Model}/FlowTemplate.d.ts +0 -0
  141. /package/dist/{Model/Flow → Flow/Model}/FlowTemplate.js +0 -0
  142. /package/dist/{Model/Log → Logging/Model}/LogLevel.d.ts +0 -0
  143. /package/dist/{Model/Log → Logging/Model}/LogLevel.js +0 -0
  144. /package/dist/{Model/Log → Logging/Model}/LogQuery.js +0 -0
  145. /package/dist/{Model/Log → Logging/Model}/LogStatus.d.ts +0 -0
  146. /package/dist/{Model/Log → Logging/Model}/LogStatus.js +0 -0
  147. /package/dist/{Model/Log → Logging/Model}/LogStream.d.ts +0 -0
  148. /package/dist/{Model/Log → Logging/Model}/LogStream.js +0 -0
  149. /package/dist/{Model/Log → Logging/Model}/LogStreamInformation.js +0 -0
  150. /package/dist/{Model/Pulse → Pulse/Model}/CrawlJob.js +0 -0
@@ -3,8 +3,8 @@ import { AdapterConnection } from '../Adapter/AdapterConnection.js';
3
3
  import { CodeSource } from '../Deployment/CodeSource.js';
4
4
  import { CodeSourceAccount } from '../Deployment/CodeSourceAccount.js';
5
5
  import { EntityType } from '../EntityType.js';
6
- import { Flow } from '../Flow/Flow.js';
7
- import { FlowRun } from '../Flow/FlowRun.js';
6
+ import { Flow } from '../../Flow/Model/Flow.js';
7
+ import { FlowRun } from '../../Flow/Model/FlowRun.js';
8
8
  import { Channel } from '../Messaging/Channel/Channel.js';
9
9
  import { Subscriber } from '../Messaging/Subscriber.js';
10
10
  import { CodeDeploy } from '../Project/CodeDeploy.js';
@@ -0,0 +1,31 @@
1
+ import { ApiRecord } from '../../Model/ApiRecord.js';
2
+ import { MatchedVendorProduct } from './MatchedVendorProduct.js';
3
+ /** What a pricing strategy proposes for a product, and which rule proposed it. */
4
+ export type PriceProposal = {
5
+ price: number;
6
+ strategyName: string;
7
+ strategyDetails: string;
8
+ };
9
+ /**
10
+ * One of the catalog's products with the competitor products matched to it — the
11
+ * `/pulse/catalogs/:catalogId/products` resource.
12
+ *
13
+ * `costPrice` is only present when the catalog carries cost data; margin and profit are left to
14
+ * the caller, since what counts as margin differs per client.
15
+ */
16
+ export declare class CatalogProductWithMatches {
17
+ id: string;
18
+ name: string;
19
+ image: string | null;
20
+ gtin: string | null;
21
+ brand: string | null;
22
+ url: string | null;
23
+ price: number;
24
+ costPrice: number | null;
25
+ priceProposal: PriceProposal | null;
26
+ matches: MatchedVendorProduct[];
27
+ constructor(id: string);
28
+ /** Mean price of the matched competitor products; null when nothing matched. */
29
+ get matchesAveragePrice(): number | null;
30
+ static parse(raw: ApiRecord): CatalogProductWithMatches;
31
+ }
@@ -0,0 +1,50 @@
1
+ import { MatchedVendorProduct } from './MatchedVendorProduct.js';
2
+ /**
3
+ * One of the catalog's products with the competitor products matched to it — the
4
+ * `/pulse/catalogs/:catalogId/products` resource.
5
+ *
6
+ * `costPrice` is only present when the catalog carries cost data; margin and profit are left to
7
+ * the caller, since what counts as margin differs per client.
8
+ */
9
+ export class CatalogProductWithMatches {
10
+ id;
11
+ name = '';
12
+ image = null;
13
+ gtin = null;
14
+ brand = null;
15
+ url = null;
16
+ price = 0;
17
+ costPrice = null;
18
+ priceProposal = null;
19
+ matches = [];
20
+ constructor(id) {
21
+ this.id = id;
22
+ }
23
+ /** Mean price of the matched competitor products; null when nothing matched. */
24
+ get matchesAveragePrice() {
25
+ if (this.matches.length === 0) {
26
+ return null;
27
+ }
28
+ const total = this.matches.reduce((sum, match) => sum + match.price, 0);
29
+ return total / this.matches.length;
30
+ }
31
+ static parse(raw) {
32
+ const product = new CatalogProductWithMatches(raw.id);
33
+ product.name = raw.name ?? '';
34
+ product.image = raw.image ?? null;
35
+ product.gtin = raw.gtin ?? null;
36
+ product.brand = raw.brand ?? null;
37
+ product.url = raw.url ?? null;
38
+ product.price = parseFloat(raw.price) || 0;
39
+ product.costPrice = raw.cost_price ?? null;
40
+ const proposal = raw.price_proposal ?? null;
41
+ product.priceProposal = proposal === null ? null : {
42
+ price: proposal.price,
43
+ strategyName: proposal.strategy_name,
44
+ strategyDetails: proposal.strategy_details,
45
+ };
46
+ const matches = raw.matches ?? [];
47
+ product.matches = matches.map((match) => MatchedVendorProduct.parse(match));
48
+ return product;
49
+ }
50
+ }
@@ -0,0 +1,15 @@
1
+ import { ApiRecord } from '../../Model/ApiRecord.js';
2
+ import { VendorProduct } from './VendorProduct.js';
3
+ /**
4
+ * A competitor's product read through the catalog's competitor —
5
+ * `/pulse/competing-vendors/:competitorId/products`.
6
+ *
7
+ * The same product as {@link VendorProduct}; the competitor is what the catalog knows the vendor
8
+ * as, so it exists only on this view. A vendor can be a competitor in several catalogs, which is
9
+ * why `competitorId` is not a property of the product itself.
10
+ */
11
+ export declare class CompetingVendorProduct extends VendorProduct {
12
+ competitorId: string;
13
+ constructor(vendorId: string, identifier: string, competitorId: string);
14
+ static parse(raw: ApiRecord): CompetingVendorProduct;
15
+ }
@@ -0,0 +1,21 @@
1
+ import { VendorProduct } from './VendorProduct.js';
2
+ /**
3
+ * A competitor's product read through the catalog's competitor —
4
+ * `/pulse/competing-vendors/:competitorId/products`.
5
+ *
6
+ * The same product as {@link VendorProduct}; the competitor is what the catalog knows the vendor
7
+ * as, so it exists only on this view. A vendor can be a competitor in several catalogs, which is
8
+ * why `competitorId` is not a property of the product itself.
9
+ */
10
+ export class CompetingVendorProduct extends VendorProduct {
11
+ competitorId;
12
+ constructor(vendorId, identifier, competitorId) {
13
+ super(vendorId, identifier);
14
+ this.competitorId = competitorId;
15
+ }
16
+ static parse(raw) {
17
+ const product = new CompetingVendorProduct(raw.vendor, raw.identifier, raw.competitor);
18
+ product.fill(raw);
19
+ return product;
20
+ }
21
+ }
@@ -0,0 +1,27 @@
1
+ import { ApiRecord } from '../../Model/ApiRecord.js';
2
+ /**
3
+ * A vendor as one catalog watches it — the `/pulse/catalogs/:catalogId/competing-vendors` resource
4
+ * (a `Competitor` server-side). The same vendor can be a competitor in several catalogs, which is
5
+ * why the counts and timestamps below belong here and not on {@link Vendor}.
6
+ *
7
+ * `priceIndex` is this competitor's prices relative to the catalog's own, over the matched
8
+ * products: 100 means level, below 100 means the competitor is cheaper.
9
+ */
10
+ export declare class Competitor {
11
+ id: string;
12
+ vendorId: string;
13
+ name: string;
14
+ domain: string;
15
+ icon: string | null;
16
+ type: string | null;
17
+ /** Which index (embedding set) the competitor's products are held in. */
18
+ index: string;
19
+ matchCount: number;
20
+ productCount: number;
21
+ priceIndex: number;
22
+ lastScrapedAt: Date | null;
23
+ lastIndexedAt: Date | null;
24
+ lastMatchedAt: Date | null;
25
+ constructor(id: string, vendorId: string, name: string);
26
+ static parse(raw: ApiRecord): Competitor;
27
+ }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * A vendor as one catalog watches it — the `/pulse/catalogs/:catalogId/competing-vendors` resource
3
+ * (a `Competitor` server-side). The same vendor can be a competitor in several catalogs, which is
4
+ * why the counts and timestamps below belong here and not on {@link Vendor}.
5
+ *
6
+ * `priceIndex` is this competitor's prices relative to the catalog's own, over the matched
7
+ * products: 100 means level, below 100 means the competitor is cheaper.
8
+ */
9
+ export class Competitor {
10
+ id;
11
+ vendorId;
12
+ name;
13
+ domain = '';
14
+ icon = null;
15
+ type = null;
16
+ /** Which index (embedding set) the competitor's products are held in. */
17
+ index = '';
18
+ matchCount = 0;
19
+ productCount = 0;
20
+ priceIndex = 0;
21
+ lastScrapedAt = null;
22
+ lastIndexedAt = null;
23
+ lastMatchedAt = null;
24
+ constructor(id, vendorId, name) {
25
+ this.id = id;
26
+ this.vendorId = vendorId;
27
+ this.name = name;
28
+ }
29
+ static parse(raw) {
30
+ const competitor = new Competitor(raw.id, raw.vendor, raw.name ?? '');
31
+ competitor.domain = raw.domain ?? '';
32
+ competitor.icon = raw.icon ?? null;
33
+ competitor.type = raw.type ?? null;
34
+ competitor.index = raw.index ?? '';
35
+ competitor.matchCount = Number(raw.match_count ?? 0);
36
+ competitor.productCount = Number(raw.product_count ?? 0);
37
+ competitor.priceIndex = Number(raw.price_index ?? 0);
38
+ competitor.lastScrapedAt = raw.last_scraped_at ? new Date(raw.last_scraped_at) : null;
39
+ competitor.lastIndexedAt = raw.last_indexed_at ? new Date(raw.last_indexed_at) : null;
40
+ competitor.lastMatchedAt = raw.last_matched_at ? new Date(raw.last_matched_at) : null;
41
+ return competitor;
42
+ }
43
+ }
@@ -1,5 +1,5 @@
1
- import { ApiRecord } from '../ApiRecord.js';
2
- export type CrawlJobStatus = 'pending' | 'started' | 'cancelled' | 'finished';
1
+ import { ApiRecord } from '../../Model/ApiRecord.js';
2
+ export type CrawlJobStatus = 'pending' | 'started' | 'cancelled' | 'stopped' | 'finished';
3
3
  /**
4
4
  * A Market Pulse crawl job: one run of scraping a vendor. Its lifecycle (pending → started →
5
5
  * finished) drives the vendor's "last scraped" timestamp (`finishedAt`) and, on finish, triggers
@@ -0,0 +1,19 @@
1
+ import { ApiRecord } from '../../Model/ApiRecord.js';
2
+ export type IndexJobStatus = 'pending' | 'started' | 'cancelled' | 'stopped' | 'finished';
3
+ /**
4
+ * One run of building the embeddings for a vendor's products — the `/pulse/…/index-jobs` resource.
5
+ * Matching a competitor requires its products to be indexed first, so an index job is the step
6
+ * between crawling and {@link ProductMatchJob}.
7
+ */
8
+ export declare class IndexJob {
9
+ id: string;
10
+ vendorId: string;
11
+ status: IndexJobStatus;
12
+ productsTotal: number | null;
13
+ productsProcessed: number | null;
14
+ createdAt: Date | null;
15
+ startedAt: Date | null;
16
+ completedAt: Date | null;
17
+ constructor(id: string, vendorId: string);
18
+ static parse(raw: ApiRecord): IndexJob;
19
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * One run of building the embeddings for a vendor's products — the `/pulse/…/index-jobs` resource.
3
+ * Matching a competitor requires its products to be indexed first, so an index job is the step
4
+ * between crawling and {@link ProductMatchJob}.
5
+ */
6
+ export class IndexJob {
7
+ id;
8
+ vendorId;
9
+ status = 'pending';
10
+ productsTotal = null;
11
+ productsProcessed = null;
12
+ createdAt = null;
13
+ startedAt = null;
14
+ completedAt = null;
15
+ constructor(id, vendorId) {
16
+ this.id = id;
17
+ this.vendorId = vendorId;
18
+ }
19
+ static parse(raw) {
20
+ const job = new IndexJob(raw.id, raw.vendor);
21
+ job.status = raw.status ?? 'pending';
22
+ job.productsTotal = raw.products_total ?? null;
23
+ job.productsProcessed = raw.products_processed ?? null;
24
+ job.createdAt = raw.created_at ? new Date(raw.created_at) : null;
25
+ job.startedAt = raw.started_at ? new Date(raw.started_at) : null;
26
+ job.completedAt = raw.completed_at ? new Date(raw.completed_at) : null;
27
+ return job;
28
+ }
29
+ }
@@ -0,0 +1,29 @@
1
+ import { ApiRecord } from '../../Model/ApiRecord.js';
2
+ import { Vendor } from './Vendor.js';
3
+ /**
4
+ * A competitor's product as it appears against one of your own — what
5
+ * `/pulse/catalogs/:catalogId/products?expand=matches.vendor` nests under each product.
6
+ *
7
+ * It carries the competitor product's own fields plus the linkage back to the match record
8
+ * ({@link ProductMatch}) and the job that produced it, so the UI can show the price side by side
9
+ * and still open the match.
10
+ */
11
+ export declare class MatchedVendorProduct {
12
+ /** Id of the competitor's product. */
13
+ id: string;
14
+ /** Id of the match record joining it to your product; null for an unreviewed direct hit. */
15
+ matchId: string | null;
16
+ matchJobId: string | null;
17
+ vendor: Vendor | null;
18
+ name: string;
19
+ image: string | null;
20
+ brand: string | null;
21
+ gtin: string | null;
22
+ url: string | null;
23
+ price: number;
24
+ shippingCost: number;
25
+ inStock: boolean | null;
26
+ updatedAt: Date | null;
27
+ constructor(id: string);
28
+ static parse(raw: ApiRecord): MatchedVendorProduct;
29
+ }
@@ -0,0 +1,48 @@
1
+ import { Vendor } from './Vendor.js';
2
+ /**
3
+ * A competitor's product as it appears against one of your own — what
4
+ * `/pulse/catalogs/:catalogId/products?expand=matches.vendor` nests under each product.
5
+ *
6
+ * It carries the competitor product's own fields plus the linkage back to the match record
7
+ * ({@link ProductMatch}) and the job that produced it, so the UI can show the price side by side
8
+ * and still open the match.
9
+ */
10
+ export class MatchedVendorProduct {
11
+ /** Id of the competitor's product. */
12
+ id;
13
+ /** Id of the match record joining it to your product; null for an unreviewed direct hit. */
14
+ matchId = null;
15
+ matchJobId = null;
16
+ vendor = null;
17
+ name = '';
18
+ image = null;
19
+ brand = null;
20
+ gtin = null;
21
+ url = null;
22
+ price = 0;
23
+ shippingCost = 0;
24
+ inStock = null;
25
+ updatedAt = null;
26
+ constructor(id) {
27
+ this.id = id;
28
+ }
29
+ static parse(raw) {
30
+ const product = new MatchedVendorProduct(raw.id);
31
+ product.matchId = raw.match ?? null;
32
+ product.matchJobId = raw.match_job ?? null;
33
+ const vendor = raw.vendor;
34
+ if (vendor !== null && typeof vendor === 'object') {
35
+ product.vendor = Vendor.parse(vendor);
36
+ }
37
+ product.name = raw.name ?? '';
38
+ product.image = raw.image ?? null;
39
+ product.brand = raw.brand ?? null;
40
+ product.gtin = raw.gtin ?? null;
41
+ product.url = raw.url ?? null;
42
+ product.price = parseFloat(raw.price) || 0;
43
+ product.shippingCost = parseFloat(raw.shipping_cost) || 0;
44
+ product.inStock = typeof raw.in_stock === 'boolean' ? raw.in_stock : null;
45
+ product.updatedAt = raw.updated ? new Date(raw.updated) : null;
46
+ return product;
47
+ }
48
+ }
@@ -0,0 +1,22 @@
1
+ import { ApiRecord } from '../../Model/ApiRecord.js';
2
+ /**
3
+ * A standing rule that watches a catalog's prices against its competitors and notifies a channel
4
+ * when it fires — the `/pulse/price-alert-configs` resource.
5
+ *
6
+ * `conditionType` names the check and `conditionParams` carries its thresholds, so a new kind of
7
+ * alert does not change this shape. `productGroup` narrows it to part of the catalog.
8
+ */
9
+ export declare class PriceAlertConfig {
10
+ id: string;
11
+ catalogId: string;
12
+ name: string;
13
+ conditionType: string;
14
+ conditionParams: Record<string, unknown>;
15
+ productGroupId: string | null;
16
+ /** The messaging channel the alert is delivered to. */
17
+ channelId: string;
18
+ isActive: boolean;
19
+ createdAt: Date | null;
20
+ constructor(id: string, catalogId: string, name: string);
21
+ static parse(raw: ApiRecord): PriceAlertConfig;
22
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * A standing rule that watches a catalog's prices against its competitors and notifies a channel
3
+ * when it fires — the `/pulse/price-alert-configs` resource.
4
+ *
5
+ * `conditionType` names the check and `conditionParams` carries its thresholds, so a new kind of
6
+ * alert does not change this shape. `productGroup` narrows it to part of the catalog.
7
+ */
8
+ export class PriceAlertConfig {
9
+ id;
10
+ catalogId;
11
+ name;
12
+ conditionType = '';
13
+ conditionParams = {};
14
+ productGroupId = null;
15
+ /** The messaging channel the alert is delivered to. */
16
+ channelId = '';
17
+ isActive = true;
18
+ createdAt = null;
19
+ constructor(id, catalogId, name) {
20
+ this.id = id;
21
+ this.catalogId = catalogId;
22
+ this.name = name;
23
+ }
24
+ static parse(raw) {
25
+ const config = new PriceAlertConfig(raw.id, raw.catalog, raw.name ?? '');
26
+ config.conditionType = raw.condition_type ?? '';
27
+ config.conditionParams = raw.condition_params ?? {};
28
+ config.productGroupId = raw.product_group ?? null;
29
+ config.channelId = raw.channel_id ?? '';
30
+ config.isActive = raw.is_active !== false;
31
+ config.createdAt = raw.created_at ? new Date(raw.created_at) : null;
32
+ return config;
33
+ }
34
+ }
@@ -0,0 +1,20 @@
1
+ import { ApiRecord } from '../../Model/ApiRecord.js';
2
+ /**
3
+ * One firing of a {@link PriceAlertConfig} — the `/pulse/price-alert-configs/:id/events` resource.
4
+ *
5
+ * `data` holds the values that tripped the condition, so the event stays readable even after the
6
+ * prices move on. Acknowledging one records who dealt with it; it is not deleted.
7
+ */
8
+ export declare class PriceAlertEvent {
9
+ id: string;
10
+ alertConfigId: string;
11
+ catalogProductId: string | null;
12
+ vendorProductId: string | null;
13
+ triggeredAt: Date | null;
14
+ data: Record<string, unknown>;
15
+ acknowledgedAt: Date | null;
16
+ acknowledgedBy: string | null;
17
+ constructor(id: string, alertConfigId: string);
18
+ get isAcknowledged(): boolean;
19
+ static parse(raw: ApiRecord): PriceAlertEvent;
20
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * One firing of a {@link PriceAlertConfig} — the `/pulse/price-alert-configs/:id/events` resource.
3
+ *
4
+ * `data` holds the values that tripped the condition, so the event stays readable even after the
5
+ * prices move on. Acknowledging one records who dealt with it; it is not deleted.
6
+ */
7
+ export class PriceAlertEvent {
8
+ id;
9
+ alertConfigId;
10
+ catalogProductId = null;
11
+ vendorProductId = null;
12
+ triggeredAt = null;
13
+ data = {};
14
+ acknowledgedAt = null;
15
+ acknowledgedBy = null;
16
+ constructor(id, alertConfigId) {
17
+ this.id = id;
18
+ this.alertConfigId = alertConfigId;
19
+ }
20
+ get isAcknowledged() {
21
+ return this.acknowledgedAt !== null;
22
+ }
23
+ static parse(raw) {
24
+ const event = new PriceAlertEvent(raw.id, raw.alert_config);
25
+ event.catalogProductId = raw.catalog_product ?? null;
26
+ event.vendorProductId = raw.vendor_product ?? null;
27
+ event.triggeredAt = raw.triggered_at ? new Date(raw.triggered_at) : null;
28
+ event.data = raw.data ?? {};
29
+ event.acknowledgedAt = raw.acknowledged_at ? new Date(raw.acknowledged_at) : null;
30
+ event.acknowledgedBy = raw.acknowledged_by ?? null;
31
+ return event;
32
+ }
33
+ }
@@ -0,0 +1,16 @@
1
+ import { ApiRecord } from '../../Model/ApiRecord.js';
2
+ /**
3
+ * One competitor's price index on one day — the
4
+ * `/pulse/catalogs/:catalogId/statistics/price-index-history` resource.
5
+ *
6
+ * `date` stays the API's `YYYY-MM-DD` string rather than a Date: these are calendar buckets, and
7
+ * converting them to Date would push them across day boundaries in other timezones.
8
+ */
9
+ export declare class PriceIndexSnapshotEntry {
10
+ date: string;
11
+ competitorId: string;
12
+ priceIndex: number;
13
+ matchCount: number;
14
+ constructor(date: string, competitorId: string);
15
+ static parse(raw: ApiRecord): PriceIndexSnapshotEntry;
16
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * One competitor's price index on one day — the
3
+ * `/pulse/catalogs/:catalogId/statistics/price-index-history` resource.
4
+ *
5
+ * `date` stays the API's `YYYY-MM-DD` string rather than a Date: these are calendar buckets, and
6
+ * converting them to Date would push them across day boundaries in other timezones.
7
+ */
8
+ export class PriceIndexSnapshotEntry {
9
+ date;
10
+ competitorId;
11
+ priceIndex = 0;
12
+ matchCount = 0;
13
+ constructor(date, competitorId) {
14
+ this.date = date;
15
+ this.competitorId = competitorId;
16
+ }
17
+ static parse(raw) {
18
+ const entry = new PriceIndexSnapshotEntry(raw.date, raw.competitor_id);
19
+ entry.priceIndex = Number(raw.price_index ?? 0);
20
+ entry.matchCount = Number(raw.match_count ?? 0);
21
+ return entry;
22
+ }
23
+ }
@@ -0,0 +1,29 @@
1
+ import { ApiRecord } from '../../Model/ApiRecord.js';
2
+ export type PriceSuggestionStatus = 'pending' | 'approved' | 'rejected';
3
+ /**
4
+ * A proposed new price for one of the catalog's products — the `/pulse/price-suggestions` resource.
5
+ *
6
+ * Produced by a {@link PricingRule} (or by a strategy run directly, leaving `pricingRuleId` null).
7
+ * `reason` records the competitor prices the suggestion was derived from, so a reviewer can see why
8
+ * without re-deriving it. Approving one does not push the price: `appliedAt` is set once a flow has
9
+ * written it back to the shop.
10
+ */
11
+ export declare class PriceSuggestion {
12
+ id: string;
13
+ catalogProductId: string;
14
+ pricingRuleId: string | null;
15
+ currentPrice: number;
16
+ suggestedPrice: number;
17
+ strategyName: string;
18
+ strategyDetails: string | null;
19
+ reason: Record<string, unknown> | null;
20
+ status: PriceSuggestionStatus;
21
+ createdAt: Date | null;
22
+ reviewedAt: Date | null;
23
+ reviewedBy: string | null;
24
+ appliedAt: Date | null;
25
+ constructor(id: string, catalogProductId: string);
26
+ /** Difference against the current price; negative means the suggestion is a price cut. */
27
+ get priceDifference(): number;
28
+ static parse(raw: ApiRecord): PriceSuggestion;
29
+ }
@@ -0,0 +1,46 @@
1
+ /**
2
+ * A proposed new price for one of the catalog's products — the `/pulse/price-suggestions` resource.
3
+ *
4
+ * Produced by a {@link PricingRule} (or by a strategy run directly, leaving `pricingRuleId` null).
5
+ * `reason` records the competitor prices the suggestion was derived from, so a reviewer can see why
6
+ * without re-deriving it. Approving one does not push the price: `appliedAt` is set once a flow has
7
+ * written it back to the shop.
8
+ */
9
+ export class PriceSuggestion {
10
+ id;
11
+ catalogProductId;
12
+ pricingRuleId = null;
13
+ currentPrice = 0;
14
+ suggestedPrice = 0;
15
+ strategyName = '';
16
+ strategyDetails = null;
17
+ reason = null;
18
+ status = 'pending';
19
+ createdAt = null;
20
+ reviewedAt = null;
21
+ reviewedBy = null;
22
+ appliedAt = null;
23
+ constructor(id, catalogProductId) {
24
+ this.id = id;
25
+ this.catalogProductId = catalogProductId;
26
+ }
27
+ /** Difference against the current price; negative means the suggestion is a price cut. */
28
+ get priceDifference() {
29
+ return this.suggestedPrice - this.currentPrice;
30
+ }
31
+ static parse(raw) {
32
+ const suggestion = new PriceSuggestion(raw.id, raw.catalog_product);
33
+ suggestion.pricingRuleId = raw.pricing_rule ?? null;
34
+ suggestion.currentPrice = Number(raw.current_price ?? 0);
35
+ suggestion.suggestedPrice = Number(raw.suggested_price ?? 0);
36
+ suggestion.strategyName = raw.strategy_name ?? '';
37
+ suggestion.strategyDetails = raw.strategy_details ?? null;
38
+ suggestion.reason = raw.reason ?? null;
39
+ suggestion.status = raw.status ?? 'pending';
40
+ suggestion.createdAt = raw.created_at ? new Date(raw.created_at) : null;
41
+ suggestion.reviewedAt = raw.reviewed_at ? new Date(raw.reviewed_at) : null;
42
+ suggestion.reviewedBy = raw.reviewed_by ?? null;
43
+ suggestion.appliedAt = raw.applied_at ? new Date(raw.applied_at) : null;
44
+ return suggestion;
45
+ }
46
+ }
@@ -0,0 +1,30 @@
1
+ import { ApiRecord } from '../../Model/ApiRecord.js';
2
+ /**
3
+ * A rule that proposes a new price for part of a catalog — the `/pulse/pricing-rules` resource.
4
+ *
5
+ * `conditions` decides which products it applies to and `actionType` / `actionParams` what it does
6
+ * to their price (match the cheapest competitor, undercut by a percentage, …). The floor and
7
+ * ceiling are guard rails the action may not cross, and `priority` breaks ties when several rules
8
+ * match the same product — lower runs first.
9
+ */
10
+ export declare class PricingRule {
11
+ id: string;
12
+ catalogId: string;
13
+ name: string;
14
+ description: string | null;
15
+ productGroupId: string | null;
16
+ conditions: Record<string, unknown>;
17
+ actionType: string;
18
+ actionParams: Record<string, unknown>;
19
+ floorMargin: number | null;
20
+ floorPrice: number | null;
21
+ ceilingPrice: number | null;
22
+ /** Skip products with no cost price rather than pricing them without a margin guard. */
23
+ ignoreIfNoCostPrice: boolean;
24
+ priority: number;
25
+ isActive: boolean;
26
+ createdAt: Date | null;
27
+ updatedAt: Date | null;
28
+ constructor(id: string, catalogId: string, name: string);
29
+ static parse(raw: ApiRecord): PricingRule;
30
+ }
@@ -0,0 +1,49 @@
1
+ /**
2
+ * A rule that proposes a new price for part of a catalog — the `/pulse/pricing-rules` resource.
3
+ *
4
+ * `conditions` decides which products it applies to and `actionType` / `actionParams` what it does
5
+ * to their price (match the cheapest competitor, undercut by a percentage, …). The floor and
6
+ * ceiling are guard rails the action may not cross, and `priority` breaks ties when several rules
7
+ * match the same product — lower runs first.
8
+ */
9
+ export class PricingRule {
10
+ id;
11
+ catalogId;
12
+ name;
13
+ description = null;
14
+ productGroupId = null;
15
+ conditions = {};
16
+ actionType = '';
17
+ actionParams = {};
18
+ floorMargin = null;
19
+ floorPrice = null;
20
+ ceilingPrice = null;
21
+ /** Skip products with no cost price rather than pricing them without a margin guard. */
22
+ ignoreIfNoCostPrice = false;
23
+ priority = 0;
24
+ isActive = true;
25
+ createdAt = null;
26
+ updatedAt = null;
27
+ constructor(id, catalogId, name) {
28
+ this.id = id;
29
+ this.catalogId = catalogId;
30
+ this.name = name;
31
+ }
32
+ static parse(raw) {
33
+ const rule = new PricingRule(raw.id, raw.catalog, raw.name ?? '');
34
+ rule.description = raw.description ?? null;
35
+ rule.productGroupId = raw.product_group ?? null;
36
+ rule.conditions = raw.conditions ?? {};
37
+ rule.actionType = raw.action_type ?? '';
38
+ rule.actionParams = raw.action_params ?? {};
39
+ rule.floorMargin = raw.floor_margin ?? null;
40
+ rule.floorPrice = raw.floor_price ?? null;
41
+ rule.ceilingPrice = raw.ceiling_price ?? null;
42
+ rule.ignoreIfNoCostPrice = raw.ignore_if_no_cost_price === true;
43
+ rule.priority = Number(raw.priority ?? 0);
44
+ rule.isActive = raw.is_active !== false;
45
+ rule.createdAt = raw.created_at ? new Date(raw.created_at) : null;
46
+ rule.updatedAt = raw.updated_at ? new Date(raw.updated_at) : null;
47
+ return rule;
48
+ }
49
+ }