rerobe-js-orm 2.7.13 → 2.7.16

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;
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;
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) || '',
@@ -64,6 +64,14 @@ class UserFromFormState extends UserFactory_1.default {
64
64
  emailVerified: ((_v = props.props) === null || _v === void 0 ? void 0 : _v.emailVerified) || false,
65
65
  createdAtTimestamp: ((_w = props.props) === null || _w === void 0 ? void 0 : _w.createdAtTimestamp) || 0,
66
66
  updatedAtTimestamp: ((_x = props.props) === null || _x === void 0 ? void 0 : _x.updatedAtTimestamp) || 0,
67
+ itemsUploadedCount: ((_y = props.props) === null || _y === void 0 ? void 0 : _y.itemsUploadedCount) || 0,
68
+ inventoryValue: ((_z = props.props) === null || _z === void 0 ? void 0 : _z.inventoryValue) || 0,
69
+ inventoryCount: ((_0 = props.props) === null || _0 === void 0 ? void 0 : _0.inventoryCount) || 0,
70
+ itemsSoldCount: ((_1 = props.props) === null || _1 === void 0 ? void 0 : _1.itemsSoldCount) || 0,
71
+ itemsSoldValue: ((_2 = props.props) === null || _2 === void 0 ? void 0 : _2.itemsSoldValue) || 0,
72
+ itemRejectionPct: ((_3 = props.props) === null || _3 === void 0 ? void 0 : _3.itemRejectionPct) || 0,
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) || '',
67
75
  };
68
76
  return new User_1.default(Object.assign({}, userAttributes));
69
77
  }
@@ -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, lastOrderDate, } = userProps;
6
+ const { firstName, lastName, email, phone, documentId, createdAt, updatedAt, addresses, title, isSeller, ordersCount, amountSpent, itemsUploadedCount, lastOrderDate, inventoryValue, inventoryCount, itemsSoldCount, itemsSoldValue, itemRejectionPct, itemSoldPct, } = userProps;
7
7
  // Step 1. Get all reserved traits (https://segment.com/docs/connections/spec/identify/#traits)
