Skip to content

Commit ff68e5c

Browse files
committed
chore: bump stream-chat version to 8.56.0
1 parent 7bafd0d commit ff68e5c

File tree

6 files changed

+138
-17
lines changed

6 files changed

+138
-17
lines changed

examples/ExpoMessaging/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7314,10 +7314,10 @@ stream-chat@^8.50.0:
73147314
jsonwebtoken "~9.0.0"
73157315
ws "^7.5.10"
73167316

7317-
stream-chat@^8.54.1:
7318-
version "8.54.1"
7319-
resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.54.1.tgz#61a7330c9b7401f3e176e55445b29317bca2b108"
7320-
integrity sha512-BmeN1nq/zbItJXayHz/kBDc36Xvs4rW5pol/ngPXs0Vl8tw7vCuYBI4aFvpthvFU9EhCIJzBn8ISqDlnfWyDkw==
7317+
stream-chat@^8.56.0:
7318+
version "8.56.0"
7319+
resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.56.0.tgz#2960282d0fdfedcf067328e36dce87190646dec5"
7320+
integrity sha512-wv0OIjNdoMcK25PCjVg9lMfezMCrKzPoG0L9eDeKo/ZbJNGY3hNhUXVsyzIDYLYGWU9aqXGhAKpuxbVfgwbnqg==
73217321
dependencies:
73227322
"@babel/runtime" "^7.16.3"
73237323
"@types/jsonwebtoken" "~9.0.0"

examples/SampleApp/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7994,10 +7994,10 @@ stream-chat@^8.50.0:
79947994
jsonwebtoken "~9.0.0"
79957995
ws "^7.5.10"
79967996

7997-
stream-chat@^8.54.1:
7998-
version "8.54.1"
7999-
resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.54.1.tgz#61a7330c9b7401f3e176e55445b29317bca2b108"
8000-
integrity sha512-BmeN1nq/zbItJXayHz/kBDc36Xvs4rW5pol/ngPXs0Vl8tw7vCuYBI4aFvpthvFU9EhCIJzBn8ISqDlnfWyDkw==
7997+
stream-chat@^8.56.0:
7998+
version "8.56.0"
7999+
resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.56.0.tgz#2960282d0fdfedcf067328e36dce87190646dec5"
8000+
integrity sha512-wv0OIjNdoMcK25PCjVg9lMfezMCrKzPoG0L9eDeKo/ZbJNGY3hNhUXVsyzIDYLYGWU9aqXGhAKpuxbVfgwbnqg==
80018001
dependencies:
80028002
"@babel/runtime" "^7.16.3"
80038003
"@types/jsonwebtoken" "~9.0.0"

examples/TypeScriptMessaging/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6849,10 +6849,10 @@ stream-chat@^8.50.0:
68496849
jsonwebtoken "~9.0.0"
68506850
ws "^7.5.10"
68516851

6852-
stream-chat@^8.54.1:
6853-
version "8.54.1"
6854-
resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.54.1.tgz#61a7330c9b7401f3e176e55445b29317bca2b108"
6855-
integrity sha512-BmeN1nq/zbItJXayHz/kBDc36Xvs4rW5pol/ngPXs0Vl8tw7vCuYBI4aFvpthvFU9EhCIJzBn8ISqDlnfWyDkw==
6852+
stream-chat@^8.56.0:
6853+
version "8.56.0"
6854+
resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.56.0.tgz#2960282d0fdfedcf067328e36dce87190646dec5"
6855+
integrity sha512-wv0OIjNdoMcK25PCjVg9lMfezMCrKzPoG0L9eDeKo/ZbJNGY3hNhUXVsyzIDYLYGWU9aqXGhAKpuxbVfgwbnqg==
68566856
dependencies:
68576857
"@babel/runtime" "^7.16.3"
68586858
"@types/jsonwebtoken" "~9.0.0"

