rerobe-js-orm 4.0.1 → 4.0.3
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/lib/factories/Product/ProductFromAlgoliaJSONDoc.js +1 -0
- package/lib/factories/Product/ProductFromFormState.js +45 -44
- package/lib/factories/Product/ProductFromShopifyJSClientJSONDoc.js +1 -0
- package/lib/factories/Product/ProductFromShopifyWebhookJSONDoc.js +1 -0
- package/lib/models/Merchant.d.ts +3 -0
- package/lib/models/Merchant.js +18 -0
- package/lib/models/Product.js +1 -0
- package/lib/types/merchant-types.d.ts +3 -0
- package/lib/types/rerobe-chatroom-types.d.ts +1 -0
- package/lib/types/rerobe-product-types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -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: ((
|
|
19
|
-
updatedAt: ((
|
|
20
|
-
publishedAt: ((
|
|
21
|
-
vendorId: props.fields.vendorId.selectedValue || ((
|
|
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: ((
|
|
27
|
-
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: ((
|
|
33
|
-
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: ((
|
|
38
|
-
metaDataTitle: ((
|
|
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: (
|
|
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: ((
|
|
61
|
+
systemTags: ((_r = props.props) === null || _r === void 0 ? void 0 : _r.systemTags) || [],
|
|
61
62
|
};
|
|
62
63
|
const consignmentAttributes = {
|
|
63
|
-
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: ((
|
|
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: ((
|
|
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: ((
|
|
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: (
|
|
92
|
-
updatedAtTimestamp: (
|
|
93
|
-
sellRequestReviewTimestamp: (
|
|
94
|
-
sellRequestReviewDraftTimestamp: (
|
|
95
|
-
rejectedTimestamp: (
|
|
96
|
-
holdTimestamp: (
|
|
97
|
-
acceptedTimestamp: (
|
|
98
|
-
sellerToDropOffTimestamp: (
|
|
99
|
-
sellerToShipTimestamp: (
|
|
100
|
-
sellerToGetPickUpTimestamp: (
|
|
101
|
-
qualityControlTimestamp: (
|
|
102
|
-
pendingPublicationTimestamp: (
|
|
103
|
-
listedTimestamp: (
|
|
104
|
-
clearanceTimestamp: (
|
|
105
|
-
reservedTimestamp: (
|
|
106
|
-
soldTimestamp: (
|
|
107
|
-
returnedTimestamp: (
|
|
108
|
-
soldSellerToBePaidTimestamp: (
|
|
109
|
-
soldSellerPaidTimestamp: (
|
|
110
|
-
sellerSelfRejectTimestamp: (
|
|
111
|
-
liquidationRequestedTimestamp: (
|
|
112
|
-
sellerLiquidatedTimestamp: (
|
|
113
|
-
archivedTimestamp: (
|
|
114
|
-
liquidationReadyTimestamp: (
|
|
115
|
-
sellerDonatedTimestamp: (
|
|
116
|
-
merchantDonatedTimestamp: (
|
|
117
|
-
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,
|
package/lib/models/Merchant.d.ts
CHANGED
|
@@ -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;
|
package/lib/models/Merchant.js
CHANGED
|
@@ -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() {
|
package/lib/models/Product.js
CHANGED
|
@@ -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';
|