rerobe-js-orm 3.4.0 → 3.4.2

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,40 +4,40 @@ 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, _20, _21;
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;
8
8
  const productAttributes = {
9
9
  availableForSale: props.fields.availableForSale.selectedValue,
10
10
  description: props.fields.description.inputValue,
11
- handle: ((_a = props.props) === null || _a === void 0 ? void 0 : _a.handle) || '',
12
- shopifyId: ((_b = props.props) === null || _b === void 0 ? void 0 : _b.shopifyId) || '',
11
+ handle: props.fields.handle.inputValue || '',
12
+ shopifyId: ((_a = props.props) === null || _a === void 0 ? void 0 : _a.shopifyId) || '',
13
13
  title: props.fields.title.inputValue,
14
- coverPhotoUrl: ((_c = props.props) === null || _c === void 0 ? void 0 : _c.coverPhotoUrl) || '',
15
- imageUrls: ((_d = props.props) === null || _d === void 0 ? void 0 : _d.imageUrls) || [],
14
+ coverPhotoUrl: ((_b = props.props) === null || _b === void 0 ? void 0 : _b.coverPhotoUrl) || '',
15
+ imageUrls: ((_c = props.props) === null || _c === void 0 ? void 0 : _c.imageUrls) || [],
16
16
  price: props.fields.price.inputValue,
17
- createdAt: ((_e = props.props) === null || _e === void 0 ? void 0 : _e.createdAt) || new Date().toUTCString(),
18
- updatedAt: ((_f = props.props) === null || _f === void 0 ? void 0 : _f.updatedAt) || new Date().toUTCString(),
19
- publishedAt: ((_g = props.props) === null || _g === void 0 ? void 0 : _g.publishedAt) || new Date().toUTCString(),
20
- vendorId: props.fields.vendorId.selectedValue || ((_h = props.props) === null || _h === void 0 ? void 0 : _h.vendorId) || '',
17
+ createdAt: ((_d = props.props) === null || _d === void 0 ? void 0 : _d.createdAt) || new Date().toUTCString(),
18
+ updatedAt: ((_e = props.props) === null || _e === void 0 ? void 0 : _e.updatedAt) || new Date().toUTCString(),
19
+ publishedAt: ((_f = props.props) === null || _f === void 0 ? void 0 : _f.publishedAt) || new Date().toUTCString(),
20
+ vendorId: props.fields.vendorId.selectedValue || ((_g = props.props) === null || _g === void 0 ? void 0 : _g.vendorId) || '',
21
21
  vendorName: props.fields.vendorName.selectedValue || '',
22
22
  weight: props.fields.weight.inputValue,
23
23
  weightRange: props.fields.weightRange.selectedValue || '',
24
24
  weightUnit: props.fields.weightUnit.selectedValue || '',
25
- variantId: ((_j = props.props) === null || _j === void 0 ? void 0 : _j.variantId) || '',
26
- reservedBy: ((_k = props.props) === null || _k === void 0 ? void 0 : _k.reservedBy) || [],
25
+ variantId: ((_h = props.props) === null || _h === void 0 ? void 0 : _h.variantId) || '',
26
+ reservedBy: ((_j = props.props) === null || _j === void 0 ? void 0 : _j.reservedBy) || [],
27
27
  options: props.fields.options.selectedValue,
28
28
  costPerItem: props.fields.costPerItem.inputValue,
29
29
  compareAtPrice: props.fields.compareAtPrice.inputValue,
30
30
  quantity: props.fields.quantity.inputValue,
31
- merchants: ((_l = props.props) === null || _l === void 0 ? void 0 : _l.merchants) || [],
32
- merchantId: ((_m = props.props) === null || _m === void 0 ? void 0 : _m.merchantId) || '',
31
+ merchants: ((_k = props.props) === null || _k === void 0 ? void 0 : _k.merchants) || [],
32
+ merchantId: ((_l = props.props) === null || _l === void 0 ? void 0 : _l.merchantId) || '',
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.metaDataDescription) === null || _o === void 0 ? void 0 : _o.inputValue) || '',
37
- metaDataTitle: ((_p = props.fields.metaDataTitle) === null || _p === void 0 ? void 0 : _p.inputValue) || '',
36
+ metaDataDescription: ((_m = props.fields.metaDataDescription) === null || _m === void 0 ? void 0 : _m.inputValue) || '',
37
+ metaDataTitle: ((_o = props.fields.metaDataTitle) === null || _o === void 0 ? void 0 : _o.inputValue) || '',
38
38
  };
