rerobe-js-orm 4.1.7 → 4.1.8

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.
@@ -248,7 +248,11 @@ class ReRobeProductHelpers {
248
248
  }
249
249
  const baseTitle = parts.join(' ');
250
250
  // For non-'Vintage' brands, append "by ${brand.trim()}"
251
- const titleWithBrand = !brand.includes('Vintage') ? `${baseTitle} by ${brand.trim()}` : baseTitle;
251
+ const titleWithBrand = !(brand.toLowerCase().trim().includes('vintage') ||
252
+ brand.toLowerCase().trim().includes('unknown') ||
253
+ brand.toLowerCase().trim().includes('none'))
254
+ ? `${brand.trim()} - ${baseTitle}`
255
+ : baseTitle;
252
256
  // Add size to the end of the title if it's available
253
257
  return size && size.trim() !== ''
254
258
  ? `${titleWithBrand}, Size ${standardSize ? standardSize.trim() : size.trim()}`
@@ -264,11 +268,12 @@ class ReRobeProductHelpers {
264
268
  }
265
269
  static autoCreateMetaDescription(productObj) {
266
270
  var _a;
267
- const { color, productType, productStyle, condition, size, standardSize, brand, sizeComment, materialComposition } = productObj;
271
+ const { color, productType, productStyle, condition, size, standardSize, brand, sizeComment, materialComposition, gender, } = productObj;
268
272
  const materials = this.materialCompJoinedString(materialComposition);
269
273
  const fit = ((_a = options_1.sizeCommentOptions.find((option) => option.value === sizeComment)) === null || _a === void 0 ? void 0 : _a.label) || '';
270
274
  const joinedProductStyle = productStyle.join(', ');
271
275
  const elements = [
276
+ gender && `Primary segment: ${gender}`,
272
277
  brand && `Brand: ${brand}`,
273
278
  size && `Size: ${standardSize ? standardSize : size}`,
274
279
  color && `Color: ${color}`,
@@ -278,9 +283,8 @@ class ReRobeProductHelpers {
278
283
  materials && `Material: ${materials}`,
279
284
  fit && `Fit: ${fit}`,
280
285
  ].filter(Boolean); // Removes any falsey values
281
- const baseDescription = elements.join(', ').slice(0, 500);
282
- const ellipsis = baseDescription.length >= 500 ? '...' : '';
283
- return baseDescription + ellipsis;
286
+ const baseDescription = elements.join(', ');
287
+ return baseDescription;
284
288
  }
285
289
  static autoCreateFullSwedishDescriptionForTraderaHTML(productDescription, merchantName = 'våra') {
286
290
  return `
@@ -700,6 +704,7 @@ class ReRobeProductHelpers {
700
704
  color: productObj.color || 'various',
701
705
  size: productObj.standardSize || 'unknown',
702
706
  material: this.materialCompJoinedString(productObj.materialComposition),
707
+ identifier_exists: 'no',
703
708
  };
704
709
  }
705
710
  }
@@ -258,6 +258,7 @@ function singularizeProductType(word) {
258
258
  'Skjortor & Blusar': '',
259
259
  Kjolar: 'Kjol',
260
260
  Toppar: 'Topp',
261
+ Jeans: 'Jeans',
261
262
  // ... potentially more irregulars
262
263
  };
263
264
  if (irregulars.hasOwnProperty(word)) {
@@ -492,7 +492,11 @@ class Product extends Base_1.default {
492
492
  }
493
493
  const baseTitle = parts.join(' ');
494
494
  // For non-'Vintage' brands, append "by ${brand.trim()}"
495
- const titleWithBrand = !brand.includes('Vintage') ? `${baseTitle} by ${brand.trim()}` : baseTitle;
495
+ const titleWithBrand = !(brand.toLowerCase().trim().includes('vintage') ||
496
+ brand.toLowerCase().trim().includes('unknown') ||
497
+ brand.toLowerCase().trim().includes('none'))
498
+ ? `${brand.trim()} - ${baseTitle}`
499
+ : baseTitle;
496
500
  // Add size to the end of the title if it's available
497
501
  return size && size.trim() !== ''
498
502
  ? `${titleWithBrand}, Size ${standardSize ? standardSize.trim() : size.trim()}`
@@ -600,12 +604,13 @@ class Product extends Base_1.default {
600
604
  }
601
605
  autoCreateMetaDescription() {
602
606
  var _a;
603
- const { color, productType, productStyle, condition, size, brand, standardSize } = this.filterAttributes;
607
+ const { color, productType, productStyle, condition, size, brand, standardSize, gender } = this.filterAttributes;
604
608
  const { sizeComment } = this.consignmentAttributes;
605
609
  const materials = this.materialCompJoinedString();
606
610
  const fit = ((_a = options_1.sizeCommentOptions.find((option) => option.value === sizeComment)) === null || _a === void 0 ? void 0 : _a.label) || '';
607
611
  const joinedProductStyle = productStyle.join(', ');
608
612
  const elements = [
613
+ gender && `Primary segment: ${gender}`,
609
614
  brand && `Brand: ${brand}`,
610
615
  size && `Size: ${standardSize ? standardSize : size}`,
611
616
  color && `Color: ${color}`,
@@ -615,9 +620,8 @@ class Product extends Base_1.default {
615
620
  materials && `Material: ${materials}`,
616
621
  fit && `Fit: ${fit}`,
617
622
  ].filter(Boolean); // Removes any falsey values
618
- const baseDescription = elements.join(', ').slice(0, 500);
619
- const ellipsis = baseDescription.length >= 500 ? '...' : '';
620
- return baseDescription + ellipsis;
623
+ const baseDescription = elements.join(', ');
624
+ return baseDescription;
621
625
  }
622
626
  generateSchemaForTypesense(name = 'prod_products_20220503') {
623
627
  return {
@@ -363,6 +363,7 @@ type GoogleMerchantCenterProductObj = {
363
363
  color: string;
364
364
  size: string;
365
365
  material: string;
366
+ identifier_exists?: string;
366
367
  style?: string;
367
368
  weight?: number;
368
369
  weight_unit?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "4.1.7",
3
+ "version": "4.1.8",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",