@stream-io/feeds-client 0.1.0 → 0.1.2

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 (43) hide show
  1. package/@react-bindings/index.ts +13 -0
  2. package/CHANGELOG.md +31 -0
  3. package/dist/@react-bindings/contexts/StreamFeedsContext.d.ts +15 -0
  4. package/dist/@react-bindings/hooks/clientStateHooks.d.ts +10 -0
  5. package/dist/@react-bindings/hooks/useCreateFeedsClient.d.ts +13 -0
  6. package/dist/@react-bindings/hooks/useOwnCapabilities.d.ts +33 -0
  7. package/dist/@react-bindings/hooks/useStateStore.d.ts +1 -1
  8. package/dist/@react-bindings/index.d.ts +5 -0
  9. package/dist/@react-bindings/wrappers/StreamFeeds.d.ts +6 -0
  10. package/dist/index-react-bindings.browser.cjs +5462 -12
  11. package/dist/index-react-bindings.browser.cjs.map +1 -1
  12. package/dist/index-react-bindings.browser.js +5457 -14
  13. package/dist/index-react-bindings.browser.js.map +1 -1
  14. package/dist/index-react-bindings.node.cjs +5462 -12
  15. package/dist/index-react-bindings.node.cjs.map +1 -1
  16. package/dist/index-react-bindings.node.js +5457 -14
  17. package/dist/index-react-bindings.node.js.map +1 -1
  18. package/dist/index.browser.cjs +100 -31
  19. package/dist/index.browser.cjs.map +1 -1
  20. package/dist/index.browser.js +100 -31
  21. package/dist/index.browser.js.map +1 -1
  22. package/dist/index.node.cjs +100 -31
  23. package/dist/index.node.cjs.map +1 -1
  24. package/dist/index.node.js +100 -31
  25. package/dist/index.node.js.map +1 -1
  26. package/dist/src/Feed.d.ts +2 -2
  27. package/dist/src/FeedsClient.d.ts +8 -5
  28. package/dist/src/common/StateStore.d.ts +1 -0
  29. package/dist/src/common/real-time/StableWSConnection.d.ts +3 -3
  30. package/dist/src/gen/feeds/FeedsApi.d.ts +7 -1
  31. package/dist/src/gen/models/index.d.ts +41 -0
  32. package/dist/src/types.d.ts +2 -0
  33. package/dist/tsconfig.tsbuildinfo +1 -1
  34. package/package.json +2 -6
  35. package/src/Feed.ts +22 -12
  36. package/src/FeedsClient.ts +24 -17
  37. package/src/common/StateStore.ts +30 -12
  38. package/src/common/utils.ts +1 -1
  39. package/src/gen/feeds/FeedsApi.ts +51 -0
  40. package/src/gen/model-decoders/decoders.ts +29 -0
  41. package/src/gen/model-decoders/event-decoder-mapping.ts +6 -0
  42. package/src/gen/models/index.ts +60 -0
  43. package/src/types.ts +4 -0
@@ -1,2 +1,15 @@
1
+ // Hooks
2
+
1
3
  export * from './hooks/useComments';
2
4
  export * from './hooks/useStateStore';
