@stream-io/feeds-client 0.2.17 → 0.2.19
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/CHANGELOG.md +24 -0
- package/dist/cjs/index.js +94 -25
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/react-bindings.js +26 -55
- package/dist/cjs/react-bindings.js.map +1 -1
- package/dist/es/index.mjs +86 -17
- package/dist/es/index.mjs.map +1 -1
- package/dist/es/react-bindings.mjs +19 -48
- package/dist/es/react-bindings.mjs.map +1 -1
- package/dist/{index-nq6SDtbt.js → feeds-client-C09giTf1.js} +322 -133
- package/dist/feeds-client-C09giTf1.js.map +1 -0
- package/dist/{index-BZL77zNq.mjs → feeds-client-CFadXO-B.mjs} +335 -146
- package/dist/feeds-client-CFadXO-B.mjs.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useOwnCapabilities.d.ts +2 -32
- package/dist/types/bindings/react/hooks/feed-state-hooks/useOwnCapabilities.d.ts.map +1 -1
- package/dist/types/common/real-time/StableWSConnection.d.ts +3 -3
- package/dist/types/common/real-time/event-models.d.ts +7 -2
- package/dist/types/common/real-time/event-models.d.ts.map +1 -1
- package/dist/types/common/types.d.ts +1 -0
- package/dist/types/common/types.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/activity/handle-activity-added.d.ts +4 -3
- package/dist/types/feed/event-handlers/activity/handle-activity-added.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/activity/handle-activity-updated.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/activity-updater.d.ts +44 -0
- package/dist/types/feed/event-handlers/activity-updater.d.ts.map +1 -0
- package/dist/types/feed/event-handlers/add-aggregated-activities-to-state.d.ts +6 -0
- package/dist/types/feed/event-handlers/add-aggregated-activities-to-state.d.ts.map +1 -0
- package/dist/types/feed/event-handlers/index.d.ts +3 -1
- package/dist/types/feed/event-handlers/index.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/{aggregated-feed/handle-aggregated-feed-updated.d.ts → notification-feed/handle-notification-feed-updated.d.ts} +2 -11
- package/dist/types/feed/event-handlers/notification-feed/handle-notification-feed-updated.d.ts.map +1 -0
- package/dist/types/feed/event-handlers/notification-feed/index.d.ts +2 -0
- package/dist/types/feed/event-handlers/notification-feed/index.d.ts.map +1 -0
- package/dist/types/feed/event-handlers/story-feeds/handle-story-feeds-updated.d.ts +15 -0
- package/dist/types/feed/event-handlers/story-feeds/handle-story-feeds-updated.d.ts.map +1 -0
- package/dist/types/feed/event-handlers/story-feeds/index.d.ts +2 -0
- package/dist/types/feed/event-handlers/story-feeds/index.d.ts.map +1 -0
- package/dist/types/feed/feed.d.ts +10 -4
- package/dist/types/feed/feed.d.ts.map +1 -1
- package/dist/types/feeds-client/feeds-client.d.ts +14 -4
- package/dist/types/feeds-client/feeds-client.d.ts.map +1 -1
- package/dist/types/gen/feeds/FeedsApi.d.ts.map +1 -1
- package/dist/types/gen/models/index.d.ts +42 -451
- package/dist/types/gen/models/index.d.ts.map +1 -1
- package/dist/types/utils/throttling/index.d.ts +3 -0
- package/dist/types/utils/throttling/index.d.ts.map +1 -0
- package/dist/types/utils/throttling/throttle.d.ts +34 -0
- package/dist/types/utils/throttling/throttle.d.ts.map +1 -0
- package/dist/types/utils/throttling/throttled-get-batched-own-capabilities.d.ts +14 -0
- package/dist/types/utils/throttling/throttled-get-batched-own-capabilities.d.ts.map +1 -0
- package/package.json +7 -3
- package/react-bindings.d.ts +11 -0
- package/react-bindings.js +7 -0
- package/react-bindings.mjs +11 -0
- package/src/bindings/react/hooks/feed-state-hooks/useOwnCapabilities.ts +21 -73
- package/src/common/real-time/event-models.ts +8 -2
- package/src/common/types.ts +1 -0
- package/src/feed/event-handlers/activity/handle-activity-added.ts +18 -12
- package/src/feed/event-handlers/activity/handle-activity-updated.ts +12 -16
- package/src/feed/event-handlers/activity-updater.ts +15 -0
- package/src/feed/event-handlers/add-aggregated-activities-to-state.ts +72 -0
- package/src/feed/event-handlers/index.ts +3 -1
- package/src/feed/event-handlers/{aggregated-feed/handle-aggregated-feed-updated.ts → notification-feed/handle-notification-feed-updated.ts} +2 -94
- package/src/feed/event-handlers/notification-feed/index.ts +1 -0
- package/src/feed/event-handlers/story-feeds/handle-story-feeds-updated.ts +122 -0
- package/src/feed/event-handlers/story-feeds/index.ts +1 -0
- package/src/feed/feed.ts +30 -3
- package/src/feeds-client/feeds-client.ts +127 -6
- package/src/gen/feeds/FeedsApi.ts +5 -0
- package/src/gen/model-decoders/decoders.ts +10 -4
- package/src/gen/models/index.ts +75 -834
- package/src/test-utils/response-generators.ts +37 -1
- package/src/utils/throttling/index.ts +2 -0
- package/src/utils/throttling/throttle.ts +123 -0
- package/src/utils/throttling/throttled-get-batched-own-capabilities.ts +42 -0
- package/dist/index-BZL77zNq.mjs.map +0 -1
- package/dist/index-nq6SDtbt.js.map +0 -1
- package/dist/types/feed/event-handlers/aggregated-feed/handle-aggregated-feed-updated.d.ts.map +0 -1
- package/dist/types/feed/event-handlers/aggregated-feed/index.d.ts +0 -2
- package/dist/types/feed/event-handlers/aggregated-feed/index.d.ts.map +0 -1
- package/src/feed/event-handlers/activity/activity-marked-utils.test.ts +0 -208
- package/src/feed/event-handlers/activity/activity-reaction-utils.test.ts +0 -371
- package/src/feed/event-handlers/activity/activity-utils.test.ts +0 -252
- package/src/feed/event-handlers/activity/handle-activity-added.test.ts +0 -86
- package/src/feed/event-handlers/activity/handle-activity-deleted.test.ts +0 -117
- package/src/feed/event-handlers/activity/handle-activity-pinned.test.ts +0 -60
- package/src/feed/event-handlers/activity/handle-activity-reaction-added.test.ts +0 -257
- package/src/feed/event-handlers/activity/handle-activity-reaction-deleted.test.ts +0 -317
- package/src/feed/event-handlers/activity/handle-activity-reaction-updated.test.ts +0 -282
- package/src/feed/event-handlers/activity/handle-activity-unpinned.test.ts +0 -95
- package/src/feed/event-handlers/activity/handle-activity-updated.test.ts +0 -245
- package/src/feed/event-handlers/aggregated-feed/handle-aggregated-feed-updated.test.ts +0 -644
- package/src/feed/event-handlers/aggregated-feed/index.ts +0 -1
- package/src/feed/event-handlers/bookmark/bookmark-utils.test.ts +0 -521
- package/src/feed/event-handlers/bookmark/handle-bookmark-added.test.ts +0 -178
- package/src/feed/event-handlers/bookmark/handle-bookmark-deleted.test.ts +0 -188
- package/src/feed/event-handlers/bookmark/handle-bookmark-updated.test.ts +0 -196
- package/src/feed/event-handlers/comment/handle-comment-added.test.ts +0 -271
- package/src/feed/event-handlers/comment/handle-comment-deleted.test.ts +0 -255
- package/src/feed/event-handlers/comment/handle-comment-reaction-added.test.ts +0 -329
- package/src/feed/event-handlers/comment/handle-comment-reaction-deleted.test.ts +0 -343
- package/src/feed/event-handlers/comment/handle-comment-reaction-updated.test.ts +0 -350
- package/src/feed/event-handlers/comment/handle-comment-updated.test.ts +0 -267
- package/src/feed/event-handlers/comment/utils/update-comment-count.test.ts +0 -322
- package/src/feed/event-handlers/feed-member/handle-feed-member-added.test.ts +0 -75
- package/src/feed/event-handlers/feed-member/handle-feed-member-removed.test.ts +0 -82
- package/src/feed/event-handlers/feed-member/handle-feed-member-updated.test.ts +0 -84
- package/src/feed/event-handlers/follow/follow-state-update-queue.test.ts +0 -219
- package/src/feed/event-handlers/follow/handle-follow-created.test.ts +0 -250
- package/src/feed/event-handlers/follow/handle-follow-deleted.test.ts +0 -268
- package/src/feed/event-handlers/follow/handle-follow-updated.test.ts +0 -131
- package/src/feed/feed.test.ts +0 -90
- package/src/feeds-client/event-handlers/user/handle-user-updated.test.ts +0 -53
- package/src/utils/event-triggered-by-connected-user.test.ts +0 -73
- package/src/utils/state-update-queue.test.ts +0 -129
- package/src/utils/unique-array-merge.test.ts +0 -179
|
@@ -871,8 +871,9 @@ decoders.MessageResponse = (input) => {
|
|
|
871
871
|
decoders.ModerationCustomActionEvent = (input) => {
|
|
872
872
|
const typeMappings = {
|
|
873
873
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
874
|
-
|
|
875
|
-
|
|
874
|
+
review_queue_item: { type: "ReviewQueueItemResponse", isSingle: true },
|
|
875
|
+
received_at: { type: "DatetimeType", isSingle: true },
|
|
876
|
+
message: { type: "MessageResponse", isSingle: true }
|
|
876
877
|
};
|
|
877
878
|
return decode(typeMappings, input);
|
|
878
879
|
};
|
|
@@ -895,8 +896,9 @@ decoders.ModerationFlaggedEvent = (input) => {
|
|
|
895
896
|
decoders.ModerationMarkReviewedEvent = (input) => {
|
|
896
897
|
const typeMappings = {
|
|
897
898
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
898
|
-
|
|
899
|
-
|
|
899
|
+
item: { type: "ReviewQueueItemResponse", isSingle: true },
|
|
900
|
+
received_at: { type: "DatetimeType", isSingle: true },
|
|
901
|
+
message: { type: "MessageResponse", isSingle: true }
|
|
900
902
|
};
|
|
901
903
|
return decode(typeMappings, input);
|
|
902
904
|
};
|
|
@@ -1250,6 +1252,7 @@ decoders.StoriesFeedUpdatedEvent = (input) => {
|
|
|
1250
1252
|
const typeMappings = {
|
|
1251
1253
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
1252
1254
|
received_at: { type: "DatetimeType", isSingle: true },
|
|
1255
|
+
activities: { type: "ActivityResponse", isSingle: false },
|
|
1253
1256
|
aggregated_activities: {
|
|
1254
1257
|
type: "AggregatedActivityResponse",
|
|
1255
1258
|
isSingle: false
|
|
@@ -1471,6 +1474,8 @@ class FeedsApi {
|
|
|
1471
1474
|
const body = {
|
|
1472
1475
|
name: request?.name,
|
|
1473
1476
|
words: request?.words,
|
|
1477
|
+
is_leet_check_enabled: request?.is_leet_check_enabled,
|
|
1478
|
+
is_plural_check_enabled: request?.is_plural_check_enabled,
|
|
1474
1479
|
team: request?.team,
|
|
1475
1480
|
type: request?.type
|
|
1476
1481
|
};
|
|
@@ -1506,6 +1511,8 @@ class FeedsApi {
|
|
|
1506
1511
|
name: request?.name
|
|
1507
1512
|
};
|
|
1508
1513
|
const body = {
|
|
1514
|
+
is_leet_check_enabled: request?.is_leet_check_enabled,
|
|
1515
|
+
is_plural_check_enabled: request?.is_plural_check_enabled,
|
|
1509
1516
|
team: request?.team,
|
|
1510
1517
|
words: request?.words
|
|
1511
1518
|
};
|
|
@@ -1702,7 +1709,8 @@ class FeedsApi {
|
|
|
1702
1709
|
mute_user: request?.mute_user,
|
|
1703
1710
|
reason: request?.reason,
|
|
1704
1711
|
report: request?.report,
|
|
1705
|
-
show_less: request?.show_less
|
|
1712
|
+
show_less: request?.show_less,
|
|
1713
|
+
show_more: request?.show_more
|
|
1706
1714
|
};
|
|
1707
1715
|
const response = await this.apiClient.sendRequest(
|
|
1708
1716
|
"POST",
|
|
@@ -3722,7 +3730,7 @@ const getRateLimitFromResponseHeader = (response_headers) => {
|
|
|
3722
3730
|
};
|
|
3723
3731
|
return result;
|
|
3724
3732
|
};
|
|
3725
|
-
const version = "0.2.
|
|
3733
|
+
const version = "0.2.19";
|
|
3726
3734
|
class ApiClient {
|
|
3727
3735
|
constructor(apiKey, tokenManager, connectionIdManager, options) {
|
|
3728
3736
|
this.apiKey = apiKey;
|
|
@@ -5288,19 +5296,16 @@ function handleBookmarkUpdated(event) {
|
|
|
5288
5296
|
}
|
|
5289
5297
|
}
|
|
5290
5298
|
function addActivitiesToState(newActivities, activities, position) {
|
|
5291
|
-
let result;
|
|
5292
5299
|
if (activities === void 0) {
|
|
5293
|
-
|
|
5294
|
-
result = {
|
|
5295
|
-
changed: true,
|
|
5296
|
-
activities
|
|
5297
|
-
};
|
|
5298
|
-
} else {
|
|
5299
|
-
result = {
|
|
5300
|
+
return {
|
|
5300
5301
|
changed: false,
|
|
5301
|
-
activities
|
|
5302
|
+
activities: []
|
|
5302
5303
|
};
|
|
5303
5304
|
}
|
|
5305
|
+
let result = {
|
|
5306
|
+
changed: false,
|
|
5307
|
+
activities
|
|
5308
|
+
};
|
|
5304
5309
|
const newActivitiesDeduplicated = [];
|
|
5305
5310
|
newActivities.forEach((newActivityResponse) => {
|
|
5306
5311
|
if (!this.hasActivity(newActivityResponse.id)) {
|
|
@@ -5322,10 +5327,15 @@ function handleActivityAdded(event) {
|
|
|
5322
5327
|
const result = addActivitiesToState.bind(this)(
|
|
5323
5328
|
[event.activity],
|
|
5324
5329
|
currentActivities,
|
|
5325
|
-
|
|
5330
|
+
this.currentState.addNewActivitiesTo
|
|
5326
5331
|
);
|
|
5327
5332
|
if (result.changed) {
|
|
5328
|
-
|
|
5333
|
+
const activity = event.activity;
|
|
5334
|
+
this.client.hydratePollCache([activity]);
|
|
5335
|
+
const currentFeed = activity.current_feed;
|
|
5336
|
+
if (currentFeed) {
|
|
5337
|
+
this.client.hydrateCapabilitiesCache([currentFeed]);
|
|
5338
|
+
}
|
|
5329
5339
|
this.state.partialNext({ activities: result.activities });
|
|
5330
5340
|
}
|
|
5331
5341
|
}
|
|
@@ -5378,22 +5388,23 @@ function handleActivityRemovedFromFeed(event) {
|
|
|
5378
5388
|
}
|
|
5379
5389
|
}
|
|
5380
5390
|
}
|
|
5381
|
-
const
|
|
5391
|
+
const updateActivity = ({
|
|
5382
5392
|
currentActivity,
|
|
5383
|
-
|
|
5393
|
+
newActivtiy
|
|
5384
5394
|
}) => {
|
|
5385
5395
|
return {
|
|
5386
|
-
...
|
|
5396
|
+
...newActivtiy,
|
|
5387
5397
|
own_reactions: currentActivity.own_reactions,
|
|
5388
5398
|
own_bookmarks: currentActivity.own_bookmarks
|
|
5389
5399
|
};
|
|
5390
5400
|
};
|
|
5401
|
+
const sharedUpdateActivity$3 = updateActivity;
|
|
5391
5402
|
const updateActivityInState = (event, activities) => updateEntityInArray({
|
|
5392
5403
|
entities: activities,
|
|
5393
5404
|
matcher: (activity) => activity.id === event.activity.id,
|
|
5394
5405
|
updater: (matchedActivity) => sharedUpdateActivity$3({
|
|
5395
5406
|
currentActivity: matchedActivity,
|
|
5396
|
-
event
|
|
5407
|
+
newActivtiy: event.activity
|
|
5397
5408
|
})
|
|
5398
5409
|
});
|
|
5399
5410
|
const updatePinnedActivityInState = (event, pinnedActivities) => updateEntityInArray({
|
|
@@ -5402,7 +5413,7 @@ const updatePinnedActivityInState = (event, pinnedActivities) => updateEntityInA
|
|
|
5402
5413
|
updater: (matchedPinnedActivity) => {
|
|
5403
5414
|
const newActivity = sharedUpdateActivity$3({
|
|
5404
5415
|
currentActivity: matchedPinnedActivity.activity,
|
|
5405
|
-
event
|
|
5416
|
+
newActivtiy: event.activity
|
|
5406
5417
|
});
|
|
5407
5418
|
if (newActivity === matchedPinnedActivity.activity) {
|
|
5408
5419
|
return matchedPinnedActivity;
|
|
@@ -5436,6 +5447,9 @@ function handleActivityUpdated(payload, fromWs) {
|
|
|
5436
5447
|
];
|
|
5437
5448
|
if (result1?.changed || result2.changed) {
|
|
5438
5449
|
this.client.hydratePollCache([payload.activity]);
|
|
5450
|
+
if (payload.activity.current_feed) {
|
|
5451
|
+
this.client.hydrateCapabilitiesCache([payload.activity.current_feed]);
|
|
5452
|
+
}
|
|
5439
5453
|
this.state.partialNext({
|
|
5440
5454
|
activities: result1?.changed ? result1.entities : currentActivities,
|
|
5441
5455
|
pinned_activities: result2.entities
|
|
@@ -5747,36 +5761,55 @@ const addAggregatedActivitiesToState = (newAggregatedActivities, aggregatedActiv
|
|
|
5747
5761
|
if (newAggregatedActivities.length === 0) {
|
|
5748
5762
|
result = {
|
|
5749
5763
|
changed: false,
|
|
5750
|
-
aggregated_activities: []
|
|
5764
|
+
aggregated_activities: aggregatedActivities ?? []
|
|
5751
5765
|
};
|
|
5752
5766
|
} else {
|
|
5753
5767
|
result = {
|
|
5754
5768
|
changed: true,
|
|
5755
5769
|
aggregated_activities: []
|
|
5756
5770
|
};
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
|
|
5760
|
-
result.aggregated_activities = uniqueArrayMerge(
|
|
5761
|
-
newAggregatedActivities,
|
|
5762
|
-
aggregatedActivities ?? [],
|
|
5763
|
-
(a) => a.group
|
|
5764
|
-
);
|
|
5765
|
-
break;
|
|
5766
|
-
case "end":
|
|
5767
|
-
result.aggregated_activities = uniqueArrayMerge(
|
|
5768
|
-
aggregatedActivities ?? [],
|
|
5769
|
-
newAggregatedActivities,
|
|
5770
|
-
(a) => a.group
|
|
5771
|
+
newAggregatedActivities.forEach((newAggregatedActivity) => {
|
|
5772
|
+
const existingAggregatedActivity = aggregatedActivities?.find(
|
|
5773
|
+
(a) => a.group === newAggregatedActivity.group
|
|
5771
5774
|
);
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
|
|
5775
|
+
if (existingAggregatedActivity) {
|
|
5776
|
+
for (let i = 0; i < newAggregatedActivity.activities.length; i++) {
|
|
5777
|
+
const activity = newAggregatedActivity.activities[i];
|
|
5778
|
+
const existingActivity = existingAggregatedActivity.activities.find(
|
|
5779
|
+
(a) => a.id === activity.id
|
|
5780
|
+
);
|
|
5781
|
+
if (existingActivity) {
|
|
5782
|
+
newAggregatedActivity.activities[i] = updateActivity({
|
|
5783
|
+
currentActivity: existingActivity,
|
|
5784
|
+
newActivtiy: activity
|
|
5785
|
+
});
|
|
5786
|
+
}
|
|
5787
|
+
}
|
|
5788
|
+
}
|
|
5789
|
+
});
|
|
5790
|
+
switch (position) {
|
|
5791
|
+
case "start":
|
|
5792
|
+
result.aggregated_activities = uniqueArrayMerge(
|
|
5793
|
+
newAggregatedActivities,
|
|
5794
|
+
aggregatedActivities ?? [],
|
|
5795
|
+
(a) => a.group
|
|
5796
|
+
);
|
|
5797
|
+
break;
|
|
5798
|
+
case "end":
|
|
5799
|
+
result.aggregated_activities = uniqueArrayMerge(
|
|
5800
|
+
aggregatedActivities ?? [],
|
|
5801
|
+
newAggregatedActivities,
|
|
5802
|
+
(a) => a.group
|
|
5803
|
+
);
|
|
5804
|
+
break;
|
|
5805
|
+
case "replace":
|
|
5806
|
+
result.aggregated_activities = replaceUniqueArrayMerge(
|
|
5807
|
+
aggregatedActivities ?? [],
|
|
5808
|
+
newAggregatedActivities,
|
|
5809
|
+
(a) => a.group
|
|
5810
|
+
);
|
|
5811
|
+
break;
|
|
5812
|
+
}
|
|
5780
5813
|
}
|
|
5781
5814
|
return result;
|
|
5782
5815
|
};
|
|
@@ -5802,7 +5835,7 @@ const updateNotificationStatus = (newNotificationStatus, currentNotificationStat
|
|
|
5802
5835
|
};
|
|
5803
5836
|
const updateNotificationFeedFromEvent = (event, currentAggregatedActivities, currentNotificationStatus) => {
|
|
5804
5837
|
const updates = {};
|
|
5805
|
-
if (event.notification_status
|
|
5838
|
+
if (event.notification_status) {
|
|
5806
5839
|
const notificationStatusResult = updateNotificationStatus(
|
|
5807
5840
|
event.notification_status,
|
|
5808
5841
|
currentNotificationStatus
|
|
@@ -5844,18 +5877,65 @@ function handleNotificationFeedUpdated(event) {
|
|
|
5844
5877
|
});
|
|
5845
5878
|
}
|
|
5846
5879
|
}
|
|
5847
|
-
|
|
5848
|
-
if (!
|
|
5880
|
+
const updateActivities = (activitiesToUpsert, currentActivities) => {
|
|
5881
|
+
if (!activitiesToUpsert || activitiesToUpsert.length === 0 || !currentActivities) {
|
|
5882
|
+
return {
|
|
5883
|
+
changed: false,
|
|
5884
|
+
activities: currentActivities ?? []
|
|
5885
|
+
};
|
|
5886
|
+
}
|
|
5887
|
+
const result = [];
|
|
5888
|
+
for (let i = 0; i < currentActivities.length; i++) {
|
|
5889
|
+
const activity = currentActivities[i];
|
|
5890
|
+
const updatedActivity = activitiesToUpsert.find(
|
|
5891
|
+
(a) => a.id === activity.id
|
|
5892
|
+
);
|
|
5893
|
+
if (updatedActivity) {
|
|
5894
|
+
result.push(
|
|
5895
|
+
updateActivity({
|
|
5896
|
+
currentActivity: activity,
|
|
5897
|
+
newActivtiy: updatedActivity
|
|
5898
|
+
})
|
|
5899
|
+
);
|
|
5900
|
+
} else {
|
|
5901
|
+
result.push(activity);
|
|
5902
|
+
}
|
|
5903
|
+
}
|
|
5904
|
+
return {
|
|
5905
|
+
changed: true,
|
|
5906
|
+
activities: result
|
|
5907
|
+
};
|
|
5908
|
+
};
|
|
5909
|
+
function updateStoriesFeedFromEvent(aggregatedActivities, activities, event) {
|
|
5910
|
+
if (!aggregatedActivities && event.aggregated_activities && event.aggregated_activities?.length > 0 || !activities && event.activities && event.activities?.length > 0) {
|
|
5849
5911
|
return {
|
|
5850
5912
|
changed: false
|
|
5851
5913
|
};
|
|
5852
5914
|
}
|
|
5915
|
+
const result = {
|
|
5916
|
+
changed: true,
|
|
5917
|
+
data: {
|
|
5918
|
+
aggregated_activities: aggregatedActivities,
|
|
5919
|
+
activities
|
|
5920
|
+
}
|
|
5921
|
+
};
|
|
5853
5922
|
if (event.aggregated_activities) {
|
|
5854
|
-
const
|
|
5923
|
+
const aggregatedActivitiesResult = addAggregatedActivitiesToState(
|
|
5855
5924
|
event.aggregated_activities,
|
|
5856
5925
|
aggregatedActivities,
|
|
5857
5926
|
"replace"
|
|
5858
5927
|
);
|
|
5928
|
+
if (aggregatedActivitiesResult.changed) {
|
|
5929
|
+
result.data.aggregated_activities = aggregatedActivitiesResult.aggregated_activities;
|
|
5930
|
+
}
|
|
5931
|
+
}
|
|
5932
|
+
if (event.activities) {
|
|
5933
|
+
const activitiesResult = updateActivities(event.activities, activities);
|
|
5934
|
+
if (activitiesResult.changed) {
|
|
5935
|
+
result.data.activities = activitiesResult.activities;
|
|
5936
|
+
}
|
|
5937
|
+
}
|
|
5938
|
+
if (event.aggregated_activities || event.activities) {
|
|
5859
5939
|
return result;
|
|
5860
5940
|
}
|
|
5861
5941
|
return {
|
|
@@ -5865,11 +5945,13 @@ function updateStoriesFeedFromEvent(aggregatedActivities, event) {
|
|
|
5865
5945
|
function handleStoriesFeedUpdated(event) {
|
|
5866
5946
|
const result = updateStoriesFeedFromEvent(
|
|
5867
5947
|
this.currentState.aggregated_activities,
|
|
5948
|
+
this.currentState.activities,
|
|
5868
5949
|
event
|
|
5869
5950
|
);
|
|
5870
5951
|
if (result.changed) {
|
|
5871
5952
|
this.state.partialNext({
|
|
5872
|
-
aggregated_activities: result.data?.aggregated_activities
|
|
5953
|
+
aggregated_activities: result.data?.aggregated_activities,
|
|
5954
|
+
activities: result.data?.activities
|
|
5873
5955
|
});
|
|
5874
5956
|
}
|
|
5875
5957
|
}
|
|
@@ -5880,7 +5962,7 @@ function handleWatchStopped() {
|
|
|
5880
5962
|
this.state.partialNext({ watch: false });
|
|
5881
5963
|
}
|
|
5882
5964
|
const _Feed = class _Feed extends FeedApi {
|
|
5883
|
-
constructor(client, groupId, id, data, watch = false) {
|
|
5965
|
+
constructor(client, groupId, id, data, watch = false, addNewActivitiesTo = "start") {
|
|
5884
5966
|
super(client, groupId, id);
|
|
5885
5967
|
this.indexedActivityIds = /* @__PURE__ */ new Set();
|
|
5886
5968
|
this.stateUpdateQueue = /* @__PURE__ */ new Set();
|
|
@@ -5948,7 +6030,8 @@ const _Feed = class _Feed extends FeedApi {
|
|
|
5948
6030
|
is_loading: false,
|
|
5949
6031
|
is_loading_activities: false,
|
|
5950
6032
|
comments_by_entity_id: {},
|
|
5951
|
-
watch
|
|
6033
|
+
watch,
|
|
6034
|
+
addNewActivitiesTo
|
|
5952
6035
|
});
|
|
5953
6036
|
this.client = client;
|
|
5954
6037
|
this.state.subscribeWithSelector(
|
|
@@ -5969,6 +6052,9 @@ const _Feed = class _Feed extends FeedApi {
|
|
|
5969
6052
|
get currentState() {
|
|
5970
6053
|
return this.state.getLatestValue();
|
|
5971
6054
|
}
|
|
6055
|
+
set addNewActivitiesTo(value) {
|
|
6056
|
+
this.state.partialNext({ addNewActivitiesTo: value });
|
|
6057
|
+
}
|
|
5972
6058
|
hasActivity(activityId) {
|
|
5973
6059
|
return this.indexedActivityIds.has(activityId);
|
|
5974
6060
|
}
|
|
@@ -5988,6 +6074,13 @@ const _Feed = class _Feed extends FeedApi {
|
|
|
5988
6074
|
});
|
|
5989
6075
|
try {
|
|
5990
6076
|
const response = await super.getOrCreate(request);
|
|
6077
|
+
const currentActivityFeeds = [];
|
|
6078
|
+
for (const activity of response.activities) {
|
|
6079
|
+
if (activity.current_feed) {
|
|
6080
|
+
currentActivityFeeds.push(activity.current_feed);
|
|
6081
|
+
}
|
|
6082
|
+
}
|
|
6083
|
+
this.client.hydrateCapabilitiesCache([response.feed, ...currentActivityFeeds]);
|
|
5991
6084
|
if (request?.next) {
|
|
5992
6085
|
const { activities: currentActivities = [] } = this.currentState;
|
|
5993
6086
|
const result = addActivitiesToState.bind(this)(
|
|
@@ -6397,11 +6490,16 @@ const _Feed = class _Feed extends FeedApi {
|
|
|
6397
6490
|
limit: currentState.last_get_or_create_request_config?.limit ?? 20
|
|
6398
6491
|
});
|
|
6399
6492
|
}
|
|
6400
|
-
addActivity(request) {
|
|
6401
|
-
|
|
6493
|
+
async addActivity(request) {
|
|
6494
|
+
const response = await this.client.addActivity({
|
|
6402
6495
|
...request,
|
|
6403
6496
|
feeds: [this.feed]
|
|
6404
6497
|
});
|
|
6498
|
+
const currentFeed = response.activity.current_feed;
|
|
6499
|
+
if (currentFeed) {
|
|
6500
|
+
this.client.hydrateCapabilitiesCache([currentFeed]);
|
|
6501
|
+
}
|
|
6502
|
+
return response;
|
|
6405
6503
|
}
|
|
6406
6504
|
handleWSEvent(event) {
|
|
6407
6505
|
const eventHandler = this.eventHandlers[event.type];
|
|
@@ -6435,6 +6533,7 @@ function handleUserUpdated(event) {
|
|
|
6435
6533
|
}
|
|
6436
6534
|
var UnhandledErrorType = /* @__PURE__ */ ((UnhandledErrorType2) => {
|
|
6437
6535
|
UnhandledErrorType2["ReconnectionReconciliation"] = "reconnection-reconciliation";
|
|
6536
|
+
UnhandledErrorType2["FetchingOwnCapabilitiesOnNewActivity"] = "fetching-own-capabilities-on-new-activity";
|
|
6438
6537
|
return UnhandledErrorType2;
|
|
6439
6538
|
})(UnhandledErrorType || {});
|
|
6440
6539
|
function updateCommentCount({
|
|
@@ -6465,6 +6564,90 @@ function updateCommentCount({
|
|
|
6465
6564
|
}, false);
|
|
6466
6565
|
}
|
|
6467
6566
|
}
|
|
6567
|
+
const throttle = (fn, timeout = 200, {
|
|
6568
|
+
leading = true,
|
|
6569
|
+
trailing = false
|
|
6570
|
+
} = {}) => {
|
|
6571
|
+
let timer = null;
|
|
6572
|
+
let storedArgs = null;
|
|
6573
|
+
let storedThis = null;
|
|
6574
|
+
let lastInvokeTime;
|
|
6575
|
+
const invoke = (args, thisArg) => {
|
|
6576
|
+
lastInvokeTime = Date.now();
|
|
6577
|
+
fn.apply(thisArg, args);
|
|
6578
|
+
};
|
|
6579
|
+
const scheduleTrailing = (delay) => {
|
|
6580
|
+
if (timer) return;
|
|
6581
|
+
timer = setTimeout(() => {
|
|
6582
|
+
timer = null;
|
|
6583
|
+
if (trailing && storedArgs) {
|
|
6584
|
+
invoke(storedArgs, storedThis);
|
|
6585
|
+
storedArgs = null;
|
|
6586
|
+
storedThis = null;
|
|
6587
|
+
}
|
|
6588
|
+
}, delay);
|
|
6589
|
+
};
|
|
6590
|
+
return {
|
|
6591
|
+
throttledFn: function(...args) {
|
|
6592
|
+
const now = Date.now();
|
|
6593
|
+
const hasBeenInvoked = lastInvokeTime != null;
|
|
6594
|
+
if (!hasBeenInvoked && !leading) lastInvokeTime = now;
|
|
6595
|
+
const timeSinceLast = hasBeenInvoked ? now - lastInvokeTime : timeout;
|
|
6596
|
+
const remaining = timeout - timeSinceLast;
|
|
6597
|
+
if (trailing) {
|
|
6598
|
+
storedArgs = args;
|
|
6599
|
+
storedThis = this;
|
|
6600
|
+
}
|
|
6601
|
+
if (remaining <= 0) {
|
|
6602
|
+
if (timer) {
|
|
6603
|
+
clearTimeout(timer);
|
|
6604
|
+
timer = null;
|
|
6605
|
+
}
|
|
6606
|
+
if (leading) {
|
|
6607
|
+
if (trailing) {
|
|
6608
|
+
if (storedArgs === args) {
|
|
6609
|
+
storedArgs = null;
|
|
6610
|
+
storedThis = null;
|
|
6611
|
+
}
|
|
6612
|
+
}
|
|
6613
|
+
invoke(args, this);
|
|
6614
|
+
} else {
|
|
6615
|
+
if (trailing) scheduleTrailing(timeout);
|
|
6616
|
+
}
|
|
6617
|
+
return;
|
|
6618
|
+
}
|
|
6619
|
+
if (trailing && !timer) {
|
|
6620
|
+
scheduleTrailing(remaining);
|
|
6621
|
+
}
|
|
6622
|
+
},
|
|
6623
|
+
cancelTimer: () => {
|
|
6624
|
+
if (timer) {
|
|
6625
|
+
clearTimeout(timer);
|
|
6626
|
+
timer = null;
|
|
6627
|
+
}
|
|
6628
|
+
}
|
|
6629
|
+
};
|
|
6630
|
+
};
|
|
6631
|
+
const DEFAULT_BATCH_OWN_CAPABILITIES_THROTTLING_INTERVAL = 2e3;
|
|
6632
|
+
const queuedFeeds = /* @__PURE__ */ new Set();
|
|
6633
|
+
function queueBatchedOwnCapabilities({ feeds }) {
|
|
6634
|
+
for (const feed of feeds) {
|
|
6635
|
+
queuedFeeds.add(feed);
|
|
6636
|
+
}
|
|
6637
|
+
if (queuedFeeds.size > 0) {
|
|
6638
|
+
this.throttledGetBatchOwnCapabilities(
|
|
6639
|
+
[...queuedFeeds],
|
|
6640
|
+
(feedsToClear) => {
|
|
6641
|
+
for (const feed of feedsToClear) {
|
|
6642
|
+
queuedFeeds.delete(feed);
|
|
6643
|
+
}
|
|
6644
|
+
}
|
|
6645
|
+
);
|
|
6646
|
+
}
|
|
6647
|
+
}
|
|
6648
|
+
function clearQueuedFeeds() {
|
|
6649
|
+
queuedFeeds.clear();
|
|
6650
|
+
}
|
|
6468
6651
|
class FeedsClient extends FeedsApi {
|
|
6469
6652
|
constructor(apiKey, options) {
|
|
6470
6653
|
const tokenManager = new TokenManager();
|
|
@@ -6479,6 +6662,29 @@ class FeedsClient extends FeedsApi {
|
|
|
6479
6662
|
this.eventDispatcher = new EventDispatcher();
|
|
6480
6663
|
this.activeFeeds = {};
|
|
6481
6664
|
this.healthyConnectionChangedEventCount = 0;
|
|
6665
|
+
this.setGetBatchOwnCapabilitiesThrottlingInterval = (throttlingMs) => {
|
|
6666
|
+
const {
|
|
6667
|
+
throttledFn: throttledGetBatchOwnCapabilities,
|
|
6668
|
+
cancelTimer: cancel
|
|
6669
|
+
} = throttle(
|
|
6670
|
+
(feeds, callback) => {
|
|
6671
|
+
this.ownCapabilitiesBatch({
|
|
6672
|
+
feeds
|
|
6673
|
+
}).catch((error) => {
|
|
6674
|
+
this.eventDispatcher.dispatch({
|
|
6675
|
+
type: "errors.unhandled",
|
|
6676
|
+
error_type: UnhandledErrorType.FetchingOwnCapabilitiesOnNewActivity,
|
|
6677
|
+
error
|
|
6678
|
+
});
|
|
6679
|
+
});
|
|
6680
|
+
callback(feeds);
|
|
6681
|
+
},
|
|
6682
|
+
throttlingMs,
|
|
6683
|
+
{ trailing: true }
|
|
6684
|
+
);
|
|
6685
|
+
this.throttledGetBatchOwnCapabilities = throttledGetBatchOwnCapabilities;
|
|
6686
|
+
this.cancelGetBatchOwnCapabilitiesTimer = cancel;
|
|
6687
|
+
};
|
|
6482
6688
|
this.recoverOnReconnect = async () => {
|
|
6483
6689
|
this.healthyConnectionChangedEventCount++;
|
|
6484
6690
|
if (this.healthyConnectionChangedEventCount > 1) {
|
|
@@ -6502,6 +6708,9 @@ class FeedsClient extends FeedsApi {
|
|
|
6502
6708
|
throw new Error(`Can't connect a new user, call "disconnectUser" first`);
|
|
6503
6709
|
}
|
|
6504
6710
|
this.tokenManager.setTokenOrProvider(tokenProvider);
|
|
6711
|
+
this.setGetBatchOwnCapabilitiesThrottlingInterval(
|
|
6712
|
+
this.query_batch_own_capabilties_throttling_interval
|
|
6713
|
+
);
|
|
6505
6714
|
try {
|
|
6506
6715
|
addConnectionEventListeners(this.updateNetworkConnectionStatus);
|
|
6507
6716
|
this.wsConnection = new StableWSConnection(
|
|
@@ -6668,15 +6877,25 @@ class FeedsClient extends FeedsApi {
|
|
|
6668
6877
|
removeConnectionEventListeners(this.updateNetworkConnectionStatus);
|
|
6669
6878
|
this.connectionIdManager.reset();
|
|
6670
6879
|
this.tokenManager.reset();
|
|
6880
|
+
this.polls_by_id.clear();
|
|
6671
6881
|
this.state.partialNext({
|
|
6672
6882
|
connected_user: void 0,
|
|
6673
|
-
is_ws_connection_healthy: false
|
|
6883
|
+
is_ws_connection_healthy: false,
|
|
6884
|
+
own_capabilities_by_fid: {}
|
|
6674
6885
|
});
|
|
6886
|
+
this.cancelGetBatchOwnCapabilitiesTimer();
|
|
6887
|
+
clearQueuedFeeds();
|
|
6675
6888
|
};
|
|
6676
6889
|
this.on = this.eventDispatcher.on;
|
|
6677
6890
|
this.off = this.eventDispatcher.off;
|
|
6678
|
-
this.feed = (groupId, id) => {
|
|
6679
|
-
return this.getOrCreateActiveFeed(
|
|
6891
|
+
this.feed = (groupId, id, options2) => {
|
|
6892
|
+
return this.getOrCreateActiveFeed(
|
|
6893
|
+
groupId,
|
|
6894
|
+
id,
|
|
6895
|
+
void 0,
|
|
6896
|
+
void 0,
|
|
6897
|
+
options2?.addNewActivitiesTo
|
|
6898
|
+
);
|
|
6680
6899
|
};
|
|
6681
6900
|
this.updateNetworkConnectionStatus = (event) => {
|
|
6682
6901
|
const networkEvent = {
|
|
@@ -6685,10 +6904,17 @@ class FeedsClient extends FeedsApi {
|
|
|
6685
6904
|
};
|
|
6686
6905
|
this.eventDispatcher.dispatch(networkEvent);
|
|
6687
6906
|
};
|
|
6688
|
-
this.getOrCreateActiveFeed = (group, id, data, watch) => {
|
|
6907
|
+
this.getOrCreateActiveFeed = (group, id, data, watch, addNewActivitiesTo) => {
|
|
6689
6908
|
const fid = `${group}:${id}`;
|
|
6690
6909
|
if (!this.activeFeeds[fid]) {
|
|
6691
|
-
this.activeFeeds[fid] = new Feed(
|
|
6910
|
+
this.activeFeeds[fid] = new Feed(
|
|
6911
|
+
this,
|
|
6912
|
+
group,
|
|
6913
|
+
id,
|
|
6914
|
+
data,
|
|
6915
|
+
watch,
|
|
6916
|
+
addNewActivitiesTo
|
|
6917
|
+
);
|
|
6692
6918
|
}
|
|
6693
6919
|
const feed = this.activeFeeds[fid];
|
|
6694
6920
|
if (!feed.currentState.watch) {
|
|
@@ -6699,12 +6925,14 @@ class FeedsClient extends FeedsApi {
|
|
|
6699
6925
|
};
|
|
6700
6926
|
this.state = new StateStore({
|
|
6701
6927
|
connected_user: void 0,
|
|
6702
|
-
is_ws_connection_healthy: false
|
|
6928
|
+
is_ws_connection_healthy: false,
|
|
6929
|
+
own_capabilities_by_fid: {}
|
|
6703
6930
|
});
|
|
6704
6931
|
this.moderation = new ModerationClient(apiClient);
|
|
6705
6932
|
this.tokenManager = tokenManager;
|
|
6706
6933
|
this.connectionIdManager = connectionIdManager;
|
|
6707
6934
|
this.polls_by_id = /* @__PURE__ */ new Map();
|
|
6935
|
+
this.query_batch_own_capabilties_throttling_interval = options?.query_batch_own_capabilties_throttling_interval ?? DEFAULT_BATCH_OWN_CAPABILITIES_THROTTLING_INTERVAL;
|
|
6708
6936
|
configureLoggers(options?.configure_loggers_options);
|
|
6709
6937
|
this.on("all", (event) => {
|
|
6710
6938
|
const fid = event.fid;
|
|
@@ -6824,9 +7052,29 @@ class FeedsClient extends FeedsApi {
|
|
|
6824
7052
|
}
|
|
6825
7053
|
}
|
|
6826
7054
|
}
|
|
7055
|
+
hydrateCapabilitiesCache(feedResponses) {
|
|
7056
|
+
let ownCapabilitiesCache = this.state.getLatestValue().own_capabilities_by_fid;
|
|
7057
|
+
const capabilitiesToFetchQueue = [];
|
|
7058
|
+
for (const feedResponse of feedResponses) {
|
|
7059
|
+
const { feed, own_capabilities } = feedResponse;
|
|
7060
|
+
if (!Object.prototype.hasOwnProperty.call(ownCapabilitiesCache, feed)) {
|
|
7061
|
+
if (own_capabilities) {
|
|
7062
|
+
ownCapabilitiesCache = {
|
|
7063
|
+
...ownCapabilitiesCache,
|
|
7064
|
+
[feed]: own_capabilities
|
|
7065
|
+
};
|
|
7066
|
+
} else {
|
|
7067
|
+
capabilitiesToFetchQueue.push(feed);
|
|
7068
|
+
}
|
|
7069
|
+
}
|
|
7070
|
+
}
|
|
7071
|
+
queueBatchedOwnCapabilities.bind(this)({ feeds: capabilitiesToFetchQueue });
|
|
7072
|
+
this.state.partialNext({ own_capabilities_by_fid: ownCapabilitiesCache });
|
|
7073
|
+
}
|
|
6827
7074
|
async queryFeeds(request) {
|
|
6828
7075
|
const response = await this._queryFeeds(request);
|
|
6829
|
-
const
|
|
7076
|
+
const feedResponses = response.feeds;
|
|
7077
|
+
const feeds = feedResponses.map(
|
|
6830
7078
|
(feedResponse) => this.getOrCreateActiveFeed(
|
|
6831
7079
|
feedResponse.group_id,
|
|
6832
7080
|
feedResponse.id,
|
|
@@ -6834,6 +7082,7 @@ class FeedsClient extends FeedsApi {
|
|
|
6834
7082
|
request?.watch
|
|
6835
7083
|
)
|
|
6836
7084
|
);
|
|
7085
|
+
this.hydrateCapabilitiesCache(feedResponses);
|
|
6837
7086
|
return {
|
|
6838
7087
|
feeds,
|
|
6839
7088
|
next: response.next,
|
|
@@ -6842,6 +7091,17 @@ class FeedsClient extends FeedsApi {
|
|
|
6842
7091
|
duration: response.duration
|
|
6843
7092
|
};
|
|
6844
7093
|
}
|
|
7094
|
+
async ownCapabilitiesBatch(request) {
|
|
7095
|
+
const response = await super.ownCapabilitiesBatch(request);
|
|
7096
|
+
const feedResponses = Object.entries(response.capabilities).map(
|
|
7097
|
+
([feed, own_capabilities]) => ({
|
|
7098
|
+
feed,
|
|
7099
|
+
own_capabilities
|
|
7100
|
+
})
|
|
7101
|
+
);
|
|
7102
|
+
this.hydrateCapabilitiesCache(feedResponses);
|
|
7103
|
+
return response;
|
|
7104
|
+
}
|
|
6845
7105
|
async updateFollow(request) {
|
|
6846
7106
|
const response = await super.updateFollow(request);
|
|
6847
7107
|
[
|
|
@@ -6909,98 +7169,27 @@ class FeedsClient extends FeedsApi {
|
|
|
6909
7169
|
);
|
|
6910
7170
|
}
|
|
6911
7171
|
}
|
|
6912
|
-
const ChannelOwnCapability = {
|
|
6913
|
-
BAN_CHANNEL_MEMBERS: "ban-channel-members",
|
|
6914
|
-
CAST_POLL_VOTE: "cast-poll-vote",
|
|
6915
|
-
CONNECT_EVENTS: "connect-events",
|
|
6916
|
-
CREATE_ATTACHMENT: "create-attachment",
|
|
6917
|
-
DELETE_ANY_MESSAGE: "delete-any-message",
|
|
6918
|
-
DELETE_CHANNEL: "delete-channel",
|
|
6919
|
-
DELETE_OWN_MESSAGE: "delete-own-message",
|
|
6920
|
-
FLAG_MESSAGE: "flag-message",
|
|
6921
|
-
FREEZE_CHANNEL: "freeze-channel",
|
|
6922
|
-
JOIN_CHANNEL: "join-channel",
|
|
6923
|
-
LEAVE_CHANNEL: "leave-channel",
|
|
6924
|
-
MUTE_CHANNEL: "mute-channel",
|
|
6925
|
-
PIN_MESSAGE: "pin-message",
|
|
6926
|
-
QUERY_POLL_VOTES: "query-poll-votes",
|
|
6927
|
-
QUOTE_MESSAGE: "quote-message",
|
|
6928
|
-
READ_EVENTS: "read-events",
|
|
6929
|
-
SEARCH_MESSAGES: "search-messages",
|
|
6930
|
-
SEND_CUSTOM_EVENTS: "send-custom-events",
|
|
6931
|
-
SEND_LINKS: "send-links",
|
|
6932
|
-
SEND_MESSAGE: "send-message",
|
|
6933
|
-
SEND_POLL: "send-poll",
|
|
6934
|
-
SEND_REACTION: "send-reaction",
|
|
6935
|
-
SEND_REPLY: "send-reply",
|
|
6936
|
-
SEND_RESTRICTED_VISIBILITY_MESSAGE: "send-restricted-visibility-message",
|
|
6937
|
-
SEND_TYPING_EVENTS: "send-typing-events",
|
|
6938
|
-
SET_CHANNEL_COOLDOWN: "set-channel-cooldown",
|
|
6939
|
-
SHARE_LOCATION: "share-location",
|
|
6940
|
-
SKIP_SLOW_MODE: "skip-slow-mode",
|
|
6941
|
-
SLOW_MODE: "slow-mode",
|
|
6942
|
-
TYPING_EVENTS: "typing-events",
|
|
6943
|
-
UPDATE_ANY_MESSAGE: "update-any-message",
|
|
6944
|
-
UPDATE_CHANNEL: "update-channel",
|
|
6945
|
-
UPDATE_CHANNEL_MEMBERS: "update-channel-members",
|
|
6946
|
-
UPDATE_OWN_MESSAGE: "update-own-message",
|
|
6947
|
-
UPDATE_THREAD: "update-thread",
|
|
6948
|
-
UPLOAD_FILE: "upload-file"
|
|
6949
|
-
};
|
|
6950
|
-
const FeedOwnCapability = {
|
|
6951
|
-
ADD_ACTIVITY: "add-activity",
|
|
6952
|
-
ADD_ACTIVITY_BOOKMARK: "add-activity-bookmark",
|
|
6953
|
-
ADD_ACTIVITY_REACTION: "add-activity-reaction",
|
|
6954
|
-
ADD_COMMENT: "add-comment",
|
|
6955
|
-
ADD_COMMENT_REACTION: "add-comment-reaction",
|
|
6956
|
-
CREATE_FEED: "create-feed",
|
|
6957
|
-
DELETE_ANY_ACTIVITY: "delete-any-activity",
|
|
6958
|
-
DELETE_ANY_COMMENT: "delete-any-comment",
|
|
6959
|
-
DELETE_FEED: "delete-feed",
|
|
6960
|
-
DELETE_OWN_ACTIVITY: "delete-own-activity",
|
|
6961
|
-
DELETE_OWN_ACTIVITY_BOOKMARK: "delete-own-activity-bookmark",
|
|
6962
|
-
DELETE_OWN_ACTIVITY_REACTION: "delete-own-activity-reaction",
|
|
6963
|
-
DELETE_OWN_COMMENT: "delete-own-comment",
|
|
6964
|
-
DELETE_OWN_COMMENT_REACTION: "delete-own-comment-reaction",
|
|
6965
|
-
FOLLOW: "follow",
|
|
6966
|
-
PIN_ACTIVITY: "pin-activity",
|
|
6967
|
-
QUERY_FEED_MEMBERS: "query-feed-members",
|
|
6968
|
-
QUERY_FOLLOWS: "query-follows",
|
|
6969
|
-
READ_ACTIVITIES: "read-activities",
|
|
6970
|
-
READ_FEED: "read-feed",
|
|
6971
|
-
UNFOLLOW: "unfollow",
|
|
6972
|
-
UPDATE_ANY_ACTIVITY: "update-any-activity",
|
|
6973
|
-
UPDATE_ANY_COMMENT: "update-any-comment",
|
|
6974
|
-
UPDATE_FEED: "update-feed",
|
|
6975
|
-
UPDATE_FEED_FOLLOWERS: "update-feed-followers",
|
|
6976
|
-
UPDATE_FEED_MEMBERS: "update-feed-members",
|
|
6977
|
-
UPDATE_OWN_ACTIVITY: "update-own-activity",
|
|
6978
|
-
UPDATE_OWN_ACTIVITY_BOOKMARK: "update-own-activity-bookmark",
|
|
6979
|
-
UPDATE_OWN_COMMENT: "update-own-comment"
|
|
6980
|
-
};
|
|
6981
7172
|
export {
|
|
6982
|
-
|
|
7173
|
+
Constants as C,
|
|
6983
7174
|
FeedsClient as F,
|
|
6984
7175
|
StreamApiError as S,
|
|
6985
7176
|
Feed as a,
|
|
6986
|
-
|
|
6987
|
-
|
|
7177
|
+
StreamPoll as b,
|
|
7178
|
+
checkHasAnotherPage as c,
|
|
6988
7179
|
debounce as d,
|
|
6989
|
-
|
|
6990
|
-
|
|
6991
|
-
|
|
6992
|
-
|
|
7180
|
+
isFollowResponse as e,
|
|
7181
|
+
isReactionResponse as f,
|
|
7182
|
+
isCommentResponse as g,
|
|
7183
|
+
isImageFile as h,
|
|
6993
7184
|
isVoteAnswer as i,
|
|
6994
|
-
|
|
6995
|
-
|
|
6996
|
-
|
|
6997
|
-
|
|
6998
|
-
|
|
6999
|
-
|
|
7000
|
-
getLogger as p,
|
|
7001
|
-
ensureExhausted as q,
|
|
7185
|
+
isVideoFile as j,
|
|
7186
|
+
getStateUpdateQueueId as k,
|
|
7187
|
+
updateEntityInArray as l,
|
|
7188
|
+
configureLoggers as m,
|
|
7189
|
+
getLogger as n,
|
|
7190
|
+
ensureExhausted as o,
|
|
7002
7191
|
replaceUniqueArrayMerge as r,
|
|
7003
7192
|
shouldUpdateState as s,
|
|
7004
7193
|
uniqueArrayMerge as u
|
|
7005
7194
|
};
|
|
7006
|
-
//# sourceMappingURL=
|
|
7195
|
+
//# sourceMappingURL=feeds-client-CFadXO-B.mjs.map
|