@stream-io/feeds-client 0.3.26 → 0.3.28
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 +14 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/react-bindings.js +60 -931
- package/dist/cjs/react-bindings.js.map +1 -1
- package/dist/es/index.mjs +2 -2
- package/dist/es/index.mjs.map +1 -1
- package/dist/es/react-bindings.mjs +9 -885
- package/dist/es/react-bindings.mjs.map +1 -1
- package/dist/{feeds-client-BNiazJbH.mjs → feeds-client-Dr24iZo9.mjs} +8 -9
- package/dist/{feeds-client-BNiazJbH.mjs.map → feeds-client-Dr24iZo9.mjs.map} +1 -1
- package/dist/{feeds-client-K0WzrfH-.js → feeds-client-c90oNdsU.js} +8 -9
- package/dist/{feeds-client-K0WzrfH-.js.map → feeds-client-c90oNdsU.js.map} +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -0
- package/dist/types/activity-with-state-updates/activity-with-state-updates.d.ts +4 -4
- package/dist/types/activity-with-state-updates/activity-with-state-updates.d.ts.map +1 -1
- package/dist/types/activity-with-state-updates/get-feed.d.ts +2 -2
- package/dist/types/bindings/react/contexts/StreamFeedContext.d.ts +2 -2
- package/dist/types/bindings/react/contexts/StreamFeedContext.d.ts.map +1 -1
- package/dist/types/bindings/react/contexts/StreamFeedsContext.d.ts +2 -2
- package/dist/types/bindings/react/contexts/StreamFeedsContext.d.ts.map +1 -1
- package/dist/types/bindings/react/contexts/StreamSearchContext.d.ts +2 -2
- package/dist/types/bindings/react/contexts/StreamSearchContext.d.ts.map +1 -1
- package/dist/types/bindings/react/contexts/StreamSearchResultsContext.d.ts +2 -2
- package/dist/types/bindings/react/contexts/StreamSearchResultsContext.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/client-state-hooks/useClientConnectedUser.d.ts +1 -1
- package/dist/types/bindings/react/hooks/client-state-hooks/useClientConnectedUser.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/client-state-hooks/useWsConnectionState.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useActivityComments.d.ts +5 -3
- package/dist/types/bindings/react/hooks/feed-state-hooks/useActivityComments.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useAggregatedActivities.d.ts +2 -2
- package/dist/types/bindings/react/hooks/feed-state-hooks/useAggregatedActivities.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useComments.d.ts +3 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useComments.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useFeedActivities.d.ts +3 -3
- package/dist/types/bindings/react/hooks/feed-state-hooks/useFeedActivities.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useFeedMetadata.d.ts +2 -2
- package/dist/types/bindings/react/hooks/feed-state-hooks/useFeedMetadata.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useFollowers.d.ts +4 -4
- package/dist/types/bindings/react/hooks/feed-state-hooks/useFollowers.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useFollowing.d.ts +4 -4
- package/dist/types/bindings/react/hooks/feed-state-hooks/useFollowing.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivityRead.d.ts +2 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivityRead.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivitySeen.d.ts +2 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivitySeen.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useNotificationStatus.d.ts +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useNotificationStatus.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useOwnCapabilities.d.ts +2 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useOwnCapabilities.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useOwnFollows.d.ts +2 -2
- package/dist/types/bindings/react/hooks/feed-state-hooks/useOwnFollows.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/search-state-hooks/useSearchQuery.d.ts +1 -1
- package/dist/types/bindings/react/hooks/search-state-hooks/useSearchQuery.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/search-state-hooks/useSearchResult.d.ts +2 -2
- package/dist/types/bindings/react/hooks/search-state-hooks/useSearchResult.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/search-state-hooks/useSearchSources.d.ts +2 -2
- package/dist/types/bindings/react/hooks/search-state-hooks/useSearchSources.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/useCreateFeedsClient.d.ts +4 -1
- package/dist/types/bindings/react/hooks/useCreateFeedsClient.d.ts.map +1 -1
- package/dist/types/bindings/react/wrappers/StreamFeed.d.ts +2 -2
- package/dist/types/bindings/react/wrappers/StreamFeed.d.ts.map +1 -1
- package/dist/types/bindings/react/wrappers/StreamFeeds.d.ts +2 -2
- package/dist/types/bindings/react/wrappers/StreamSearch.d.ts +2 -2
- package/dist/types/bindings/react/wrappers/StreamSearch.d.ts.map +1 -1
- package/dist/types/bindings/react/wrappers/StreamSearchResults.d.ts +2 -2
- package/dist/types/bindings/react/wrappers/StreamSearchResults.d.ts.map +1 -1
- package/dist/types/common/ApiClient.d.ts +3 -3
- package/dist/types/common/EventDispatcher.d.ts +1 -1
- package/dist/types/common/Poll.d.ts +2 -2
- package/dist/types/common/rate-limit.d.ts +1 -1
- package/dist/types/common/real-time/StableWSConnection.d.ts +6 -6
- package/dist/types/common/real-time/event-models.d.ts +2 -1
- package/dist/types/common/real-time/event-models.d.ts.map +1 -1
- package/dist/types/common/search/ActivitySearchSource.d.ts +3 -3
- package/dist/types/common/search/BaseSearchSource.d.ts +2 -2
- package/dist/types/common/search/FeedSearchSource.d.ts +3 -3
- package/dist/types/common/search/SearchController.d.ts +1 -1
- package/dist/types/common/search/UserSearchSource.d.ts +4 -4
- package/dist/types/common/types.d.ts +1 -1
- package/dist/types/feed/event-handlers/activity/handle-activity-added.d.ts +3 -3
- package/dist/types/feed/event-handlers/activity/handle-activity-deleted.d.ts +3 -3
- package/dist/types/feed/event-handlers/activity/handle-activity-feedback.d.ts +2 -2
- package/dist/types/feed/event-handlers/activity/handle-activity-feedback.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/activity/handle-activity-marked.d.ts +3 -3
- package/dist/types/feed/event-handlers/activity/handle-activity-pinned.d.ts +2 -2
- package/dist/types/feed/event-handlers/activity/handle-activity-reaction-added.d.ts +3 -3
- package/dist/types/feed/event-handlers/activity/handle-activity-reaction-deleted.d.ts +3 -3
- package/dist/types/feed/event-handlers/activity/handle-activity-reaction-updated.d.ts +3 -3
- package/dist/types/feed/event-handlers/activity/handle-activity-removed-from-feed.d.ts +2 -2
- package/dist/types/feed/event-handlers/activity/handle-activity-unpinned.d.ts +2 -2
- package/dist/types/feed/event-handlers/activity/handle-activity-updated.d.ts +3 -3
- package/dist/types/feed/event-handlers/activity-updater.d.ts +15 -15
- package/dist/types/feed/event-handlers/add-aggregated-activities-to-state.d.ts +2 -2
- package/dist/types/feed/event-handlers/bookmark/handle-bookmark-added.d.ts +3 -3
- package/dist/types/feed/event-handlers/bookmark/handle-bookmark-deleted.d.ts +3 -3
- package/dist/types/feed/event-handlers/bookmark/handle-bookmark-updated.d.ts +3 -3
- package/dist/types/feed/event-handlers/comment/handle-comment-added.d.ts +2 -2
- package/dist/types/feed/event-handlers/comment/handle-comment-deleted.d.ts +3 -2
- package/dist/types/feed/event-handlers/comment/handle-comment-reaction-added.d.ts +3 -2
- package/dist/types/feed/event-handlers/comment/handle-comment-reaction-deleted.d.ts +3 -2
- package/dist/types/feed/event-handlers/comment/handle-comment-reaction-updated.d.ts +3 -2
- package/dist/types/feed/event-handlers/comment/handle-comment-updated.d.ts +3 -2
- package/dist/types/feed/event-handlers/comment/utils/update-comment-count.d.ts +2 -1
- package/dist/types/feed/event-handlers/comment/utils/update-comment-count.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/feed/handle-feed-updated.d.ts +2 -2
- package/dist/types/feed/event-handlers/feed-member/handle-feed-member-added.d.ts +2 -2
- package/dist/types/feed/event-handlers/feed-member/handle-feed-member-removed.d.ts +2 -2
- package/dist/types/feed/event-handlers/feed-member/handle-feed-member-updated.d.ts +2 -2
- package/dist/types/feed/event-handlers/follow/handle-follow-created.d.ts +3 -3
- package/dist/types/feed/event-handlers/follow/handle-follow-deleted.d.ts +3 -3
- package/dist/types/feed/event-handlers/follow/handle-follow-updated.d.ts +2 -2
- package/dist/types/feed/event-handlers/is-activity-pin.d.ts +1 -1
- package/dist/types/feed/event-handlers/notification-feed/handle-notification-feed-updated.d.ts +3 -3
- package/dist/types/feed/event-handlers/story-feeds/handle-story-feeds-updated.d.ts +3 -3
- package/dist/types/feed/event-handlers/watch/handle-watch-started.d.ts +1 -1
- package/dist/types/feed/event-handlers/watch/handle-watch-stopped.d.ts +1 -1
- package/dist/types/feed/feed.d.ts +9 -9
- package/dist/types/feeds-client/active-activity.d.ts +1 -1
- package/dist/types/feeds-client/event-handlers/user/handle-user-updated.d.ts +2 -2
- package/dist/types/feeds-client/feeds-client.d.ts +22 -22
- package/dist/types/feeds-client/feeds-client.d.ts.map +1 -1
- package/dist/types/feeds-client/get-or-create-active-feed.d.ts +2 -2
- package/dist/types/gen/feeds/FeedApi.d.ts +2 -2
- package/dist/types/gen/feeds/FeedsApi.d.ts +2 -2
- package/dist/types/gen/model-decoders/event-decoder-mapping.d.ts +1 -1
- package/dist/types/gen/models/index.d.ts +1 -1
- package/dist/types/gen/models/index.d.ts.map +1 -1
- package/dist/types/gen/moderation/ModerationApi.d.ts +2 -2
- package/dist/types/types-internal.d.ts +1 -1
- package/dist/types/types.d.ts +5 -4
- package/dist/types/utils/check-own-fields-equality.d.ts +2 -2
- package/dist/types/utils/event-triggered-by-connected-user.d.ts +2 -2
- package/dist/types/utils/own-feed-fields.d.ts +1 -1
- package/dist/types/utils/state-update-queue.d.ts +4 -4
- package/dist/types/utils/throttling/throttled-get-batched-own-capabilities.d.ts +2 -2
- package/dist/types/utils/throttling/throttled-get-batched-own-capabilities.d.ts.map +1 -1
- package/dist/types/utils/type-assertions.d.ts +2 -2
- package/package.json +11 -12
- package/src/activity-with-state-updates/activity-with-state-updates.ts +2 -2
- package/src/bindings/react/contexts/StreamFeedContext.tsx +2 -1
- package/src/bindings/react/contexts/StreamFeedsContext.tsx +2 -1
- package/src/bindings/react/contexts/StreamSearchContext.tsx +2 -1
- package/src/bindings/react/contexts/StreamSearchResultsContext.tsx +2 -1
- package/src/bindings/react/hooks/client-state-hooks/useClientConnectedUser.ts +2 -1
- package/src/bindings/react/hooks/client-state-hooks/useWsConnectionState.ts +2 -1
- package/src/bindings/react/hooks/feed-state-hooks/useActivityComments.ts +7 -11
- package/src/bindings/react/hooks/feed-state-hooks/useAggregatedActivities.ts +3 -2
- package/src/bindings/react/hooks/feed-state-hooks/useComments.ts +5 -9
- package/src/bindings/react/hooks/feed-state-hooks/useFeedActivities.ts +4 -3
- package/src/bindings/react/hooks/feed-state-hooks/useFeedMetadata.ts +3 -2
- package/src/bindings/react/hooks/feed-state-hooks/useFollowers.ts +2 -1
- package/src/bindings/react/hooks/feed-state-hooks/useFollowing.ts +3 -1
- package/src/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivityRead.ts +4 -2
- package/src/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivitySeen.ts +4 -2
- package/src/bindings/react/hooks/feed-state-hooks/useNotificationStatus.ts +3 -1
- package/src/bindings/react/hooks/feed-state-hooks/useOwnCapabilities.ts +5 -2
- package/src/bindings/react/hooks/feed-state-hooks/useOwnFollows.ts +3 -2
- package/src/bindings/react/hooks/search-state-hooks/useSearchQuery.ts +6 -2
- package/src/bindings/react/hooks/search-state-hooks/useSearchResult.ts +4 -2
- package/src/bindings/react/hooks/search-state-hooks/useSearchSources.ts +3 -5
- package/src/bindings/react/hooks/useCreateFeedsClient.ts +5 -6
- package/src/bindings/react/wrappers/StreamFeed.tsx +2 -1
- package/src/bindings/react/wrappers/StreamSearch.tsx +2 -1
- package/src/bindings/react/wrappers/StreamSearchResults.tsx +2 -1
- package/src/common/real-time/event-models.ts +2 -2
- package/src/feed/event-handlers/activity/handle-activity-feedback.ts +4 -8
- package/src/feed/event-handlers/comment/utils/update-comment-count.ts +2 -2
- package/src/feeds-client/feeds-client.ts +10 -12
- package/src/gen/models/index.ts +2 -2
- package/src/utils/throttling/throttled-get-batched-own-capabilities.ts +1 -1
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stream-io/feeds-client",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.28",
|
|
4
4
|
"packageManager": "yarn@3.2.4",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/es/index.mjs",
|
|
7
|
+
"types": "./dist/types/index.d.ts",
|
|
7
8
|
"exports": {
|
|
8
9
|
".": {
|
|
9
10
|
"types": "./dist/types/index.d.ts",
|
|
@@ -13,7 +14,7 @@
|
|
|
13
14
|
},
|
|
14
15
|
"import": "./dist/es/index.mjs",
|
|
15
16
|
"require": "./dist/cjs/index.js",
|
|
16
|
-
"default": "./dist/
|
|
17
|
+
"default": "./dist/cjs/index.js"
|
|
17
18
|
},
|
|
18
19
|
"./react-bindings": {
|
|
19
20
|
"types": "./dist/types/bindings/react/index.d.ts",
|
|
@@ -23,15 +24,14 @@
|
|
|
23
24
|
},
|
|
24
25
|
"import": "./dist/es/react-bindings.mjs",
|
|
25
26
|
"require": "./dist/cjs/react-bindings.js",
|
|
26
|
-
"default": "./dist/
|
|
27
|
+
"default": "./dist/cjs/react-bindings.js"
|
|
27
28
|
}
|
|
28
29
|
},
|
|
29
|
-
"types": "./dist/types/index.d.ts",
|
|
30
30
|
"license": "See license in LICENSE",
|
|
31
31
|
"scripts": {
|
|
32
32
|
"clean": "rimraf dist",
|
|
33
|
-
"start": "vite build --watch",
|
|
34
|
-
"build": "vite build",
|
|
33
|
+
"start": "yarn clean; concurrently 'vite build --watch' 'tsc -p tsconfig.lib.json --watch'",
|
|
34
|
+
"build": "yarn clean; concurrently 'vite build' 'tsc -p tsconfig.lib.json'",
|
|
35
35
|
"test": "vitest",
|
|
36
36
|
"test:unit": "vitest --exclude '__integration-tests__/**'",
|
|
37
37
|
"test-ci": "vitest --exclude '__integration-tests__/docs-snippets/**' --coverage",
|
|
@@ -56,19 +56,18 @@
|
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@stream-io/node-sdk": "0.6.0",
|
|
59
|
-
"@types/react": "
|
|
59
|
+
"@types/react": "~19.1.0",
|
|
60
60
|
"@vitest/coverage-v8": "3.2.4",
|
|
61
|
+
"concurrently": "^9.2.1",
|
|
61
62
|
"dotenv": "^16.4.5",
|
|
62
63
|
"human-id": "^4.1.1",
|
|
63
|
-
"react": "19.0.0",
|
|
64
64
|
"rimraf": "^6.0.1",
|
|
65
|
-
"typescript": "^5.
|
|
66
|
-
"vite": "^7
|
|
67
|
-
"vite-plugin-dts": "^4.5.4",
|
|
65
|
+
"typescript": "^5.9.3",
|
|
66
|
+
"vite": "^7",
|
|
68
67
|
"vitest": "^3.2.4"
|
|
69
68
|
},
|
|
70
69
|
"peerDependencies": {
|
|
71
|
-
"react": "^18 || ^19"
|
|
70
|
+
"react": "^17 || ^18 || ^19"
|
|
72
71
|
},
|
|
73
72
|
"peerDependenciesMeta": {
|
|
74
73
|
"react": {
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
disconnectActivityFromFeed,
|
|
8
8
|
isAnyFeedWatched,
|
|
9
9
|
} from '../feeds-client/active-activity';
|
|
10
|
-
import type { GetCommentsRequest } from '
|
|
10
|
+
import type { GetCommentsRequest } from '../types';
|
|
11
11
|
import { deepEqual } from '../utils/deep-equal';
|
|
12
12
|
|
|
13
13
|
type GetActivityConfig = {
|
|
@@ -164,7 +164,7 @@ export class ActivityWithStateUpdates {
|
|
|
164
164
|
}) {
|
|
165
165
|
this.feed = connectActivityToFeed.call(this.feedsClient, { fid });
|
|
166
166
|
|
|
167
|
-
this.feed
|
|
167
|
+
this.feed?.state.partialNext({
|
|
168
168
|
activities: [initialState],
|
|
169
169
|
});
|
|
170
170
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { FeedsClientState } from '@self';
|
|
2
1
|
import { useStateStore } from '@stream-io/state-store/react-bindings';
|
|
2
|
+
|
|
3
3
|
import { useFeedsClient } from '../../contexts/StreamFeedsContext';
|
|
4
|
+
import type { FeedsClientState } from '../../../../feeds-client';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* A React hook that returns the currently connected user on a `FeedsClient` instance and null otherwise.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { FeedsClientState } from '@self';
|
|
2
1
|
import { useStateStore } from '@stream-io/state-store/react-bindings';
|
|
2
|
+
|
|
3
3
|
import { useFeedsClient } from '../../contexts/StreamFeedsContext';
|
|
4
|
+
import type { FeedsClientState } from '../../../../feeds-client';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* A React hook that returns the websocket connection state of `FeedsClient`.
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { useCallback, useMemo } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
type ActivityResponse,
|
|
4
|
-
type CommentResponse,
|
|
5
|
-
type Feed,
|
|
6
|
-
type FeedState,
|
|
7
|
-
checkHasAnotherPage,
|
|
8
|
-
type ActivityWithStateUpdates,
|
|
9
|
-
type ActivityState,
|
|
10
|
-
type StateStore,
|
|
11
|
-
} from '@self';
|
|
12
|
-
import { useFeedContext } from '../../contexts/StreamFeedContext';
|
|
13
2
|
import { useStateStore } from '@stream-io/state-store/react-bindings';
|
|
3
|
+
import type { StateStore } from '@stream-io/state-store';
|
|
4
|
+
|
|
5
|
+
import { useFeedContext } from '../../contexts/StreamFeedContext';
|
|
6
|
+
import { checkHasAnotherPage } from '../../../../utils';
|
|
7
|
+
import type { Feed, FeedState } from '../../../../feed';
|
|
8
|
+
import type { ActivityState, ActivityWithStateUpdates } from '../../../../activity-with-state-updates/activity-with-state-updates';
|
|
9
|
+
import type { ActivityResponse, CommentResponse } from '../../../../gen/models';
|
|
14
10
|
|
|
15
11
|
const canLoadComments = (
|
|
16
12
|
feedOrActivity: Feed | ActivityResponse | ActivityWithStateUpdates,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
2
|
import { useStateStore } from '@stream-io/state-store/react-bindings';
|
|
3
|
+
|
|
3
4
|
import { useFeedContext } from '../../contexts/StreamFeedContext';
|
|
4
|
-
import { useMemo } from 'react';
|
|
5
5
|
import { useStableCallback } from '../internal';
|
|
6
|
+
import type { Feed, FeedState } from '../../../../feed';
|
|
6
7
|
|
|
7
8
|
const selector = ({
|
|
8
9
|
is_loading_activities,
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import { useCallback, useMemo } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
type ActivityResponse,
|
|
4
|
-
type CommentResponse,
|
|
5
|
-
type CommentParent,
|
|
6
|
-
type Feed,
|
|
7
|
-
type FeedState,
|
|
8
|
-
checkHasAnotherPage,
|
|
9
|
-
isCommentResponse,
|
|
10
|
-
} from '@self';
|
|
11
2
|
import { useStateStore } from '@stream-io/state-store/react-bindings';
|
|
3
|
+
|
|
12
4
|
import { useFeedContext } from '../../contexts/StreamFeedContext';
|
|
5
|
+
import { checkHasAnotherPage, isCommentResponse } from '../../../../utils';
|
|
6
|
+
import type { ActivityResponse, CommentResponse } from '../../../../gen/models';
|
|
7
|
+
import type { Feed, FeedState } from '../../../../feed';
|
|
8
|
+
import type { CommentParent } from '../../../../types';
|
|
13
9
|
|
|
14
10
|
type UseCommentsReturnType<T extends ActivityResponse | CommentResponse> = {
|
|
15
11
|
comments: NonNullable<
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { useFeedContext } from '../../contexts/StreamFeedContext';
|
|
2
|
-
import type { Feed, FeedState } from '@self';
|
|
3
|
-
import { useStateStore } from '@stream-io/state-store/react-bindings';
|
|
4
1
|
import { useMemo } from 'react';
|
|
2
|
+
import { useStateStore } from '@stream-io/state-store/react-bindings';
|
|
3
|
+
|
|
4
|
+
import { useFeedContext } from '../../contexts/StreamFeedContext';
|
|
5
5
|
import { useStableCallback } from '../internal';
|
|
6
|
+
import type { Feed, FeedState } from '../../../../feed';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* A React hook that returns a reactive object containing the current activities,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { Feed, FeedState } from '@self';
|
|
2
|
-
import { useFeedContext } from '../../contexts/StreamFeedContext';
|
|
3
1
|
import { useStateStore } from '@stream-io/state-store/react-bindings';
|
|
4
2
|
|
|
3
|
+
import { useFeedContext } from '../../contexts/StreamFeedContext';
|
|
4
|
+
import type { Feed, FeedState } from '../../../../feed';
|
|
5
|
+
|
|
5
6
|
/**
|
|
6
7
|
* A React hook that returns a reactive object containing some often used
|
|
7
8
|
* metadata for a feed.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useCallback, useMemo } from 'react';
|
|
2
|
-
import { type Feed, type FeedState, checkHasAnotherPage } from '@self';
|
|
3
2
|
import { useStateStore } from '@stream-io/state-store/react-bindings';
|
|
4
3
|
import { useFeedContext } from '../../contexts/StreamFeedContext';
|
|
4
|
+
import type { Feed, FeedState } from '../../../../feed';
|
|
5
|
+
import { checkHasAnotherPage } from '../../../../utils';
|
|
5
6
|
|
|
6
7
|
const selector = ({
|
|
7
8
|
follower_count,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { useCallback, useMemo } from 'react';
|
|
2
|
-
import { type Feed, type FeedState, checkHasAnotherPage } from '@self';
|
|
3
2
|
import { useStateStore } from '@stream-io/state-store/react-bindings';
|
|
3
|
+
|
|
4
4
|
import { useFeedContext } from '../../contexts/StreamFeedContext';
|
|
5
|
+
import { checkHasAnotherPage } from '../../../../utils';
|
|
6
|
+
import type { Feed, FeedState } from '../../../../feed';
|
|
5
7
|
|
|
6
8
|
const selector = ({
|
|
7
9
|
following_count,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
|
|
1
3
|
import { useFeedContext } from '../../contexts/StreamFeedContext';
|
|
2
4
|
import { useNotificationStatus } from './useNotificationStatus';
|
|
3
|
-
import {
|
|
4
|
-
import type { AggregatedActivityResponse
|
|
5
|
+
import type { Feed } from '../../../../feed';
|
|
6
|
+
import type { AggregatedActivityResponse } from '../../../../gen/models';
|
|
5
7
|
|
|
6
8
|
export const useIsAggregatedActivityRead = ({
|
|
7
9
|
feed: feedFromProps,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
|
|
1
3
|
import { useFeedContext } from '../../contexts/StreamFeedContext';
|
|
2
4
|
import { useNotificationStatus } from './useNotificationStatus';
|
|
3
|
-
import {
|
|
4
|
-
import type { AggregatedActivityResponse
|
|
5
|
+
import type { Feed } from '../../../../feed';
|
|
6
|
+
import type { AggregatedActivityResponse } from '../../../../gen/models';
|
|
5
7
|
|
|
6
8
|
export const useIsAggregatedActivitySeen = ({
|
|
7
9
|
feed: feedFromProps,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import type { Feed, FeedState, NotificationStatusResponse } from '@self';
|
|
2
1
|
import { useStateStore } from '@stream-io/state-store/react-bindings';
|
|
2
|
+
|
|
3
3
|
import { useFeedContext } from '../../contexts/StreamFeedContext';
|
|
4
|
+
import type { Feed, FeedState } from '../../../../feed';
|
|
5
|
+
import type { NotificationStatusResponse } from '../../../../gen/models';
|
|
4
6
|
|
|
5
7
|
const selector = ({ notification_status }: FeedState) =>
|
|
6
8
|
({
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
2
|
import { useStateStore } from '@stream-io/state-store/react-bindings';
|
|
3
|
+
|
|
3
4
|
import { useFeedContext } from '../../contexts/StreamFeedContext';
|
|
4
5
|
import { useFeedsClient } from '../../contexts/StreamFeedsContext';
|
|
5
|
-
import {
|
|
6
|
+
import type { Feed } from '../../../../feed';
|
|
7
|
+
import type { FeedOwnCapability } from '../../../../gen/models';
|
|
8
|
+
import type { FeedsClientState } from '../../../../feeds-client';
|
|
6
9
|
|
|
7
10
|
const stableEmptyArray: readonly FeedOwnCapability[] = [];
|
|
8
11
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { Feed, FeedState } from '@self';
|
|
2
|
-
import { useFeedContext } from '../../contexts/StreamFeedContext';
|
|
3
1
|
import { useStateStore } from '@stream-io/state-store/react-bindings';
|
|
4
2
|
|
|
3
|
+
import { useFeedContext } from '../../contexts/StreamFeedContext';
|
|
4
|
+
import type { Feed, FeedState } from '../../../../feed';
|
|
5
|
+
|
|
5
6
|
/**
|
|
6
7
|
* A React hook that returns a reactive array of feeds that the current user
|
|
7
8
|
* owns and are following the respective feed that we are observing.
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import type { SearchController, SearchControllerState } from '@self';
|
|
2
|
-
import { useSearchContext } from '../../contexts/StreamSearchContext';
|
|
3
1
|
import { useStateStore } from '@stream-io/state-store/react-bindings';
|
|
4
2
|
|
|
3
|
+
import type {
|
|
4
|
+
SearchController,
|
|
5
|
+
SearchControllerState,
|
|
6
|
+
} from '../../../../common/search';
|
|
7
|
+
import { useSearchContext } from '../../contexts/StreamSearchContext';
|
|
8
|
+
|
|
5
9
|
export const useSearchQuery = (controllerFromProps?: SearchController) => {
|
|
6
10
|
const controllerFromState = useSearchContext();
|
|
7
11
|
const controller = controllerFromProps ?? controllerFromState;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import type { SearchSource, SearchSourceState } from '@self';
|
|
2
1
|
import { useMemo } from 'react';
|
|
3
|
-
import { useSearchResultsContext } from '../../contexts/StreamSearchResultsContext';
|
|
4
2
|
import { useStateStore } from '@stream-io/state-store/react-bindings';
|
|
3
|
+
|
|
4
|
+
import { useSearchResultsContext } from '../../contexts/StreamSearchResultsContext';
|
|
5
5
|
import { useStableCallback } from '../internal';
|
|
6
|
+
import type { SearchSourceState } from '../../../../common/types';
|
|
7
|
+
import type { SearchSource } from '../../../../common/search';
|
|
6
8
|
|
|
7
9
|
export const useSearchResult = (sourceFromProps?: SearchSource) => {
|
|
8
10
|
const sourceFromContext = useSearchResultsContext();
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
SearchController,
|
|
3
|
-
SearchControllerState,
|
|
4
|
-
} from '@self';
|
|
5
|
-
import { useSearchContext } from '../../contexts/StreamSearchContext';
|
|
6
1
|
import { useStateStore } from '@stream-io/state-store/react-bindings';
|
|
7
2
|
|
|
3
|
+
import { useSearchContext } from '../../contexts/StreamSearchContext';
|
|
4
|
+
import type { SearchController, SearchControllerState } from '../../../../common/search';
|
|
5
|
+
|
|
8
6
|
export const useSearchSources = (controllerFromProps?: SearchController) => {
|
|
9
7
|
const controllerFromState = useSearchContext();
|
|
10
8
|
const controller = controllerFromProps ?? controllerFromState;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from '@self';
|
|
2
|
+
|
|
3
|
+
import { FeedsClient } from '../../../feeds-client';
|
|
4
|
+
import type { TokenOrProvider } from '../../../types';
|
|
5
|
+
import type { UserRequest } from '../../../gen/models';
|
|
6
|
+
import type { FeedsClientOptions } from '../../../common/types';
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* A React hook to create, connect and return an instance of `FeedsClient`.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { PropsWithChildren } from 'react';
|
|
2
|
+
|
|
2
3
|
import { StreamFeedContext } from '../contexts/StreamFeedContext';
|
|
3
|
-
import type { Feed } from '
|
|
4
|
+
import type { Feed } from '../../../feed';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* The props for the StreamFeed component. It accepts a `Feed` instance.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { PropsWithChildren } from 'react';
|
|
2
|
+
|
|
2
3
|
import { StreamSearchContext } from '../contexts/StreamSearchContext';
|
|
3
|
-
import type { SearchController } from '
|
|
4
|
+
import type { SearchController } from '../../../common/search';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* The props for the StreamSearch component. It accepts a `SearchController` instance.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { PropsWithChildren } from 'react';
|
|
2
|
+
|
|
2
3
|
import { StreamSearchResultsContext } from '../contexts/StreamSearchResultsContext';
|
|
3
|
-
import type { SearchSource } from '
|
|
4
|
+
import type { SearchSource } from '../../../common/search';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* The props for the StreamSearchResults component. It accepts a `SearchSource` instance.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ConnectedUser } from '
|
|
2
|
-
import type { StreamApiError } from '
|
|
1
|
+
import type { ConnectedUser } from '../../types';
|
|
2
|
+
import type { StreamApiError } from '../types';
|
|
3
3
|
|
|
4
4
|
export interface ConnectionChangedEvent {
|
|
5
5
|
type: 'connection.changed';
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
updateEntityInArray,
|
|
3
|
-
type ActivityFeedbackEventPayload,
|
|
4
|
-
type ActivityPinResponse,
|
|
5
|
-
type ActivityResponse,
|
|
6
|
-
type Feed,
|
|
7
|
-
} from '@self';
|
|
8
|
-
import type { EventPayload } from '../../../types-internal';
|
|
1
|
+
import { updateEntityInArray } from '../../../utils';
|
|
9
2
|
import { isPin } from '../is-activity-pin';
|
|
3
|
+
import type { Feed } from '../../feed';
|
|
4
|
+
import type { EventPayload } from '../../../types-internal';
|
|
5
|
+
import type { ActivityFeedbackEventPayload, ActivityPinResponse, ActivityResponse } from '../../../gen/models';
|
|
10
6
|
|
|
11
7
|
const updateActivityFromFeedback = <
|
|
12
8
|
T extends ActivityResponse | ActivityPinResponse,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ActivityResponse, Feed } from '@self';
|
|
2
|
-
import type { CommentResponse } from '@self';
|
|
3
1
|
import { handleCommentUpdated } from '../handle-comment-updated';
|
|
4
2
|
import { handleActivityUpdated } from '../../activity';
|
|
3
|
+
import type { Feed } from '../../../feed';
|
|
4
|
+
import type { ActivityResponse, CommentResponse } from '../../../../gen/models';
|
|
5
5
|
|
|
6
6
|
export function updateCommentCount(
|
|
7
7
|
this: Feed,
|
|
@@ -17,6 +17,7 @@ import type {
|
|
|
17
17
|
FollowResponse,
|
|
18
18
|
GetFollowSuggestionsResponse,
|
|
19
19
|
GetOrCreateFeedRequest,
|
|
20
|
+
ImageSize,
|
|
20
21
|
ImageUploadRequest,
|
|
21
22
|
OwnBatchRequest,
|
|
22
23
|
PollResponse,
|
|
@@ -213,7 +214,7 @@ export class FeedsClient extends FeedsApi {
|
|
|
213
214
|
for (const activeFeed of this.allActiveFeeds) {
|
|
214
215
|
const currentActivities = activeFeed.currentState.activities;
|
|
215
216
|
if (currentActivities) {
|
|
216
|
-
const newActivities = [];
|
|
217
|
+
const newActivities: ActivityResponse[] = [];
|
|
217
218
|
let changed = false;
|
|
218
219
|
for (const activity of currentActivities) {
|
|
219
220
|
if (activity.poll?.id === event.poll.id) {
|
|
@@ -347,7 +348,7 @@ export class FeedsClient extends FeedsApi {
|
|
|
347
348
|
...Object.values(this.activeActivities)
|
|
348
349
|
.filter((a) => !!getFeed.call(a))
|
|
349
350
|
.map((a) => getFeed.call(a)!),
|
|
350
|
-
];
|
|
351
|
+
] as Feed[];
|
|
351
352
|
}
|
|
352
353
|
|
|
353
354
|
public pollFromState = (id: string) => this.polls_by_id.get(id);
|
|
@@ -450,25 +451,22 @@ export class FeedsClient extends FeedsApi {
|
|
|
450
451
|
});
|
|
451
452
|
};
|
|
452
453
|
|
|
453
|
-
// @ts-expect-error API spec says file should be a string
|
|
454
454
|
uploadFile = (
|
|
455
|
-
request
|
|
455
|
+
request?: Omit<FileUploadRequest, 'file'> & { file?: StreamFile | string },
|
|
456
456
|
) => {
|
|
457
457
|
return super.uploadFile({
|
|
458
|
-
|
|
459
|
-
file: request.file,
|
|
458
|
+
file: request?.file as string,
|
|
460
459
|
});
|
|
461
460
|
};
|
|
462
461
|
|
|
463
|
-
// @ts-expect-error API spec says file should be a string
|
|
464
462
|
uploadImage = (
|
|
465
|
-
request
|
|
463
|
+
request?: Omit<ImageUploadRequest, 'file'> & { file?: StreamFile | string },
|
|
466
464
|
) => {
|
|
467
465
|
return super.uploadImage({
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
466
|
+
file: request?.file as string,
|
|
467
|
+
upload_sizes: JSON.stringify(
|
|
468
|
+
request?.upload_sizes,
|
|
469
|
+
) as unknown as ImageSize[],
|
|
472
470
|
});
|
|
473
471
|
};
|
|
474
472
|
|
package/src/gen/models/index.ts
CHANGED
|
@@ -2415,6 +2415,8 @@ export interface EnrichedReaction {
|
|
|
2415
2415
|
}
|
|
2416
2416
|
|
|
2417
2417
|
export interface EnrichmentOptions {
|
|
2418
|
+
enrich_own_followings?: boolean;
|
|
2419
|
+
|
|
2418
2420
|
skip_activity?: boolean;
|
|
2419
2421
|
|
|
2420
2422
|
skip_activity_collections?: boolean;
|
|
@@ -2445,8 +2447,6 @@ export interface EnrichmentOptions {
|
|
|
2445
2447
|
|
|
2446
2448
|
skip_own_capabilities?: boolean;
|
|
2447
2449
|
|
|
2448
|
-
skip_own_followings?: boolean;
|
|
2449
|
-
|
|
2450
2450
|
skip_own_follows?: boolean;
|
|
2451
2451
|
|
|
2452
2452
|
skip_pins?: boolean;
|