rerobe-js-orm 2.7.16 → 2.7.17

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, _5;
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;
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) || '',
@@ -72,6 +72,7 @@ class UserFromFormState extends UserFactory_1.default {
72
72
  itemRejectionPct: ((_3 = props.props) === null || _3 === void 0 ? void 0 : _3.itemRejectionPct) || 0,
73
73
  itemSoldPct: ((_4 = props.props) === null || _4 === void 0 ? void 0 : _4.itemSoldPct) || 0,
74
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) || '',
75
76
  };
76
77
  return new User_1.default(Object.assign({}, userAttributes));
77
78
  }
@@ -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, itemSoldPct, } = userProps;
6
+ const { firstName, lastName, email, phone, documentId, createdAt, updatedAt, addresses, title, isSeller, ordersCount, amountSpent, itemsUploadedCount, lastOrderDate, inventoryValue, inventoryCount, itemsSoldCount, itemsSoldValue, itemRejectionPct, itemSoldPct, lastUploadDate, } = userProps;
7
7
  // Step 1. Get all reserved traits (https://segment.com/docs/connections/spec/identify/#traits)
8
8
  const reservedTraitsObj = {
9
9
  firstName,
@@ -29,6 +29,7 @@ class AnalyticsHelpers {
29
29
  itemRejectionPct,
30
30
  itemSoldPct,
31
31
  lastOrderDate,
32
+ lastUploadDate,
32
33
  };
33
34
  return {
34
35
  userId: documentId || '',
@@ -44,6 +44,7 @@ export default class User extends Base {
44
44
  itemRejectionPct: number;
45
45
  itemSoldPct: number;
46
46
  lastOrderDate: string;
47
+ lastUploadDate: string;
47
48
  constructor(props?: any);
48
49
  toObj(): UserAttributes;
49
50
  toCustomerUpdateInputObjForShopify(): any;
@@ -64,6 +64,7 @@ class User extends Base_1.default {
64
64
  this.itemRejectionPct = (props === null || props === void 0 ? void 0 : props.itemRejectionPct) || 0;
65
65
  this.itemSoldPct = (props === null || props === void 0 ? void 0 : props.itemSoldPct) || 0;
66
66
  this.lastOrderDate = (props === null || props === void 0 ? void 0 : props.lastOrderDate) || '';
67
+ this.lastUploadDate = (props === null || props === void 0 ? void 0 : props.lastUploadDate) || '';
67
68
  }
68
69
  toObj() {
69
70
  return {
@@ -108,6 +109,7 @@ class User extends Base_1.default {
108
109
  itemRejectionPct: this.itemRejectionPct,
109
110
  itemSoldPct: this.itemSoldPct,
110
111
  lastOrderDate: this.lastOrderDate,
112
+ lastUploadDate: this.lastUploadDate,
111
113
  };
112
114
  }
113
115
  toCustomerUpdateInputObjForShopify() {
@@ -185,6 +187,7 @@ class User extends Base_1.default {
185
187
  itemRejectionPct: this.itemRejectionPct,
186
188
  itemSoldPct: this.itemSoldPct,
187
189
  lastOrderDate: this.lastOrderDate,
190
+ lastUploadDate: this.lastUploadDate,
188
191
  };
189
192
  return customerInput;
190
193
  }
@@ -289,8 +292,13 @@ class User extends Base_1.default {
289
292
  },
290
293
  {
291
294
  facet: true,
292
- name: 'lastOrderDate',
293
- type: 'string',
295
+ name: 'lastOrderTimestamp',
296
+ type: 'int64',
297
+ },
298
+ {
299
+ facet: true,
300
+ name: 'lastUploadTimestamp',
301
+ type: 'int64',
294
302
  },
295
303
  ],
296
304
  name: 'prod_customers_20220907',
@@ -317,7 +325,8 @@ class User extends Base_1.default {
317
325
  itemsSoldValue: this.utilities.sanitizeNumber(this.itemsSoldValue),
318
326
  itemRejectionPct: this.utilities.sanitizeNumber(this.itemRejectionPct),
319
327
  itemSoldPct: this.utilities.sanitizeNumber(this.itemSoldPct),
320
- lastOrderDate: this.utilities.sanitizeString(this.lastOrderDate),
328
+ lastOrderTimestamp: this.utilities.sanitizeMillisTimeStamp(new Date(this.lastOrderDate).getTime()),
329
+ lastUploadTimestamp: this.utilities.sanitizeMillisTimeStamp(new Date(this.lastUploadDate).getTime()),
321
330
  };
322
331
  return stagedObj;
323
332
  }
@@ -40,6 +40,7 @@ interface UserAttributes extends ReRobeDocument {
40
40
  itemRejectionPct?: number;
41
41
  itemSoldPct?: number;
42
42
  lastOrderDate?: string;
43
+ lastUploadDate?: string;
43
44
  }
44
45
  declare type RibbnCustomerObj = {
45
46
  uid?: string;
@@ -74,6 +75,7 @@ declare type RibbnCustomerObj = {
74
75
  itemRejectionPct?: number;
75
76
  itemSoldPct?: number;
76
77
  lastOrderDate?: string;
78
+ lastUploadDate?: string;
77
79
  };
78
80
  declare type UserObjForAuthTemplateMethod = {
79
81
  authUserProfile: UserFromShopifyGraphQLResp;
@@ -165,5 +167,6 @@ declare type TypesenseUserObj = {
165
167
  itemsSoldValue: number;
166
168
  itemRejectionPct: number;
167
169
  itemSoldPct: number;
168
- lastOrderDate: string;
170
+ lastOrderTimestamp: number;
171
+ lastUploadTimestamp: number;
169
172
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "2.7.16",
3
+ "version": "2.7.17",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",