39
39
  const productFilterAttributes = {
40
- documentId: (_q = props.props) === null || _q === void 0 ? void 0 : _q.documentId,
40
+ documentId: (_p = props.props) === null || _p === void 0 ? void 0 : _p.documentId,
41
41
  brand: props.fields.brand.selectedValue,
42
42
  measurementCategory: props.fields.measurementCategory.selectedValue,
43
43
  size: props.fields.size.selectedValue,
@@ -58,7 +58,7 @@ class ProductFromFormState extends ProductFactory_1.default {
58
58
  tags: props.fields.tags.selectedValues || [],
59
59
  };
60
60
  const consignmentAttributes = {
61
- sellRequestId: ((_r = props.props) === null || _r === void 0 ? void 0 : _r.sellRequestId) || '',
61
+ sellRequestId: ((_q = props.props) === null || _q === void 0 ? void 0 : _q.sellRequestId) || '',
62
62
  publishType: props.fields.publishType.selectedValue,
63
63
  conditionRemarks: props.fields.conditionRemarks.inputValue,
64
64
  productRemarks: props.fields.productRemarks.inputValue,
@@ -71,47 +71,47 @@ class ProductFromFormState extends ProductFactory_1.default {
71
71
  nextAvailableSeason: props.fields.nextAvailableSeason.selectedValue,
72
72
  notesForProductionTeam: props.fields.notesForProductionTeam.inputValue,
73
73
  reviewedBy: props.fields.reviewedBy.selectedValue,
74
- sellRequestImageUrls: ((_s = props.props) === null || _s === void 0 ? void 0 : _s.sellRequestImageUrls) || [],
74
+ sellRequestImageUrls: ((_r = props.props) === null || _r === void 0 ? void 0 : _r.sellRequestImageUrls) || [],
75
75
  salesChannel: props.fields.salesChannel.selectedValues || [],
76
76
  sizeComment: props.fields.sizeComment.selectedValue,
77
- salePrice: ((_t = props.props) === null || _t === void 0 ? void 0 : _t.salePrice) || '',
77
+ salePrice: ((_s = props.props) === null || _s === void 0 ? void 0 : _s.salePrice) || '',
78
78
  isOnSale: props.fields.isOnSale.selectedValue || '',
79
79
  discountType: props.fields.discountType.selectedValue || '',
80
80
  discountValue: props.fields.discountValue.inputValue || '',
81
- selectedForClearance: ((_u = props.props) === null || _u === void 0 ? void 0 : _u.selectedForClearance) || '',
81
+ selectedForClearance: ((_t = props.props) === null || _t === void 0 ? void 0 : _t.selectedForClearance) || '',
82
82
  locationIds: props.fields.locationIds.selectedValues || [],
83
83
  inventoryLocations: props.fields.inventoryLocations.selectedValues || [],
84
84
  majorDefects: props.fields.majorDefects.selectedValues || [],
85
85
  minorDefects: props.fields.minorDefects.selectedValues || [],
86
86
  };
87
87
  const timestampAttributes = {
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,
88
+ createdAtTimestamp: (_u = props.props) === null || _u === void 0 ? void 0 : _u.createdAtTimestamp,
89
+ updatedAtTimestamp: (_v = props.props) === null || _v === void 0 ? void 0 : _v.updatedAtTimestamp,
90
+ sellRequestReviewTimestamp: (_w = props.props) === null || _w === void 0 ? void 0 : _w.sellRequestReviewTimestamp,
91
+ sellRequestReviewDraftTimestamp: (_x = props.props) === null || _x === void 0 ? void 0 : _x.sellRequestReviewDraftTimestamp,
92
+ rejectedTimestamp: (_y = props.props) === null || _y === void 0 ? void 0 : _y.rejectedTimestamp,
93
+ holdTimestamp: (_z = props.props) === null || _z === void 0 ? void 0 : _z.holdTimestamp,
94
+ acceptedTimestamp: (_0 = props.props) === null || _0 === void 0 ? void 0 : _0.acceptedTimestamp,
95
+ sellerToDropOffTimestamp: (_1 = props.props) === null || _1 === void 0 ? void 0 : _1.sellerToDropOffTimestamp,
96
+ sellerToShipTimestamp: (_2 = props.props) === null || _2 === void 0 ? void 0 : _2.sellerToShipTimestamp,
97
+ sellerToGetPickUpTimestamp: (_3 = props.props) === null || _3 === void 0 ? void 0 : _3.sellerToGetPickUpTimestamp,
98
+ qualityControlTimestamp: (_4 = props.props) === null || _4 === void 0 ? void 0 : _4.qualityControlTimestamp,
99
+ pendingPublicationTimestamp: (_5 = props.props) === null || _5 === void 0 ? void 0 : _5.pendingPublicationTimestamp,
100
+ listedTimestamp: (_6 = props.props) === null || _6 === void 0 ? void 0 : _6.listedTimestamp,
101
+ clearanceTimestamp: (_7 = props.props) === null || _7 === void 0 ? void 0 : _7.clearanceTimestamp,
102
+ reservedTimestamp: (_8 = props.props) === null || _8 === void 0 ? void 0 : _8.reservedTimestamp,
103
+ soldTimestamp: (_9 = props.props) === null || _9 === void 0 ? void 0 : _9.soldTimestamp,
104
+ returnedTimestamp: (_10 = props.props) === null || _10 === void 0 ? void 0 : _10.returnedTimestamp,
105
+ soldSellerToBePaidTimestamp: (_11 = props.props) === null || _11 === void 0 ? void 0 : _11.soldSellerToBePaidTimestamp,
106
+ soldSellerPaidTimestamp: (_12 = props.props) === null || _12 === void 0 ? void 0 : _12.soldSellerPaidTimestamp,
107
+ sellerSelfRejectTimestamp: (_13 = props.props) === null || _13 === void 0 ? void 0 : _13.sellerSelfRejectTimestamp,
108
+ liquidationRequestedTimestamp: (_14 = props.props) === null || _14 === void 0 ? void 0 : _14.liquidationRequestedTimestamp,
109
+ sellerLiquidatedTimestamp: (_15 = props.props) === null || _15 === void 0 ? void 0 : _15.sellerLiquidatedTimestamp,
110
+ archivedTimestamp: (_16 = props.props) === null || _16 === void 0 ? void 0 : _16.archivedTimestamp,
111
+ liquidationReadyTimestamp: (_17 = props.props) === null || _17 === void 0 ? void 0 : _17.liquidationReadyTimestamp,
112
+ sellerDonatedTimestamp: (_18 = props.props) === null || _18 === void 0 ? void 0 : _18.sellerDonatedTimestamp,
113
+ merchantDonatedTimestamp: (_19 = props.props) === null || _19 === void 0 ? void 0 : _19.merchantDonatedTimestamp,
114
+ draftTimestamp: (_20 = props.props) === null || _20 === void 0 ? void 0 : _20.draftTimestamp,
115
115
  };
116
116
  return new Product_1.default(Object.assign(Object.assign(Object.assign(Object.assign({}, productAttributes), productFilterAttributes), consignmentAttributes), timestampAttributes));
117
117
  }
@@ -80,6 +80,7 @@ class ProductFormState extends FormState_1.default {
80
80
  this.fields.tags = this.fieldFactory('multiSelect', 'tags');
81
81
  this.fields.metaDataTitle = this.fieldFactory('textInput', 'metaDataTitle');
82
82
  this.fields.metaDataDescription = this.fieldFactory('textInput', 'metaDataDescription');
83
+ this.fields.handle = this.fieldFactory('textInput', 'handle');
83
84
  }
84
85
  autoCreateTitle() {
85
86
  return this.createProduct().autoCreateTitle();
@@ -694,7 +695,7 @@ class ProductFormState extends FormState_1.default {
694
695
  let onChangeHandler = (val) => this.multiSelectChangeHandler(fieldKey, val);
695
696
  if (fieldKey === 'productStyle') {
696
697
  options = this.setProductStylesFromPassedOptions(this.props.productCategory, this.props.productType);
697
- if (this.props.productStyle && this.props.productStyle.length > 0) {
698
+ if (this.props.productStyle && Array.isArray(this.props.productStyle) && this.props.productStyle.length > 0) {
698
699
  this.props.productStyle.forEach((productStyle) => {
699
700
  if (!options.map((o) => o.value).includes(productStyle)) {
700
701
  options.splice(0, 0, { label: productStyle, value: productStyle });
@@ -165,6 +165,7 @@ declare type ProductAttributesFormFields = {
165
165
  sku: TextInputFormField<string>;
166
166
  metaDataTitle: TextInputFormField<string>;
167
167
  metaDataDescription: TextInputFormField<string>;
168
+ handle: TextInputFormField<string>;
168
169
  };
169
170
  declare type ProductFilterAttributesFormFields = {
170
171
  brand: SingleSelectFormField<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "3.4.0",
3
+ "version": "3.4.2",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",