@wildix/xbees-conversations-utils 1.1.41 → 1.1.42

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.
@@ -74,6 +74,7 @@ function normalizeStreamMessage(streamMessage, channelId) {
74
74
  }
75
75
  exports.normalizeStreamMessage = normalizeStreamMessage;
76
76
  function localizeStreamMessage(streamMessage, channelId, userId) {
77
+ const { pinned, ref } = streamMessage;
77
78
  const normalizedMessage = normalizeStreamMessage(streamMessage, channelId);
78
79
  const createdAt = new Date(normalizedMessage.createdAt);
79
80
  const updatedAt = normalizedMessage.updatedAt ? new Date(normalizedMessage.updatedAt) : undefined;
@@ -93,6 +94,8 @@ function localizeStreamMessage(streamMessage, channelId, userId) {
93
94
  direction,
94
95
  createdAt,
95
96
  updatedAt,
97
+ pinned,
98
+ ref: ref || null,
96
99
  };
97
100
  }
98
101
  exports.localizeStreamMessage = localizeStreamMessage;
@@ -127,7 +130,7 @@ function normalizeStreamChannel(channel) {
127
130
  company: data.company,
128
131
  context,
129
132
  createdAt: data.created_at,
130
- createdBy: data.created_by_id,
133
+ createdBy: data.created_by_id || data.created_by.id,
131
134
  description: data.description,
132
135
  external: data.external,
133
136
  kite: data.kite,
@@ -67,6 +67,7 @@ export function normalizeStreamMessage(streamMessage, channelId) {
67
67
  };
68
68
  }
69
69
  export function localizeStreamMessage(streamMessage, channelId, userId) {
70
+ const { pinned, ref } = streamMessage;
70
71
  const normalizedMessage = normalizeStreamMessage(streamMessage, channelId);
71
72
  const createdAt = new Date(normalizedMessage.createdAt);
72
73
  const updatedAt = normalizedMessage.updatedAt ? new Date(normalizedMessage.updatedAt) : undefined;
@@ -86,6 +87,8 @@ export function localizeStreamMessage(streamMessage, channelId, userId) {
86
87
  direction,
87
88
  createdAt,
88
89
  updatedAt,
90
+ pinned,
91
+ ref: ref || null,
89
92
  };
90
93
  }
91
94
  export function normalizeStreamChannel(channel) {
@@ -119,7 +122,7 @@ export function normalizeStreamChannel(channel) {
119
122
  company: data.company,
120
123
  context,
121
124
  createdAt: data.created_at,
122
- createdBy: data.created_by_id,
125
+ createdBy: data.created_by_id || data.created_by.id,
123
126
  description: data.description,
124
127
  external: data.external,
125
128
  kite: data.kite,
@@ -16,6 +16,8 @@ export interface LocalizedMessage extends Omit<Message, 'user' | 'createdAt' | '
16
16
  direction: MessageDirection;
17
17
  createdAt: Date;
18
18
  updatedAt?: Date;
19
+ pinned: boolean | undefined;
20
+ ref?: string | null;
19
21
  }
20
22
  export interface LocalizedChannel extends Omit<Channel, 'createdAt' | 'updatedAt' | 'is_broadcast' | 'external' | 'hidden'> {
21
23
  createdAt: Date;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildix/xbees-conversations-utils",
3
- "version": "1.1.41",
3
+ "version": "1.1.42",
4
4
  "description": "",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",