@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.
Files changed (171) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/index.js +1 -1
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/react-bindings.js +60 -931
  5. package/dist/cjs/react-bindings.js.map +1 -1
  6. package/dist/es/index.mjs +2 -2
  7. package/dist/es/index.mjs.map +1 -1
  8. package/dist/es/react-bindings.mjs +9 -885
  9. package/dist/es/react-bindings.mjs.map +1 -1
  10. package/dist/{feeds-client-BNiazJbH.mjs → feeds-client-Dr24iZo9.mjs} +8 -9
  11. package/dist/{feeds-client-BNiazJbH.mjs.map → feeds-client-Dr24iZo9.mjs.map} +1 -1
  12. package/dist/{feeds-client-K0WzrfH-.js → feeds-client-c90oNdsU.js} +8 -9
  13. package/dist/{feeds-client-K0WzrfH-.js.map → feeds-client-c90oNdsU.js.map} +1 -1
  14. package/dist/tsconfig.lib.tsbuildinfo +1 -0
  15. package/dist/types/activity-with-state-updates/activity-with-state-updates.d.ts +4 -4
  16. package/dist/types/activity-with-state-updates/activity-with-state-updates.d.ts.map +1 -1
  17. package/dist/types/activity-with-state-updates/get-feed.d.ts +2 -2
  18. package/dist/types/bindings/react/contexts/StreamFeedContext.d.ts +2 -2
  19. package/dist/types/bindings/react/contexts/StreamFeedContext.d.ts.map +1 -1
  20. package/dist/types/bindings/react/contexts/StreamFeedsContext.d.ts +2 -2
  21. package/dist/types/bindings/react/contexts/StreamFeedsContext.d.ts.map +1 -1
  22. package/dist/types/bindings/react/contexts/StreamSearchContext.d.ts +2 -2
  23. package/dist/types/bindings/react/contexts/StreamSearchContext.d.ts.map +1 -1
  24. package/dist/types/bindings/react/contexts/StreamSearchResultsContext.d.ts +2 -2
  25. package/dist/types/bindings/react/contexts/StreamSearchResultsContext.d.ts.map +1 -1
  26. package/dist/types/bindings/react/hooks/client-state-hooks/useClientConnectedUser.d.ts +1 -1
  27. package/dist/types/bindings/react/hooks/client-state-hooks/useClientConnectedUser.d.ts.map +1 -1
  28. package/dist/types/bindings/react/hooks/client-state-hooks/useWsConnectionState.d.ts.map +1 -1
  29. package/dist/types/bindings/react/hooks/feed-state-hooks/useActivityComments.d.ts +5 -3
  30. package/dist/types/bindings/react/hooks/feed-state-hooks/useActivityComments.d.ts.map +1 -1
  31. package/dist/types/bindings/react/hooks/feed-state-hooks/useAggregatedActivities.d.ts +2 -2
  32. package/dist/types/bindings/react/hooks/feed-state-hooks/useAggregatedActivities.d.ts.map +1 -1
  33. package/dist/types/bindings/react/hooks/feed-state-hooks/useComments.d.ts +3 -1
  34. package/dist/types/bindings/react/hooks/feed-state-hooks/useComments.d.ts.map +1 -1
  35. package/dist/types/bindings/react/hooks/feed-state-hooks/useFeedActivities.d.ts +3 -3
  36. package/dist/types/bindings/react/hooks/feed-state-hooks/useFeedActivities.d.ts.map +1 -1
  37. package/dist/types/bindings/react/hooks/feed-state-hooks/useFeedMetadata.d.ts +2 -2
  38. package/dist/types/bindings/react/hooks/feed-state-hooks/useFeedMetadata.d.ts.map +1 -1
  39. package/dist/types/bindings/react/hooks/feed-state-hooks/useFollowers.d.ts +4 -4
  40. package/dist/types/bindings/react/hooks/feed-state-hooks/useFollowers.d.ts.map +1 -1
  41. package/dist/types/bindings/react/hooks/feed-state-hooks/useFollowing.d.ts +4 -4
  42. package/dist/types/bindings/react/hooks/feed-state-hooks/useFollowing.d.ts.map +1 -1
  43. package/dist/types/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivityRead.d.ts +2 -1
  44. package/dist/types/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivityRead.d.ts.map +1 -1
  45. package/dist/types/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivitySeen.d.ts +2 -1
  46. package/dist/types/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivitySeen.d.ts.map +1 -1
  47. package/dist/types/bindings/react/hooks/feed-state-hooks/useNotificationStatus.d.ts +1 -1
  48. package/dist/types/bindings/react/hooks/feed-state-hooks/useNotificationStatus.d.ts.map +1 -1
  49. package/dist/types/bindings/react/hooks/feed-state-hooks/useOwnCapabilities.d.ts +2 -1
  50. package/dist/types/bindings/react/hooks/feed-state-hooks/useOwnCapabilities.d.ts.map +1 -1
  51. package/dist/types/bindings/react/hooks/feed-state-hooks/useOwnFollows.d.ts +2 -2
  52. package/dist/types/bindings/react/hooks/feed-state-hooks/useOwnFollows.d.ts.map +1 -1
  53. package/dist/types/bindings/react/hooks/search-state-hooks/useSearchQuery.d.ts +1 -1
  54. package/dist/types/bindings/react/hooks/search-state-hooks/useSearchQuery.d.ts.map +1 -1
  55. package/dist/types/bindings/react/hooks/search-state-hooks/useSearchResult.d.ts +2 -2
  56. package/dist/types/bindings/react/hooks/search-state-hooks/useSearchResult.d.ts.map +1 -1
  57. package/dist/types/bindings/react/hooks/search-state-hooks/useSearchSources.d.ts +2 -2
  58. package/dist/types/bindings/react/hooks/search-state-hooks/useSearchSources.d.ts.map +1 -1
  59. package/dist/types/bindings/react/hooks/useCreateFeedsClient.d.ts +4 -1
  60. package/dist/types/bindings/react/hooks/useCreateFeedsClient.d.ts.map +1 -1
  61. package/dist/types/bindings/react/wrappers/StreamFeed.d.ts +2 -2
  62. package/dist/types/bindings/react/wrappers/StreamFeed.d.ts.map +1 -1
  63. package/dist/types/bindings/react/wrappers/StreamFeeds.d.ts +2 -2
  64. package/dist/types/bindings/react/wrappers/StreamSearch.d.ts +2 -2
  65. package/dist/types/bindings/react/wrappers/StreamSearch.d.ts.map +1 -1
  66. package/dist/types/bindings/react/wrappers/StreamSearchResults.d.ts +2 -2
  67. package/dist/types/bindings/react/wrappers/StreamSearchResults.d.ts.map +1 -1
  68. package/dist/types/common/ApiClient.d.ts +3 -3
  69. package/dist/types/common/EventDispatcher.d.ts +1 -1
  70. package/dist/types/common/Poll.d.ts +2 -2
  71. package/dist/types/common/rate-limit.d.ts +1 -1
  72. package/dist/types/common/real-time/StableWSConnection.d.ts +6 -6
  73. package/dist/types/common/real-time/event-models.d.ts +2 -1
  74. package/dist/types/common/real-time/event-models.d.ts.map +1 -1
  75. package/dist/types/common/search/ActivitySearchSource.d.ts +3 -3
  76. package/dist/types/common/search/BaseSearchSource.d.ts +2 -2
  77. package/dist/types/common/search/FeedSearchSource.d.ts +3 -3
  78. package/dist/types/common/search/SearchController.d.ts +1 -1
  79. package/dist/types/common/search/UserSearchSource.d.ts +4 -4
  80. package/dist/types/common/types.d.ts +1 -1
  81. package/dist/types/feed/event-handlers/activity/handle-activity-added.d.ts +3 -3
  82. package/dist/types/feed/event-handlers/activity/handle-activity-deleted.d.ts +3 -3
  83. package/dist/types/feed/event-handlers/activity/handle-activity-feedback.d.ts +2 -2
  84. package/dist/types/feed/event-handlers/activity/handle-activity-feedback.d.ts.map +1 -1
  85. package/dist/types/feed/event-handlers/activity/handle-activity-marked.d.ts +3 -3
  86. package/dist/types/feed/event-handlers/activity/handle-activity-pinned.d.ts +2 -2
  87. package/dist/types/feed/event-handlers/activity/handle-activity-reaction-added.d.ts +3 -3
  88. package/dist/types/feed/event-handlers/activity/handle-activity-reaction-deleted.d.ts +3 -3
  89. package/dist/types/feed/event-handlers/activity/handle-activity-reaction-updated.d.ts +3 -3
  90. package/dist/types/feed/event-handlers/activity/handle-activity-removed-from-feed.d.ts +2 -2
  91. package/dist/types/feed/event-handlers/activity/handle-activity-unpinned.d.ts +2 -2
  92. package/dist/types/feed/event-handlers/activity/handle-activity-updated.d.ts +3 -3
  93. package/dist/types/feed/event-handlers/activity-updater.d.ts +15 -15
  94. package/dist/types/feed/event-handlers/add-aggregated-activities-to-state.d.ts +2 -2
  95. package/dist/types/feed/event-handlers/bookmark/handle-bookmark-added.d.ts +3 -3
  96. package/dist/types/feed/event-handlers/bookmark/handle-bookmark-deleted.d.ts +3 -3
  97. package/dist/types/feed/event-handlers/bookmark/handle-bookmark-updated.d.ts +3 -3
  98. package/dist/types/feed/event-handlers/comment/handle-comment-added.d.ts +2 -2
  99. package/dist/types/feed/event-handlers/comment/handle-comment-deleted.d.ts +3 -2
  100. package/dist/types/feed/event-handlers/comment/handle-comment-reaction-added.d.ts +3 -2
  101. package/dist/types/feed/event-handlers/comment/handle-comment-reaction-deleted.d.ts +3 -2
  102. package/dist/types/feed/event-handlers/comment/handle-comment-reaction-updated.d.ts +3 -2
  103. package/dist/types/feed/event-handlers/comment/handle-comment-updated.d.ts +3 -2
  104. package/dist/types/feed/event-handlers/comment/utils/update-comment-count.d.ts +2 -1
  105. package/dist/types/feed/event-handlers/comment/utils/update-comment-count.d.ts.map +1 -1
  106. package/dist/types/feed/event-handlers/feed/handle-feed-updated.d.ts +2 -2
  107. package/dist/types/feed/event-handlers/feed-member/handle-feed-member-added.d.ts +2 -2
  108. package/dist/types/feed/event-handlers/feed-member/handle-feed-member-removed.d.ts +2 -2
  109. package/dist/types/feed/event-handlers/feed-member/handle-feed-member-updated.d.ts +2 -2
  110. package/dist/types/feed/event-handlers/follow/handle-follow-created.d.ts +3 -3
  111. package/dist/types/feed/event-handlers/follow/handle-follow-deleted.d.ts +3 -3
  112. package/dist/types/feed/event-handlers/follow/handle-follow-updated.d.ts +2 -2
  113. package/dist/types/feed/event-handlers/is-activity-pin.d.ts +1 -1
  114. package/dist/types/feed/event-handlers/notification-feed/handle-notification-feed-updated.d.ts +3 -3
  115. package/dist/types/feed/event-handlers/story-feeds/handle-story-feeds-updated.d.ts +3 -3
  116. package/dist/types/feed/event-handlers/watch/handle-watch-started.d.ts +1 -1
  117. package/dist/types/feed/event-handlers/watch/handle-watch-stopped.d.ts +1 -1
  118. package/dist/types/feed/feed.d.ts +9 -9
  119. package/dist/types/feeds-client/active-activity.d.ts +1 -1
  120. package/dist/types/feeds-client/event-handlers/user/handle-user-updated.d.ts +2 -2
  121. package/dist/types/feeds-client/feeds-client.d.ts +22 -22
  122. package/dist/types/feeds-client/feeds-client.d.ts.map +1 -1
  123. package/dist/types/feeds-client/get-or-create-active-feed.d.ts +2 -2
  124. package/dist/types/gen/feeds/FeedApi.d.ts +2 -2
  125. package/dist/types/gen/feeds/FeedsApi.d.ts +2 -2
  126. package/dist/types/gen/model-decoders/event-decoder-mapping.d.ts +1 -1
  127. package/dist/types/gen/models/index.d.ts +1 -1
  128. package/dist/types/gen/models/index.d.ts.map +1 -1
  129. package/dist/types/gen/moderation/ModerationApi.d.ts +2 -2
  130. package/dist/types/types-internal.d.ts +1 -1
  131. package/dist/types/types.d.ts +5 -4
  132. package/dist/types/utils/check-own-fields-equality.d.ts +2 -2
  133. package/dist/types/utils/event-triggered-by-connected-user.d.ts +2 -2
  134. package/dist/types/utils/own-feed-fields.d.ts +1 -1
  135. package/dist/types/utils/state-update-queue.d.ts +4 -4
  136. package/dist/types/utils/throttling/throttled-get-batched-own-capabilities.d.ts +2 -2
  137. package/dist/types/utils/throttling/throttled-get-batched-own-capabilities.d.ts.map +1 -1
  138. package/dist/types/utils/type-assertions.d.ts +2 -2
  139. package/package.json +11 -12
  140. package/src/activity-with-state-updates/activity-with-state-updates.ts +2 -2
  141. package/src/bindings/react/contexts/StreamFeedContext.tsx +2 -1
  142. package/src/bindings/react/contexts/StreamFeedsContext.tsx +2 -1
  143. package/src/bindings/react/contexts/StreamSearchContext.tsx +2 -1
  144. package/src/bindings/react/contexts/StreamSearchResultsContext.tsx +2 -1
  145. package/src/bindings/react/hooks/client-state-hooks/useClientConnectedUser.ts +2 -1
  146. package/src/bindings/react/hooks/client-state-hooks/useWsConnectionState.ts +2 -1
  147. package/src/bindings/react/hooks/feed-state-hooks/useActivityComments.ts +7 -11
  148. package/src/bindings/react/hooks/feed-state-hooks/useAggregatedActivities.ts +3 -2
  149. package/src/bindings/react/hooks/feed-state-hooks/useComments.ts +5 -9
  150. package/src/bindings/react/hooks/feed-state-hooks/useFeedActivities.ts +4 -3
  151. package/src/bindings/react/hooks/feed-state-hooks/useFeedMetadata.ts +3 -2
  152. package/src/bindings/react/hooks/feed-state-hooks/useFollowers.ts +2 -1
  153. package/src/bindings/react/hooks/feed-state-hooks/useFollowing.ts +3 -1
  154. package/src/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivityRead.ts +4 -2
  155. package/src/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivitySeen.ts +4 -2
  156. package/src/bindings/react/hooks/feed-state-hooks/useNotificationStatus.ts +3 -1
  157. package/src/bindings/react/hooks/feed-state-hooks/useOwnCapabilities.ts +5 -2
  158. package/src/bindings/react/hooks/feed-state-hooks/useOwnFollows.ts +3 -2
  159. package/src/bindings/react/hooks/search-state-hooks/useSearchQuery.ts +6 -2
  160. package/src/bindings/react/hooks/search-state-hooks/useSearchResult.ts +4 -2
  161. package/src/bindings/react/hooks/search-state-hooks/useSearchSources.ts +3 -5
  162. package/src/bindings/react/hooks/useCreateFeedsClient.ts +5 -6
  163. package/src/bindings/react/wrappers/StreamFeed.tsx +2 -1
  164. package/src/bindings/react/wrappers/StreamSearch.tsx +2 -1
  165. package/src/bindings/react/wrappers/StreamSearchResults.tsx +2 -1
  166. package/src/common/real-time/event-models.ts +2 -2
  167. package/src/feed/event-handlers/activity/handle-activity-feedback.ts +4 -8
  168. package/src/feed/event-handlers/comment/utils/update-comment-count.ts +2 -2
  169. package/src/feeds-client/feeds-client.ts +10 -12
  170. package/src/gen/models/index.ts +2 -2
  171. 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.26",
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/es/index.mjs"
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/es/react-bindings.mjs"
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": "^19.1.8",
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.8.3",
66
- "vite": "^7.1.11",
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 '@self';
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.state.partialNext({
167
+ this.feed?.state.partialNext({
168
168
  activities: [initialState],
169
169
  });
170
170
  }
@@ -1,5 +1,6 @@
1
1
  import { createContext, useContext } from 'react';
2
- import type { Feed } from '@self';
2
+
3
+ import type { Feed } from '../../../feed';
3
4
 
4
5
  export const StreamFeedContext = createContext<Feed | undefined>(undefined);
5
6
 
@@ -1,5 +1,6 @@
1
1
  import { createContext, useContext } from 'react';
2
- import type { FeedsClient } from '@self';
2
+
3
+ import type { FeedsClient } from '../../../feeds-client';
3
4
 
4
5
  export const StreamFeedsContext = createContext<FeedsClient | undefined>(undefined);
5
6
 
@@ -1,5 +1,6 @@
1
1
  import { createContext, useContext } from 'react';
2
- import type { SearchController } from '@self';
2
+
3
+ import type { SearchController } from '../../../common/search';
3
4
 
4
5
  export const StreamSearchContext = createContext<SearchController | undefined>(undefined);
5
6
 
@@ -1,5 +1,6 @@
1
1
  import { createContext, useContext } from 'react';
2
- import type { SearchSource } from '@self';
2
+
3
+ import type { SearchSource } from '../../../common/search';
3
4
 
4
5
  export const StreamSearchResultsContext = createContext<
5
6
  SearchSource | undefined
@@ -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 type { Feed, FeedState } from '@self';
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 { useMemo } from 'react';
4
- import type { AggregatedActivityResponse, Feed } from '@self';
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 { useMemo } from 'react';
4
- import type { AggregatedActivityResponse, Feed } from '@self';
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 type { FeedOwnCapability, Feed, FeedsClientState } from '@self';
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 { useCallback } from 'react';
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
- import {
3
- FeedsClient,
4
- type FeedsClientOptions,
5
- type UserRequest,
6
- type TokenOrProvider,
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 '@self';
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 '@self';
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 '@self';
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 '@self';
2
- import type { StreamApiError } from '@self';
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: Omit<FileUploadRequest, 'file'> & { file: StreamFile },
455
+ request?: Omit<FileUploadRequest, 'file'> & { file?: StreamFile | string },
456
456
  ) => {
457
457
  return super.uploadFile({
458
- // @ts-expect-error API spec says file should be a string
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: Omit<ImageUploadRequest, 'file'> & { file: StreamFile },
463
+ request?: Omit<ImageUploadRequest, 'file'> & { file?: StreamFile | string },
466
464
  ) => {
467
465
  return super.uploadImage({
468
- // @ts-expect-error API spec says file should be a string
469
- file: request.file,
470
- // @ts-expect-error form data will only work if this is a string
471
- upload_sizes: JSON.stringify(request.upload_sizes),
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
 
@@ -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;
@@ -1,4 +1,4 @@
1
- import type { FeedsClient } from '@self';
1
+ import type { FeedsClient } from '../../feeds-client';
2
2
  import type { ThrottledFunction } from './throttle';
3
3
 
4
4
  const BATCH_OWN_CAPABILITIES_API_LIMIT = 100;