@stream-io/feeds-client 0.3.48 → 0.3.49

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.
Files changed (45) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/index.js +1 -1
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/react-bindings.js +1 -1
  5. package/dist/es/index.mjs +2 -2
  6. package/dist/es/index.mjs.map +1 -1
  7. package/dist/es/react-bindings.mjs +1 -1
  8. package/dist/{feeds-client-D-EFo20w.mjs → feeds-client-B9b7zUcW.mjs} +102 -189
  9. package/dist/feeds-client-B9b7zUcW.mjs.map +1 -0
  10. package/dist/{feeds-client-DuJuJuEJ.js → feeds-client-BDvUG9yF.js} +102 -189
  11. package/dist/feeds-client-BDvUG9yF.js.map +1 -0
  12. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  13. package/dist/types/common/Poll.d.ts +7 -3
  14. package/dist/types/common/Poll.d.ts.map +1 -1
  15. package/dist/types/common/real-time/StableWSConnection.d.ts +3 -3
  16. package/dist/types/common/real-time/StableWSConnection.d.ts.map +1 -1
  17. package/dist/types/feed/event-handlers/activity-updater.d.ts +1 -1
  18. package/dist/types/feed/event-handlers/comment/handle-comment-added.d.ts.map +1 -1
  19. package/dist/types/feed/feed.d.ts +2 -2
  20. package/dist/types/feed/feed.d.ts.map +1 -1
  21. package/dist/types/feeds-client/feeds-client.d.ts +7 -3
  22. package/dist/types/feeds-client/feeds-client.d.ts.map +1 -1
  23. package/dist/types/gen/feeds/FeedsApi.d.ts.map +1 -1
  24. package/dist/types/gen/model-decoders/event-decoder-mapping.d.ts.map +1 -1
  25. package/dist/types/gen/models/index.d.ts +196 -422
  26. package/dist/types/gen/models/index.d.ts.map +1 -1
  27. package/dist/types/gen/moderation/ModerationApi.d.ts.map +1 -1
  28. package/dist/types/types.d.ts +2 -2
  29. package/dist/types/types.d.ts.map +1 -1
  30. package/dist/types/utils/constants.d.ts +1 -1
  31. package/package.json +1 -1
  32. package/src/common/Poll.ts +16 -15
  33. package/src/feed/event-handlers/comment/handle-comment-added.ts +14 -2
  34. package/src/feed/feed.ts +24 -9
  35. package/src/feeds-client/feeds-client.ts +28 -1
  36. package/src/gen/feeds/FeedsApi.ts +1 -0
  37. package/src/gen/model-decoders/decoders.ts +40 -251
  38. package/src/gen/model-decoders/event-decoder-mapping.ts +3 -2
  39. package/src/gen/models/index.ts +310 -741
  40. package/src/gen/moderation/ModerationApi.ts +1 -0
  41. package/src/test-utils/response-generators.ts +3 -2
  42. package/src/types.ts +2 -2
  43. package/src/utils/constants.ts +1 -1
  44. package/dist/feeds-client-D-EFo20w.mjs.map +0 -1
  45. package/dist/feeds-client-DuJuJuEJ.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { useStateStore } from "@stream-io/state-store/react-bindings";
2
2
  export * from "@stream-io/state-store/react-bindings";
3
3
  import { useState, useEffect, createContext, useContext, useRef, useCallback, useMemo } from "react";
