rerobe-js-orm 2.6.3 → 2.6.6

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.
@@ -1576,6 +1576,7 @@ const colors = [
1576
1576
  { label: 'Yellow', value: 'Yellow' },
1577
1577
  ];
1578
1578
  exports.colors = colors;
1579
+ // Review
1579
1580
  const conditions = [
1580
1581
  {
1581
1582
  label: 'New with tags',
@@ -1,6 +1,8 @@
1
1
  import Base from '../Base';
2
2
  export default class ChatRoom extends Base {
3
3
  documentId: string;
4
+ createdAt: string;
5
+ createdAtTimestamp: number;
4
6
  userIdsToBeNotified: string[];
5
7
  type: ChatRoomType;
6
8
  lastMessage: LastMessageObj;
@@ -5,6 +5,8 @@ class ChatRoom extends Base_1.default {
5
5
  constructor(props) {
6
6
  super();
7
7
  this.documentId = (props === null || props === void 0 ? void 0 : props.documentId) || this.utilities.makeRandId(28);
8
+ this.createdAt = (props === null || props === void 0 ? void 0 : props.createdAt) || '';
9
+ this.createdAtTimestamp = (props === null || props === void 0 ? void 0 : props.createdAtTimestamp) || 0;
8
10
  this.userIdsToBeNotified = (props === null || props === void 0 ? void 0 : props.userIdsToBeNotified) || [];
9
11
  this.type = (props === null || props === void 0 ? void 0 : props.type) || 'CUSTOMER_SUPPORT';
10
12
  this.lastMessage = (props === null || props === void 0 ? void 0 : props.lastMessage) || {};
@@ -15,6 +17,8 @@ class ChatRoom extends Base_1.default {
15
17
  toObj() {
16
18
  return {
17
19
  documentId: this.documentId,
20
+ createdAt: this.createdAt,
21
+ createdAtTimestamp: this.createdAtTimestamp,
18
22
  userIdsToBeNotified: this.userIdsToBeNotified,
19
23
  type: this.type,
20
24
  lastMessage: this.lastMessage,
@@ -32,6 +36,11 @@ class ChatRoom extends Base_1.default {
32
36
  name: 'documentId',
33
37
  type: 'string',
34
38
  },
39
+ {
40
+ facet: true,
41
+ name: 'createdAtTimestamp',
42
+ type: 'int64',
43
+ },
35
44
  {
36
45
  facet: true,
37
46
  name: 'type',
@@ -62,6 +71,11 @@ class ChatRoom extends Base_1.default {
62
71
  name: 'lastMessage.content',
63
72
  type: 'string',
64
73
  },
74
+ {
75
+ facet: true,
76
+ name: 'createdAtTimestamp',
77
+ type: 'int64',
78
+ },
65
79
  {
66
80
  facet: true,
67
81
  name: 'lastMessage.createdAtTimestamp',
@@ -83,7 +97,7 @@ class ChatRoom extends Base_1.default {
83
97
  type: 'string',
84
98
  },
85
99
  ],
86
- name,
100
+ name: 'dev_chatRooms_20220725',
87
101
  };
88
102
  }
89
103
  toObjForTypesense() {
@@ -98,6 +112,7 @@ class ChatRoom extends Base_1.default {
98
112
  }, []);
99
113
  const stagedObj = {
100
114
  documentId: this.utilities.sanitizeString(this.documentId),
115
+ createdAtTimestamp: this.utilities.sanitizeMillisTimeStamp(this.createdAtTimestamp),
101
116
  type: this.utilities.sanitizeString(this.type),
102
117
  userIds: this.utilities.sanitzeStringArr(this.userIds),
103
118
  userIdsToBeNotified: this.utilities.sanitzeStringArr(this.userIdsToBeNotified),
@@ -1,6 +1,8 @@
1
1
  import Base from '../Base';
2
2
  export default class ProductCollection extends Base {
3
3
  documentId: string;
4
+ merchantId: string;
5
+ createdAtTimestamp: number;
4
6
  preTitle: string;
5
7
  title: string;
6
8
  subTitle: string;
@@ -5,6 +5,8 @@ class ProductCollection extends Base_1.default {
5
5
  constructor(props) {
6
6
  super();
7
7
  this.documentId = (props === null || props === void 0 ? void 0 : props.documentId) || this.utilities.makeRandId(28);
8
+ this.merchantId = (props === null || props === void 0 ? void 0 : props.merchantId) || '';
9
+ this.createdAtTimestamp = (props === null || props === void 0 ? void 0 : props.createdAtTimestamp) || 0;
8
10
  this.preTitle = (props === null || props === void 0 ? void 0 : props.preTitle) || '';
9
11
  this.title = (props === null || props === void 0 ? void 0 : props.title) || '';
10
12
  this.subTitle = (props === null || props === void 0 ? void 0 : props.subTitle) || '';
@@ -18,6 +20,8 @@ class ProductCollection extends Base_1.default {
18
20
  toObj() {
19
21
  const productCollectionObj = {
20
22
  documentId: this.documentId,
23
+ merchantId: this.merchantId,
24
+ createdAtTimestamp: this.createdAtTimestamp,
21
25
  preTitle: this.preTitle,
22
26
  title: this.title,
23
27
  subTitle: this.subTitle,
@@ -32,13 +36,23 @@ class ProductCollection extends Base_1.default {
32
36
  }
33
37
  generateSchemaForTypesense(name = 'prod_productCollections_20220722') {
34
38
  return {
35
- default_sorting_field: 'title',
39
+ default_sorting_field: 'createdAtTimestamp',
36
40
  fields: [
37
41
  {
38
42
  facet: false,
39
43
  name: 'documentId',
40
44
  type: 'string',
41
45
  },
46
+ {
47
+ facet: true,
48
+ name: 'merchantId',
49
+ type: 'string',
50
+ },
51
+ {
52
+ facet: true,
53
+ name: 'createdAtTimestamp',
54
+ type: 'int64',
55
+ },
42
56
  {
43
57
  facet: true,
44
58
  name: 'title',
@@ -158,13 +172,20 @@ class ProductCollection extends Base_1.default {
158
172
  name: 'tags',
159
173
  type: 'string[]',
160
174
  },
175
+ {
176
+ facet: true,
177
+ name: 'collectionId',
178
+ type: 'string',
179
+ },
161
180
  ],
162
- name,
181
+ name: 'dev_productCollections_20220726',
163
182
  };
164
183
  }
165
184
  toObjForTypesense() {
166
185
  const stagedObj = {
167
186
  documentId: this.utilities.sanitizeString(this.documentId),
187
+ merchantId: this.utilities.sanitizeString(this.merchantId),
188
+ createdAtTimestamp: this.utilities.sanitizeMillisTimeStamp(this.createdAtTimestamp),
168
189
  preTitle: this.utilities.sanitizeString(this.preTitle),
169
190
  title: this.utilities.sanitizeString(this.title),
170
191
  subTitle: this.utilities.sanitizeString(this.subTitle),
@@ -186,6 +207,7 @@ class ProductCollection extends Base_1.default {
186
207
  'refinements.statusRefinement': this.utilities.sanitzeStringArr(this.refinements.statusRefinement),
187
208
  'refinements.salesChannelRefinement': this.utilities.sanitzeStringArr(this.refinements.salesChannelRefinement),
188
209
  tags: this.utilities.sanitzeStringArr(this.tags),
210
+ collectionId: this.utilities.sanitizeString(this.collectionId),
189
211
  };
190
212
  return stagedObj;
191
213
  }
@@ -35,8 +35,10 @@ interface ProductRefinements {
35
35
  declare type CollectionType = 'AUTOMATED' | 'MANUAL';
36
36
  declare type ProductCollectionType = {
37
37
  createdAt?: string;
38
+ createdAtTimestamp?: number;
38
39
  updatedAt?: string;
39
40
  documentId?: string;
41
+ merchantId?: string;
40
42
  preTitle: string;
41
43
  title: string;
42
44
  subTitle: string;
@@ -63,6 +65,8 @@ declare type ProductCollectionFormFields = {
63
65
  };
64
66
  declare type TypesenseProductCollectionObj = {
65
67
  documentId: string;
68
+ merchantId: string;
69
+ createdAtTimestamp: number;
66
70
  preTitle: string;
67
71
  title: string;
68
72
  subTitle: string;
@@ -84,4 +88,5 @@ declare type TypesenseProductCollectionObj = {
84
88
  'refinements.statusRefinement': string[];
85
89
  'refinements.salesChannelRefinement': string[];
86
90
  tags: string[];
91
+ collectionId: string;
87
92
  };
@@ -1,5 +1,7 @@
1
1
  declare type ChatRoomAttributes = {
2
2
  documentId: string;
3
+ createdAt: string;
4
+ createdAtTimestamp: number;
3
5
  userIdsToBeNotified: string[];
4
6
  type: ChatRoomType;
5
7
  lastMessage: LastMessageObj;
@@ -30,6 +32,7 @@ declare type ChatRoomUserInfo = {
30
32
  };
31
33
  declare type TypesenseChatRoomObj = {
32
34
  documentId: string;
35
+ createdAtTimestamp: number;
33
36
  type: string;
34
37
  userIds: string[];
35
38
  userIdsToBeNotified: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "2.6.3",
3
+ "version": "2.6.6",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",