rerobe-js-orm 2.7.41 → 2.8.0
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/constants/ledger-constants.d.ts +1 -0
- package/lib/constants/ledger-constants.js +1 -0
- package/lib/factories/Merchant/MerchantFromFormState.js +5 -6
- package/lib/factories/User/UserFromAuthTemplateMethod.js +3 -10
- package/lib/factories/User/UserFromFormState.js +24 -29
- package/lib/form-states/Merchant/MerchantFormState.js +2 -0
- package/lib/helpers/AnalyticsHelpers.js +1 -2
- package/lib/helpers/ShopifyHelpers.js +1 -1
- package/lib/models/CustomerLedgerTransaction.js +1 -1
- package/lib/models/Merchant.d.ts +2 -3
- package/lib/models/Merchant.js +4 -18
- package/lib/models/User.d.ts +0 -5
- package/lib/models/User.js +0 -19
- package/lib/types/merchant-types.d.ts +4 -3
- package/lib/types/rerobe-user-types.d.ts +0 -10
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ const MerchantFactory_1 = require("./MerchantFactory");
|
|
|
4
4
|
const Merchant_1 = require("../../models/Merchant");
|
|
5
5
|
class MerchantFromFormState extends MerchantFactory_1.default {
|
|
6
6
|
createMerchant(fs) {
|
|
7
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
7
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
8
8
|
const merchantAttributes = {
|
|
9
9
|
id: ((_a = fs.props) === null || _a === void 0 ? void 0 : _a.id) || '',
|
|
10
10
|
name: fs.fields.name.inputValue,
|
|
@@ -26,12 +26,11 @@ class MerchantFromFormState extends MerchantFactory_1.default {
|
|
|
26
26
|
numFiles: (_e = fs.props) === null || _e === void 0 ? void 0 : _e.numFiles,
|
|
27
27
|
numOrders: (_f = fs.props) === null || _f === void 0 ? void 0 : _f.numOrders,
|
|
28
28
|
numProducts: (_g = fs.props) === null || _g === void 0 ? void 0 : _g.numProducts,
|
|
29
|
-
|
|
30
|
-
productTags: (_j = fs.props) === null || _j === void 0 ? void 0 : _j.productTags,
|
|
31
|
-
theme: (_k = fs.props) === null || _k === void 0 ? void 0 : _k.theme,
|
|
32
|
-
webshopTenantId: (_l = fs.props) === null || _l === void 0 ? void 0 : _l.webshopTenantId,
|
|
29
|
+
webshopTenantId: (_h = fs.props) === null || _h === void 0 ? void 0 : _h.webshopTenantId,
|
|
33
30
|
webhooks: fs.fields.webhooks.selectedValues,
|
|
34
|
-
sharedSecret: (
|
|
31
|
+
sharedSecret: (_j = fs.props) === null || _j === void 0 ? void 0 : _j.sharedSecret,
|
|
32
|
+
ribbnId: fs.fields.ribbnId.inputValue,
|
|
33
|
+
primaryDomain: fs.fields.primaryDomain.inputValue,
|
|
35
34
|
};
|
|
36
35
|
return new Merchant_1.default(Object.assign({}, merchantAttributes));
|
|
37
36
|
}
|
|
@@ -4,20 +4,13 @@ const UserFactory_1 = require("./UserFactory");
|
|
|
4
4
|
const User_1 = require("../../models/User");
|
|
5
5
|
class UserFromAuthTemplateMethod extends UserFactory_1.default {
|
|
6
6
|
createUser(props) {
|
|
7
|
-
const { authUserProfile, prevUserProfile,
|
|
8
|
-
|
|
9
|
-
let prevSavedItems = [];
|
|
10
|
-
if (prevUserProfile) {
|
|
11
|
-
prevShoppingBag =
|
|
12
|
-
prevUserProfile.shoppingBag && Array.isArray(prevUserProfile.shoppingBag) ? prevUserProfile.shoppingBag : [];
|
|
13
|
-
prevSavedItems =
|
|
14
|
-
prevUserProfile.savedItems && Array.isArray(prevUserProfile.savedItems) ? prevUserProfile.savedItems : [];
|
|
15
|
-
}
|
|
7
|
+
const { authUserProfile, prevUserProfile, savedItems, devicePlatform, shoppingSessionId = '', registrationSource = '', } = props;
|
|
8
|
+
const prevSavedItems = [];
|
|
16
9
|
let gid = 'noGid';
|
|
17
10
|
if (authUserProfile.id && this.shopifyHelpers.getDecodedShopifyId(authUserProfile.id).includes('Customer/')) {
|
|
18
11
|
[, gid] = this.shopifyHelpers.getDecodedShopifyId(authUserProfile.id).split('Customer/');
|
|
19
12
|
}
|
|
20
|
-
const newUserProfile = Object.assign(Object.assign({}, (prevUserProfile ? prevUserProfile : {})), { uid: authUserProfile.id, gid, displayName: authUserProfile.displayName, firstName: authUserProfile.firstName, lastName: authUserProfile.lastName, email: authUserProfile.email, phone: authUserProfile.phone, addresses: authUserProfile.addresses,
|
|
13
|
+
const newUserProfile = Object.assign(Object.assign({}, (prevUserProfile ? prevUserProfile : {})), { uid: authUserProfile.id, gid, displayName: authUserProfile.displayName, firstName: authUserProfile.firstName, lastName: authUserProfile.lastName, email: authUserProfile.email, phone: authUserProfile.phone, addresses: authUserProfile.addresses, savedItems: this.utilities.uniqArray([...prevSavedItems, ...savedItems]), devicePlatform,
|
|
21
14
|
shoppingSessionId, lastLogin: new Date().toISOString(), registrationSource });
|
|
22
15
|
return new User_1.default(Object.assign({}, newUserProfile));
|
|
23
16
|
}
|
|
@@ -4,7 +4,7 @@ const UserFactory_1 = require("./UserFactory");
|
|
|
4
4
|
const User_1 = require("../../models/User");
|
|
5
5
|
class UserFromFormState extends UserFactory_1.default {
|
|
6
6
|
createUser(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
|
|
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;
|
|
8
8
|
const userAttributes = {
|
|
9
9
|
documentId: ((_a = props.props) === null || _a === void 0 ? void 0 : _a.documentId) || '',
|
|
10
10
|
uid: ((_b = props.props) === null || _b === void 0 ? void 0 : _b.uid) || '',
|
|
@@ -14,8 +14,7 @@ class UserFromFormState extends UserFactory_1.default {
|
|
|
14
14
|
email: props.fields.email.inputValue,
|
|
15
15
|
phone: props.fields.phone.inputValue,
|
|
16
16
|
gid: ((_d = props.props) === null || _d === void 0 ? void 0 : _d.gid) || '',
|
|
17
|
-
|
|
18
|
-
tokens: ((_f = props.props) === null || _f === void 0 ? void 0 : _f.tokens) || [],
|
|
17
|
+
tokens: ((_e = props.props) === null || _e === void 0 ? void 0 : _e.tokens) || [],
|
|
19
18
|
addresses: {
|
|
20
19
|
delivery: props.fields.delivery.selectedValues || [],
|
|
21
20
|
pickUp: props.fields.pickUp.selectedValue || {
|
|
@@ -42,38 +41,34 @@ class UserFromFormState extends UserFactory_1.default {
|
|
|
42
41
|
zip: '',
|
|
43
42
|
},
|
|
44
43
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
savedItems: ((_o = props.props) === null || _o === void 0 ? void 0 : _o.savedItems) || [],
|
|
52
|
-
shoppingBag: ((_p = props.props) === null || _p === void 0 ? void 0 : _p.shoppingBag) || [],
|
|
53
|
-
remainingReferralCodes: ((_q = props.props) === null || _q === void 0 ? void 0 : _q.remainingReferralCodes) || 0,
|
|
54
|
-
isSeller: ((_r = props.props) === null || _r === void 0 ? void 0 : _r.isSeller) || false,
|
|
44
|
+
createdAt: ((_f = props.props) === null || _f === void 0 ? void 0 : _f.createdAt) || '',
|
|
45
|
+
updatedAt: ((_g = props.props) === null || _g === void 0 ? void 0 : _g.updatedAt) || '',
|
|
46
|
+
devicePlatform: ((_h = props.props) === null || _h === void 0 ? void 0 : _h.devicePlatform) || '',
|
|
47
|
+
shoppingSessionId: ((_j = props.props) === null || _j === void 0 ? void 0 : _j.shoppingSessionId) || '',
|
|
48
|
+
savedItems: ((_k = props.props) === null || _k === void 0 ? void 0 : _k.savedItems) || [],
|
|
49
|
+
isSeller: ((_l = props.props) === null || _l === void 0 ? void 0 : _l.isSeller) || false,
|
|
55
50
|
title: props.fields.title.inputValue,
|
|
56
51
|
aboutMe: props.fields.aboutMe.inputValue,
|
|
57
52
|
location: props.fields.location.inputValue,
|
|
58
53
|
avatarUrl: props.fields.avatarUrl.selectedValue,
|
|
59
54
|
tags: props.fields.tags.selectedValues,
|
|
60
55
|
notes: props.fields.notes.inputValue,
|
|
61
|
-
lastLogin: ((
|
|
62
|
-
ordersCount: ((
|
|
63
|
-
amountSpent: ((
|
|
64
|
-
emailVerified: ((
|
|
65
|
-
createdAtTimestamp: ((
|
|
66
|
-
updatedAtTimestamp: ((
|
|
67
|
-
itemsUploadedCount: ((
|
|
68
|
-
inventoryValue: ((
|
|
69
|
-
inventoryCount: ((
|
|
70
|
-
itemsSoldCount: ((
|
|
71
|
-
itemsSoldValue: ((
|
|
72
|
-
itemRejectionPct: ((
|
|
73
|
-
itemSoldPct: ((
|
|
74
|
-
lastOrderDate: ((
|
|
75
|
-
lastUploadDate: ((
|
|
76
|
-
registrationSource: ((
|
|
56
|
+
lastLogin: ((_m = props.props) === null || _m === void 0 ? void 0 : _m.lastLogin) || '',
|
|
57
|
+
ordersCount: ((_o = props.props) === null || _o === void 0 ? void 0 : _o.ordersCount) || 0,
|
|
58
|
+
amountSpent: ((_p = props.props) === null || _p === void 0 ? void 0 : _p.amountSpent) || 0,
|
|
59
|
+
emailVerified: ((_q = props.props) === null || _q === void 0 ? void 0 : _q.emailVerified) || false,
|
|
60
|
+
createdAtTimestamp: ((_r = props.props) === null || _r === void 0 ? void 0 : _r.createdAtTimestamp) || 0,
|
|
61
|
+
updatedAtTimestamp: ((_s = props.props) === null || _s === void 0 ? void 0 : _s.updatedAtTimestamp) || 0,
|
|
62
|
+
itemsUploadedCount: ((_t = props.props) === null || _t === void 0 ? void 0 : _t.itemsUploadedCount) || 0,
|
|
63
|
+
inventoryValue: ((_u = props.props) === null || _u === void 0 ? void 0 : _u.inventoryValue) || 0,
|
|
64
|
+
inventoryCount: ((_v = props.props) === null || _v === void 0 ? void 0 : _v.inventoryCount) || 0,
|
|
65
|
+
itemsSoldCount: ((_w = props.props) === null || _w === void 0 ? void 0 : _w.itemsSoldCount) || 0,
|
|
66
|
+
itemsSoldValue: ((_x = props.props) === null || _x === void 0 ? void 0 : _x.itemsSoldValue) || 0,
|
|
67
|
+
itemRejectionPct: ((_y = props.props) === null || _y === void 0 ? void 0 : _y.itemRejectionPct) || 0,
|
|
68
|
+
itemSoldPct: ((_z = props.props) === null || _z === void 0 ? void 0 : _z.itemSoldPct) || 0,
|
|
69
|
+
lastOrderDate: ((_0 = props.props) === null || _0 === void 0 ? void 0 : _0.lastOrderDate) || '',
|
|
70
|
+
lastUploadDate: ((_1 = props.props) === null || _1 === void 0 ? void 0 : _1.lastUploadDate) || '',
|
|
71
|
+
registrationSource: ((_2 = props.props) === null || _2 === void 0 ? void 0 : _2.registrationSource) || '',
|
|
77
72
|
};
|
|
78
73
|
return new User_1.default(Object.assign({}, userAttributes));
|
|
79
74
|
}
|
|
@@ -22,6 +22,8 @@ class MerchantFormState extends FormState_1.default {
|
|
|
22
22
|
this.fields.unitSystem = this.fieldFactory('singleSelect', 'unitSystem', options_1.unitSystemOptions);
|
|
23
23
|
this.fields.defaultWeightUnit = this.fieldFactory('singleSelect', 'defaultWeightUnit');
|
|
24
24
|
this.fields.webhooks = this.fieldFactory('multiSelect', 'webhooks');
|
|
25
|
+
this.fields.ribbnId = this.fieldFactory('textInput', 'ribbnId');
|
|
26
|
+
this.fields.primaryDomain = this.fieldFactory('textInput', 'primaryDomain');
|
|
25
27
|
}
|
|
26
28
|
createMerchant() {
|
|
27
29
|
const merchantFactory = new MerchantFromFormState_1.default();
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
class AnalyticsHelpers {
|
|
4
4
|
// Trait object for analytics.identify (https://segment.com/docs/connections/spec/identify/)
|
|
5
5
|
static createIdentifyPayloadForSegment(userProps) {
|
|
6
|
-
const { firstName, lastName, email, phone, documentId, createdAt, updatedAt, addresses, title, isSeller, ordersCount = 0, amountSpent = 0, itemsUploadedCount = 0, lastOrderDate, inventoryValue = 0, inventoryCount = 0, itemsSoldCount = 0, itemsSoldValue = 0, itemRejectionPct, itemSoldPct, lastUploadDate,
|
|
6
|
+
const { firstName, lastName, email, phone, documentId, createdAt, updatedAt, addresses, title, isSeller, ordersCount = 0, amountSpent = 0, itemsUploadedCount = 0, lastOrderDate, inventoryValue = 0, inventoryCount = 0, itemsSoldCount = 0, itemsSoldValue = 0, itemRejectionPct, itemSoldPct, lastUploadDate, registrationSource = '', } = userProps;
|
|
7
7
|
// Step 1. Get all reserved traits (https://segment.com/docs/connections/spec/identify/#traits)
|
|
8
8
|
const reservedTraitsObj = {
|
|
9
9
|
firstName,
|
|
@@ -30,7 +30,6 @@ class AnalyticsHelpers {
|
|
|
30
30
|
itemSoldPct,
|
|
31
31
|
lastOrderDate,
|
|
32
32
|
lastUploadDate,
|
|
33
|
-
availableCredit,
|
|
34
33
|
registrationSource,
|
|
35
34
|
};
|
|
36
35
|
return {
|
|
@@ -145,7 +145,7 @@ class ShopifyHelpers {
|
|
|
145
145
|
imageURLConverter(url, size = '1000x1000') {
|
|
146
146
|
let imageUrl = url;
|
|
147
147
|
if (imageUrl) {
|
|
148
|
-
imageUrl = imageUrl.replace(/\/(.*)\.(\w{2,4})/g, `/$1_${size}.$2`);
|
|
148
|
+
// imageUrl = imageUrl.replace(/\/(.*)\.(\w{2,4})/g, `/$1_${size}.$2`);
|
|
149
149
|
}
|
|
150
150
|
else {
|
|
151
151
|
imageUrl = 'http://cdn.shopify.com/s/images/admin/no-image-compact.gif';
|
package/lib/models/Merchant.d.ts
CHANGED
|
@@ -56,12 +56,11 @@ export default class Merchant extends Base {
|
|
|
56
56
|
numFiles: number;
|
|
57
57
|
numOrders: number;
|
|
58
58
|
numProducts: number;
|
|
59
|
-
orderTags: string[];
|
|
60
|
-
productTags: string[];
|
|
61
|
-
theme: MerchantTheme;
|
|
62
59
|
webshopTenantId: string;
|
|
63
60
|
webhooks: MerchantWebHook[];
|
|
64
61
|
sharedSecret: string;
|
|
62
|
+
ribbnId: string;
|
|
63
|
+
primaryDomain: string;
|
|
65
64
|
constructor(props?: any);
|
|
66
65
|
toObj(): MerchantObj;
|
|
67
66
|
}
|
package/lib/models/Merchant.js
CHANGED
|
@@ -33,24 +33,11 @@ class Merchant extends Base_1.default {
|
|
|
33
33
|
this.numFiles = (props === null || props === void 0 ? void 0 : props.numFiles) || 0;
|
|
34
34
|
this.numOrders = (props === null || props === void 0 ? void 0 : props.numOrders) || 0;
|
|
35
35
|
this.numProducts = (props === null || props === void 0 ? void 0 : props.numProducts) || 0;
|
|
36
|
-
this.orderTags = (props === null || props === void 0 ? void 0 : props.orderTags) || [];
|
|
37
|
-
this.productTags = (props === null || props === void 0 ? void 0 : props.productTags) || [];
|
|
38
|
-
this.theme = (props === null || props === void 0 ? void 0 : props.theme) || {
|
|
39
|
-
layoutType: 'StandardNavLayout',
|
|
40
|
-
bgColor: '#fff',
|
|
41
|
-
bgFooterColor: '#000',
|
|
42
|
-
primaryColor: '#009688',
|
|
43
|
-
footerTextColor: '#fff',
|
|
44
|
-
textColor: '#000',
|
|
45
|
-
successColor: '#009460',
|
|
46
|
-
warningColor: '#edaf4a',
|
|
47
|
-
errorColor: '#da344d',
|
|
48
|
-
logoImageSrc: '',
|
|
49
|
-
logoImageWidth: '60',
|
|
50
|
-
};
|
|
51
36
|
this.webshopTenantId = (props === null || props === void 0 ? void 0 : props.webshopTenantId) || '';
|
|
52
37
|
this.webhooks = (props === null || props === void 0 ? void 0 : props.webhooks) || [];
|
|
53
38
|
this.sharedSecret = (props === null || props === void 0 ? void 0 : props.sharedSecret) || '';
|
|
39
|
+
this.ribbnId = (props === null || props === void 0 ? void 0 : props.ribbnId) || '';
|
|
40
|
+
this.primaryDomain = (props === null || props === void 0 ? void 0 : props.primaryDomain) || '';
|
|
54
41
|
}
|
|
55
42
|
toObj() {
|
|
56
43
|
return {
|
|
@@ -74,12 +61,11 @@ class Merchant extends Base_1.default {
|
|
|
74
61
|
numFiles: this.numFiles,
|
|
75
62
|
numOrders: this.numOrders,
|
|
76
63
|
numProducts: this.numProducts,
|
|
77
|
-
orderTags: this.orderTags,
|
|
78
|
-
productTags: this.productTags,
|
|
79
|
-
theme: this.theme,
|
|
80
64
|
webshopTenantId: this.webshopTenantId,
|
|
81
65
|
webhooks: this.webhooks,
|
|
82
66
|
sharedSecret: this.sharedSecret,
|
|
67
|
+
ribbnId: this.ribbnId,
|
|
68
|
+
primaryDomain: this.primaryDomain,
|
|
83
69
|
};
|
|
84
70
|
}
|
|
85
71
|
}
|
package/lib/models/User.d.ts
CHANGED
|
@@ -8,10 +8,8 @@ export default class User extends Base {
|
|
|
8
8
|
email: string;
|
|
9
9
|
phone: string;
|
|
10
10
|
gid: string;
|
|
11
|
-
referralCode: string;
|
|
12
11
|
tokens: string[];
|
|
13
12
|
addresses: UserAddress;
|
|
14
|
-
availableCredit: number;
|
|
15
13
|
createdAt: string | FireStoreTimeStamp;
|
|
16
14
|
updatedAt: string | FireStoreTimeStamp;
|
|
17
15
|
createdAtTimestamp: number;
|
|
@@ -19,10 +17,7 @@ export default class User extends Base {
|
|
|
19
17
|
lastLogin: string;
|
|
20
18
|
devicePlatform: string;
|
|
21
19
|
shoppingSessionId: string;
|
|
22
|
-
orders: any[];
|
|
23
20
|
savedItems: string[];
|
|
24
|
-
shoppingBag: string[];
|
|
25
|
-
remainingReferralCodes: number;
|
|
26
21
|
isSeller: boolean;
|
|
27
22
|
title: string;
|
|
28
23
|
aboutMe: string;
|
package/lib/models/User.js
CHANGED
|
@@ -12,7 +12,6 @@ class User extends Base_1.default {
|
|
|
12
12
|
this.email = (props === null || props === void 0 ? void 0 : props.email) || '';
|
|
13
13
|
this.phone = (props === null || props === void 0 ? void 0 : props.phone) || '';
|
|
14
14
|
this.gid = (props === null || props === void 0 ? void 0 : props.gid) || '';
|
|
15
|
-
this.referralCode = (props === null || props === void 0 ? void 0 : props.referralCode) || '';
|
|
16
15
|
this.tokens = (props === null || props === void 0 ? void 0 : props.tokens) || [];
|
|
17
16
|
this.addresses = (props === null || props === void 0 ? void 0 : props.addresses) || {
|
|
18
17
|
delivery: [],
|
|
@@ -31,17 +30,13 @@ class User extends Base_1.default {
|
|
|
31
30
|
billing: [],
|
|
32
31
|
payout: {},
|
|
33
32
|
};
|
|
34
|
-
this.availableCredit = (props === null || props === void 0 ? void 0 : props.availableCredit) || 0;
|
|
35
33
|
this.createdAt = (props === null || props === void 0 ? void 0 : props.createdAt) || '';
|
|
36
34
|
this.createdAtTimestamp = (props === null || props === void 0 ? void 0 : props.createdAtTimestamp) || 0;
|
|
37
35
|
this.updatedAtTimestamp = (props === null || props === void 0 ? void 0 : props.updatedAtTimestamp) || 0;
|
|
38
36
|
this.updatedAt = (props === null || props === void 0 ? void 0 : props.updatedAt) || '';
|
|
39
37
|
this.devicePlatform = (props === null || props === void 0 ? void 0 : props.devicePlatform) || '';
|
|
40
38
|
this.shoppingSessionId = (props === null || props === void 0 ? void 0 : props.shoppingSessionId) || '';
|
|
41
|
-
this.orders = (props === null || props === void 0 ? void 0 : props.orders) || [];
|
|
42
39
|
this.savedItems = (props === null || props === void 0 ? void 0 : props.savedItems) || [];
|
|
43
|
-
this.shoppingBag = (props === null || props === void 0 ? void 0 : props.shoppingBag) || [];
|
|
44
|
-
this.remainingReferralCodes = (props === null || props === void 0 ? void 0 : props.remainingReferralCodes) || 5;
|
|
45
40
|
this.isSeller = (props === null || props === void 0 ? void 0 : props.isSeller) || false;
|
|
46
41
|
this.title = (props === null || props === void 0 ? void 0 : props.title) || '';
|
|
47
42
|
this.aboutMe = (props === null || props === void 0 ? void 0 : props.aboutMe) || '';
|
|
@@ -77,20 +72,15 @@ class User extends Base_1.default {
|
|
|
77
72
|
email: this.email,
|
|
78
73
|
phone: this.phone,
|
|
79
74
|
gid: this.gid,
|
|
80
|
-
referralCode: this.referralCode,
|
|
81
75
|
tokens: this.tokens,
|
|
82
76
|
addresses: this.addresses,
|
|
83
|
-
availableCredit: this.availableCredit,
|
|
84
77
|
createdAt: this.createdAt,
|
|
85
78
|
updatedAt: this.updatedAt,
|
|
86
79
|
createdAtTimestamp: this.createdAtTimestamp,
|
|
87
80
|
updatedAtTimestamp: this.updatedAtTimestamp,
|
|
88
81
|
devicePlatform: this.devicePlatform,
|
|
89
82
|
shoppingSessionId: this.shoppingSessionId,
|
|
90
|
-
orders: this.orders,
|
|
91
83
|
savedItems: this.savedItems,
|
|
92
|
-
shoppingBag: this.shoppingBag,
|
|
93
|
-
remainingReferralCodes: this.remainingReferralCodes,
|
|
94
84
|
isSeller: this.isSeller,
|
|
95
85
|
title: this.title,
|
|
96
86
|
aboutMe: this.aboutMe,
|
|
@@ -166,11 +156,9 @@ class User extends Base_1.default {
|
|
|
166
156
|
email: this.email,
|
|
167
157
|
phone: this.phone,
|
|
168
158
|
addresses: this.addresses,
|
|
169
|
-
availableCredit: this.availableCredit,
|
|
170
159
|
createdAt: this.createdAt,
|
|
171
160
|
shoppingSessionId: this.shoppingSessionId,
|
|
172
161
|
savedItems: this.savedItems,
|
|
173
|
-
shoppingBag: this.shoppingBag,
|
|
174
162
|
avatarUrl: this.avatarUrl,
|
|
175
163
|
tags: this.tags,
|
|
176
164
|
notes: this.notes,
|
|
@@ -180,7 +168,6 @@ class User extends Base_1.default {
|
|
|
180
168
|
isSeller: this.isSeller,
|
|
181
169
|
devicePlatform: this.devicePlatform,
|
|
182
170
|
lastLogin: this.lastLogin,
|
|
183
|
-
referralCode: this.referralCode,
|
|
184
171
|
itemsUploadedCount: this.itemsUploadedCount,
|
|
185
172
|
inventoryValue: this.inventoryValue,
|
|
186
173
|
inventoryCount: this.inventoryCount,
|
|
@@ -303,11 +290,6 @@ class User extends Base_1.default {
|
|
|
303
290
|
name: 'lastUploadTimestamp',
|
|
304
291
|
type: 'int64',
|
|
305
292
|
},
|
|
306
|
-
{
|
|
307
|
-
facet: true,
|
|
308
|
-
name: 'availableCredit',
|
|
309
|
-
type: 'float',
|
|
310
|
-
},
|
|
311
293
|
{
|
|
312
294
|
facet: true,
|
|
313
295
|
name: 'registrationSource',
|
|
@@ -340,7 +322,6 @@ class User extends Base_1.default {
|
|
|
340
322
|
itemSoldPct: this.utilities.sanitizeNumber(this.itemSoldPct),
|
|
341
323
|
lastOrderTimestamp: this.utilities.sanitizeMillisTimeStamp(new Date(this.lastOrderDate).getTime()),
|
|
342
324
|
lastUploadTimestamp: this.utilities.sanitizeMillisTimeStamp(new Date(this.lastUploadDate).getTime()),
|
|
343
|
-
availableCredit: this.utilities.sanitizeNumber(this.availableCredit),
|
|
344
325
|
registrationSource: this.utilities.sanitizeString(this.registrationSource),
|
|
345
326
|
};
|
|
346
327
|
return stagedObj;
|
|
@@ -19,12 +19,11 @@ declare type MerchantObj = {
|
|
|
19
19
|
numFiles: number;
|
|
20
20
|
numOrders: number;
|
|
21
21
|
numProducts: number;
|
|
22
|
-
orderTags: string[];
|
|
23
|
-
productTags: string[];
|
|
24
|
-
theme: MerchantTheme;
|
|
25
22
|
webhooks: MerchantWebHook[];
|
|
26
23
|
webshopTenantId: string;
|
|
27
24
|
sharedSecret: string;
|
|
25
|
+
ribbnId: string;
|
|
26
|
+
primaryDomain: string;
|
|
28
27
|
};
|
|
29
28
|
declare type MerchantTypes = 'INDIVIDUAL' | 'BUSINESS';
|
|
30
29
|
declare type RibbnPaymentTiers = 'FREE' | 'TIER_ONE';
|
|
@@ -64,6 +63,8 @@ declare type MerchantFormFields = {
|
|
|
64
63
|
unitSystem: SingleSelectFormField<string>;
|
|
65
64
|
defaultWeightUnit: SingleSelectFormField<string>;
|
|
66
65
|
webhooks: MultiSelectFormField<MerchantWebHook>;
|
|
66
|
+
ribbnId: TextInputFormField<string>;
|
|
67
|
+
primaryDomain: TextInputFormField<string>;
|
|
67
68
|
};
|
|
68
69
|
declare type WebhookFormFields = {
|
|
69
70
|
event: SingleSelectFormField<string>;
|
|
@@ -6,16 +6,11 @@ interface UserAttributes extends ReRobeDocument {
|
|
|
6
6
|
email: string;
|
|
7
7
|
phone: string;
|
|
8
8
|
gid?: string;
|
|
9
|
-
referralCode?: string;
|
|
10
9
|
tokens?: string[];
|
|
11
10
|
addresses: UserAddress;
|
|
12
|
-
availableCredit: number;
|
|
13
11
|
devicePlatform: string;
|
|
14
12
|
shoppingSessionId: string;
|
|
15
|
-
orders: any[];
|
|
16
13
|
savedItems: string[];
|
|
17
|
-
shoppingBag: string[];
|
|
18
|
-
remainingReferralCodes: number;
|
|
19
14
|
isSeller: boolean;
|
|
20
15
|
title?: string;
|
|
21
16
|
aboutMe?: string;
|
|
@@ -52,12 +47,10 @@ declare type RibbnCustomerObj = {
|
|
|
52
47
|
email: string;
|
|
53
48
|
phone?: string;
|
|
54
49
|
addresses?: UserAddress;
|
|
55
|
-
availableCredit?: number;
|
|
56
50
|
createdAt?: string;
|
|
57
51
|
updatedAt?: string;
|
|
58
52
|
shoppingSessionId?: string;
|
|
59
53
|
savedItems?: string[];
|
|
60
|
-
shoppingBag?: string[];
|
|
61
54
|
avatarUrl?: string | null;
|
|
62
55
|
tags?: string[];
|
|
63
56
|
notes?: string;
|
|
@@ -67,7 +60,6 @@ declare type RibbnCustomerObj = {
|
|
|
67
60
|
isSeller?: boolean;
|
|
68
61
|
devicePlatform?: string;
|
|
69
62
|
lastLogin?: string;
|
|
70
|
-
referralCode?: string;
|
|
71
63
|
itemsUploadedCount?: number;
|
|
72
64
|
inventoryValue?: number;
|
|
73
65
|
inventoryCount?: number;
|
|
@@ -82,7 +74,6 @@ declare type RibbnCustomerObj = {
|
|
|
82
74
|
declare type UserObjForAuthTemplateMethod = {
|
|
83
75
|
authUserProfile: UserFromShopifyGraphQLResp;
|
|
84
76
|
prevUserProfile: UserAttributes | undefined;
|
|
85
|
-
shoppingBag: string[];
|
|
86
77
|
savedItems: string[];
|
|
87
78
|
devicePlatform: string;
|
|
88
79
|
shoppingSessionId: string;
|
|
@@ -172,6 +163,5 @@ declare type TypesenseUserObj = {
|
|
|
172
163
|
itemSoldPct: number;
|
|
173
164
|
lastOrderTimestamp: number;
|
|
174
165
|
lastUploadTimestamp: number;
|
|
175
|
-
availableCredit: number;
|
|
176
166
|
registrationSource: string;
|
|
177
167
|
};
|