4
- import { F as FeedsClient, g as isCommentResponse, c as checkHasAnotherPage } from "../feeds-client-D-EFo20w.mjs";
4
+ import { F as FeedsClient, g as isCommentResponse, c as checkHasAnotherPage } from "../feeds-client-B9b7zUcW.mjs";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  const useCreateFeedsClient = ({
7
7
  apiKey,
@@ -137,7 +137,7 @@ decoders.ActivityResponse = (input) => {
137
137
  own_bookmarks: { type: "BookmarkResponse", isSingle: false },
138
138
  own_reactions: { type: "FeedsReactionResponse", isSingle: false },
139
139
  collections: { type: "EnrichedCollectionResponse", isSingle: false },
140
- reaction_groups: { type: "ReactionGroupResponse", isSingle: false },
140
+ reaction_groups: { type: "FeedsReactionGroupResponse", isSingle: false },
141
141
  user: { type: "UserResponse", isSingle: true },
142
142
  deleted_at: { type: "DatetimeType", isSingle: true },
143
143
  edited_at: { type: "DatetimeType", isSingle: true },
@@ -234,13 +234,12 @@ decoders.AppealItemResponse = (input) => {
234
234
  };
235
235
  return decode(typeMappings, input);
236
236
  };
237
- decoders.Ban = (input) => {
237
+ decoders.BanInfoResponse = (input) => {
238
238
  const typeMappings = {
239
239
  created_at: { type: "DatetimeType", isSingle: true },
240
240
  expires: { type: "DatetimeType", isSingle: true },
241
- channel: { type: "Channel", isSingle: true },
242
- created_by: { type: "User", isSingle: true },
243
- target: { type: "User", isSingle: true }
241
+ created_by: { type: "UserResponse", isSingle: true },
242
+ user: { type: "UserResponse", isSingle: true }
244
243
  };
245
244
  return decode(typeMappings, input);
246
245
  };
@@ -355,30 +354,6 @@ decoders.CallSessionResponse = (input) => {
355
354
  };
356
355
  return decode(typeMappings, input);
357
356
  };
358
- decoders.Channel = (input) => {
359
- const typeMappings = {
360
- created_at: { type: "DatetimeType", isSingle: true },
361
- updated_at: { type: "DatetimeType", isSingle: true },
362
- deleted_at: { type: "DatetimeType", isSingle: true },
363
- last_message_at: { type: "DatetimeType", isSingle: true },
364
- message_count_updated_at: { type: "DatetimeType", isSingle: true },
365
- active_live_locations: { type: "SharedLocation", isSingle: false },
366
- invites: { type: "ChannelMember", isSingle: false },
367
- members: { type: "ChannelMember", isSingle: false },
368
- config: { type: "ChannelConfig", isSingle: true },
369
- created_by: { type: "User", isSingle: true },
370
- members_lookup: { type: "ChannelMemberLookup", isSingle: false },
371
- truncated_by: { type: "User", isSingle: true }
372
- };
373
- return decode(typeMappings, input);
374
- };
375
- decoders.ChannelConfig = (input) => {
376
- const typeMappings = {
377
- created_at: { type: "DatetimeType", isSingle: true },
378
- updated_at: { type: "DatetimeType", isSingle: true }
379
- };
380
- return decode(typeMappings, input);
381
- };
382
357
  decoders.ChannelConfigWithInfo = (input) => {
383
358
  const typeMappings = {
384
359
  created_at: { type: "DatetimeType", isSingle: true },
@@ -387,28 +362,6 @@ decoders.ChannelConfigWithInfo = (input) => {
387
362
  };
388
363
  return decode(typeMappings, input);
389
364
  };
390
- decoders.ChannelMember = (input) => {
391
- const typeMappings = {
392
- created_at: { type: "DatetimeType", isSingle: true },
393
- updated_at: { type: "DatetimeType", isSingle: true },
394
- archived_at: { type: "DatetimeType", isSingle: true },
395
- ban_expires: { type: "DatetimeType", isSingle: true },
396
- deleted_at: { type: "DatetimeType", isSingle: true },
397
- invite_accepted_at: { type: "DatetimeType", isSingle: true },
398
- invite_rejected_at: { type: "DatetimeType", isSingle: true },
399
- pinned_at: { type: "DatetimeType", isSingle: true },
400
- user: { type: "User", isSingle: true }
401
- };
402
- return decode(typeMappings, input);
403
- };
404
- decoders.ChannelMemberLookup = (input) => {
405
- const typeMappings = {
406
- archived_at: { type: "DatetimeType", isSingle: true },
407
- ban_expires: { type: "DatetimeType", isSingle: true },
408
- pinned_at: { type: "DatetimeType", isSingle: true }
409
- };
410
- return decode(typeMappings, input);
411
- };
412
365
  decoders.ChannelMemberResponse = (input) => {
413
366
  const typeMappings = {
414
367
  created_at: { type: "DatetimeType", isSingle: true },
@@ -519,7 +472,7 @@ decoders.CommentResponse = (input) => {
519
472
  deleted_at: { type: "DatetimeType", isSingle: true },
520
473
  edited_at: { type: "DatetimeType", isSingle: true },
521
474
  latest_reactions: { type: "FeedsReactionResponse", isSingle: false },
522
- reaction_groups: { type: "ReactionGroupResponse", isSingle: false }
475
+ reaction_groups: { type: "FeedsReactionGroupResponse", isSingle: false }
523
476
  };
524
477
  return decode(typeMappings, input);
525
478
  };
@@ -589,12 +542,6 @@ decoders.DeleteCommentResponse = (input) => {
589
542
  };
590
543
  return decode(typeMappings, input);
591
544
  };
592
- decoders.Device = (input) => {
593
- const typeMappings = {
594
- created_at: { type: "DatetimeType", isSingle: true }
595
- };
596
- return decode(typeMappings, input);
597
- };
598
545
  decoders.DeviceResponse = (input) => {
599
546
  const typeMappings = {
600
547
  created_at: { type: "DatetimeType", isSingle: true }
@@ -745,6 +692,13 @@ decoders.FeedUpdatedEvent = (input) => {
745
692
  };
746
693
  return decode(typeMappings, input);
747
694
  };
695
+ decoders.FeedsReactionGroupResponse = (input) => {
696
+ const typeMappings = {
697
+ first_reaction_at: { type: "DatetimeType", isSingle: true },
698
+ last_reaction_at: { type: "DatetimeType", isSingle: true }
699
+ };
700
+ return decode(typeMappings, input);
701
+ };
748
702
  decoders.FeedsReactionResponse = (input) => {
749
703
  const typeMappings = {
750
704
  created_at: { type: "DatetimeType", isSingle: true },
@@ -877,7 +831,8 @@ decoders.GetOrCreateFeedResponse = (input) => {
877
831
  decoders.HealthCheckEvent = (input) => {
878
832
  const typeMappings = {
879
833
  created_at: { type: "DatetimeType", isSingle: true },
880
- received_at: { type: "DatetimeType", isSingle: true }
834
+ received_at: { type: "DatetimeType", isSingle: true },
835
+ me: { type: "OwnUserResponse", isSingle: true }
881
836
  };
882
837
  return decode(typeMappings, input);
883
838
  };
@@ -900,40 +855,6 @@ decoders.MembershipLevelResponse = (input) => {
900
855
  };
901
856
  return decode(typeMappings, input);
902
857
  };
903
- decoders.Message = (input) => {
904
- const typeMappings = {
905
- created_at: { type: "DatetimeType", isSingle: true },
906
- updated_at: { type: "DatetimeType", isSingle: true },
907
- latest_reactions: { type: "Reaction", isSingle: false },
908
- mentioned_users: { type: "User", isSingle: false },
909
- own_reactions: { type: "Reaction", isSingle: false },
910
- reaction_groups: { type: "ReactionGroupResponse", isSingle: false },
911
- deleted_at: { type: "DatetimeType", isSingle: true },
912
- message_text_updated_at: { type: "DatetimeType", isSingle: true },
913
- pin_expires: { type: "DatetimeType", isSingle: true },
914
- pinned_at: { type: "DatetimeType", isSingle: true },
915
- thread_participants: { type: "User", isSingle: false },
916
- member: { type: "ChannelMember", isSingle: true },
917
- pinned_by: { type: "User", isSingle: true },
918
- poll: { type: "Poll", isSingle: true },
919
- quoted_message: { type: "Message", isSingle: true },
920
- reminder: { type: "MessageReminder", isSingle: true },
921
- shared_location: { type: "SharedLocation", isSingle: true },
922
- user: { type: "User", isSingle: true }
923
- };
924
- return decode(typeMappings, input);
925
- };
926
- decoders.MessageReminder = (input) => {
927
- const typeMappings = {
928
- created_at: { type: "DatetimeType", isSingle: true },
929
- updated_at: { type: "DatetimeType", isSingle: true },
930
- remind_at: { type: "DatetimeType", isSingle: true },
931
- channel: { type: "Channel", isSingle: true },
932
- message: { type: "Message", isSingle: true },
933
- user: { type: "User", isSingle: true }
934
- };
935
- return decode(typeMappings, input);
936
- };
937
858
  decoders.MessageResponse = (input) => {
938
859
  const typeMappings = {
939
860
  created_at: { type: "DatetimeType", isSingle: true },
@@ -979,7 +900,7 @@ decoders.ModerationFlagResponse = (input) => {
979
900
  decoders.ModerationFlaggedEvent = (input) => {
980
901
  const typeMappings = {
981
902
  created_at: { type: "DatetimeType", isSingle: true },
982
- user: { type: "User", isSingle: true }
903
+ received_at: { type: "DatetimeType", isSingle: true }
983
904
  };
984
905
  return decode(typeMappings, input);
985
906
  };
@@ -994,8 +915,8 @@ decoders.ModerationMarkReviewedEvent = (input) => {
994
915
  };
995
916
  decoders.MuteResponse = (input) => {
996
917
  const typeMappings = {
997
- mutes: { type: "UserMute", isSingle: false },
998
- own_user: { type: "OwnUser", isSingle: true }
918
+ mutes: { type: "UserMuteResponse", isSingle: false },
919
+ own_user: { type: "OwnUserResponse", isSingle: true }
999
920
  };
1000
921
  return decode(typeMappings, input);
1001
922
  };
@@ -1024,18 +945,18 @@ decoders.OwnBatchResponse = (input) => {
1024
945
  };
1025
946
  return decode(typeMappings, input);
1026
947
  };
1027
- decoders.OwnUser = (input) => {
948
+ decoders.OwnUserResponse = (input) => {
1028
949
  const typeMappings = {
1029
950
  created_at: { type: "DatetimeType", isSingle: true },
1030
951
  updated_at: { type: "DatetimeType", isSingle: true },
1031
952
  channel_mutes: { type: "ChannelMute", isSingle: false },
1032
- devices: { type: "Device", isSingle: false },
1033
- mutes: { type: "UserMute", isSingle: false },
953
+ devices: { type: "DeviceResponse", isSingle: false },
954
+ mutes: { type: "UserMuteResponse", isSingle: false },
1034
955
  deactivated_at: { type: "DatetimeType", isSingle: true },
1035
956
  deleted_at: { type: "DatetimeType", isSingle: true },
1036
957
  last_active: { type: "DatetimeType", isSingle: true },
1037
- last_engaged_at: { type: "DatetimeType", isSingle: true },
1038
- push_preferences: { type: "PushPreferences", isSingle: true }
958
+ revoke_tokens_issued_before: { type: "DatetimeType", isSingle: true },
959
+ push_preferences: { type: "PushPreferencesResponse", isSingle: true }
1039
960
  };
1040
961
  return decode(typeMappings, input);
1041
962
  };
@@ -1046,16 +967,6 @@ decoders.PinActivityResponse = (input) => {
1046
967
  };
1047
968
  return decode(typeMappings, input);
1048
969
  };
1049
- decoders.Poll = (input) => {
1050
- const typeMappings = {
1051
- created_at: { type: "DatetimeType", isSingle: true },
1052
- updated_at: { type: "DatetimeType", isSingle: true },
1053
- latest_answers: { type: "PollVote", isSingle: false },
1054
- own_votes: { type: "PollVote", isSingle: false },
1055
- created_by: { type: "User", isSingle: true }
1056
- };
1057
- return decode(typeMappings, input);
1058
- };
1059
970
  decoders.PollClosedFeedEvent = (input) => {
1060
971
  const typeMappings = {
1061
972
  created_at: { type: "DatetimeType", isSingle: true },
@@ -1096,14 +1007,6 @@ decoders.PollUpdatedFeedEvent = (input) => {
1096
1007
  };
1097
1008
  return decode(typeMappings, input);
1098
1009
  };
1099
- decoders.PollVote = (input) => {
1100
- const typeMappings = {
1101
- created_at: { type: "DatetimeType", isSingle: true },
1102
- updated_at: { type: "DatetimeType", isSingle: true },
1103
- user: { type: "User", isSingle: true }
1104
- };
1105
- return decode(typeMappings, input);
1106
- };
1107
1010
  decoders.PollVoteCastedFeedEvent = (input) => {
1108
1011
  const typeMappings = {
1109
1012
  created_at: { type: "DatetimeType", isSingle: true },
@@ -1152,7 +1055,7 @@ decoders.PollVotesResponse = (input) => {
1152
1055
  };
1153
1056
  return decode(typeMappings, input);
1154
1057
  };
1155
- decoders.PushPreferences = (input) => {
1058
+ decoders.PushPreferencesResponse = (input) => {
1156
1059
  const typeMappings = {
1157
1060
  disabled_until: { type: "DatetimeType", isSingle: true }
1158
1061
  };
@@ -1246,8 +1149,7 @@ decoders.Reaction = (input) => {
1246
1149
  const typeMappings = {
1247
1150
  created_at: { type: "DatetimeType", isSingle: true },
1248
1151
  updated_at: { type: "DatetimeType", isSingle: true },
1249
- deleted_at: { type: "DatetimeType", isSingle: true },
1250
- user: { type: "User", isSingle: true }
1152
+ deleted_at: { type: "DatetimeType", isSingle: true }
1251
1153
  };
1252
1154
  return decode(typeMappings, input);
1253
1155
  };
@@ -1306,7 +1208,7 @@ decoders.ReviewQueueItemResponse = (input) => {
1306
1208
  created_at: { type: "DatetimeType", isSingle: true },
1307
1209
  updated_at: { type: "DatetimeType", isSingle: true },
1308
1210
  actions: { type: "ActionLogResponse", isSingle: false },
1309
- bans: { type: "Ban", isSingle: false },
1211
+ bans: { type: "BanInfoResponse", isSingle: false },
1310
1212
  flags: { type: "ModerationFlagResponse", isSingle: false },
1311
1213
  completed_at: { type: "DatetimeType", isSingle: true },
1312
1214
  reviewed_at: { type: "DatetimeType", isSingle: true },
@@ -1322,16 +1224,6 @@ decoders.ReviewQueueItemResponse = (input) => {
1322
1224
  };
1323
1225
  return decode(typeMappings, input);
1324
1226
  };
1325
- decoders.SharedLocation = (input) => {
1326
- const typeMappings = {
1327
- created_at: { type: "DatetimeType", isSingle: true },
1328
- updated_at: { type: "DatetimeType", isSingle: true },
1329
- end_at: { type: "DatetimeType", isSingle: true },
1330
- channel: { type: "Channel", isSingle: true },
1331
- message: { type: "Message", isSingle: true }
1332
- };
1333
- return decode(typeMappings, input);
1334
- };
1335
1227
  decoders.SharedLocationResponse = (input) => {
1336
1228
  const typeMappings = {
1337
1229
  created_at: { type: "DatetimeType", isSingle: true },
@@ -1397,7 +1289,7 @@ decoders.ThreadedCommentResponse = (input) => {
1397
1289
  edited_at: { type: "DatetimeType", isSingle: true },
1398
1290
  latest_reactions: { type: "FeedsReactionResponse", isSingle: false },
1399
1291
  replies: { type: "ThreadedCommentResponse", isSingle: false },
1400
- reaction_groups: { type: "ReactionGroupResponse", isSingle: false }
1292
+ reaction_groups: { type: "FeedsReactionGroupResponse", isSingle: false }
1401
1293
  };
1402
1294
  return decode(typeMappings, input);
1403
1295
  };
@@ -1500,47 +1392,22 @@ decoders.UpsertConfigResponse = (input) => {
1500
1392
  };
1501
1393
  decoders.UpsertPushPreferencesResponse = (input) => {
1502
1394
  const typeMappings = {
1503
- user_preferences: { type: "PushPreferences", isSingle: false }
1504
- };
1505
- return decode(typeMappings, input);
1506
- };
1507
- decoders.User = (input) => {
1508
- const typeMappings = {
1509
- ban_expires: { type: "DatetimeType", isSingle: true },
1510
- created_at: { type: "DatetimeType", isSingle: true },
1511
- deactivated_at: { type: "DatetimeType", isSingle: true },
1512
- deleted_at: { type: "DatetimeType", isSingle: true },
1513
- last_active: { type: "DatetimeType", isSingle: true },
1514
- last_engaged_at: { type: "DatetimeType", isSingle: true },
1515
- revoke_tokens_issued_before: { type: "DatetimeType", isSingle: true },
1516
- updated_at: { type: "DatetimeType", isSingle: true }
1395
+ user_preferences: { type: "PushPreferencesResponse", isSingle: false }
1517
1396
  };
1518
1397
  return decode(typeMappings, input);
1519
1398
  };
1520
1399
  decoders.UserBannedEvent = (input) => {
1521
1400
  const typeMappings = {
1522
1401
  created_at: { type: "DatetimeType", isSingle: true },
1523
- created_by: { type: "User", isSingle: true },
1524
1402
  expiration: { type: "DatetimeType", isSingle: true },
1525
- user: { type: "User", isSingle: true }
1403
+ received_at: { type: "DatetimeType", isSingle: true }
1526
1404
  };
1527
1405
  return decode(typeMappings, input);
1528
1406
  };
1529
1407
  decoders.UserDeactivatedEvent = (input) => {
1530
1408
  const typeMappings = {
1531
1409
  created_at: { type: "DatetimeType", isSingle: true },
1532
- created_by: { type: "User", isSingle: true },
1533
- user: { type: "User", isSingle: true }
1534
- };
1535
- return decode(typeMappings, input);
1536
- };
1537
- decoders.UserMute = (input) => {
1538
- const typeMappings = {
1539
- created_at: { type: "DatetimeType", isSingle: true },
1540
- updated_at: { type: "DatetimeType", isSingle: true },
1541
- expires: { type: "DatetimeType", isSingle: true },
1542
- target: { type: "User", isSingle: true },
1543
- user: { type: "User", isSingle: true }
1410
+ received_at: { type: "DatetimeType", isSingle: true }
1544
1411
  };
1545
1412
  return decode(typeMappings, input);
1546
1413
  };
@@ -1554,17 +1421,10 @@ decoders.UserMuteResponse = (input) => {
1554
1421
  };
1555
1422
  return decode(typeMappings, input);
1556
1423
  };
1557
- decoders.UserMutedEvent = (input) => {
1558
- const typeMappings = {
1559
- created_at: { type: "DatetimeType", isSingle: true },
1560
- user: { type: "User", isSingle: true }
1561
- };
1562
- return decode(typeMappings, input);
1563
- };
1564
1424
  decoders.UserReactivatedEvent = (input) => {
1565
1425
  const typeMappings = {
1566
1426
  created_at: { type: "DatetimeType", isSingle: true },
1567
- user: { type: "User", isSingle: true }
1427
+ received_at: { type: "DatetimeType", isSingle: true }
1568
1428
  };
1569
1429
  return decode(typeMappings, input);
1570
1430
  };
@@ -1579,6 +1439,13 @@ decoders.UserResponse = (input) => {
1579
1439
  };
1580
1440
  return decode(typeMappings, input);
1581
1441
  };
1442
+ decoders.UserUnbannedEvent = (input) => {
1443
+ const typeMappings = {
1444
+ created_at: { type: "DatetimeType", isSingle: true },
1445
+ received_at: { type: "DatetimeType", isSingle: true }
1446
+ };
1447
+ return decode(typeMappings, input);
1448
+ };
1582
1449
  decoders.UserUpdatedEvent = (input) => {
1583
1450
  const typeMappings = {
1584
1451
  created_at: { type: "DatetimeType", isSingle: true },
@@ -2023,7 +1890,8 @@ class FeedsApi {
2023
1890
  interest_tags: request?.interest_tags,
2024
1891
  mentioned_user_ids: request?.mentioned_user_ids,
2025
1892
  custom: request?.custom,
2026
- location: request?.location
1893
+ location: request?.location,
1894
+ search_data: request?.search_data
2027
1895
  };
2028
1896
  const response = await this.apiClient.sendRequest(
2029
1897
  "PUT",
@@ -4039,7 +3907,7 @@ const getRateLimitFromResponseHeader = (response_headers) => {
4039
3907
  };
4040
3908
  return result;
4041
3909
  };
4042
- const version = "0.3.48";
3910
+ const version = "0.3.49";
4043
3911
  const axios = axiosImport.default ?? axiosImport;
4044
3912
  class ApiClient {
4045
3913
  constructor(apiKey, tokenManager, connectionIdManager, options) {
@@ -4262,8 +4130,8 @@ const eventDecoderMapping = {
4262
4130
  "moderation.mark_reviewed": (data) => decoders.ModerationMarkReviewedEvent(data),
4263
4131
  "user.banned": (data) => decoders.UserBannedEvent(data),
4264
4132
  "user.deactivated": (data) => decoders.UserDeactivatedEvent(data),
4265
- "user.muted": (data) => decoders.UserMutedEvent(data),
4266
4133
  "user.reactivated": (data) => decoders.UserReactivatedEvent(data),
4134
+ "user.unbanned": (data) => decoders.UserUnbannedEvent(data),
4267
4135
  "user.updated": (data) => decoders.UserUpdatedEvent(data)
4268
4136
  };
4269
4137
  const decodeWSEvent = (data) => {
@@ -4489,6 +4357,7 @@ class ModerationApi {
4489
4357
  delete_message: request?.delete_message,
4490
4358
  delete_reaction: request?.delete_reaction,
4491
4359
  delete_user: request?.delete_user,
4360
+ flag: request?.flag,
4492
4361
  mark_reviewed: request?.mark_reviewed,
4493
4362
  reject_appeal: request?.reject_appeal,
4494
4363
  restore: request?.restore,
@@ -4510,8 +4379,6 @@ class ModerationApi {
4510
4379
  }
4511
4380
  class ModerationClient extends ModerationApi {
4512
4381
  }
4513
- const isPollUpdatedEvent = (e) => e.type === "feeds.poll.updated";
4514
- const isPollClosedEventEvent = (e) => e.type === "feeds.poll.closed";
4515
4382
  const isVoteAnswer = (vote) => !!vote?.answer_text;
4516
4383
  class StreamPoll {
4517
4384
  constructor({ client, poll }) {
@@ -4543,7 +4410,10 @@ class StreamPoll {
4543
4410
  };
4544
4411
  this.handlePollUpdated = (event) => {
4545
4412
  if (event.poll?.id && event.poll.id !== this.id) return;
4546
- if (!isPollUpdatedEvent(event)) return;
4413
+ const currentState = this.data;
4414
+ if (currentState.updated_at && event.poll.updated_at && event.poll.updated_at <= currentState.updated_at) {
4415
+ return;
4416
+ }
4547
4417
  const { id, ...pollData } = event.poll;
4548
4418
  this.state.partialNext({
4549
4419
  ...pollData,
@@ -4552,7 +4422,8 @@ class StreamPoll {
4552
4422
  };
4553
4423
  this.handlePollClosed = (event) => {
4554
4424
  if (event.poll?.id && event.poll.id !== this.id) return;
4555
- if (!isPollClosedEventEvent(event)) return;
4425
+ const currentState = this.data;
4426
+ if (currentState.is_closed) return;
4556
4427
  this.state.partialNext({
4557
4428
  is_closed: true,
4558
4429
  last_activity_at: new Date(event.created_at)
@@ -4873,7 +4744,7 @@ const replaceUniqueArrayMerge = (existingArray, arrayToMerge, getKey) => {
4873
4744
  return result;
4874
4745
  };
4875
4746
  const Constants = {
4876
- DEFAULT_COMMENT_PAGINATION: "first"
4747
+ DEFAULT_COMMENT_PAGINATION: "last"
4877
4748
  };
4878
4749
  const isFollowResponse = (data) => {
4879
4750
  return "source_feed" in data && "target_feed" in data;
@@ -5164,8 +5035,21 @@ function handleCommentAdded(payload, fromWs) {
5164
5035
  return currentState;
5165
5036
  }
5166
5037
  const newComments = entityState?.comments ? [...entityState.comments] : [];
5167
- if (entityState.pagination?.sort === "last") {
5038
+ const sort = entityState.pagination?.sort;
5039
+ const hasMorePages = entityState.pagination?.next !== void 0;
5040
+ const isFromCurrentUser = eventTriggeredByConnectedUser.call(this, payload);
5041
+ if (sort === "last") {
5168
5042
  newComments.unshift(comment);
5043
+ } else if (sort === "first") {
5044
+ if (isFromCurrentUser) {
5045
+ newComments.push(comment);
5046
+ } else {
5047
+ if (!hasMorePages) {
5048
+ newComments.push(comment);
5049
+ } else {
5050
+ return currentState;
5051
+ }
5052
+ }
5169
5053
  } else {
5170
5054
  newComments.push(comment);
5171
5055
  }
@@ -6589,11 +6473,11 @@ const _Feed = class _Feed extends FeedApi {
6589
6473
  "app.updated": _Feed.noop,
6590
6474
  "user.banned": _Feed.noop,
6591
6475
  "user.deactivated": _Feed.noop,
6592
- "user.muted": _Feed.noop,
6593
6476
  "user.reactivated": _Feed.noop,
6594
6477
  "user.updated": _Feed.noop,
6595
6478
  "feeds.activity.feedback": handleActivityFeedback.bind(this),
6596
- "feeds.activity.restored": _Feed.noop
6479
+ "feeds.activity.restored": _Feed.noop,
6480
+ "user.unbanned": _Feed.noop
6597
6481
  };
6598
6482
  this.eventDispatcher = new EventDispatcher();
6599
6483
  this.on = this.eventDispatcher.on;
@@ -6643,7 +6527,9 @@ const _Feed = class _Feed extends FeedApi {
6643
6527
  const { last_get_or_create_request_config } = this.state.getLatestValue();
6644
6528
  if (last_get_or_create_request_config?.watch) {
6645
6529
  this.inProgressGetOrCreate = void 0;
6646
- await withRetry(() => this.getOrCreate(last_get_or_create_request_config));
6530
+ await withRetry(
6531
+ () => this.getOrCreate(last_get_or_create_request_config)
6532
+ );
6647
6533
  }
6648
6534
  }
6649
6535
  async getOrCreate(request) {
@@ -6785,6 +6671,16 @@ const _Feed = class _Feed extends FeedApi {
6785
6671
  ({ replies: _r, meta: _m, ...restOfTheCommentResponse }) => restOfTheCommentResponse
6786
6672
  );
6787
6673
  const existingComments = newCommentsByEntityId[entityId]?.comments;
6674
+ let comments = existingComments ? uniqueArrayMerge(
6675
+ existingComments,
6676
+ newComments,
6677
+ (comment) => comment.id
6678
+ ) : newComments;
6679
+ if (data.sort === "first" && existingComments && existingComments.length > 0) {
6680
+ comments = [...comments].sort(
6681
+ (a, b) => new Date(a.created_at).getTime() - new Date(b.created_at).getTime()
6682
+ );
6683
+ }
6788
6684
  newCommentsByEntityId[entityId] = {
6789
6685
  ...newCommentsByEntityId[entityId],
6790
6686
  entity_parent_id: item.entityParentId,
@@ -6793,11 +6689,7 @@ const _Feed = class _Feed extends FeedApi {
6793
6689
  next: item.next,
6794
6690
  sort: data.sort
6795
6691
  },
6796
- comments: existingComments ? uniqueArrayMerge(
6797
- existingComments,
6798
- newComments,
6799
- (comment) => comment.id
6800
- ) : newComments
6692
+ comments
6801
6693
  };
6802
6694
  }
6803
6695
  return {
@@ -7555,13 +7447,34 @@ class FeedsClient extends FeedsApi {
7555
7447
  this.devToken = (userId) => {
7556
7448
  return streamDevToken(userId);
7557
7449
  };
7450
+ this.updatePoll = async (request) => {
7451
+ const poll = this.pollFromState(request.id);
7452
+ const response = await super.updatePoll(request);
7453
+ if (response.poll && poll) {
7454
+ poll.handlePollUpdated({ poll: response.poll, created_at: /* @__PURE__ */ new Date() });
7455
+ }
7456
+ return response;
7457
+ };
7458
+ this.updatePollPartial = async (request) => {
7459
+ const poll = this.pollFromState(request.poll_id);
7460
+ const response = await super.updatePollPartial(request);
7461
+ if (response.poll && poll) {
7462
+ poll.handlePollUpdated({ poll: response.poll, created_at: /* @__PURE__ */ new Date() });
7463
+ }
7464
+ return response;
7465
+ };
7558
7466
  this.closePoll = async (request) => {
7559
- return await this.updatePollPartial({
7467
+ const poll = this.pollFromState(request.poll_id);
7468
+ const response = await super.updatePollPartial({
7560
7469
  poll_id: request.poll_id,
7561
7470
  set: {
7562
7471
  is_closed: true
7563
7472
  }
7564
7473
  });
7474
+ if (response.poll && poll) {
7475
+ poll.handlePollClosed({ poll: response.poll, created_at: /* @__PURE__ */ new Date() });
7476
+ }
7477
+ return response;
7565
7478
  };
7566
7479
  this.castPollVote = async (request) => {
7567
7480
  const poll = this.pollFromState(request.poll_id);
@@ -8170,4 +8083,4 @@ export {
8170
8083
  shouldUpdateState as s,
8171
8084
  uniqueArrayMerge as u
8172
8085
  };
8173
- //# sourceMappingURL=feeds-client-D-EFo20w.mjs.map
8086
+ //# sourceMappingURL=feeds-client-B9b7zUcW.mjs.map