package/export-test.js

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
const error = require('eslint-plugin-react/lib/util/error');
2+
const { StreamChat } = require('stream-chat');
3+
4+
5+
const appKey = 'yjrt5yxw77ev';
6+
const appSecret = 'kscndrhzzcujsyv7k8rejhjnwhxy5ahjhzvakb422kdjjh4f94wsrxuapxdt85fw';
7+
8+
const serverClient = new StreamChat(appKey, appSecret);
9+
10+
const exportedData = '{"channel":{"cid":"messaging:!members-T587kU501WCs0ADiZq-37FW6uTNcxmCFiLhJqaXawjE","id":"!members-T587kU501WCs0ADiZq-37FW6uTNcxmCFiLhJqaXawjE","type":"messaging","last_message_at":"2025-01-23T13:05:54.645081Z","created_by":{"id":"rodolphe","role":"user","created_at":"2024-09-18T09:39:02.302556Z","updated_at":"2025-01-23T12:30:02.405893Z","last_active":"2025-01-23T13:06:58.365621247Z","last_engaged_at":"2025-01-23T00:06:23.292601Z","banned":false,"online":false,"name":"Rodolphe Irany","image":"https://ca.slack-edge.com/T02RM6X6B-U05C1DG31LJ-3e1ec816128d-192","birthland":""},"created_at":"2025-01-23T13:05:35.310709Z","updated_at":"2025-01-23T13:05:35.310709Z","frozen":false,"disabled":false,"member_count":2,"config":{"name":"messaging","typing_events":true,"read_events":true,"connect_events":true,"search":true,"reactions":true,"replies":true,"quotes":true,"mutes":true,"uploads":true,"url_enrichment":true,"custom_events":true,"push_notifications":true,"reminders":false,"mark_messages_pending":false,"polls":true,"message_retention":"infinite","max_message_length":5000,"automod":"AI","automod_behavior":"flag","blocklist_behavior":"flag","automod_thresholds":{"explicit":{"flag":0.85,"block":0.9},"spam":{"flag":0.85,"block":0.9},"toxic":{"flag":0.85,"block":0.9}},"skip_last_msg_update_for_system_msgs":false,"created_at":"2021-03-01T19:29:10.634629Z","updated_at":"2024-12-19T12:08:48.048363Z","commands":["giphy","mute","unmute","ban","unban"]},"auto_translation_language":""},"messages":[{"id":"64828eb5-ca8c-4459-ad13-276f4b374360","text":"Hi","html":"\u003cp\u003eHi\u003c/p\u003e\\n","type":"regular","user":{"id":"rodolphe","role":"user","created_at":"2024-09-18T09:39:02.302556Z","updated_at":"2025-01-23T12:30:02.405893Z","last_active":"2025-01-23T13:06:58.365621247Z","last_engaged_at":"2025-01-23T00:06:23.292601Z","banned":false,"online":false,"birthland":"","name":"Rodolphe Irany","image":"https://ca.slack-edge.com/T02RM6X6B-U05C1DG31LJ-3e1ec816128d-192"},"attachments":[],"latest_reactions":[],"own_reactions":[],"reaction_counts":{},"reaction_scores":{},"reaction_groups":null,"reply_count":0,"deleted_reply_count":0,"cid":"messaging:!members-T587kU501WCs0ADiZq-37FW6uTNcxmCFiLhJqaXawjE","created_at":"2025-01-23T13:05:35.491258Z","updated_at":"2025-01-23T13:05:35.491258Z","shadowed":false,"mentioned_users":[],"silent":false,"pinned":false,"pinned_at":null,"pinned_by":null,"pin_expires":null},{"id":"rodolphe-85f6fa93-1165-437c-01f7-90a02d07cdc9","text":"Hiya hiya","html":"\u003cp\u003eHiya hiya\u003c/p\u003e\\n","type":"regular","user":{"id":"rodolphe","role":"user","created_at":"2024-09-18T09:39:02.302556Z","updated_at":"2025-01-23T12:30:02.405893Z","last_active":"2025-01-23T13:06:58.365621247Z","last_engaged_at":"2025-01-23T00:06:23.292601Z","banned":false,"online":false,"name":"Rodolphe Irany","image":"https://ca.slack-edge.com/T02RM6X6B-U05C1DG31LJ-3e1ec816128d-192","birthland":""},"attachments":[],"latest_reactions":[],"own_reactions":[],"reaction_counts":{},"reaction_scores":{},"reaction_groups":null,"reply_count":0,"deleted_reply_count":0,"cid":"messaging:!members-T587kU501WCs0ADiZq-37FW6uTNcxmCFiLhJqaXawjE","created_at":"2025-01-23T13:05:40.116085Z","updated_at":"2025-01-23T13:05:40.116085Z","shadowed":false,"mentioned_users":[],"silent":false,"pinned":false,"pinned_at":null,"pinned_by":null,"pin_expires":null},{"id":"rodolphe-58faf785-69e0-44e6-3a34-f3226ac1c084","text":"Will try to migrate this","html":"\u003cp\u003eWill try to migrate this\u003c/p\u003e\\n","type":"regular","user":{"id":"rodolphe","role":"user","created_at":"2024-09-18T09:39:02.302556Z","updated_at":"2025-01-23T12:30:02.405893Z","last_active":"2025-01-23T13:06:58.365621247Z","last_engaged_at":"2025-01-23T00:06:23.292601Z","banned":false,"online":false,"name":"Rodolphe Irany","image":"https://ca.slack-edge.com/T02RM6X6B-U05C1DG31LJ-3e1ec816128d-192","birthland":""},"attachments":[],"latest_reactions":[],"own_reactions":[],"reaction_counts":{},"reaction_scores":{},"reaction_groups":null,"reply_count":0,"deleted_reply_count":0,"cid":"messaging:!members-T587kU501WCs0ADiZq-37FW6uTNcxmCFiLhJqaXawjE","created_at":"2025-01-23T13:05:49.526105Z","updated_at":"2025-01-23T13:05:49.526105Z","shadowed":false,"mentioned_users":[],"silent":false,"pinned":false,"pinned_at":null,"pinned_by":null,"pin_expires":null},{"id":"rodolphe-2d126a21-ed50-4c2a-2359-a92a083fd4b6","text":"Maybe it works","html":"\u003cp\u003eMaybe it works\u003c/p\u003e\\n","type":"regular","user":{"id":"rodolphe","role":"user","created_at":"2024-09-18T09:39:02.302556Z","updated_at":"2025-01-23T12:30:02.405893Z","last_active":"2025-01-23T13:06:58.365621247Z","last_engaged_at":"2025-01-23T00:06:23.292601Z","banned":false,"online":false,"name":"Rodolphe Irany","image":"https://ca.slack-edge.com/T02RM6X6B-U05C1DG31LJ-3e1ec816128d-192","birthland":""},"attachments":[],"latest_reactions":[],"own_reactions":[],"reaction_counts":{},"reaction_scores":{},"reaction_groups":null,"reply_count":0,"deleted_reply_count":0,"cid":"messaging:!members-T587kU501WCs0ADiZq-37FW6uTNcxmCFiLhJqaXawjE","created_at":"2025-01-23T13:05:54.645081Z","updated_at":"2025-01-23T13:05:54.645081Z","shadowed":false,"mentioned_users":[],"silent":false,"pinned":false,"pinned_at":null,"pinned_by":null,"pin_expires":null}],"members":[{"user_id":"rodolphe","user":{"id":"rodolphe","role":"user","created_at":"2024-09-18T09:39:02.302556Z","updated_at":"2025-01-23T12:30:02.405893Z","last_active":"2025-01-23T13:06:58.365621247Z","last_engaged_at":"2025-01-23T00:06:23.292601Z","banned":false,"online":false,"birthland":"","name":"Rodolphe Irany","image":"https://ca.slack-edge.com/T02RM6X6B-U05C1DG31LJ-3e1ec816128d-192"},"status":"member","created_at":"2025-01-23T13:05:35.315676Z","updated_at":"2025-01-23T13:05:35.315676Z","banned":false,"shadow_banned":false,"archived_at":null,"pinned_at":null,"role":"owner","channel_role":"channel_member","notifications_muted":false},{"user_id":"test-mig-user","user":{"id":"test-mig-user","role":"user","created_at":"2025-01-23T13:05:03.06666Z","updated_at":"2025-01-23T13:05:03.06666Z","banned":false,"online":false,"name":"Test Mig User"},"status":"member","created_at":"2025-01-23T13:05:35.315676Z","updated_at":"2025-01-23T13:05:35.315676Z","banned":false,"shadow_banned":false,"archived_at":null,"pinned_at":null,"role":"member","channel_role":"channel_member","notifications_muted":false}]}';
11+
12+
const exportLivestreamChannel = async () => {
13+
try {
14+
const response = await serverClient.exportChannel({
15+
type: "messaging",
16+
id: "!members-T587kU501WCs0ADiZq-37FW6uTNcxmCFiLhJqaXawjE",
17+
//messages_since: "2020-11-10T09:30:00.000Z",
18+
//messages_until: "2020-11-10T11:30:00.000Z",
19+
},{
20+
include_truncated_messages: true,
21+
// include_soft_deleted_channels: true,
22+
});
23+
const taskID = response.task_id;
24+
console.log("Exported channel successfully. Task ID:", taskID);
25+
return taskID;
26+
} catch (error) {
27+
console.error("Error exporting channel:", error);
28+
throw error;
29+
// return null;
30+
}
31+
};
32+
33+
const fetchTaskApi = async ({ taskId }) => {
34+
try {
35+
return await serverClient.getExportChannelStatus(taskId);
36+
} catch (error) {
37+
console.error("Error fetching task:", error);
38+
throw error;
39+
}
40+
};
41+
42+
const exportAndFetchTask = async () => {
43+
const taskId = await exportLivestreamChannel();
44+
const response = await fetchTaskApi({ taskId });
45+
console.log('Export response: ', response);
46+
};
47+
48+
// exportAndFetchTask();
49+
50+
const importData = async () => {
51+
const parsedData = JSON.parse(exportedData);
52+
53+
const channelId = parsedData.channel.id;
54+
const channelType = 'messaging';
55+
const memberIds = parsedData.members.map(m => m.user.id);
56+
57+
const channel = {
58+
type: 'channel',
59+
item: {
60+
created_by: parsedData.channel.created_by.id,
61+
// id: channelId,
62+
member_ids: memberIds,
63+
type: channelType,
64+
}
65+
};
66+
67+
const members = parsedData.members.map(m => ({
68+
type: 'member',
69+
item: {
70+
user_id: m.user_id,
71+
// channel_id: channelId,
72+
channel_member_ids: memberIds,
73+
channel_type: channelType,
74+
channel_role: m.channel_role,
75+
created_at: m.created_at,
76+
}
77+
}));
78+
79+
const messages = parsedData.messages.map(m => ({
80+
type: 'message',
81+
item: {
82+
id: m.id,
83+
// channel_id: channelId,
84+
channel_member_ids: memberIds,
85+
channel_type: channelType,
86+
user: m.user.id,
87+
text: m.text,
88+
type: m.type,
89+
created_at: m.created_at,
90+
}
91+
}));
92+
93+
const users = parsedData.members.map(m => ({
94+
type: 'user',
95+
item: {
96+
id: m.user.id,
97+
name: m.user.name,
98+
image: m.user.image,
99+
role: m.user.role,
100+
created_at: m.user.created_at,
101+
invisible: true,
102+
}
103+
}));
104+
105+
const importData = [channel, ...members, ...messages, ...users];
106+
107+
console.log(JSON.stringify(importData));
108+
};
109+
110+
importData();
111+
112+
113+
// exportLivestreamChannel()
114+
// .then(() => {
115+
// console.log("Export operation completed successfully.");
116+
// })
117+
// .catch((error) => {
118+
// console.error("Error exporting channel:", error);
119+
// });
120+
121+
// 20b7e6f8-5008-4a3e-b8d6-d2afde842255