8
8
  const reservedTraitsObj = {
9
9
  firstName,
@@ -21,6 +21,13 @@ class AnalyticsHelpers {
21
21
  isSeller,
22
22
  ordersCount,
23
23
  amountSpent,
24
+ itemsUploadedCount,
25
+ inventoryValue,
26
+ inventoryCount,
27
+ itemsSoldCount,
28
+ itemsSoldValue,
29
+ itemRejectionPct,
30
+ itemSoldPct,
24
31
  lastOrderDate,
25
32
  };
26
33
  return {
@@ -36,6 +36,14 @@ export default class User extends Base {
36
36
  ordersCount: number;
37
37
  amountSpent: number;
38
38
  emailVerified: boolean;
39
+ itemsUploadedCount: number;
40
+ inventoryValue: number;
41
+ inventoryCount: number;
42
+ itemsSoldCount: number;
43
+ itemsSoldValue: number;
44
+ itemRejectionPct: number;
45
+ itemSoldPct: number;
46
+ lastOrderDate: string;
39
47
  constructor(props?: any);
40
48
  toObj(): UserAttributes;
41
49
  toCustomerUpdateInputObjForShopify(): any;
@@ -56,6 +56,14 @@ class User extends Base_1.default {
56
56
  this.amountSpent = (props === null || props === void 0 ? void 0 : props.amountSpent) || 0;
57
57
  this.lastLogin = (props === null || props === void 0 ? void 0 : props.lastLogin) || '';
58
58
  this.emailVerified = (props === null || props === void 0 ? void 0 : props.emailVerified) || false;
59
+ this.itemsUploadedCount = (props === null || props === void 0 ? void 0 : props.itemsUploadedCount) || 0;
60
+ this.inventoryValue = (props === null || props === void 0 ? void 0 : props.inventoryValue) || 0;
61
+ this.inventoryCount = (props === null || props === void 0 ? void 0 : props.inventoryCount) || 0;
62
+ this.itemsSoldCount = (props === null || props === void 0 ? void 0 : props.itemsSoldCount) || 0;
63
+ this.itemsSoldValue = (props === null || props === void 0 ? void 0 : props.itemsSoldValue) || 0;
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;
66
+ this.lastOrderDate = (props === null || props === void 0 ? void 0 : props.lastOrderDate) || '';
59
67
  }
60
68
  toObj() {
61
69
  return {
@@ -92,6 +100,14 @@ class User extends Base_1.default {
92
100
  emailVerified: this.emailVerified,
93
101
  ordersCount: this.ordersCount,
94
102
  amountSpent: this.amountSpent,
103
+ itemsUploadedCount: this.itemsUploadedCount,
104
+ inventoryValue: this.inventoryValue,
105
+ inventoryCount: this.inventoryCount,
106
+ itemsSoldCount: this.itemsSoldCount,
107
+ itemsSoldValue: this.itemsSoldValue,
108
+ itemRejectionPct: this.itemRejectionPct,
109
+ itemSoldPct: this.itemSoldPct,
110
+ lastOrderDate: this.lastOrderDate,
95
111
  };
96
112
  }
97
113
  toCustomerUpdateInputObjForShopify() {
@@ -161,6 +177,14 @@ class User extends Base_1.default {
161
177
  devicePlatform: this.devicePlatform,
162
178
  lastLogin: this.lastLogin,
163
179
  referralCode: this.referralCode,
180
+ itemsUploadedCount: this.itemsUploadedCount,
181
+ inventoryValue: this.inventoryValue,
182
+ inventoryCount: this.inventoryCount,
183
+ itemsSoldCount: this.itemsSoldCount,
184
+ itemsSoldValue: this.itemsSoldValue,
185
+ itemRejectionPct: this.itemRejectionPct,
186
+ itemSoldPct: this.itemSoldPct,
187
+ lastOrderDate: this.lastOrderDate,
164
188
  };
165
189
  return customerInput;
166
190
  }
@@ -228,8 +252,48 @@ class User extends Base_1.default {
228
252
  name: 'merchantId',
229
253
  type: 'string',
230
254
  },
255
+ {
256
+ facet: true,
257
+ name: 'itemsUploadedCount',
258
+ type: 'int32',
259
+ },
260
+ {
261
+ facet: true,
262
+ name: 'inventoryValue',
263
+ type: 'float',
264
+ },
265
+ {
266
+ facet: true,
267
+ name: 'inventoryCount',
268
+ type: 'int32',
269
+ },
270
+ {
271
+ facet: true,
272
+ name: 'itemsSoldCount',
273
+ type: 'int32',
274
+ },
275
+ {
276
+ facet: true,
277
+ name: 'itemsSoldValue',
278
+ type: 'float',
279
+ },
280
+ {
281
+ facet: true,
282
+ name: 'itemRejectionPct',
283
+ type: 'float',
284
+ },
285
+ {
286
+ facet: true,
287
+ name: 'itemSoldPct',
288
+ type: 'float',
289
+ },
290
+ {
291
+ facet: true,
292
+ name: 'lastOrderDate',
293
+ type: 'string',
294
+ },
231
295
  ],
232
- name: 'prod_customers_20220811',
296
+ name: 'prod_customers_20220907',
233
297
  };
234
298
  }
235
299
  toObjForTypesense(merchantId) {
@@ -246,6 +310,14 @@ class User extends Base_1.default {
246
310
  isSeller: this.isSeller,
247
311
  amountSpent: this.utilities.sanitizeNumber(this.amountSpent),
248
312
  ordersCount: this.utilities.sanitizeNumber(this.ordersCount),
313
+ itemsUploadedCount: this.utilities.sanitizeNumber(this.itemsUploadedCount),
314
+ inventoryValue: this.utilities.sanitizeNumber(this.inventoryValue),
315
+ inventoryCount: this.utilities.sanitizeNumber(this.inventoryCount),
316
+ itemsSoldCount: this.utilities.sanitizeNumber(this.itemsSoldCount),
317
+ itemsSoldValue: this.utilities.sanitizeNumber(this.itemsSoldValue),
318
+ itemRejectionPct: this.utilities.sanitizeNumber(this.itemRejectionPct),
319
+ itemSoldPct: this.utilities.sanitizeNumber(this.itemSoldPct),
320
+ lastOrderDate: this.utilities.sanitizeString(this.lastOrderDate),
249
321
  };
250
322
  return stagedObj;
251
323
  }
@@ -32,6 +32,14 @@ interface UserAttributes extends ReRobeDocument {
32
32
  emailVerified: boolean;
33
33
  createdAtTimestamp: number;
34
34
  updatedAtTimestamp: number;
35
+ itemsUploadedCount?: number;
36
+ inventoryValue?: number;
37
+ inventoryCount?: number;
38
+ itemsSoldCount?: number;
39
+ itemsSoldValue?: number;
40
+ itemRejectionPct?: number;
41
+ itemSoldPct?: number;
42
+ lastOrderDate?: string;
35
43
  }
36
44
  declare type RibbnCustomerObj = {
37
45
  uid?: string;
@@ -58,6 +66,14 @@ declare type RibbnCustomerObj = {
58
66
  devicePlatform?: string;
59
67
  lastLogin?: string;
60
68
  referralCode?: string;
69
+ itemsUploadedCount?: number;
70
+ inventoryValue?: number;
71
+ inventoryCount?: number;
72
+ itemsSoldCount?: number;
73
+ itemsSoldValue?: number;
74
+ itemRejectionPct?: number;
75
+ itemSoldPct?: number;
76
+ lastOrderDate?: string;
61
77
  };
62
78
  declare type UserObjForAuthTemplateMethod = {
63
79
  authUserProfile: UserFromShopifyGraphQLResp;
@@ -142,4 +158,12 @@ declare type TypesenseUserObj = {
142
158
  amountSpent: number;
143
159
  ordersCount: number;
144
160
  merchantId: string;
161
+ itemsUploadedCount: number;
162
+ inventoryValue: number;
163
+ inventoryCount: number;
164
+ itemsSoldCount: number;
165
+ itemsSoldValue: number;
166
+ itemRejectionPct: number;
167
+ itemSoldPct: number;
168
+ lastOrderDate: string;
145
169
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "2.7.13",
3
+ "version": "2.7.16",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",