@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
|
@@ -889,8 +889,9 @@ decoders.MessageResponse = (input) => {
|
|
|
889
889
|
decoders.ModerationCustomActionEvent = (input) => {
|
|
890
890
|
const typeMappings = {
|
|
891
891
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
892
|
-
|
|
893
|
-
|
|
892
|
+
review_queue_item: { type: "ReviewQueueItemResponse", isSingle: true },
|
|
893
|
+
received_at: { type: "DatetimeType", isSingle: true },
|
|
894
|
+
message: { type: "MessageResponse", isSingle: true }
|
|
894
895
|
};
|
|
895
896
|
return decode(typeMappings, input);
|
|
896
897
|
};
|
|
@@ -913,8 +914,9 @@ decoders.ModerationFlaggedEvent = (input) => {
|
|
|
913
914
|
decoders.ModerationMarkReviewedEvent = (input) => {
|
|
914
915
|
const typeMappings = {
|
|
915
916
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
916
|
-
|
|
917
|
-
|
|
917
|
+
item: { type: "ReviewQueueItemResponse", isSingle: true },
|
|
918
|
+
received_at: { type: "DatetimeType", isSingle: true },
|
|
919
|
+
message: { type: "MessageResponse", isSingle: true }
|
|
918
920
|
};
|
|
919
921
|
return decode(typeMappings, input);
|
|
920
922
|
};
|
|
@@ -1268,6 +1270,7 @@ decoders.StoriesFeedUpdatedEvent = (input) => {
|
|
|
1268
1270
|
const typeMappings = {
|
|
1269
1271
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
1270
1272
|
received_at: { type: "DatetimeType", isSingle: true },
|
|
1273
|
+
activities: { type: "ActivityResponse", isSingle: false },
|
|
1271
1274
|
aggregated_activities: {
|
|
1272
1275
|
type: "AggregatedActivityResponse",
|
|
1273
1276
|
isSingle: false
|
|
@@ -1489,6 +1492,8 @@ class FeedsApi {
|
|
|
1489
1492
|
const body = {
|
|
1490
1493
|
name: request?.name,
|
|
1491
1494
|
words: request?.words,
|
|
1495
|
+
is_leet_check_enabled: request?.is_leet_check_enabled,
|
|
1496
|
+
is_plural_check_enabled: request?.is_plural_check_enabled,
|
|
1492
1497
|
team: request?.team,
|
|
1493
1498
|
type: request?.type
|
|
1494
1499
|
};
|
|
@@ -1524,6 +1529,8 @@ class FeedsApi {
|
|
|
1524
1529
|
name: request?.name
|
|
1525
1530
|
};
|
|
1526
1531
|
const body = {
|
|
1532
|
+
is_leet_check_enabled: request?.is_leet_check_enabled,
|
|
1533
|
+
is_plural_check_enabled: request?.is_plural_check_enabled,
|
|
1527
1534
|
team: request?.team,
|
|
1528
1535
|
words: request?.words
|
|
1529
1536
|
};
|
|
@@ -1720,7 +1727,8 @@ class FeedsApi {
|
|
|
1720
1727
|
mute_user: request?.mute_user,
|
|
1721
1728
|
reason: request?.reason,
|
|
1722
1729
|
report: request?.report,
|
|
1723
|
-
show_less: request?.show_less
|
|
1730
|
+
show_less: request?.show_less,
|
|
1731
|
+
show_more: request?.show_more
|
|
1724
1732
|
};
|
|
1725
1733
|
const response = await this.apiClient.sendRequest(
|
|
1726
1734
|
"POST",
|
|
@@ -3740,7 +3748,7 @@ const getRateLimitFromResponseHeader = (response_headers) => {
|
|
|
3740
3748
|
};
|
|
3741
3749
|
return result;
|
|
3742
3750
|
};
|
|
3743
|
-
const version = "0.2.
|
|
3751
|
+
const version = "0.2.19";
|
|
3744
3752
|
class ApiClient {
|
|
3745
3753
|
constructor(apiKey, tokenManager, connectionIdManager, options) {
|
|
3746
3754
|
this.apiKey = apiKey;
|
|
@@ -5306,19 +5314,16 @@ function handleBookmarkUpdated(event) {
|
|
|
5306
5314
|
}
|
|
5307
5315
|
}
|
|
5308
5316
|
function addActivitiesToState(newActivities, activities, position) {
|
|
5309
|
-
let result;
|
|
5310
5317
|
if (activities === void 0) {
|
|
5311
|
-
|
|
5312
|
-
result = {
|
|
5313
|
-
changed: true,
|
|
5314
|
-
activities
|
|
5315
|
-
};
|
|
5316
|
-
} else {
|
|
5317
|
-
result = {
|
|
5318
|
+
return {
|
|
5318
5319
|
changed: false,
|
|
5319
|
-
activities
|
|
5320
|
+
activities: []
|
|
5320
5321
|
};
|
|
5321
5322
|
}
|
|
5323
|
+
let result = {
|
|
5324
|
+
changed: false,
|
|
5325
|
+
activities
|
|
5326
|
+
};
|
|
5322
5327
|
const newActivitiesDeduplicated = [];
|
|
5323
5328
|
newActivities.forEach((newActivityResponse) => {
|
|
5324
5329
|
if (!this.hasActivity(newActivityResponse.id)) {
|
|
@@ -5340,10 +5345,15 @@ function handleActivityAdded(event) {
|
|
|
5340
5345
|
const result = addActivitiesToState.bind(this)(
|
|
5341
5346
|
[event.activity],
|
|
5342
5347
|
currentActivities,
|
|
5343
|
-
|
|
5348
|
+
this.currentState.addNewActivitiesTo
|
|
5344
5349
|
);
|
|
5345
5350
|
if (result.changed) {
|
|
5346
|
-
|
|
5351
|
+
const activity = event.activity;
|
|
5352
|
+
this.client.hydratePollCache([activity]);
|
|
5353
|
+
const currentFeed = activity.current_feed;
|
|
5354
|
+
if (currentFeed) {
|
|
5355
|
+
this.client.hydrateCapabilitiesCache([currentFeed]);
|
|
5356
|
+
}
|
|
5347
5357
|
this.state.partialNext({ activities: result.activities });
|
|
5348
5358
|
}
|
|
5349
5359
|
}
|
|
@@ -5396,22 +5406,23 @@ function handleActivityRemovedFromFeed(event) {
|
|
|
5396
5406
|
}
|
|
5397
5407
|
}
|
|
5398
5408
|
}
|
|
5399
|
-
const
|
|
5409
|
+
const updateActivity = ({
|
|
5400
5410
|
currentActivity,
|
|
5401
|
-
|
|
5411
|
+
newActivtiy
|
|
5402
5412
|
}) => {
|
|
5403
5413
|
return {
|
|
5404
|
-
...
|
|
5414
|
+
...newActivtiy,
|
|
5405
5415
|
own_reactions: currentActivity.own_reactions,
|
|
5406
5416
|
own_bookmarks: currentActivity.own_bookmarks
|
|
5407
5417
|
};
|
|
5408
5418
|
};
|
|
5419
|
+
const sharedUpdateActivity$3 = updateActivity;
|
|
5409
5420
|
const updateActivityInState = (event, activities) => updateEntityInArray({
|
|
5410
5421
|
entities: activities,
|
|
5411
5422
|
matcher: (activity) => activity.id === event.activity.id,
|
|
5412
5423
|
updater: (matchedActivity) => sharedUpdateActivity$3({
|
|
5413
5424
|
currentActivity: matchedActivity,
|
|
5414
|
-
event
|
|
5425
|
+
newActivtiy: event.activity
|
|
5415
5426
|
})
|
|
5416
5427
|
});
|
|
5417
5428
|
const updatePinnedActivityInState = (event, pinnedActivities) => updateEntityInArray({
|
|
@@ -5420,7 +5431,7 @@ const updatePinnedActivityInState = (event, pinnedActivities) => updateEntityInA
|
|
|
5420
5431
|
updater: (matchedPinnedActivity) => {
|
|
5421
5432
|
const newActivity = sharedUpdateActivity$3({
|
|
5422
5433
|
currentActivity: matchedPinnedActivity.activity,
|
|
5423
|
-
event
|
|
5434
|
+
newActivtiy: event.activity
|
|
5424
5435
|
});
|
|
5425
5436
|
if (newActivity === matchedPinnedActivity.activity) {
|
|
5426
5437
|
return matchedPinnedActivity;
|
|
@@ -5454,6 +5465,9 @@ function handleActivityUpdated(payload, fromWs) {
|
|
|
5454
5465
|
];
|
|
5455
5466
|
if (result1?.changed || result2.changed) {
|
|
5456
5467
|
this.client.hydratePollCache([payload.activity]);
|
|
5468
|
+
if (payload.activity.current_feed) {
|
|
5469
|
+
this.client.hydrateCapabilitiesCache([payload.activity.current_feed]);
|
|
5470
|
+
}
|
|
5457
5471
|
this.state.partialNext({
|
|
5458
5472
|
activities: result1?.changed ? result1.entities : currentActivities,
|
|
5459
5473
|
pinned_activities: result2.entities
|
|
@@ -5765,36 +5779,55 @@ const addAggregatedActivitiesToState = (newAggregatedActivities, aggregatedActiv
|
|
|
5765
5779
|
if (newAggregatedActivities.length === 0) {
|
|
5766
5780
|
result = {
|
|
5767
5781
|
changed: false,
|
|
5768
|
-
aggregated_activities: []
|
|
5782
|
+
aggregated_activities: aggregatedActivities ?? []
|
|
5769
5783
|
};
|
|
5770
5784
|
} else {
|
|
5771
5785
|
result = {
|
|
5772
5786
|
changed: true,
|
|
5773
5787
|
aggregated_activities: []
|
|
5774
5788
|
};
|
|
5775
|
-
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
result.aggregated_activities = uniqueArrayMerge(
|
|
5779
|
-
newAggregatedActivities,
|
|
5780
|
-
aggregatedActivities ?? [],
|
|
5781
|
-
(a) => a.group
|
|
5782
|
-
);
|
|
5783
|
-
break;
|
|
5784
|
-
case "end":
|
|
5785
|
-
result.aggregated_activities = uniqueArrayMerge(
|
|
5786
|
-
aggregatedActivities ?? [],
|
|
5787
|
-
newAggregatedActivities,
|
|
5788
|
-
(a) => a.group
|
|
5789
|
+
newAggregatedActivities.forEach((newAggregatedActivity) => {
|
|
5790
|
+
const existingAggregatedActivity = aggregatedActivities?.find(
|
|
5791
|
+
(a) => a.group === newAggregatedActivity.group
|
|
5789
5792
|
);
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
|
|
5793
|
+
if (existingAggregatedActivity) {
|
|
5794
|
+
for (let i = 0; i < newAggregatedActivity.activities.length; i++) {
|
|
5795
|
+
const activity = newAggregatedActivity.activities[i];
|
|
5796
|
+
const existingActivity = existingAggregatedActivity.activities.find(
|
|
5797
|
+
(a) => a.id === activity.id
|
|
5798
|
+
);
|
|
5799
|
+
if (existingActivity) {
|
|
5800
|
+
newAggregatedActivity.activities[i] = updateActivity({
|
|
5801
|
+
currentActivity: existingActivity,
|
|
5802
|
+
newActivtiy: activity
|
|
5803
|
+
});
|
|
5804
|
+
}
|
|
5805
|
+
}
|
|
5806
|
+
}
|
|
5807
|
+
});
|
|
5808
|
+
switch (position) {
|
|
5809
|
+
case "start":
|
|
5810
|
+
result.aggregated_activities = uniqueArrayMerge(
|
|
5811
|
+
newAggregatedActivities,
|
|
5812
|
+
aggregatedActivities ?? [],
|
|
5813
|
+
(a) => a.group
|
|
5814
|
+
);
|
|
5815
|
+
break;
|
|
5816
|
+
case "end":
|
|
5817
|
+
result.aggregated_activities = uniqueArrayMerge(
|
|
5818
|
+
aggregatedActivities ?? [],
|
|
5819
|
+
newAggregatedActivities,
|
|
5820
|
+
(a) => a.group
|
|
5821
|
+
);
|
|
5822
|
+
break;
|
|
5823
|
+
case "replace":
|
|
5824
|
+
result.aggregated_activities = replaceUniqueArrayMerge(
|
|
5825
|
+
aggregatedActivities ?? [],
|
|
5826
|
+
newAggregatedActivities,
|
|
5827
|
+
(a) => a.group
|
|
5828
|
+
);
|
|
5829
|
+
break;
|
|
5830
|
+
}
|
|
5798
5831
|
}
|
|
5799
5832
|
return result;
|
|
5800
5833
|
};
|
|
@@ -5820,7 +5853,7 @@ const updateNotificationStatus = (newNotificationStatus, currentNotificationStat
|
|
|
5820
5853
|
};
|
|
5821
5854
|
const updateNotificationFeedFromEvent = (event, currentAggregatedActivities, currentNotificationStatus) => {
|
|
5822
5855
|
const updates = {};
|
|
5823
|
-
if (event.notification_status
|
|
5856
|
+
if (event.notification_status) {
|
|
5824
5857
|
const notificationStatusResult = updateNotificationStatus(
|
|
5825
5858
|
event.notification_status,
|
|
5826
5859
|
currentNotificationStatus
|
|
@@ -5862,18 +5895,65 @@ function handleNotificationFeedUpdated(event) {
|
|
|
5862
5895
|
});
|
|
5863
5896
|
}
|
|
5864
5897
|
}
|
|
5865
|
-
|
|
5866
|
-
if (!
|
|
5898
|
+
const updateActivities = (activitiesToUpsert, currentActivities) => {
|
|
5899
|
+
if (!activitiesToUpsert || activitiesToUpsert.length === 0 || !currentActivities) {
|
|
5900
|
+
return {
|
|
5901
|
+
changed: false,
|
|
5902
|
+
activities: currentActivities ?? []
|
|
5903
|
+
};
|
|
5904
|
+
}
|
|
5905
|
+
const result = [];
|
|
5906
|
+
for (let i = 0; i < currentActivities.length; i++) {
|
|
5907
|
+
const activity = currentActivities[i];
|
|
5908
|
+
const updatedActivity = activitiesToUpsert.find(
|
|
5909
|
+
(a) => a.id === activity.id
|
|
5910
|
+
);
|
|
5911
|
+
if (updatedActivity) {
|
|
5912
|
+
result.push(
|
|
5913
|
+
updateActivity({
|
|
5914
|
+
currentActivity: activity,
|
|
5915
|
+
newActivtiy: updatedActivity
|
|
5916
|
+
})
|
|
5917
|
+
);
|
|
5918
|
+
} else {
|
|
5919
|
+
result.push(activity);
|
|
5920
|
+
}
|
|
5921
|
+
}
|
|
5922
|
+
return {
|
|
5923
|
+
changed: true,
|
|
5924
|
+
activities: result
|
|
5925
|
+
};
|
|
5926
|
+
};
|
|
5927
|
+
function updateStoriesFeedFromEvent(aggregatedActivities, activities, event) {
|
|
5928
|
+
if (!aggregatedActivities && event.aggregated_activities && event.aggregated_activities?.length > 0 || !activities && event.activities && event.activities?.length > 0) {
|
|
5867
5929
|
return {
|
|
5868
5930
|
changed: false
|
|
5869
5931
|
};
|
|
5870
5932
|
}
|
|
5933
|
+
const result = {
|
|
5934
|
+
changed: true,
|
|
5935
|
+
data: {
|
|
5936
|
+
aggregated_activities: aggregatedActivities,
|
|
5937
|
+
activities
|
|
5938
|
+
}
|
|
5939
|
+
};
|
|
5871
5940
|
if (event.aggregated_activities) {
|
|
5872
|
-
const
|
|
5941
|
+
const aggregatedActivitiesResult = addAggregatedActivitiesToState(
|
|
5873
5942
|
event.aggregated_activities,
|
|
5874
5943
|
aggregatedActivities,
|
|
5875
5944
|
"replace"
|
|
5876
5945
|
);
|
|
5946
|
+
if (aggregatedActivitiesResult.changed) {
|
|
5947
|
+
result.data.aggregated_activities = aggregatedActivitiesResult.aggregated_activities;
|
|
5948
|
+
}
|
|
5949
|
+
}
|
|
5950
|
+
if (event.activities) {
|
|
5951
|
+
const activitiesResult = updateActivities(event.activities, activities);
|
|
5952
|
+
if (activitiesResult.changed) {
|
|
5953
|
+
result.data.activities = activitiesResult.activities;
|
|
5954
|
+
}
|
|
5955
|
+
}
|
|
5956
|
+
if (event.aggregated_activities || event.activities) {
|
|
5877
5957
|
return result;
|
|
5878
5958
|
}
|
|
5879
5959
|
return {
|
|
@@ -5883,11 +5963,13 @@ function updateStoriesFeedFromEvent(aggregatedActivities, event) {
|
|
|
5883
5963
|
function handleStoriesFeedUpdated(event) {
|
|
5884
5964
|
const result = updateStoriesFeedFromEvent(
|
|
5885
5965
|
this.currentState.aggregated_activities,
|
|
5966
|
+
this.currentState.activities,
|
|
5886
5967
|
event
|
|
5887
5968
|
);
|
|
5888
5969
|
if (result.changed) {
|
|
5889
5970
|
this.state.partialNext({
|
|
5890
|
-
aggregated_activities: result.data?.aggregated_activities
|
|
5971
|
+
aggregated_activities: result.data?.aggregated_activities,
|
|
5972
|
+
activities: result.data?.activities
|
|
5891
5973
|
});
|
|
5892
5974
|
}
|
|
5893
5975
|
}
|
|
@@ -5898,7 +5980,7 @@ function handleWatchStopped() {
|
|
|
5898
5980
|
this.state.partialNext({ watch: false });
|
|
5899
5981
|
}
|
|
5900
5982
|
const _Feed = class _Feed extends FeedApi {
|
|
5901
|
-
constructor(client, groupId, id, data, watch = false) {
|
|
5983
|
+
constructor(client, groupId, id, data, watch = false, addNewActivitiesTo = "start") {
|
|
5902
5984
|
super(client, groupId, id);
|
|
5903
5985
|
this.indexedActivityIds = /* @__PURE__ */ new Set();
|
|
5904
5986
|
this.stateUpdateQueue = /* @__PURE__ */ new Set();
|
|
@@ -5966,7 +6048,8 @@ const _Feed = class _Feed extends FeedApi {
|
|
|
5966
6048
|
is_loading: false,
|
|
5967
6049
|
is_loading_activities: false,
|
|
5968
6050
|
comments_by_entity_id: {},
|
|
5969
|
-
watch
|
|
6051
|
+
watch,
|
|
6052
|
+
addNewActivitiesTo
|
|
5970
6053
|
});
|
|
5971
6054
|
this.client = client;
|
|
5972
6055
|
this.state.subscribeWithSelector(
|
|
@@ -5987,6 +6070,9 @@ const _Feed = class _Feed extends FeedApi {
|
|
|
5987
6070
|
get currentState() {
|
|
5988
6071
|
return this.state.getLatestValue();
|
|
5989
6072
|
}
|
|
6073
|
+
set addNewActivitiesTo(value) {
|
|
6074
|
+
this.state.partialNext({ addNewActivitiesTo: value });
|
|
6075
|
+
}
|
|
5990
6076
|
hasActivity(activityId) {
|
|
5991
6077
|
return this.indexedActivityIds.has(activityId);
|
|
5992
6078
|
}
|
|
@@ -6006,6 +6092,13 @@ const _Feed = class _Feed extends FeedApi {
|
|
|
6006
6092
|
});
|
|
6007
6093
|
try {
|
|
6008
6094
|
const response = await super.getOrCreate(request);
|
|
6095
|
+
const currentActivityFeeds = [];
|
|
6096
|
+
for (const activity of response.activities) {
|
|
6097
|
+
if (activity.current_feed) {
|
|
6098
|
+
currentActivityFeeds.push(activity.current_feed);
|
|
6099
|
+
}
|
|
6100
|
+
}
|
|
6101
|
+
this.client.hydrateCapabilitiesCache([response.feed, ...currentActivityFeeds]);
|
|
6009
6102
|
if (request?.next) {
|
|
6010
6103
|
const { activities: currentActivities = [] } = this.currentState;
|
|
6011
6104
|
const result = addActivitiesToState.bind(this)(
|
|
@@ -6415,11 +6508,16 @@ const _Feed = class _Feed extends FeedApi {
|
|
|
6415
6508
|
limit: currentState.last_get_or_create_request_config?.limit ?? 20
|
|
6416
6509
|
});
|
|
6417
6510
|
}
|
|
6418
|
-
addActivity(request) {
|
|
6419
|
-
|
|
6511
|
+
async addActivity(request) {
|
|
6512
|
+
const response = await this.client.addActivity({
|
|
6420
6513
|
...request,
|
|
6421
6514
|
feeds: [this.feed]
|
|
6422
6515
|
});
|
|
6516
|
+
const currentFeed = response.activity.current_feed;
|
|
6517
|
+
if (currentFeed) {
|
|
6518
|
+
this.client.hydrateCapabilitiesCache([currentFeed]);
|
|
6519
|
+
}
|
|
6520
|
+
return response;
|
|
6423
6521
|
}
|
|
6424
6522
|
handleWSEvent(event) {
|
|
6425
6523
|
const eventHandler = this.eventHandlers[event.type];
|
|
@@ -6453,6 +6551,7 @@ function handleUserUpdated(event) {
|
|
|
6453
6551
|
}
|
|
6454
6552
|
var UnhandledErrorType = /* @__PURE__ */ ((UnhandledErrorType2) => {
|
|
6455
6553
|
UnhandledErrorType2["ReconnectionReconciliation"] = "reconnection-reconciliation";
|
|
6554
|
+
UnhandledErrorType2["FetchingOwnCapabilitiesOnNewActivity"] = "fetching-own-capabilities-on-new-activity";
|
|
6456
6555
|
return UnhandledErrorType2;
|
|
6457
6556
|
})(UnhandledErrorType || {});
|
|
6458
6557
|
function updateCommentCount({
|
|
@@ -6483,6 +6582,90 @@ function updateCommentCount({
|
|
|
6483
6582
|
}, false);
|
|
6484
6583
|
}
|
|
6485
6584
|
}
|
|
6585
|
+
const throttle = (fn, timeout = 200, {
|
|
6586
|
+
leading = true,
|
|
6587
|
+
trailing = false
|
|
6588
|
+
} = {}) => {
|
|
6589
|
+
let timer = null;
|
|
6590
|
+
let storedArgs = null;
|
|
6591
|
+
let storedThis = null;
|
|
6592
|
+
let lastInvokeTime;
|
|
6593
|
+
const invoke = (args, thisArg) => {
|
|
6594
|
+
lastInvokeTime = Date.now();
|
|
6595
|
+
fn.apply(thisArg, args);
|
|
6596
|
+
};
|
|
6597
|
+
const scheduleTrailing = (delay) => {
|
|
6598
|
+
if (timer) return;
|
|
6599
|
+
timer = setTimeout(() => {
|
|
6600
|
+
timer = null;
|
|
6601
|
+
if (trailing && storedArgs) {
|
|
6602
|
+
invoke(storedArgs, storedThis);
|
|
6603
|
+
storedArgs = null;
|
|
6604
|
+
storedThis = null;
|
|
6605
|
+
}
|
|
6606
|
+
}, delay);
|
|
6607
|
+
};
|
|
6608
|
+
return {
|
|
6609
|
+
throttledFn: function(...args) {
|
|
6610
|
+
const now = Date.now();
|
|
6611
|
+
const hasBeenInvoked = lastInvokeTime != null;
|
|
6612
|
+
if (!hasBeenInvoked && !leading) lastInvokeTime = now;
|
|
6613
|
+
const timeSinceLast = hasBeenInvoked ? now - lastInvokeTime : timeout;
|
|
6614
|
+
const remaining = timeout - timeSinceLast;
|
|
6615
|
+
if (trailing) {
|
|
6616
|
+
storedArgs = args;
|
|
6617
|
+
storedThis = this;
|
|
6618
|
+
}
|
|
6619
|
+
if (remaining <= 0) {
|
|
6620
|
+
if (timer) {
|
|
6621
|
+
clearTimeout(timer);
|
|
6622
|
+
timer = null;
|
|
6623
|
+
}
|
|
6624
|
+
if (leading) {
|
|
6625
|
+
if (trailing) {
|
|
6626
|
+
if (storedArgs === args) {
|
|
6627
|
+
storedArgs = null;
|
|
6628
|
+
storedThis = null;
|
|
6629
|
+
}
|
|
6630
|
+
}
|
|
6631
|
+
invoke(args, this);
|
|
6632
|
+
} else {
|
|
6633
|
+
if (trailing) scheduleTrailing(timeout);
|
|
6634
|
+
}
|
|
6635
|
+
return;
|
|
6636
|
+
}
|
|
6637
|
+
if (trailing && !timer) {
|
|
6638
|
+
scheduleTrailing(remaining);
|
|
6639
|
+
}
|
|
6640
|
+
},
|
|
6641
|
+
cancelTimer: () => {
|
|
6642
|
+
if (timer) {
|
|
6643
|
+
clearTimeout(timer);
|
|
6644
|
+
timer = null;
|
|
6645
|
+
}
|
|
6646
|
+
}
|
|
6647
|
+
};
|
|
6648
|
+
};
|
|
6649
|
+
const DEFAULT_BATCH_OWN_CAPABILITIES_THROTTLING_INTERVAL = 2e3;
|
|
6650
|
+
const queuedFeeds = /* @__PURE__ */ new Set();
|
|
6651
|
+
function queueBatchedOwnCapabilities({ feeds }) {
|
|
6652
|
+
for (const feed of feeds) {
|
|
6653
|
+
queuedFeeds.add(feed);
|
|
6654
|
+
}
|
|
6655
|
+
if (queuedFeeds.size > 0) {
|
|
6656
|
+
this.throttledGetBatchOwnCapabilities(
|
|
6657
|
+
[...queuedFeeds],
|
|
6658
|
+
(feedsToClear) => {
|
|
6659
|
+
for (const feed of feedsToClear) {
|
|
6660
|
+
queuedFeeds.delete(feed);
|
|
6661
|
+
}
|
|
6662
|
+
}
|
|
6663
|
+
);
|
|
6664
|
+
}
|
|
6665
|
+
}
|
|
6666
|
+
function clearQueuedFeeds() {
|
|
6667
|
+
queuedFeeds.clear();
|
|
6668
|
+
}
|
|
6486
6669
|
class FeedsClient extends FeedsApi {
|
|
6487
6670
|
constructor(apiKey, options) {
|
|
6488
6671
|
const tokenManager = new TokenManager();
|
|
@@ -6497,6 +6680,29 @@ class FeedsClient extends FeedsApi {
|
|
|
6497
6680
|
this.eventDispatcher = new EventDispatcher();
|
|
6498
6681
|
this.activeFeeds = {};
|
|
6499
6682
|
this.healthyConnectionChangedEventCount = 0;
|
|
6683
|
+
this.setGetBatchOwnCapabilitiesThrottlingInterval = (throttlingMs) => {
|
|
6684
|
+
const {
|
|
6685
|
+
throttledFn: throttledGetBatchOwnCapabilities,
|
|
6686
|
+
cancelTimer: cancel
|
|
6687
|
+
} = throttle(
|
|
6688
|
+
(feeds, callback) => {
|
|
6689
|
+
this.ownCapabilitiesBatch({
|
|
6690
|
+
feeds
|
|
6691
|
+
}).catch((error) => {
|
|
6692
|
+
this.eventDispatcher.dispatch({
|
|
6693
|
+
type: "errors.unhandled",
|
|
6694
|
+
error_type: UnhandledErrorType.FetchingOwnCapabilitiesOnNewActivity,
|
|
6695
|
+
error
|
|
6696
|
+
});
|
|
6697
|
+
});
|
|
6698
|
+
callback(feeds);
|
|
6699
|
+
},
|
|
6700
|
+
throttlingMs,
|
|
6701
|
+
{ trailing: true }
|
|
6702
|
+
);
|
|
6703
|
+
this.throttledGetBatchOwnCapabilities = throttledGetBatchOwnCapabilities;
|
|
6704
|
+
this.cancelGetBatchOwnCapabilitiesTimer = cancel;
|
|
6705
|
+
};
|
|
6500
6706
|
this.recoverOnReconnect = async () => {
|
|
6501
6707
|
this.healthyConnectionChangedEventCount++;
|
|
6502
6708
|
if (this.healthyConnectionChangedEventCount > 1) {
|
|
@@ -6520,6 +6726,9 @@ class FeedsClient extends FeedsApi {
|
|
|
6520
6726
|
throw new Error(`Can't connect a new user, call "disconnectUser" first`);
|
|
6521
6727
|
}
|
|
6522
6728
|
this.tokenManager.setTokenOrProvider(tokenProvider);
|
|
6729
|
+
this.setGetBatchOwnCapabilitiesThrottlingInterval(
|
|
6730
|
+
this.query_batch_own_capabilties_throttling_interval
|
|
6731
|
+
);
|
|
6523
6732
|
try {
|
|
6524
6733
|
addConnectionEventListeners(this.updateNetworkConnectionStatus);
|
|
6525
6734
|
this.wsConnection = new StableWSConnection(
|
|
@@ -6686,15 +6895,25 @@ class FeedsClient extends FeedsApi {
|
|
|
6686
6895
|
removeConnectionEventListeners(this.updateNetworkConnectionStatus);
|
|
6687
6896
|
this.connectionIdManager.reset();
|
|
6688
6897
|
this.tokenManager.reset();
|
|
6898
|
+
this.polls_by_id.clear();
|
|
6689
6899
|
this.state.partialNext({
|
|
6690
6900
|
connected_user: void 0,
|
|
6691
|
-
is_ws_connection_healthy: false
|
|
6901
|
+
is_ws_connection_healthy: false,
|
|
6902
|
+
own_capabilities_by_fid: {}
|
|
6692
6903
|
});
|
|
6904
|
+
this.cancelGetBatchOwnCapabilitiesTimer();
|
|
6905
|
+
clearQueuedFeeds();
|
|
6693
6906
|
};
|
|
6694
6907
|
this.on = this.eventDispatcher.on;
|
|
6695
6908
|
this.off = this.eventDispatcher.off;
|
|
6696
|
-
this.feed = (groupId, id) => {
|
|
6697
|
-
return this.getOrCreateActiveFeed(
|
|
6909
|
+
this.feed = (groupId, id, options2) => {
|
|
6910
|
+
return this.getOrCreateActiveFeed(
|
|
6911
|
+
groupId,
|
|
6912
|
+
id,
|
|
6913
|
+
void 0,
|
|
6914
|
+
void 0,
|
|
6915
|
+
options2?.addNewActivitiesTo
|
|
6916
|
+
);
|
|
6698
6917
|
};
|
|
6699
6918
|
this.updateNetworkConnectionStatus = (event) => {
|
|
6700
6919
|
const networkEvent = {
|
|
@@ -6703,10 +6922,17 @@ class FeedsClient extends FeedsApi {
|
|
|
6703
6922
|
};
|
|
6704
6923
|
this.eventDispatcher.dispatch(networkEvent);
|
|
6705
6924
|
};
|
|
6706
|
-
this.getOrCreateActiveFeed = (group, id, data, watch) => {
|
|
6925
|
+
this.getOrCreateActiveFeed = (group, id, data, watch, addNewActivitiesTo) => {
|
|
6707
6926
|
const fid = `${group}:${id}`;
|
|
6708
6927
|
if (!this.activeFeeds[fid]) {
|
|
6709
|
-
this.activeFeeds[fid] = new Feed(
|
|
6928
|
+
this.activeFeeds[fid] = new Feed(
|
|
6929
|
+
this,
|
|
6930
|
+
group,
|
|
6931
|
+
id,
|
|
6932
|
+
data,
|
|
6933
|
+
watch,
|
|
6934
|
+
addNewActivitiesTo
|
|
6935
|
+
);
|
|
6710
6936
|
}
|
|
6711
6937
|
const feed = this.activeFeeds[fid];
|
|
6712
6938
|
if (!feed.currentState.watch) {
|
|
@@ -6717,12 +6943,14 @@ class FeedsClient extends FeedsApi {
|
|
|
6717
6943
|
};
|
|
6718
6944
|
this.state = new stateStore.StateStore({
|
|
6719
6945
|
connected_user: void 0,
|
|
6720
|
-
is_ws_connection_healthy: false
|
|
6946
|
+
is_ws_connection_healthy: false,
|
|
6947
|
+
own_capabilities_by_fid: {}
|
|
6721
6948
|
});
|
|
6722
6949
|
this.moderation = new ModerationClient(apiClient);
|
|
6723
6950
|
this.tokenManager = tokenManager;
|
|
6724
6951
|
this.connectionIdManager = connectionIdManager;
|
|
6725
6952
|
this.polls_by_id = /* @__PURE__ */ new Map();
|
|
6953
|
+
this.query_batch_own_capabilties_throttling_interval = options?.query_batch_own_capabilties_throttling_interval ?? DEFAULT_BATCH_OWN_CAPABILITIES_THROTTLING_INTERVAL;
|
|
6726
6954
|
configureLoggers(options?.configure_loggers_options);
|
|
6727
6955
|
this.on("all", (event) => {
|
|
6728
6956
|
const fid = event.fid;
|
|
@@ -6842,9 +7070,29 @@ class FeedsClient extends FeedsApi {
|
|
|
6842
7070
|
}
|
|
6843
7071
|
}
|
|
6844
7072
|
}
|
|
7073
|
+
hydrateCapabilitiesCache(feedResponses) {
|
|
7074
|
+
let ownCapabilitiesCache = this.state.getLatestValue().own_capabilities_by_fid;
|
|
7075
|
+
const capabilitiesToFetchQueue = [];
|
|
7076
|
+
for (const feedResponse of feedResponses) {
|
|
7077
|
+
const { feed, own_capabilities } = feedResponse;
|
|
7078
|
+
if (!Object.prototype.hasOwnProperty.call(ownCapabilitiesCache, feed)) {
|
|
7079
|
+
if (own_capabilities) {
|
|
7080
|
+
ownCapabilitiesCache = {
|
|
7081
|
+
...ownCapabilitiesCache,
|
|
7082
|
+
[feed]: own_capabilities
|
|
7083
|
+
};
|
|
7084
|
+
} else {
|
|
7085
|
+
capabilitiesToFetchQueue.push(feed);
|
|
7086
|
+
}
|
|
7087
|
+
}
|
|
7088
|
+
}
|
|
7089
|
+
queueBatchedOwnCapabilities.bind(this)({ feeds: capabilitiesToFetchQueue });
|
|
7090
|
+
this.state.partialNext({ own_capabilities_by_fid: ownCapabilitiesCache });
|
|
7091
|
+
}
|
|
6845
7092
|
async queryFeeds(request) {
|
|
6846
7093
|
const response = await this._queryFeeds(request);
|
|
6847
|
-
const
|
|
7094
|
+
const feedResponses = response.feeds;
|
|
7095
|
+
const feeds = feedResponses.map(
|
|
6848
7096
|
(feedResponse) => this.getOrCreateActiveFeed(
|
|
6849
7097
|
feedResponse.group_id,
|
|
6850
7098
|
feedResponse.id,
|
|
@@ -6852,6 +7100,7 @@ class FeedsClient extends FeedsApi {
|
|
|
6852
7100
|
request?.watch
|
|
6853
7101
|
)
|
|
6854
7102
|
);
|
|
7103
|
+
this.hydrateCapabilitiesCache(feedResponses);
|
|
6855
7104
|
return {
|
|
6856
7105
|
feeds,
|
|
6857
7106
|
next: response.next,
|
|
@@ -6860,6 +7109,17 @@ class FeedsClient extends FeedsApi {
|
|
|
6860
7109
|
duration: response.duration
|
|
6861
7110
|
};
|
|
6862
7111
|
}
|
|
7112
|
+
async ownCapabilitiesBatch(request) {
|
|
7113
|
+
const response = await super.ownCapabilitiesBatch(request);
|
|
7114
|
+
const feedResponses = Object.entries(response.capabilities).map(
|
|
7115
|
+
([feed, own_capabilities]) => ({
|
|
7116
|
+
feed,
|
|
7117
|
+
own_capabilities
|
|
7118
|
+
})
|
|
7119
|
+
);
|
|
7120
|
+
this.hydrateCapabilitiesCache(feedResponses);
|
|
7121
|
+
return response;
|
|
7122
|
+
}
|
|
6863
7123
|
async updateFollow(request) {
|
|
6864
7124
|
const response = await super.updateFollow(request);
|
|
6865
7125
|
[
|
|
@@ -6927,79 +7187,8 @@ class FeedsClient extends FeedsApi {
|
|
|
6927
7187
|
);
|
|
6928
7188
|
}
|
|
6929
7189
|
}
|
|
6930
|
-
const ChannelOwnCapability = {
|
|
6931
|
-
BAN_CHANNEL_MEMBERS: "ban-channel-members",
|
|
6932
|
-
CAST_POLL_VOTE: "cast-poll-vote",
|
|
6933
|
-
CONNECT_EVENTS: "connect-events",
|
|
6934
|
-
CREATE_ATTACHMENT: "create-attachment",
|
|
6935
|
-
DELETE_ANY_MESSAGE: "delete-any-message",
|
|
6936
|
-
DELETE_CHANNEL: "delete-channel",
|
|
6937
|
-
DELETE_OWN_MESSAGE: "delete-own-message",
|
|
6938
|
-
FLAG_MESSAGE: "flag-message",
|
|
6939
|
-
FREEZE_CHANNEL: "freeze-channel",
|
|
6940
|
-
JOIN_CHANNEL: "join-channel",
|
|
6941
|
-
LEAVE_CHANNEL: "leave-channel",
|
|
6942
|
-
MUTE_CHANNEL: "mute-channel",
|
|
6943
|
-
PIN_MESSAGE: "pin-message",
|
|
6944
|
-
QUERY_POLL_VOTES: "query-poll-votes",
|
|
6945
|
-
QUOTE_MESSAGE: "quote-message",
|
|
6946
|
-
READ_EVENTS: "read-events",
|
|
6947
|
-
SEARCH_MESSAGES: "search-messages",
|
|
6948
|
-
SEND_CUSTOM_EVENTS: "send-custom-events",
|
|
6949
|
-
SEND_LINKS: "send-links",
|
|
6950
|
-
SEND_MESSAGE: "send-message",
|
|
6951
|
-
SEND_POLL: "send-poll",
|
|
6952
|
-
SEND_REACTION: "send-reaction",
|
|
6953
|
-
SEND_REPLY: "send-reply",
|
|
6954
|
-
SEND_RESTRICTED_VISIBILITY_MESSAGE: "send-restricted-visibility-message",
|
|
6955
|
-
SEND_TYPING_EVENTS: "send-typing-events",
|
|
6956
|
-
SET_CHANNEL_COOLDOWN: "set-channel-cooldown",
|
|
6957
|
-
SHARE_LOCATION: "share-location",
|
|
6958
|
-
SKIP_SLOW_MODE: "skip-slow-mode",
|
|
6959
|
-
SLOW_MODE: "slow-mode",
|
|
6960
|
-
TYPING_EVENTS: "typing-events",
|
|
6961
|
-
UPDATE_ANY_MESSAGE: "update-any-message",
|
|
6962
|
-
UPDATE_CHANNEL: "update-channel",
|
|
6963
|
-
UPDATE_CHANNEL_MEMBERS: "update-channel-members",
|
|
6964
|
-
UPDATE_OWN_MESSAGE: "update-own-message",
|
|
6965
|
-
UPDATE_THREAD: "update-thread",
|
|
6966
|
-
UPLOAD_FILE: "upload-file"
|
|
6967
|
-
};
|
|
6968
|
-
const FeedOwnCapability = {
|
|
6969
|
-
ADD_ACTIVITY: "add-activity",
|
|
6970
|
-
ADD_ACTIVITY_BOOKMARK: "add-activity-bookmark",
|
|
6971
|
-
ADD_ACTIVITY_REACTION: "add-activity-reaction",
|
|
6972
|
-
ADD_COMMENT: "add-comment",
|
|
6973
|
-
ADD_COMMENT_REACTION: "add-comment-reaction",
|
|
6974
|
-
CREATE_FEED: "create-feed",
|
|
6975
|
-
DELETE_ANY_ACTIVITY: "delete-any-activity",
|
|
6976
|
-
DELETE_ANY_COMMENT: "delete-any-comment",
|
|
6977
|
-
DELETE_FEED: "delete-feed",
|
|
6978
|
-
DELETE_OWN_ACTIVITY: "delete-own-activity",
|
|
6979
|
-
DELETE_OWN_ACTIVITY_BOOKMARK: "delete-own-activity-bookmark",
|
|
6980
|
-
DELETE_OWN_ACTIVITY_REACTION: "delete-own-activity-reaction",
|
|
6981
|
-
DELETE_OWN_COMMENT: "delete-own-comment",
|
|
6982
|
-
DELETE_OWN_COMMENT_REACTION: "delete-own-comment-reaction",
|
|
6983
|
-
FOLLOW: "follow",
|
|
6984
|
-
PIN_ACTIVITY: "pin-activity",
|
|
6985
|
-
QUERY_FEED_MEMBERS: "query-feed-members",
|
|
6986
|
-
QUERY_FOLLOWS: "query-follows",
|
|
6987
|
-
READ_ACTIVITIES: "read-activities",
|
|
6988
|
-
READ_FEED: "read-feed",
|
|
6989
|
-
UNFOLLOW: "unfollow",
|
|
6990
|
-
UPDATE_ANY_ACTIVITY: "update-any-activity",
|
|
6991
|
-
UPDATE_ANY_COMMENT: "update-any-comment",
|
|
6992
|
-
UPDATE_FEED: "update-feed",
|
|
6993
|
-
UPDATE_FEED_FOLLOWERS: "update-feed-followers",
|
|
6994
|
-
UPDATE_FEED_MEMBERS: "update-feed-members",
|
|
6995
|
-
UPDATE_OWN_ACTIVITY: "update-own-activity",
|
|
6996
|
-
UPDATE_OWN_ACTIVITY_BOOKMARK: "update-own-activity-bookmark",
|
|
6997
|
-
UPDATE_OWN_COMMENT: "update-own-comment"
|
|
6998
|
-
};
|
|
6999
|
-
exports.ChannelOwnCapability = ChannelOwnCapability;
|
|
7000
7190
|
exports.Constants = Constants;
|
|
7001
7191
|
exports.Feed = Feed;
|
|
7002
|
-
exports.FeedOwnCapability = FeedOwnCapability;
|
|
7003
7192
|
exports.FeedsClient = FeedsClient;
|
|
7004
7193
|
exports.StreamApiError = StreamApiError;
|
|
7005
7194
|
exports.StreamPoll = StreamPoll;
|
|
@@ -7019,4 +7208,4 @@ exports.replaceUniqueArrayMerge = replaceUniqueArrayMerge;
|
|
|
7019
7208
|
exports.shouldUpdateState = shouldUpdateState;
|
|
7020
7209
|
exports.uniqueArrayMerge = uniqueArrayMerge;
|
|
7021
7210
|
exports.updateEntityInArray = updateEntityInArray;
|
|
7022
|
-
//# sourceMappingURL=
|
|
7211
|
+
//# sourceMappingURL=feeds-client-C09giTf1.js.map
|