package/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"path": "0.12.7",
7878
"react-native-markdown-package": "1.8.2",
7979
"react-native-url-polyfill": "^1.3.0",
80-
"stream-chat": "^8.54.1",
80+
"stream-chat": "^8.56.0",
8181
"use-sync-external-store": "^1.4.0"
8282
},
8383
"peerDependencies": {

package/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9316,10 +9316,10 @@ statuses@~1.5.0:
93169316
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
93179317
integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==
93189318

9319-
stream-chat@^8.54.1:
9320-
version "8.54.1"
9321-
resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.54.1.tgz#61a7330c9b7401f3e176e55445b29317bca2b108"
9322-
integrity sha512-BmeN1nq/zbItJXayHz/kBDc36Xvs4rW5pol/ngPXs0Vl8tw7vCuYBI4aFvpthvFU9EhCIJzBn8ISqDlnfWyDkw==
9319+
stream-chat@^8.56.0:
9320+
version "8.56.0"
9321+
resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.56.0.tgz#2960282d0fdfedcf067328e36dce87190646dec5"
9322+
integrity sha512-wv0OIjNdoMcK25PCjVg9lMfezMCrKzPoG0L9eDeKo/ZbJNGY3hNhUXVsyzIDYLYGWU9aqXGhAKpuxbVfgwbnqg==
93239323
dependencies:
93249324
"@babel/runtime" "^7.16.3"
93259325
"@types/jsonwebtoken" "~9.0.0"

0 commit comments

Comments
 (0)