rerobe-js-orm 2.6.3 → 2.6.4
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/models/ChatRoom.d.ts +2 -0
- package/lib/models/ChatRoom.js +16 -1
- package/lib/models/ProductCollection.d.ts +1 -0
- package/lib/models/ProductCollection.js +10 -2
- package/lib/types/product-collection-types.d.ts +2 -0
- package/lib/types/rerobe-chatroom-types.d.ts +3 -0
- package/package.json +1 -1
package/lib/models/ChatRoom.d.ts
CHANGED
package/lib/models/ChatRoom.js
CHANGED
|
@@ -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),
|
|
@@ -5,6 +5,7 @@ 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.createdAtTimestamp = (props === null || props === void 0 ? void 0 : props.createdAtTimestamp) || 0;
|
|
8
9
|
this.preTitle = (props === null || props === void 0 ? void 0 : props.preTitle) || '';
|
|
9
10
|
this.title = (props === null || props === void 0 ? void 0 : props.title) || '';
|
|
10
11
|
this.subTitle = (props === null || props === void 0 ? void 0 : props.subTitle) || '';
|
|
@@ -18,6 +19,7 @@ class ProductCollection extends Base_1.default {
|
|
|
18
19
|
toObj() {
|
|
19
20
|
const productCollectionObj = {
|
|
20
21
|
documentId: this.documentId,
|
|
22
|
+
createdAtTimestamp: this.createdAtTimestamp,
|
|
21
23
|
preTitle: this.preTitle,
|
|
22
24
|
title: this.title,
|
|
23
25
|
subTitle: this.subTitle,
|
|
@@ -32,13 +34,18 @@ class ProductCollection extends Base_1.default {
|
|
|
32
34
|
}
|
|
33
35
|
generateSchemaForTypesense(name = 'prod_productCollections_20220722') {
|
|
34
36
|
return {
|
|
35
|
-
default_sorting_field: '
|
|
37
|
+
default_sorting_field: 'createdAtTimestamp',
|
|
36
38
|
fields: [
|
|
37
39
|
{
|
|
38
40
|
facet: false,
|
|
39
41
|
name: 'documentId',
|
|
40
42
|
type: 'string',
|
|
41
43
|
},
|
|
44
|
+
{
|
|
45
|
+
facet: true,
|
|
46
|
+
name: 'createdAtTimestamp',
|
|
47
|
+
type: 'int64',
|
|
48
|
+
},
|
|
42
49
|
{
|
|
43
50
|
facet: true,
|
|
44
51
|
name: 'title',
|
|
@@ -159,12 +166,13 @@ class ProductCollection extends Base_1.default {
|
|
|
159
166
|
type: 'string[]',
|
|
160
167
|
},
|
|
161
168
|
],
|
|
162
|
-
name,
|
|
169
|
+
name: 'dev_productCollections_20220725',
|
|
163
170
|
};
|
|
164
171
|
}
|
|
165
172
|
toObjForTypesense() {
|
|
166
173
|
const stagedObj = {
|
|
167
174
|
documentId: this.utilities.sanitizeString(this.documentId),
|
|
175
|
+
createdAtTimestamp: this.utilities.sanitizeMillisTimeStamp(this.createdAtTimestamp),
|
|
168
176
|
preTitle: this.utilities.sanitizeString(this.preTitle),
|
|
169
177
|
title: this.utilities.sanitizeString(this.title),
|
|
170
178
|
subTitle: this.utilities.sanitizeString(this.subTitle),
|
|
@@ -35,6 +35,7 @@ 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;
|
|
40
41
|
preTitle: string;
|
|
@@ -63,6 +64,7 @@ declare type ProductCollectionFormFields = {
|
|
|
63
64
|
};
|
|
64
65
|
declare type TypesenseProductCollectionObj = {
|
|
65
66
|
documentId: string;
|
|
67
|
+
createdAtTimestamp: number;
|
|
66
68
|
preTitle: string;
|
|
67
69
|
title: string;
|
|
68
70
|
subTitle: string;
|
|
@@ -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[];
|