rerobe-js-orm 2.7.15 → 2.7.18

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 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, _3, _4;
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
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) || '',
@@ -70,7 +70,10 @@ class UserFromFormState extends UserFactory_1.default {
70
70
  itemsSoldCount: ((_1 = props.props) === null || _1 === void 0 ? void 0 : _1.itemsSoldCount) || 0,
71
71
  itemsSoldValue: ((_2 = props.props) === null || _2 === void 0 ? void 0 : _2.itemsSoldValue) || 0,
72
72
  itemRejectionPct: ((_3 = props.props) === null || _3 === void 0 ? void 0 : _3.itemRejectionPct) || 0,
73
- lastOrderDate: ((_4 = props.props) === null || _4 === void 0 ? void 0 : _4.lastOrderDate) || '',
73
+ itemSoldPct: ((_4 = props.props) === null || _4 === void 0 ? void 0 : _4.itemSoldPct) || 0,
74
+ lastOrderDate: ((_5 = props.props) === null || _5 === void 0 ? void 0 : _5.lastOrderDate) || '',
75
+ lastUploadDate: ((_6 = props.props) === null || _6 === void 0 ? void 0 : _6.lastUploadDate) || '',
76
+ registrationSource: ((_7 = props.props) === null || _7 === void 0 ? void 0 : _7.registrationSource) || '',
74
77
  };
75
78
  return new User_1.default(Object.assign({}, userAttributes));
76
79
  }
@@ -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, amountSpent, itemsUploadedCount, lastOrderDate, inventoryValue, inventoryCount, itemsSoldCount, itemsSoldValue, itemRejectionPct, } = 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, availableCredit, 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,
@@ -27,7 +27,11 @@ class AnalyticsHelpers {
27
27
  itemsSoldCount,
28
28
  itemsSoldValue,
29
29
  itemRejectionPct,
30
+ itemSoldPct,
30
31
  lastOrderDate,
32
+ lastUploadDate,
33
+ availableCredit,
34
+ registrationSource,
31
35
  };
