rerobe-js-orm 4.0.2 → 4.0.4

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.
@@ -12,6 +12,7 @@ class ProductFromAlgoliaJSONDoc extends ProductFactory_1.default {
12
12
  title: props.title,
13
13
  coverPhotoUrl: this.shopifyHelpers.imageURLConverter(props.product_image),
14
14
  imageUrls: [],
15
+ imageUrlsForAI: [],
15
16
  price: String(props.price),
16
17
  createdAt: props.created_at,
17
18
  updatedAt: props.updated_at,
@@ -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, _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, _21, _22;
8
8
  const productAttributes = {
9
9
  availableForSale: props.fields.availableForSale.selectedValue,
10
10
  description: props.fields.description.inputValue,
@@ -13,32 +13,33 @@ class ProductFromFormState extends ProductFactory_1.default {
13
13
  title: props.fields.title.inputValue,
14
14
  coverPhotoUrl: ((_b = props.props) === null || _b === void 0 ? void 0 : _b.coverPhotoUrl) || '',
15
15
  imageUrls: ((_c = props.props) === null || _c === void 0 ? void 0 : _c.imageUrls) || [],
16
+ imageUrlsForAI: ((_d = props.props) === null || _d === void 0 ? void 0 : _d.imageUrlsForAI) || [],
16
17
  price: props.fields.price.inputValue,
17
18
  isTaxable: props.fields.isTaxable.selectedValue,
18
- createdAt: ((_d = props.props) === null || _d === void 0 ? void 0 : _d.createdAt) || new Date().toUTCString(),
19
- updatedAt: ((_e = props.props) === null || _e === void 0 ? void 0 : _e.updatedAt) || new Date().toUTCString(),
20
- publishedAt: ((_f = props.props) === null || _f === void 0 ? void 0 : _f.publishedAt) || new Date().toUTCString(),
21
- vendorId: props.fields.vendorId.selectedValue || ((_g = props.props) === null || _g === void 0 ? void 0 : _g.vendorId) || '',
19
+ createdAt: ((_e = props.props) === null || _e === void 0 ? void 0 : _e.createdAt) || new Date().toUTCString(),
20
+ updatedAt: ((_f = props.props) === null || _f === void 0 ? void 0 : _f.updatedAt) || new Date().toUTCString(),
21
+ publishedAt: ((_g = props.props) === null || _g === void 0 ? void 0 : _g.publishedAt) || new Date().toUTCString(),
22
+ vendorId: props.fields.vendorId.selectedValue || ((_h = props.props) === null || _h === void 0 ? void 0 : _h.vendorId) || '',
22
23
  vendorName: props.fields.vendorName.selectedValue || '',
23
24
  weight: props.fields.weight.inputValue,
24
25
  weightRange: props.fields.weightRange.selectedValue || '',
25
26
  weightUnit: props.fields.weightUnit.selectedValue || '',
26
- variantId: ((_h = props.props) === null || _h === void 0 ? void 0 : _h.variantId) || '',
27
- reservedBy: ((_j = props.props) === null || _j === void 0 ? void 0 : _j.reservedBy) || [],
27
+ variantId: ((_j = props.props) === null || _j === void 0 ? void 0 : _j.variantId) || '',
28
+ reservedBy: ((_k = props.props) === null || _k === void 0 ? void 0 : _k.reservedBy) || [],
28
29
  options: props.fields.options.selectedValue,
29
30
  costPerItem: props.fields.costPerItem.inputValue,
30
31
  compareAtPrice: props.fields.compareAtPrice.inputValue,
31
32
  quantity: props.fields.quantity.inputValue,
32
- merchants: ((_k = props.props) === null || _k === void 0 ? void 0 : _k.merchants) || [],
33
- merchantId: ((_l = props.props) === null || _l === void 0 ? void 0 : _l.merchantId) || '',
33
+ merchants: ((_l = props.props) === null || _l === void 0 ? void 0 : _l.merchants) || [],
34
+ merchantId: ((_m = props.props) === null || _m === void 0 ? void 0 : _m.merchantId) || '',
34
35
  editorAuthorizations: props.fields.editorAuthorizations.selectedValue,
35
36
  rfidTag: props.fields.rfidTag.inputValue || '',
36
37
  sku: props.fields.sku.inputValue || '',
37
- metaDataDescription: ((_m = props.fields.metaDataDescription) === null || _m === void 0 ? void 0 : _m.inputValue) || '',
38
- metaDataTitle: ((_o = props.fields.metaDataTitle) === null || _o === void 0 ? void 0 : _o.inputValue) || '',
38
+ metaDataDescription: ((_o = props.fields.metaDataDescription) === null || _o === void 0 ? void 0 : _o.inputValue) || '',
39
+ metaDataTitle: ((_p = props.fields.metaDataTitle) === null || _p === void 0 ? void 0 : _p.inputValue) || '',
39
40
  };
40
41
  const productFilterAttributes = {
41
- documentId: (_p = props.props) === null || _p === void 0 ? void 0 : _p.documentId,
42
+ documentId: (_q = props.props) === null || _q === void 0 ? void 0 : _q.documentId,
42
43
  brand: props.fields.brand.selectedValue,
43
44
  measurementCategory: props.fields.measurementCategory.selectedValue,
44
45
  size: props.fields.size.selectedValue,
@@ -57,10 +58,10 @@ class ProductFromFormState extends ProductFactory_1.default {
57
58
  featuredCollections: props.fields.featuredCollections.selectedValues || [],
58
59
  primaryAgeCategory: props.fields.primaryAgeCategory.selectedValue || '',
59
60
  tags: props.fields.tags.selectedValues || [],
60
- systemTags: ((_q = props.props) === null || _q === void 0 ? void 0 : _q.systemTags) || [],
61
+ systemTags: ((_r = props.props) === null || _r === void 0 ? void 0 : _r.systemTags) || [],
61
62
  };
62
63
  const consignmentAttributes = {
63
- sellRequestId: ((_r = props.props) === null || _r === void 0 ? void 0 : _r.sellRequestId) || '',
64
+ sellRequestId: ((_s = props.props) === null || _s === void 0 ? void 0 : _s.sellRequestId) || '',
64
65
  publishType: props.fields.publishType.selectedValue,
65
66
  conditionRemarks: props.fields.conditionRemarks.inputValue,
66
67
  productRemarks: props.fields.productRemarks.inputValue,
@@ -73,14 +74,14 @@ class ProductFromFormState extends ProductFactory_1.default {
73
74
  nextAvailableSeason: props.fields.nextAvailableSeason.selectedValue,
74
75
  notesForProductionTeam: props.fields.notesForProductionTeam.inputValue,
75
76
  reviewedBy: props.fields.reviewedBy.selectedValue,
76
- sellRequestImageUrls: ((_s = props.props) === null || _s === void 0 ? void 0 : _s.sellRequestImageUrls) || [],
77
+ sellRequestImageUrls: ((_t = props.props) === null || _t === void 0 ? void 0 : _t.sellRequestImageUrls) || [],
77
78
  salesChannel: props.fields.salesChannel.selectedValues || [],
78
79
  sizeComment: props.fields.sizeComment.selectedValue,
79
- salePrice: ((_t = props.props) === null || _t === void 0 ? void 0 : _t.salePrice) || '',
80
+ salePrice: ((_u = props.props) === null || _u === void 0 ? void 0 : _u.salePrice) || '',
80
81
  isOnSale: props.fields.isOnSale.selectedValue || '',
81
82
  discountType: props.fields.discountType.selectedValue || '',
82
83
  discountValue: props.fields.discountValue.inputValue || '',
83
- selectedForClearance: ((_u = props.props) === null || _u === void 0 ? void 0 : _u.selectedForClearance) || '',
84
+ selectedForClearance: ((_v = props.props) === null || _v === void 0 ? void 0 : _v.selectedForClearance) || '',
84
85
  locationIds: props.fields.locationIds.selectedValues || [],
85
86
  inventoryLocations: props.fields.inventoryLocations.selectedValues || [],
86
87
  majorDefects: props.fields.majorDefects.selectedValues || [],
@@ -88,33 +89,33 @@ class ProductFromFormState extends ProductFactory_1.default {
88
89
  careInstructions: props.fields.careInstructions.inputValue || '',
89
90
  };
90
91
  const timestampAttributes = {
91
- createdAtTimestamp: (_v = props.props) === null || _v === void 0 ? void 0 : _v.createdAtTimestamp,
92
- updatedAtTimestamp: (_w = props.props) === null || _w === void 0 ? void 0 : _w.updatedAtTimestamp,
93
- sellRequestReviewTimestamp: (_x = props.props) === null || _x === void 0 ? void 0 : _x.sellRequestReviewTimestamp,
94
- sellRequestReviewDraftTimestamp: (_y = props.props) === null || _y === void 0 ? void 0 : _y.sellRequestReviewDraftTimestamp,
95
- rejectedTimestamp: (_z = props.props) === null || _z === void 0 ? void 0 : _z.rejectedTimestamp,
96
- holdTimestamp: (_0 = props.props) === null || _0 === void 0 ? void 0 : _0.holdTimestamp,
97
- acceptedTimestamp: (_1 = props.props) === null || _1 === void 0 ? void 0 : _1.acceptedTimestamp,
98
- sellerToDropOffTimestamp: (_2 = props.props) === null || _2 === void 0 ? void 0 : _2.sellerToDropOffTimestamp,
99
- sellerToShipTimestamp: (_3 = props.props) === null || _3 === void 0 ? void 0 : _3.sellerToShipTimestamp,
100
- sellerToGetPickUpTimestamp: (_4 = props.props) === null || _4 === void 0 ? void 0 : _4.sellerToGetPickUpTimestamp,
101
- qualityControlTimestamp: (_5 = props.props) === null || _5 === void 0 ? void 0 : _5.qualityControlTimestamp,
102
- pendingPublicationTimestamp: (_6 = props.props) === null || _6 === void 0 ? void 0 : _6.pendingPublicationTimestamp,
103
- listedTimestamp: (_7 = props.props) === null || _7 === void 0 ? void 0 : _7.listedTimestamp,
104
- clearanceTimestamp: (_8 = props.props) === null || _8 === void 0 ? void 0 : _8.clearanceTimestamp,
105
- reservedTimestamp: (_9 = props.props) === null || _9 === void 0 ? void 0 : _9.reservedTimestamp,
106
- soldTimestamp: (_10 = props.props) === null || _10 === void 0 ? void 0 : _10.soldTimestamp,
107
- returnedTimestamp: (_11 = props.props) === null || _11 === void 0 ? void 0 : _11.returnedTimestamp,
108
- soldSellerToBePaidTimestamp: (_12 = props.props) === null || _12 === void 0 ? void 0 : _12.soldSellerToBePaidTimestamp,
109
- soldSellerPaidTimestamp: (_13 = props.props) === null || _13 === void 0 ? void 0 : _13.soldSellerPaidTimestamp,
110
- sellerSelfRejectTimestamp: (_14 = props.props) === null || _14 === void 0 ? void 0 : _14.sellerSelfRejectTimestamp,
111
- liquidationRequestedTimestamp: (_15 = props.props) === null || _15 === void 0 ? void 0 : _15.liquidationRequestedTimestamp,
112
- sellerLiquidatedTimestamp: (_16 = props.props) === null || _16 === void 0 ? void 0 : _16.sellerLiquidatedTimestamp,
113
- archivedTimestamp: (_17 = props.props) === null || _17 === void 0 ? void 0 : _17.archivedTimestamp,
114
- liquidationReadyTimestamp: (_18 = props.props) === null || _18 === void 0 ? void 0 : _18.liquidationReadyTimestamp,
115
- sellerDonatedTimestamp: (_19 = props.props) === null || _19 === void 0 ? void 0 : _19.sellerDonatedTimestamp,
116
- merchantDonatedTimestamp: (_20 = props.props) === null || _20 === void 0 ? void 0 : _20.merchantDonatedTimestamp,
117
- draftTimestamp: (_21 = props.props) === null || _21 === void 0 ? void 0 : _21.draftTimestamp,
92
+ createdAtTimestamp: (_w = props.props) === null || _w === void 0 ? void 0 : _w.createdAtTimestamp,
93
+ updatedAtTimestamp: (_x = props.props) === null || _x === void 0 ? void 0 : _x.updatedAtTimestamp,
94
+ sellRequestReviewTimestamp: (_y = props.props) === null || _y === void 0 ? void 0 : _y.sellRequestReviewTimestamp,
95
+ sellRequestReviewDraftTimestamp: (_z = props.props) === null || _z === void 0 ? void 0 : _z.sellRequestReviewDraftTimestamp,
96
+ rejectedTimestamp: (_0 = props.props) === null || _0 === void 0 ? void 0 : _0.rejectedTimestamp,
97
+ holdTimestamp: (_1 = props.props) === null || _1 === void 0 ? void 0 : _1.holdTimestamp,
98
+ acceptedTimestamp: (_2 = props.props) === null || _2 === void 0 ? void 0 : _2.acceptedTimestamp,
99
+ sellerToDropOffTimestamp: (_3 = props.props) === null || _3 === void 0 ? void 0 : _3.sellerToDropOffTimestamp,
100
+ sellerToShipTimestamp: (_4 = props.props) === null || _4 === void 0 ? void 0 : _4.sellerToShipTimestamp,
101
+ sellerToGetPickUpTimestamp: (_5 = props.props) === null || _5 === void 0 ? void 0 : _5.sellerToGetPickUpTimestamp,
102
+ qualityControlTimestamp: (_6 = props.props) === null || _6 === void 0 ? void 0 : _6.qualityControlTimestamp,
103
+ pendingPublicationTimestamp: (_7 = props.props) === null || _7 === void 0 ? void 0 : _7.pendingPublicationTimestamp,
104
+ listedTimestamp: (_8 = props.props) === null || _8 === void 0 ? void 0 : _8.listedTimestamp,
105
+ clearanceTimestamp: (_9 = props.props) === null || _9 === void 0 ? void 0 : _9.clearanceTimestamp,
106
+ reservedTimestamp: (_10 = props.props) === null || _10 === void 0 ? void 0 : _10.reservedTimestamp,
107
+ soldTimestamp: (_11 = props.props) === null || _11 === void 0 ? void 0 : _11.soldTimestamp,
108
+ returnedTimestamp: (_12 = props.props) === null || _12 === void 0 ? void 0 : _12.returnedTimestamp,
109
+ soldSellerToBePaidTimestamp: (_13 = props.props) === null || _13 === void 0 ? void 0 : _13.soldSellerToBePaidTimestamp,
110
+ soldSellerPaidTimestamp: (_14 = props.props) === null || _14 === void 0 ? void 0 : _14.soldSellerPaidTimestamp,
111
+ sellerSelfRejectTimestamp: (_15 = props.props) === null || _15 === void 0 ? void 0 : _15.sellerSelfRejectTimestamp,
112
+ liquidationRequestedTimestamp: (_16 = props.props) === null || _16 === void 0 ? void 0 : _16.liquidationRequestedTimestamp,
113
+ sellerLiquidatedTimestamp: (_17 = props.props) === null || _17 === void 0 ? void 0 : _17.sellerLiquidatedTimestamp,
114
+ archivedTimestamp: (_18 = props.props) === null || _18 === void 0 ? void 0 : _18.archivedTimestamp,
115
+ liquidationReadyTimestamp: (_19 = props.props) === null || _19 === void 0 ? void 0 : _19.liquidationReadyTimestamp,
116
+ sellerDonatedTimestamp: (_20 = props.props) === null || _20 === void 0 ? void 0 : _20.sellerDonatedTimestamp,
117
+ merchantDonatedTimestamp: (_21 = props.props) === null || _21 === void 0 ? void 0 : _21.merchantDonatedTimestamp,
118
+ draftTimestamp: (_22 = props.props) === null || _22 === void 0 ? void 0 : _22.draftTimestamp,
118
119
  };
119
120
  return new Product_1.default(Object.assign(Object.assign(Object.assign(Object.assign({}, productAttributes), productFilterAttributes), consignmentAttributes), timestampAttributes));
120
121
  }
@@ -12,6 +12,7 @@ class ProductFromShopifyJSClientJSONDoc extends ProductFactory_1.default {
12
12
  title: props.title,
13
13
  coverPhotoUrl: this.getImageUrls(props.images)[0],
14
14
  imageUrls: this.getImageUrls(props.images),
15
+ imageUrlsForAI: [],
15
16
  price: this.getPrice(props.priceRange || props.priceRangeV2),
16
17
  createdAt: props.createdAt,
17
18
  updatedAt: props.updatedAt,
@@ -12,6 +12,7 @@ class ProductFromShopifyWebhookJSONDoc extends ProductFactory_1.default {
12
12
  availableForSale: this.checkAvailableForSale(props) || false,
13
13
  coverPhotoUrl: this.getCoverPhotoUrl(props),
14
14
  imageUrls: this.getImageUrls(props),
15
+ imageUrlsForAI: [],
15
16
  price: this.getPrice(props),
16
17
  createdAt: props.created_at,
17
18
  updatedAt: props.updated_at,
@@ -142,10 +142,7 @@ class ProductFormState extends FormState_1.default {
142
142
  this.fields.shoeSize.hidden = true;
143
143
  this.fields.shoeSize.valid = false;
144
144
  this.fields.shoeSize.selectedValue = '';
145
- // Reset size fields except options
146
145
  this.fields.size.hidden = false;
147
- this.fields.size.valid = false;
148
- this.fields.size.selectedValue = '';
149
146
  }
150
147
  geWeightArray(range) {
151
148
  if (!range)
@@ -216,10 +213,7 @@ class ProductFormState extends FormState_1.default {
216
213
  this.fields.shoeSize.hidden = true;
217
214
  this.fields.shoeSize.selectedValue = '';
218
215
  this.fields.shoeSize.valid = false;
219
- // Reset Size
220
216
  this.fields.size.hidden = false;
221
- this.fields.size.selectedValue = '';
222
- this.fields.size.valid = false;
223
217
  }
224
218
  productTypeSelectHandler(value) {
225
219
  // Mutate productType selectedValue and valid prop
@@ -243,9 +237,6 @@ class ProductFormState extends FormState_1.default {
243
237
  this.fields.shoeSize.selectedValue = '';
244
238
  this.fields.shoeSize.valid = false;
245
239
  this.fields.shoeSize.hidden = !value || this.fields.productCategory.selectedValue !== 'Shoes';
246
- // Reset size
247
- this.fields.size.selectedValue = '';
248
- this.fields.size.valid = false;
249
240
  this.fields.size.hidden = false;
250
241
  }
251
242
  setPriceRangeFromPrice(value) {
@@ -85,6 +85,9 @@ export default class Merchant extends Base {
85
85
  hasStripeBluetoothReader?: boolean;
86
86
  organizationNumber?: string;
87
87
  returnPolicy?: string;
88
+ stripeRegion?: string;
89
+ hasAutomatedPayouts?: boolean;
90
+ hasAIQuickList?: boolean;
88
91
  constructor(props?: any);
89
92
  toObj(): MerchantObj;
90
93
  toMerchantMutableData(): MerchantMutableData;
@@ -59,6 +59,15 @@ class Merchant extends Base_1.default {
59
59
  if (props === null || props === void 0 ? void 0 : props.hasStripeBluetoothReader) {
60
60
  this.hasStripeBluetoothReader = props.hasStripeBluetoothReader;
61
61
  }
62
+ if (props === null || props === void 0 ? void 0 : props.stripeRegion) {
63
+ this.stripeRegion = props.stripeRegion;
64
+ }
65
+ if (props === null || props === void 0 ? void 0 : props.hasAutomatedPayouts) {
66
+ this.hasAutomatedPayouts = props.hasAutomatedPayouts;
67
+ }
68
+ if (props === null || props === void 0 ? void 0 : props.hasAIQuickList) {
69
+ this.hasAIQuickList = props.hasAIQuickList;
70
+ }
62
71
  }
63
72
  toObj() {
64
73
  const mObj = {
@@ -101,6 +110,15 @@ class Merchant extends Base_1.default {
101
110
  if (this.hasStripeBluetoothReader) {
102
111
  mObj.hasStripeBluetoothReader = this.hasStripeBluetoothReader;
103
112
  }
113
+ if (this.stripeRegion) {
114
+ mObj.stripeRegion = this.stripeRegion;
115
+ }
116
+ if (this.hasAutomatedPayouts) {
117
+ mObj.hasAutomatedPayouts = this.hasAutomatedPayouts;
118
+ }
119
+ if (this.hasAIQuickList) {
120
+ mObj.hasAIQuickList = this.hasAIQuickList;
121
+ }
104
122
  return mObj;
105
123
  }
106
124
  toMerchantMutableData() {
@@ -13,6 +13,7 @@ class Product extends Base_1.default {
13
13
  description: (props === null || props === void 0 ? void 0 : props.description) || '',
14
14
  coverPhotoUrl: (props === null || props === void 0 ? void 0 : props.coverPhotoUrl) || 'http://cdn.shopify.com/s/images/admin/no-image-compact.gif',
15
15
  imageUrls: this.utilities.sanitzeStringArr(props === null || props === void 0 ? void 0 : props.imageUrls),
16
+ imageUrlsForAI: this.utilities.sanitzeStringArr(props === null || props === void 0 ? void 0 : props.imageUrlsForAI),
16
17
  price: (props === null || props === void 0 ? void 0 : props.price) || '',
17
18
  shopifyId: (props === null || props === void 0 ? void 0 : props.shopifyId) || '',
18
19
  handle: (props === null || props === void 0 ? void 0 : props.handle) || '',
@@ -41,6 +41,9 @@ type MerchantSystemOnlyMutableData = {
41
41
  isZettleUser?: boolean;
42
42
  isChannelPartner?: boolean;
43
43
  hasStripeBluetoothReader?: boolean;
44
+ stripeRegion?: string;
45
+ hasAutomatedPayouts?: boolean;
46
+ hasAIQuickList?: boolean;
44
47
  };
45
48
  type MerchantObj = MerchantMutableData & MerchantSystemOnlyMutableData;
46
49
  type MerchantTypes = 'INDIVIDUAL' | 'BUSINESS';
@@ -6,6 +6,7 @@ type ProductAttributes = {
6
6
  title: string;
7
7
  coverPhotoUrl: string;
8
8
  imageUrls: string[];
9
+ imageUrlsForAI: string[];
9
10
  price: string;
10
11
  createdAt: string;
11
12
  updatedAt: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "4.0.2",
3
+ "version": "4.0.4",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",