5
+ export * from './hooks/useOwnCapabilities';
6
+ export * from './hooks/clientStateHooks';
7
+ export * from './hooks/useCreateFeedsClient';
8
+
9
+ // Contexts
10
+
11
+ export * from './contexts/StreamFeedsContext';
12
+
13
+ // Wrappers
14
+
15
+ export * from './wrappers/StreamFeeds';
package/CHANGELOG.md CHANGED
@@ -2,6 +2,37 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.1.2](https://github.com/GetStream/stream-feeds-js/compare/@stream-io/feeds-client-0.1.1...@stream-io/feeds-client-0.1.2) (2025-07-11)
6
+
7
+
8
+ * run CI actions on PRs for main, and on main ([#47](https://github.com/GetStream/stream-feeds-js/issues/47)) ([1a2c35b](https://github.com/GetStream/stream-feeds-js/commit/1a2c35bb1425d6e9f897a153024fdafce7a5e9df))
9
+ * Run tests on Node ([#50](https://github.com/GetStream/stream-feeds-js/issues/50)) ([8669bd6](https://github.com/GetStream/stream-feeds-js/commit/8669bd60be696fb40c77d5ba180c605edb660df4))
10
+
11
+
12
+ ### Features
13
+
14
+ * client creation hooks, StreamFeeds wrapper, contexts ([#49](https://github.com/GetStream/stream-feeds-js/issues/49)) ([f5c6059](https://github.com/GetStream/stream-feeds-js/commit/f5c6059e83e0cd1a0ca142d5a4d9871c53b0e88d))
15
+ * **gen:** bookmark folder stuff ([#51](https://github.com/GetStream/stream-feeds-js/issues/51)) ([eb5c5be](https://github.com/GetStream/stream-feeds-js/commit/eb5c5be1ce3302e74b0ebaf76d7050f93056d413))
16
+ * Update to latest open API spec ([#53](https://github.com/GetStream/stream-feeds-js/issues/53)) ([e7c3f49](https://github.com/GetStream/stream-feeds-js/commit/e7c3f49f12ed19c522dede04dfa8fea8a6cf1d05))
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * update source feed on `feeds.follow.created` ([#52](https://github.com/GetStream/stream-feeds-js/issues/52)) ([e2bed97](https://github.com/GetStream/stream-feeds-js/commit/e2bed97d3b3e8b106e193d2d435468e5654c7381))
22
+
23
+ ## [0.1.1](https://github.com/GetStream/stream-feeds-js/compare/@stream-io/feeds-client-0.1.0...@stream-io/feeds-client-0.1.1) (2025-07-09)
24
+
25
+
26
+ ### Features
27
+
28
+ * add useOwnCapabilities hook ([#42](https://github.com/GetStream/stream-feeds-js/issues/42)) ([cc98328](https://github.com/GetStream/stream-feeds-js/commit/cc98328d434ee1306c0d8d5d7d236626f6481431))
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * Handle missing properties in comment reaction WS event, Simplify reaction handling, fix JS tests ([#43](https://github.com/GetStream/stream-feeds-js/issues/43)) ([356e90b](https://github.com/GetStream/stream-feeds-js/commit/356e90bfd4199a7ef44c88de820f11bb52851e47))
34
+ * lint issues ([3b87041](https://github.com/GetStream/stream-feeds-js/commit/3b870418018173ef38389dd6b7b05bbf33499c78))
35
+
5
36
  ## [0.1.0](https://github.com/GetStream/stream-feeds-js/compare/@stream-io/feeds-client-0.0.0...@stream-io/feeds-client-0.1.0) (2025-07-08)
6
37
 
7
38
 
@@ -0,0 +1,15 @@
1
+ import type { FeedsClient } from '../../src/FeedsClient';
2
+ export declare const StreamFeedsContext: import("react").Context<FeedsClient | undefined>;
3
+ /**
4
+ * The props for the StreamFeedsProvider component.
5
+ */
6
+ export type StreamFeedsContextProps = {
7
+ /**
8
+ * The client instance to provide to the component tree.
9
+ */
10
+ client: FeedsClient;
11
+ };
12
+ /**
13
+ * Hook to access the nearest FeedsClient instance.
14
+ */
15
+ export declare const useFeedsClient: () => FeedsClient | undefined;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * A React hook that returns the currently connected user on a `FeedsClient` instance and null otherwise.
3
+ */
4
+ export declare const useClientConnectedUser: () => import("../..").OwnUser | undefined;
5
+ /**
6
+ * A React hook that returns the websocket connection state of `FeedsClient`.
7
+ */
8
+ export declare const useWsConnectionState: () => {
9
+ isHealthy: boolean | undefined;
10
+ };
@@ -0,0 +1,13 @@
1
+ import { FeedsClient } from '../../src/FeedsClient';
2
+ import type { UserRequest } from '../../src/gen/models';
3
+ import type { TokenOrProvider } from '../../src/types';
4
+ import type { FeedsClientOptions } from '../../src/common/types';
5
+ /**
6
+ * A React hook to create, connect and return an instance of `FeedsClient`.
7
+ */
8
+ export declare const useCreateFeedsClient: ({ apiKey, tokenOrProvider, userData, options, }: {
9
+ apiKey: string;
10
+ tokenOrProvider: TokenOrProvider;
11
+ userData: UserRequest;
12
+ options?: FeedsClientOptions;
13
+ }) => FeedsClient | null;
@@ -0,0 +1,33 @@
1
+ import type { Feed } from '../../src/Feed';
2
+ export declare const useOwnCapabilities: (feed: Feed | undefined) => {
3
+ canAddActivity: boolean;
4
+ canAddActivityReaction: boolean;
5
+ canAddComment: boolean;
6
+ canAddCommentReaction: boolean;
7
+ canBookmarkActivity: boolean;
8
+ canCreateFeed: boolean;
9
+ canDeleteBookmark: boolean;
10
+ canDeleteComment: boolean;
11
+ canDeleteFeed: boolean;
12
+ canEditBookmark: boolean;
13
+ canFollow: boolean;
14
+ canRemoveActivity: boolean;
15
+ canRemoveActivityReaction: boolean;
16
+ canRemoveCommentReaction: boolean;
17
+ canUnfollow: boolean;
18
+ canUpdateFeed: boolean;
19
+ canInviteFeed: boolean;
20
+ canJoinFeed: boolean;
21
+ canLeaveFeed: boolean;
22
+ canManageFeedGroup: boolean;
23
+ canMarkActivity: boolean;
24
+ canPinActivity: boolean;
25
+ canQueryFeedMembers: boolean;
26
+ canQueryFollows: boolean;
27
+ canReadActivities: boolean;
28
+ canReadFeed: boolean;
29
+ canUpdateActivity: boolean;
30
+ canUpdateComment: boolean;
31
+ canUpdateFeedFollowers: boolean;
32
+ canUpdateFeedMembers: boolean;
33
+ };
@@ -1,3 +1,3 @@
1
- import type { StateStore } from '../../src/common/StateStore';
1
+ import { StateStore } from '../../src/common/StateStore';
2
2
  export declare function useStateStore<T extends Record<string, unknown>, O extends Readonly<Record<string, unknown> | readonly unknown[]>>(store: StateStore<T>, selector: (v: T) => O): O;
3
3
  export declare function useStateStore<T extends Record<string, unknown>, O extends Readonly<Record<string, unknown> | readonly unknown[]>>(store: StateStore<T> | undefined, selector: (v: T) => O): O | undefined;
@@ -1,2 +1,7 @@
1
1
  export * from './hooks/useComments';
2
2
  export * from './hooks/useStateStore';
3
+ export * from './hooks/useOwnCapabilities';
4
+ export * from './hooks/clientStateHooks';
5
+ export * from './hooks/useCreateFeedsClient';
6
+ export * from './contexts/StreamFeedsContext';
7
+ export * from './wrappers/StreamFeeds';
@@ -0,0 +1,6 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import type { StreamFeedsContextProps } from '../contexts/StreamFeedsContext';
3
+ export declare const StreamFeeds: {
4
+ ({ client, children }: PropsWithChildren<StreamFeedsContextProps>): import("react/jsx-runtime").JSX.Element;
5
+ displayName: string;
6
+ };