@wildix/xbees-conversations-utils 1.0.13 → 1.0.15
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/dist-cjs/normalization.js +15 -9
- package/dist-es/normalization.js +15 -9
- package/dist-types/stream.d.ts +5 -2
- package/package.json +4 -4
|
@@ -8,15 +8,17 @@ function normalizeStreamUser(streamUser) {
|
|
|
8
8
|
name: streamUser.name || undefined,
|
|
9
9
|
email: streamUser.email || undefined,
|
|
10
10
|
phone: streamUser.phone || undefined,
|
|
11
|
-
picture: streamUser.picture,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
picture: streamUser.picture || undefined,
|
|
12
|
+
locale: streamUser.locale || undefined,
|
|
13
|
+
timeZone: streamUser.timeZone || undefined,
|
|
14
|
+
company: streamUser.company || undefined,
|
|
15
|
+
pbxDomain: streamUser.pbxDomain || undefined,
|
|
16
|
+
pbxPort: streamUser.pbxPort || undefined,
|
|
17
|
+
pbxExtension: streamUser.pbxExtension || undefined,
|
|
18
|
+
pbxSerial: streamUser.pbxSerial || undefined,
|
|
19
|
+
pbxUserId: streamUser.pbxUserId || undefined,
|
|
20
|
+
createdAt: streamUser.created_at || undefined,
|
|
21
|
+
updatedAt: streamUser.updated_at || undefined,
|
|
20
22
|
};
|
|
21
23
|
}
|
|
22
24
|
exports.normalizeStreamUser = normalizeStreamUser;
|
|
@@ -61,6 +63,8 @@ function normalizeStreamMessage(streamMessage, channelId) {
|
|
|
61
63
|
edit,
|
|
62
64
|
sms: streamMessage.sms,
|
|
63
65
|
smsStatus: streamMessage.sms_status,
|
|
66
|
+
whatsapp: streamMessage.whatsapp,
|
|
67
|
+
whatsappStatus: streamMessage.whatsapp_status,
|
|
64
68
|
silent,
|
|
65
69
|
event,
|
|
66
70
|
};
|
|
@@ -135,6 +139,8 @@ function normalizeStreamChannel(channel) {
|
|
|
135
139
|
telephony: data.telephony,
|
|
136
140
|
sms: data.sms,
|
|
137
141
|
mms: data.mms,
|
|
142
|
+
whatsapp: data.whatsapp,
|
|
143
|
+
whatsappStatus: data.whatsapp_status,
|
|
138
144
|
broadcast: data.broadcast || data.is_broadcast,
|
|
139
145
|
external: data.external,
|
|
140
146
|
createdAt: data.created_at,
|
package/dist-es/normalization.js
CHANGED
|
@@ -5,15 +5,17 @@ export function normalizeStreamUser(streamUser) {
|
|
|
5
5
|
name: streamUser.name || undefined,
|
|
6
6
|
email: streamUser.email || undefined,
|
|
7
7
|
phone: streamUser.phone || undefined,
|
|
8
|
-
picture: streamUser.picture,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
picture: streamUser.picture || undefined,
|
|
9
|
+
locale: streamUser.locale || undefined,
|
|
10
|
+
timeZone: streamUser.timeZone || undefined,
|
|
11
|
+
company: streamUser.company || undefined,
|
|
12
|
+
pbxDomain: streamUser.pbxDomain || undefined,
|
|
13
|
+
pbxPort: streamUser.pbxPort || undefined,
|
|
14
|
+
pbxExtension: streamUser.pbxExtension || undefined,
|
|
15
|
+
pbxSerial: streamUser.pbxSerial || undefined,
|
|
16
|
+
pbxUserId: streamUser.pbxUserId || undefined,
|
|
17
|
+
createdAt: streamUser.created_at || undefined,
|
|
18
|
+
updatedAt: streamUser.updated_at || undefined,
|
|
17
19
|
};
|
|
18
20
|
}
|
|
19
21
|
export function localizeStreamUser(streamUser) {
|
|
@@ -55,6 +57,8 @@ export function normalizeStreamMessage(streamMessage, channelId) {
|
|
|
55
57
|
edit,
|
|
56
58
|
sms: streamMessage.sms,
|
|
57
59
|
smsStatus: streamMessage.sms_status,
|
|
60
|
+
whatsapp: streamMessage.whatsapp,
|
|
61
|
+
whatsappStatus: streamMessage.whatsapp_status,
|
|
58
62
|
silent,
|
|
59
63
|
event,
|
|
60
64
|
};
|
|
@@ -127,6 +131,8 @@ export function normalizeStreamChannel(channel) {
|
|
|
127
131
|
telephony: data.telephony,
|
|
128
132
|
sms: data.sms,
|
|
129
133
|
mms: data.mms,
|
|
134
|
+
whatsapp: data.whatsapp,
|
|
135
|
+
whatsappStatus: data.whatsapp_status,
|
|
130
136
|
broadcast: data.broadcast || data.is_broadcast,
|
|
131
137
|
external: data.external,
|
|
132
138
|
createdAt: data.created_at,
|
package/dist-types/stream.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Channel, ChannelData, ChannelFilters, ChannelMembership, ChannelMemberResponse, ChannelSort, ChannelResponse, Event, ExtendableGenerics, LiteralStringForUnion, Message, MessageResponse, ReactionResponse, UR, UserResponse, ChannelAPIResponse, User, Reaction, PartialMessageUpdate, UpdatedMessage, PartialUpdateChannel } from 'stream-chat';
|
|
2
|
-
import { Message as MessageNormalized, MessageForward, MessageAttachment, MessageGiphy, User as NormalizedUser, ChannelAccess } from "@wildix/xbees-conversations-client";
|
|
3
|
-
import { MessageSmsStatus } from "@wildix-internal/xbees-conversations-ssdk";
|
|
2
|
+
import { Message as MessageNormalized, MessageForward, MessageAttachment, MessageGiphy, User as NormalizedUser, ChannelAccess, MessageSmsStatus, MessageWhatsAppStatus, ChannelWhatsAppStatus } from "@wildix/xbees-conversations-client";
|
|
4
3
|
export interface StreamChannelFields extends UR {
|
|
5
4
|
subject?: string;
|
|
6
5
|
description?: string;
|
|
@@ -22,6 +21,8 @@ export interface StreamChannelFields extends UR {
|
|
|
22
21
|
telephony?: boolean;
|
|
23
22
|
sms?: boolean;
|
|
24
23
|
mms?: boolean;
|
|
24
|
+
whatsapp?: boolean;
|
|
25
|
+
whatsapp_status?: ChannelWhatsAppStatus | string;
|
|
25
26
|
broadcast?: boolean;
|
|
26
27
|
is_broadcast?: boolean;
|
|
27
28
|
external?: boolean;
|
|
@@ -48,6 +49,8 @@ export interface StreamMessageFields extends UR {
|
|
|
48
49
|
attachments?: MessageAttachment[];
|
|
49
50
|
sms?: boolean;
|
|
50
51
|
sms_status?: MessageSmsStatus | string;
|
|
52
|
+
whatsapp?: boolean;
|
|
53
|
+
whatsapp_status?: MessageWhatsAppStatus | string;
|
|
51
54
|
created_at: string;
|
|
52
55
|
updated_at: string;
|
|
53
56
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/xbees-conversations-utils",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist-cjs/index.js",
|
|
6
6
|
"module": "./dist-es/index.js",
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo"
|
|
17
17
|
},
|
|
18
18
|
"engines": {
|
|
19
|
-
"node": ">=
|
|
19
|
+
"node": ">=16.0.0"
|
|
20
20
|
},
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@wildix/xbees-conversations-client": "1.0.
|
|
23
|
+
"@wildix/xbees-conversations-client": "1.0.42",
|
|
24
24
|
"stream-chat": "8.12.1",
|
|
25
25
|
"tslib": "^2.5.0"
|
|
26
26
|
},
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@tsconfig/recommended": "1.0.1",
|
|
29
29
|
"concurrently": "7.0.0",
|
|
30
30
|
"downlevel-dts": "0.10.1",
|
|
31
|
-
"rimraf": "3.0.
|
|
31
|
+
"rimraf": "^3.0.0",
|
|
32
32
|
"typescript": "~4.9.5"
|
|
33
33
|
},
|
|
34
34
|
"typesVersions": {
|