32
36
  return {
33
37
  userId: documentId || '',
@@ -42,7 +42,10 @@ export default class User extends Base {
42
42
  itemsSoldCount: number;
43
43
  itemsSoldValue: number;
44
44
  itemRejectionPct: number;
45
+ itemSoldPct: number;
45
46
  lastOrderDate: string;
47
+ lastUploadDate: string;
48
+ registrationSource: string;
46
49
  constructor(props?: any);
47
50
  toObj(): UserAttributes;
48
51
  toCustomerUpdateInputObjForShopify(): any;
@@ -62,7 +62,10 @@ class User extends Base_1.default {
62
62
  this.itemsSoldCount = (props === null || props === void 0 ? void 0 : props.itemsSoldCount) || 0;
63
63
  this.itemsSoldValue = (props === null || props === void 0 ? void 0 : props.itemsSoldValue) || 0;
64
64
  this.itemRejectionPct = (props === null || props === void 0 ? void 0 : props.itemRejectionPct) || 0;
65
+ this.itemSoldPct = (props === null || props === void 0 ? void 0 : props.itemSoldPct) || 0;
65
66
  this.lastOrderDate = (props === null || props === void 0 ? void 0 : props.lastOrderDate) || '';
67
+ this.lastUploadDate = (props === null || props === void 0 ? void 0 : props.lastUploadDate) || '';
68
+ this.registrationSource = (props === null || props === void 0 ? void 0 : props.registrationSource) || '';
66
69
  }
67
70
  toObj() {
68
71
  return {
@@ -105,7 +108,10 @@ class User extends Base_1.default {
105
108
  itemsSoldCount: this.itemsSoldCount,
106
109
  itemsSoldValue: this.itemsSoldValue,
107
110
  itemRejectionPct: this.itemRejectionPct,
111
+ itemSoldPct: this.itemSoldPct,
108
112
  lastOrderDate: this.lastOrderDate,
113
+ lastUploadDate: this.lastUploadDate,
114
+ registrationSource: this.registrationSource,
109
115
  };
110
116
  }
111
117
  toCustomerUpdateInputObjForShopify() {
@@ -181,7 +187,10 @@ class User extends Base_1.default {
181
187
  itemsSoldCount: this.itemsSoldCount,
182
188
  itemsSoldValue: this.itemsSoldValue,
183
189
  itemRejectionPct: this.itemRejectionPct,
190
+ itemSoldPct: this.itemSoldPct,
184
191
  lastOrderDate: this.lastOrderDate,
192
+ lastUploadDate: this.lastUploadDate,
193
+ registrationSource: this.registrationSource,
185
194
  };
186
195
  return customerInput;
187
196
  }
@@ -281,7 +290,27 @@ class User extends Base_1.default {
281
290
  },
282
291
  {
283
292
  facet: true,
284
- name: 'lastOrderDate',
293
+ name: 'itemSoldPct',
294
+ type: 'float',
295
+ },
296
+ {
297
+ facet: true,
298
+ name: 'lastOrderTimestamp',
299
+ type: 'int64',
300
+ },
301
+ {
302
+ facet: true,
303
+ name: 'lastUploadTimestamp',
304
+ type: 'int64',
305
+ },
306
+ {
307
+ facet: true,
308
+ name: 'availableCredit',
309
+ type: 'float',
310
+ },
311
+ {
312
+ facet: true,
313
+ name: 'registrationSource',
285
314
  type: 'string',
286
315
  },
287
316
  ],
@@ -308,7 +337,11 @@ class User extends Base_1.default {
308
337
  itemsSoldCount: this.utilities.sanitizeNumber(this.itemsSoldCount),
309
338
  itemsSoldValue: this.utilities.sanitizeNumber(this.itemsSoldValue),
310
339
  itemRejectionPct: this.utilities.sanitizeNumber(this.itemRejectionPct),
311
- lastOrderDate: this.utilities.sanitizeString(this.lastOrderDate),
340
+ itemSoldPct: this.utilities.sanitizeNumber(this.itemSoldPct),
341
+ lastOrderTimestamp: this.utilities.sanitizeMillisTimeStamp(new Date(this.lastOrderDate).getTime()),
342
+ lastUploadTimestamp: this.utilities.sanitizeMillisTimeStamp(new Date(this.lastUploadDate).getTime()),
343
+ availableCredit: this.utilities.sanitizeNumber(this.availableCredit),
344
+ registrationSource: this.utilities.sanitizeString(this.registrationSource),
312
345
  };
313
346
  return stagedObj;
314
347
  }
@@ -38,7 +38,10 @@ interface UserAttributes extends ReRobeDocument {
38
38
  itemsSoldCount?: number;
39
39
  itemsSoldValue?: number;
40
40
  itemRejectionPct?: number;
41
+ itemSoldPct?: number;
41
42
  lastOrderDate?: string;
43
+ lastUploadDate?: string;
44
+ registrationSource?: string;
42
45
  }
43
46
  declare type RibbnCustomerObj = {
44
47
  uid?: string;
@@ -71,7 +74,10 @@ declare type RibbnCustomerObj = {
71
74
  itemsSoldCount?: number;
72
75
  itemsSoldValue?: number;
73
76
  itemRejectionPct?: number;
77
+ itemSoldPct?: number;
74
78
  lastOrderDate?: string;
79
+ lastUploadDate?: string;
80
+ registrationSource?: string;
75
81
  };
76
82
  declare type UserObjForAuthTemplateMethod = {
77
83
  authUserProfile: UserFromShopifyGraphQLResp;
@@ -162,5 +168,9 @@ declare type TypesenseUserObj = {
162
168
  itemsSoldCount: number;
163
169
  itemsSoldValue: number;
164
170
  itemRejectionPct: number;
165
- lastOrderDate: string;
171
+ itemSoldPct: number;
172
+ lastOrderTimestamp: number;
173
+ lastUploadTimestamp: number;
174
+ availableCredit: number;
175
+ registrationSource: string;
166
176
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "2.7.15",
3
+ "version": "2.7.18",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",