@factorypure/client-helpers 1.1.26 → 1.1.28

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/index.d.ts CHANGED
@@ -385,6 +385,7 @@ export declare const scrapeResultsSchema: z.ZodObject<{
385
385
  parsed_results: z.ZodOptional<z.ZodNull>;
386
386
  lowest_price: z.ZodOptional<z.ZodNull>;
387
387
  highest_price: z.ZodOptional<z.ZodNull>;
388
+ listing_hash: z.ZodOptional<z.ZodNull>;
388
389
  latest_source_count: z.ZodOptional<z.ZodNull>;
389
390
  largest_source_count: z.ZodOptional<z.ZodNull>;
390
391
  is_immersive: z.ZodOptional<z.ZodNull>;
@@ -575,6 +576,8 @@ export declare const variantScrapeOptionsSchema: z.ZodObject<{
575
576
  key_parts: z.ZodString;
576
577
  }, z.core.$strip>>>;
577
578
  day_window: z.ZodNullable<z.ZodString>;
579
+ latest_margin_email_sent_at: z.ZodNullable<z.ZodString>;
580
+ latest_map_email_sent_at: z.ZodNullable<z.ZodString>;
578
581
  }, z.core.$strip>;
579
582
  export type VariantScrapeOptionsType = z.infer<typeof variantScrapeOptionsSchema>;
580
583
  declare const matchConfirmationSchema: z.ZodObject<{
package/dist/index.js CHANGED
@@ -279,6 +279,7 @@ export const scrapeResultsSchema = z.object({
279
279
  parsed_results: z.null().optional(),
280
280
  lowest_price: z.null().optional(),
281
281
  highest_price: z.null().optional(),
282
+ listing_hash: z.null().optional(),
282
283
  latest_source_count: z.null().optional(),
283
284
  largest_source_count: z.null().optional(),
284
285
  is_immersive: z.null().optional(),
@@ -380,6 +381,8 @@ export const variantScrapeOptionsSchema = z.object({
380
381
  found_product_ids: z.array(z.string()),
381
382
  result_ignore_keys: z.array(ResultIgnoreSchema).nullable(),
382
383
  day_window: z.string().nullable(),
384
+ latest_margin_email_sent_at: z.string().nullable(),
385
+ latest_map_email_sent_at: z.string().nullable(),
383
386
  });
384
387
  const matchConfirmationSchema = z.object({
385
388
  confirmation_source: z.string(),
@@ -1644,8 +1647,10 @@ export const filterScrapeResultsV2 = ({ scrapeResults, variant, variantScrapeOpt
1644
1647
  function handleDuplicatesV2(results) {
1645
1648
  const filteredUniqueResultsMap = {};
1646
1649
  results.forEach((item) => {
1647
- // @ts-ignore
1648
1650
  const key = item.listing_hash;
1651
+ if (!key) {
1652
+ return;
1653
+ }
1649
1654
  if (!filteredUniqueResultsMap[key]) {
1650
1655
  filteredUniqueResultsMap[key] = item;
1651
1656
  }
@@ -2255,7 +2260,7 @@ export function getShownResults(matchResult, sortedResults, minConfidence, sortD
2255
2260
  const bPrice = b.extracted_total || b.extracted_price || 0;
2256
2261
  return sortDirection === 'asc' ? aPrice - bPrice : bPrice - aPrice;
2257
2262
  });
2258
- return shownResults;
2263
+ return shownResults.filter((r) => r.source !== 'FactoryPure');
2259
2264
  }
2260
2265
  /**
2261
2266
  * Derives the needs-review results from a MatchResult.
@@ -2289,5 +2294,5 @@ export function getNeedsReviewResults(matchResult, sortedResults, shownResults,
2289
2294
  const bPrice = b.extracted_total || b.extracted_price || 0;
2290
2295
  return aPrice - bPrice;
2291
2296
  });
2292
- return needsReviewResults;
2297
+ return needsReviewResults.filter((r) => r.source !== 'FactoryPure');
2293
2298
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@factorypure/client-helpers",
3
- "version": "1.1.26",
3
+ "version": "1.1.28",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",