rerobe-js-orm 3.2.9 → 3.3.1

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.
@@ -4,7 +4,7 @@ const ProductFactory_1 = require("./ProductFactory");
4
4
  const Product_1 = require("../../models/Product");
5
5
  class ProductFromFormState extends ProductFactory_1.default {
6
6
  createProduct(props) {
7
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19;
7
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21;
8
8
  const productAttributes = {
9
9
  availableForSale: props.fields.availableForSale.selectedValue,
10
10
  description: props.fields.description.inputValue,
@@ -33,9 +33,11 @@ class ProductFromFormState extends ProductFactory_1.default {
33
33
  editorAuthorizations: props.fields.editorAuthorizations.selectedValue,
34
34
  rfidTag: props.fields.rfidTag.inputValue || '',
35
35
  sku: props.fields.sku.inputValue || '',
36
+ metaDataDescription: ((_o = props.fields.metaDataTitle) === null || _o === void 0 ? void 0 : _o.inputValue) || '',
37
+ metaDataTitle: ((_p = props.fields.metaDataTitle) === null || _p === void 0 ? void 0 : _p.inputValue) || '',
36
38
  };
37
39
  const productFilterAttributes = {
38
- documentId: (_o = props.props) === null || _o === void 0 ? void 0 : _o.documentId,
40
+ documentId: (_q = props.props) === null || _q === void 0 ? void 0 : _q.documentId,
39
41
  brand: props.fields.brand.selectedValue,
40
42
  measurementCategory: props.fields.measurementCategory.selectedValue,
41
43
  size: props.fields.size.selectedValue,
@@ -56,7 +58,7 @@ class ProductFromFormState extends ProductFactory_1.default {
56
58
  tags: props.fields.tags.selectedValues || [],
57
59
  };
58
60
  const consignmentAttributes = {
59
- sellRequestId: ((_p = props.props) === null || _p === void 0 ? void 0 : _p.sellRequestId) || '',
61
+ sellRequestId: ((_r = props.props) === null || _r === void 0 ? void 0 : _r.sellRequestId) || '',
60
62
  publishType: props.fields.publishType.selectedValue,
61
63
  conditionRemarks: props.fields.conditionRemarks.inputValue,
62
64
  productRemarks: props.fields.productRemarks.inputValue,
@@ -69,47 +71,47 @@ class ProductFromFormState extends ProductFactory_1.default {
69
71
  nextAvailableSeason: props.fields.nextAvailableSeason.selectedValue,
70
72
  notesForProductionTeam: props.fields.notesForProductionTeam.inputValue,
71
73
  reviewedBy: props.fields.reviewedBy.selectedValue,
72
- sellRequestImageUrls: ((_q = props.props) === null || _q === void 0 ? void 0 : _q.sellRequestImageUrls) || [],
74
+ sellRequestImageUrls: ((_s = props.props) === null || _s === void 0 ? void 0 : _s.sellRequestImageUrls) || [],
73
75
  salesChannel: props.fields.salesChannel.selectedValues || [],
74
76
  sizeComment: props.fields.sizeComment.selectedValue,
75
- salePrice: ((_r = props.props) === null || _r === void 0 ? void 0 : _r.salePrice) || '',
77
+ salePrice: ((_t = props.props) === null || _t === void 0 ? void 0 : _t.salePrice) || '',
76
78
  isOnSale: props.fields.isOnSale.selectedValue || '',
77
79
  discountType: props.fields.discountType.selectedValue || '',
78
80
  discountValue: props.fields.discountValue.inputValue || '',
79
- selectedForClearance: ((_s = props.props) === null || _s === void 0 ? void 0 : _s.selectedForClearance) || '',
81
+ selectedForClearance: ((_u = props.props) === null || _u === void 0 ? void 0 : _u.selectedForClearance) || '',
80
82
  locationIds: props.fields.locationIds.selectedValues || [],
81
83
  inventoryLocations: props.fields.inventoryLocations.selectedValues || [],
82
84
  majorDefects: props.fields.majorDefects.selectedValues || [],
83
85
  minorDefects: props.fields.minorDefects.selectedValues || [],
84
86
  };
85
87
  const timestampAttributes = {
86
- createdAtTimestamp: (_t = props.props) === null || _t === void 0 ? void 0 : _t.createdAtTimestamp,
87
- updatedAtTimestamp: (_u = props.props) === null || _u === void 0 ? void 0 : _u.updatedAtTimestamp,
88
- sellRequestReviewTimestamp: (_v = props.props) === null || _v === void 0 ? void 0 : _v.sellRequestReviewTimestamp,
89
- sellRequestReviewDraftTimestamp: (_w = props.props) === null || _w === void 0 ? void 0 : _w.sellRequestReviewDraftTimestamp,
90
- rejectedTimestamp: (_x = props.props) === null || _x === void 0 ? void 0 : _x.rejectedTimestamp,
91
- holdTimestamp: (_y = props.props) === null || _y === void 0 ? void 0 : _y.holdTimestamp,
92
- acceptedTimestamp: (_z = props.props) === null || _z === void 0 ? void 0 : _z.acceptedTimestamp,
93
- sellerToDropOffTimestamp: (_0 = props.props) === null || _0 === void 0 ? void 0 : _0.sellerToDropOffTimestamp,
94
- sellerToShipTimestamp: (_1 = props.props) === null || _1 === void 0 ? void 0 : _1.sellerToShipTimestamp,
95
- sellerToGetPickUpTimestamp: (_2 = props.props) === null || _2 === void 0 ? void 0 : _2.sellerToGetPickUpTimestamp,
96
- qualityControlTimestamp: (_3 = props.props) === null || _3 === void 0 ? void 0 : _3.qualityControlTimestamp,
97
- pendingPublicationTimestamp: (_4 = props.props) === null || _4 === void 0 ? void 0 : _4.pendingPublicationTimestamp,
98
- listedTimestamp: (_5 = props.props) === null || _5 === void 0 ? void 0 : _5.listedTimestamp,
99
- clearanceTimestamp: (_6 = props.props) === null || _6 === void 0 ? void 0 : _6.clearanceTimestamp,
100
- reservedTimestamp: (_7 = props.props) === null || _7 === void 0 ? void 0 : _7.reservedTimestamp,
101
- soldTimestamp: (_8 = props.props) === null || _8 === void 0 ? void 0 : _8.soldTimestamp,
102
- returnedTimestamp: (_9 = props.props) === null || _9 === void 0 ? void 0 : _9.returnedTimestamp,
103
- soldSellerToBePaidTimestamp: (_10 = props.props) === null || _10 === void 0 ? void 0 : _10.soldSellerToBePaidTimestamp,
104
- soldSellerPaidTimestamp: (_11 = props.props) === null || _11 === void 0 ? void 0 : _11.soldSellerPaidTimestamp,
105
- sellerSelfRejectTimestamp: (_12 = props.props) === null || _12 === void 0 ? void 0 : _12.sellerSelfRejectTimestamp,
106
- liquidationRequestedTimestamp: (_13 = props.props) === null || _13 === void 0 ? void 0 : _13.liquidationRequestedTimestamp,
107
- sellerLiquidatedTimestamp: (_14 = props.props) === null || _14 === void 0 ? void 0 : _14.sellerLiquidatedTimestamp,
108
- archivedTimestamp: (_15 = props.props) === null || _15 === void 0 ? void 0 : _15.archivedTimestamp,
109
- liquidationReadyTimestamp: (_16 = props.props) === null || _16 === void 0 ? void 0 : _16.liquidationReadyTimestamp,
110
- sellerDonatedTimestamp: (_17 = props.props) === null || _17 === void 0 ? void 0 : _17.sellerDonatedTimestamp,
111
- merchantDonatedTimestamp: (_18 = props.props) === null || _18 === void 0 ? void 0 : _18.merchantDonatedTimestamp,
112
- draftTimestamp: (_19 = props.props) === null || _19 === void 0 ? void 0 : _19.draftTimestamp,
88
+ createdAtTimestamp: (_v = props.props) === null || _v === void 0 ? void 0 : _v.createdAtTimestamp,
89
+ updatedAtTimestamp: (_w = props.props) === null || _w === void 0 ? void 0 : _w.updatedAtTimestamp,
90
+ sellRequestReviewTimestamp: (_x = props.props) === null || _x === void 0 ? void 0 : _x.sellRequestReviewTimestamp,
91
+ sellRequestReviewDraftTimestamp: (_y = props.props) === null || _y === void 0 ? void 0 : _y.sellRequestReviewDraftTimestamp,
92
+ rejectedTimestamp: (_z = props.props) === null || _z === void 0 ? void 0 : _z.rejectedTimestamp,
93
+ holdTimestamp: (_0 = props.props) === null || _0 === void 0 ? void 0 : _0.holdTimestamp,
94
+ acceptedTimestamp: (_1 = props.props) === null || _1 === void 0 ? void 0 : _1.acceptedTimestamp,
95
+ sellerToDropOffTimestamp: (_2 = props.props) === null || _2 === void 0 ? void 0 : _2.sellerToDropOffTimestamp,
96
+ sellerToShipTimestamp: (_3 = props.props) === null || _3 === void 0 ? void 0 : _3.sellerToShipTimestamp,
97
+ sellerToGetPickUpTimestamp: (_4 = props.props) === null || _4 === void 0 ? void 0 : _4.sellerToGetPickUpTimestamp,
98
+ qualityControlTimestamp: (_5 = props.props) === null || _5 === void 0 ? void 0 : _5.qualityControlTimestamp,
99
+ pendingPublicationTimestamp: (_6 = props.props) === null || _6 === void 0 ? void 0 : _6.pendingPublicationTimestamp,
100
+ listedTimestamp: (_7 = props.props) === null || _7 === void 0 ? void 0 : _7.listedTimestamp,
101
+ clearanceTimestamp: (_8 = props.props) === null || _8 === void 0 ? void 0 : _8.clearanceTimestamp,
102
+ reservedTimestamp: (_9 = props.props) === null || _9 === void 0 ? void 0 : _9.reservedTimestamp,
103
+ soldTimestamp: (_10 = props.props) === null || _10 === void 0 ? void 0 : _10.soldTimestamp,
104
+ returnedTimestamp: (_11 = props.props) === null || _11 === void 0 ? void 0 : _11.returnedTimestamp,
105
+ soldSellerToBePaidTimestamp: (_12 = props.props) === null || _12 === void 0 ? void 0 : _12.soldSellerToBePaidTimestamp,
106
+ soldSellerPaidTimestamp: (_13 = props.props) === null || _13 === void 0 ? void 0 : _13.soldSellerPaidTimestamp,
107
+ sellerSelfRejectTimestamp: (_14 = props.props) === null || _14 === void 0 ? void 0 : _14.sellerSelfRejectTimestamp,
108
+ liquidationRequestedTimestamp: (_15 = props.props) === null || _15 === void 0 ? void 0 : _15.liquidationRequestedTimestamp,
109
+ sellerLiquidatedTimestamp: (_16 = props.props) === null || _16 === void 0 ? void 0 : _16.sellerLiquidatedTimestamp,
110
+ archivedTimestamp: (_17 = props.props) === null || _17 === void 0 ? void 0 : _17.archivedTimestamp,
111
+ liquidationReadyTimestamp: (_18 = props.props) === null || _18 === void 0 ? void 0 : _18.liquidationReadyTimestamp,
112
+ sellerDonatedTimestamp: (_19 = props.props) === null || _19 === void 0 ? void 0 : _19.sellerDonatedTimestamp,
113
+ merchantDonatedTimestamp: (_20 = props.props) === null || _20 === void 0 ? void 0 : _20.merchantDonatedTimestamp,
114
+ draftTimestamp: (_21 = props.props) === null || _21 === void 0 ? void 0 : _21.draftTimestamp,
113
115
  };
114
116
  return new Product_1.default(Object.assign(Object.assign(Object.assign(Object.assign({}, productAttributes), productFilterAttributes), consignmentAttributes), timestampAttributes));
115
117
  }
@@ -78,6 +78,8 @@ class ProductFormState extends FormState_1.default {
78
78
  this.fields.featuredCollections = this.fieldFactory('multiSelect', 'featuredCollections');
79
79
  this.fields.primaryAgeCategory = this.fieldFactory('singleSelect', 'primaryAgeCategory');
80
80
  this.fields.tags = this.fieldFactory('multiSelect', 'tags');
81
+ this.fields.metaDataTitle = this.fieldFactory('textInput', 'metaDataTitle');
82
+ this.fields.metaDataDescription = this.fieldFactory('textInput', 'metaDataDescription');
81
83
  }
82
84
  autoCreateTitle() {
83
85
  return this.createProduct().autoCreateTitle();
@@ -772,7 +774,7 @@ class ProductFormState extends FormState_1.default {
772
774
  onChangeHandler = (val) => this.priceInputChangeHandler(val);
773
775
  }
774
776
  if (fieldKey === 'reRobeCommission') {
775
- inputValue = this.props[fieldKey] || '0.5';
777
+ inputValue = this.props[fieldKey] || '';
776
778
  valid = true;
777
779
  }
778
780
  if (fieldKey === 'discountValue') {
@@ -28,4 +28,5 @@ export default class Utilities {
28
28
  createdAtYear: string;
29
29
  };
30
30
  humanize(str: string): string;
31
+ singularizeProductType(word: string): string;
31
32
  }
@@ -175,5 +175,25 @@ class Utilities {
175
175
  const result = str.replace(/([A-Z])/g, ' $1');
176
176
  return result.charAt(0).toUpperCase() + result.slice(1);
177
177
  }
178
+ singularizeProductType(word) {
179
+ const irregulars = {
180
+ Blazers: 'Blazer',
181
+ Jumpsuits: 'Jumpsuit',
182
+ Skirts: 'Skirt',
183
+ Tops: 'Top',
184
+ Dresses: 'Dress',
185
+ 'Suit Jacket': '',
186
+ 'Shirts & Blouses': '',
187
+ Outerwear: '',
188
+ // ... potentially more irregulars
189
+ };
190
+ if (irregulars.hasOwnProperty(word)) {
191
+ return irregulars[word];
192
+ }
193
+ if (word.endsWith('s')) {
194
+ return word.slice(0, -1);
195
+ }
196
+ return word;
197
+ }
178
198
  }
179
199
  exports.default = Utilities;
@@ -14,7 +14,9 @@ export default class Product extends Base {
14
14
  toObjForTypesense(): TypesenseProductObj;
15
15
  updateSelfFromTranslatedTextArray(translatedTextArray?: string[]): void;
16
16
  autoCreateTitle(): string;
17
+ autoCreateMetaDataTitle(): string;
17
18
  autoCreateDescriptionHTML(): string;
19
+ autoCreateMetaDescription(): string;
18
20
  generateSchemaForTypesense(name?: string): {
19
21
  default_sorting_field: string;
20
22
  fields: ({
@@ -35,6 +35,8 @@ class Product extends Base_1.default {
35
35
  editorAuthorizations: (props === null || props === void 0 ? void 0 : props.editorAuthorizations) || {},
36
36
  rfidTag: (props === null || props === void 0 ? void 0 : props.rfidTag) || '',
37
37
  sku: (props === null || props === void 0 ? void 0 : props.sku) || '',
38
+ metaDataTitle: (props === null || props === void 0 ? void 0 : props.metaDataTitle) || '',
39
+ metaDataDescription: (props === null || props === void 0 ? void 0 : props.metaDataDescription) || '',
38
40
  };
39
41
  this.filterAttributes = {
40
42
  documentId: (props === null || props === void 0 ? void 0 : props.documentId) || this.utilities.makeRandId(28),
@@ -405,78 +407,97 @@ class Product extends Base_1.default {
405
407
  });
406
408
  }
407
409
  autoCreateTitle() {
408
- const color = this.filterAttributes.color;
409
- let productType = this.filterAttributes.productType;
410
- const productStyle = this.filterAttributes.productStyle.join(', ');
411
- const brand = this.filterAttributes.brand;
412
- if (productType === 'Suit Jacket' || productType === 'Shirts & Blouses' || productType === 'Outerwear') {
413
- productType = '';
414
- }
415
- if (['Blazers', 'Jumpsuits', 'Skirts', 'Tops'].includes(productType)) {
416
- productType = productType.substring(0, productType.length - 1);
417
- }
418
- if (productType === 'Dresses') {
419
- productType = 'Dress';
420
- }
421
- let result;
422
- if (brand.includes('Vintage')) {
423
- if (productType !== '') {
424
- if (productStyle.length === 0) {
425
- result = `${color.trim()} ${brand.trim()} ${productType.trim()}`;
426
- }
427
- result = `${color.trim()} ${brand.trim()} ${productStyle.trim()} ${productType.trim()}`;
410
+ const { color, productType, productStyle } = this.filterAttributes;
411
+ const singularProductType = this.utilities.singularizeProductType(productType);
412
+ // Function to build the title without brand and size
413
+ const buildTitle = (includeProductType) => {
414
+ const parts = [color.trim()];
415
+ if (productStyle && productStyle.length > 0) {
416
+ parts.push(productStyle.join(', ').trim());
428
417
  }
429
- else {
430
- result = `${color.trim()} ${brand.trim()} ${productStyle.trim()}`;
418
+ if (includeProductType && singularProductType) {
419
+ parts.push(singularProductType.trim());
431
420
  }
432
- return result;
421
+ return parts.join(' ');
422
+ };
423
+ // Generate the result
424
+ let result = buildTitle(true);
425
+ if (!singularProductType) {
426
+ // If product type should not be included in the title
427
+ result = buildTitle(false);
433
428
  }
434
- if (productType !== '') {
435
- if (productStyle.length === 0) {
436
- result = `${color.trim()} ${productType.trim()} by ${brand.trim()}`;
429
+ return this.utilities.capitalizeString(result).trim();
430
+ }
431
+ autoCreateMetaDataTitle() {
432
+ const { color, productType, productStyle, brand, size } = this.filterAttributes;
433
+ // Singularize the product type
434
+ const singularProductType = this.utilities.singularizeProductType(productType);
435
+ // Function to build the title
436
+ const buildTitle = (includeProductType) => {
437
+ const parts = [color.trim(), brand.trim()];
438
+ if (productStyle && productStyle.length > 0) {
439
+ parts.push(productStyle.join(', ').trim());
437
440
  }
438
- result = `${color.trim()} ${productStyle.trim()} ${productType.trim()} by ${brand.trim()}`;
439
- }
440
- else {
441
- result = `${color.trim()} ${productStyle.trim()} by ${brand.trim()}`;
441
+ if (includeProductType && singularProductType) {
442
+ parts.push(singularProductType.trim());
443
+ }
444
+ const baseTitle = parts.join(' ');
445
+ const titleWithBrand = brand.includes('Vintage') ? baseTitle : `${baseTitle} by ${brand.trim()}`;
446
+ // Add size to the end of the title if it's available
447
+ return size && size.trim() !== '' ? `${titleWithBrand}, Size ${size.trim()}` : titleWithBrand;
448
+ };
449
+ // Generate the result
450
+ let result = buildTitle(true);
451
+ if (!singularProductType) {
452
+ // If product type should not be included in the title
453
+ result = buildTitle(false);
442
454
  }
443
455
  return this.utilities.capitalizeString(result).trim();
444
456
  }
445
457
  autoCreateDescriptionHTML() {
446
458
  var _a;
447
- const customHeading = false; // ToDo: Add as an attribute;
448
- const color = this.filterAttributes.color;
449
- const productStyle = this.filterAttributes.productStyle.join(', ');
450
- const productRemarks = this.consignmentAttributes.productRemarks;
451
- const conditionRemarks = this.consignmentAttributes.conditionRemarks;
452
- const condition = this.filterAttributes.condition;
453
- const priceNew = this.consignmentAttributes.purchasePrice;
454
- const yearPurchased = this.consignmentAttributes.yearPurchased;
455
- const materials = this.materialCompJoinedString();
456
- const sizeComment = this.consignmentAttributes.sizeComment;
459
+ const { color, productStyle, condition } = this.filterAttributes;
457
460
  const measurements = this.measurementsJoinedString(this.filterAttributes.measurements);
458
- const fit = ((_a = options_1.sizeCommentOptions.filter((option) => option.value === sizeComment)[0]) === null || _a === void 0 ? void 0 : _a.label) || '';
459
- const descriptionObj = {
460
- title: customHeading ? `<p>${customHeading}</p>\n` : 'REMOVE_ME',
461
- line1: `<ul>\n`,
462
- line2: fit ? `<li>Fit: ${fit}</li>\n` : 'REMOVE_ME',
463
- line3: condition ? `<li>Condition: ${condition}</li>\n` : 'REMOVE_ME',
464
- line4: conditionRemarks ? `\n<li>Condition Remarks: ${conditionRemarks}</li>` : 'REMOVE_ME',
465
- line5: color ? `<li>Color: ${color}</li>` : 'REMOVE_ME',
466
- line6: productStyle && productStyle.length > 0 ? `\n<li>Style: ${productStyle}</li>` : 'REMOVE_ME',
467
- line7: materials ? `\n<li>Material: ${materials}</li>` : 'REMOVE_ME',
468
- line8: measurements ? `\n<li>Measurements: ${measurements}</li>` : 'REMOVE_ME',
469
- line9: productRemarks ? `\n<li>Remarks: ${productRemarks}</li>` : 'REMOVE_ME',
470
- line10: priceNew ? `\n<li>Purchase price: ${priceNew}</li>` : 'REMOVE_ME',
471
- line11: yearPurchased ? `\n<li>Year purchased: ${yearPurchased}</li>` : 'REMOVE_ME',
472
- line12: `\n</ul>`,
473
- };
474
- return Object.values(descriptionObj).reduce((acc, cur) => {
475
- if (!cur.includes('REMOVE_ME')) {
476
- acc = acc.concat(cur);
477
- }
478
- return acc;
479
- }, this.attributes.description);
461
+ const { productRemarks, conditionRemarks, purchasePrice, yearPurchased, sizeComment } = this.consignmentAttributes;
462
+ const materials = this.materialCompJoinedString();
463
+ const fit = ((_a = options_1.sizeCommentOptions.find((option) => option.value === sizeComment)) === null || _a === void 0 ? void 0 : _a.label) || '';
464
+ const joinedProductStyle = productStyle.join(', ');
465
+ const attributesList = [
466
+ fit && `<li>Fit: ${fit}</li>`,
467
+ condition && `<li>Condition: ${condition}</li>`,
468
+ conditionRemarks && `<li>Condition Remarks: ${conditionRemarks}</li>`,
469
+ color && `<li>Color: ${color}</li>`,
470
+ productStyle.length > 0 && `<li>Style: ${joinedProductStyle}</li>`,
471
+ materials && `<li>Material: ${materials}</li>`,
472
+ measurements && `<li>Measurements: ${measurements}</li>`,
473
+ productRemarks && `<li>Remarks: ${productRemarks}</li>`,
474
+ purchasePrice && `<li>Purchase price: ${purchasePrice}</li>`,
475
+ yearPurchased && `<li>Year purchased: ${yearPurchased}</li>`,
476
+ ].filter(Boolean); // Removes any falsey values
477
+ const descriptionHTML = attributesList.length > 0 ? `<ul>\n${attributesList.join('\n')}\n</ul>` : '';
478
+ return this.attributes.description + (descriptionHTML ? `\n${descriptionHTML}` : '');
479
+ }
480
+ autoCreateMetaDescription() {
481
+ var _a;
482
+ const { color, productType, productStyle, condition, size, brand } = this.filterAttributes;
483
+ const { productRemarks, sizeComment } = this.consignmentAttributes;
484
+ const materials = this.materialCompJoinedString();
485
+ const fit = ((_a = options_1.sizeCommentOptions.find((option) => option.value === sizeComment)) === null || _a === void 0 ? void 0 : _a.label) || '';
486
+ const joinedProductStyle = productStyle.join(', ');
487
+ const elements = [
488
+ brand && `Brand: ${brand}`,
489
+ size && `Size: ${size}`,
490
+ color && `Color: ${color}`,
491
+ productType && `Type: ${productType}`,
492
+ productStyle.length > 0 && `Style: ${joinedProductStyle}`,
493
+ condition && `Condition: ${condition}`,
494
+ materials && `Material: ${materials}`,
495
+ fit && `Fit: ${fit}`,
496
+ productRemarks && `Remarks: ${productRemarks}`,
497
+ ].filter(Boolean); // Removes any falsey values
498
+ const baseDescription = elements.join(', ').slice(0, 157);
499
+ const ellipsis = baseDescription.length >= 157 ? '...' : '';
500
+ return baseDescription + ellipsis;
480
501
  }
481
502
  generateSchemaForTypesense(name = 'prod_products_20220503') {
482
503
  return {
@@ -26,6 +26,8 @@ declare type ProductAttributes = {
26
26
  editorAuthorizations?: EditorAuthorization;
27
27
  rfidTag?: string;
28
28
  sku?: string;
29
+ metaDataTitle?: string;
30
+ metaDataDescription?: string;
29
31
  };
30
32
  declare type ProductFilterAttributes = {
31
33
  documentId: string;
@@ -161,6 +163,8 @@ declare type ProductAttributesFormFields = {
161
163
  vendorName: SingleSelectFormField<string>;
162
164
  rfidTag: TextInputFormField<string>;
163
165
  sku: TextInputFormField<string>;
166
+ metaDataTitle: TextInputFormField<string>;
167
+ metaDataDescription: TextInputFormField<string>;
164
168
  };
165
169
  declare type ProductFilterAttributesFormFields = {
166
170
  brand: SingleSelectFormField<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "3.2.9",
3
+ "version": "3.3.1",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",