@stream-io/feeds-client 0.3.6 → 0.3.8
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 +2 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/react-bindings.js +76 -14
- package/dist/cjs/react-bindings.js.map +1 -1
- package/dist/es/index.mjs +3 -2
- package/dist/es/index.mjs.map +1 -1
- package/dist/es/react-bindings.mjs +76 -14
- package/dist/es/react-bindings.mjs.map +1 -1
- package/dist/{feeds-client-47vliZx_.js → feeds-client-CwioZBvA.js} +355 -52
- package/dist/feeds-client-CwioZBvA.js.map +1 -0
- package/dist/{feeds-client-Cd2LsXp-.mjs → feeds-client-DVbsjKUf.mjs} +355 -52
- package/dist/feeds-client-DVbsjKUf.mjs.map +1 -0
- package/dist/types/activity-with-state-updates/activity-with-state-updates.d.ts +49 -0
- package/dist/types/activity-with-state-updates/activity-with-state-updates.d.ts.map +1 -0
- package/dist/types/activity-with-state-updates/get-feed.d.ts +3 -0
- package/dist/types/activity-with-state-updates/get-feed.d.ts.map +1 -0
- package/dist/types/bindings/react/hooks/feed-state-hooks/index.d.ts +1 -0
- package/dist/types/bindings/react/hooks/feed-state-hooks/index.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useActivityComments.d.ts +32 -0
- package/dist/types/bindings/react/hooks/feed-state-hooks/useActivityComments.d.ts.map +1 -0
- package/dist/types/bindings/react/hooks/feed-state-hooks/useComments.d.ts +4 -0
- package/dist/types/bindings/react/hooks/feed-state-hooks/useComments.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useOwnCapabilities.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/useCreateFeedsClient.d.ts.map +1 -1
- package/dist/types/common/real-time/event-models.d.ts +1 -0
- package/dist/types/common/real-time/event-models.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/activity-updater.d.ts +1 -0
- package/dist/types/feed/event-handlers/activity-updater.d.ts.map +1 -1
- package/dist/types/feed/feed.d.ts +1 -1
- package/dist/types/feed/feed.d.ts.map +1 -1
- package/dist/types/feeds-client/active-activity.d.ts +8 -0
- package/dist/types/feeds-client/active-activity.d.ts.map +1 -0
- package/dist/types/feeds-client/feeds-client.d.ts +36 -3
- package/dist/types/feeds-client/feeds-client.d.ts.map +1 -1
- package/dist/types/gen/feeds/FeedsApi.d.ts +9 -1
- package/dist/types/gen/feeds/FeedsApi.d.ts.map +1 -1
- package/dist/types/gen/models/index.d.ts +52 -0
- package/dist/types/gen/models/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/activity-with-state-updates/activity-with-state-updates.ts +190 -0
- package/src/activity-with-state-updates/get-feed.ts +5 -0
- package/src/bindings/react/hooks/feed-state-hooks/index.ts +1 -0
- package/src/bindings/react/hooks/feed-state-hooks/useActivityComments.ts +113 -0
- package/src/bindings/react/hooks/feed-state-hooks/useComments.ts +4 -0
- package/src/bindings/react/hooks/feed-state-hooks/useOwnCapabilities.ts +12 -9
- package/src/bindings/react/hooks/useCreateFeedsClient.ts +0 -6
- package/src/common/real-time/event-models.ts +5 -1
- package/src/feed/feed.ts +16 -6
- package/src/feeds-client/active-activity.ts +42 -0
- package/src/feeds-client/feeds-client.ts +162 -53
- package/src/gen/feeds/FeedsApi.ts +86 -0
- package/src/gen/model-decoders/decoders.ts +41 -0
- package/src/gen/models/index.ts +84 -0
- package/src/index.ts +1 -0
- package/src/test-utils/response-generators.ts +1 -0
- package/src/types.ts +8 -10
- package/dist/feeds-client-47vliZx_.js.map +0 -1
- package/dist/feeds-client-Cd2LsXp-.mjs.map +0 -1
package/src/gen/models/index.ts
CHANGED
|
@@ -383,6 +383,8 @@ export interface ActivityRequest {
|
|
|
383
383
|
|
|
384
384
|
attachments?: Attachment[];
|
|
385
385
|
|
|
386
|
+
collection_refs?: string[];
|
|
387
|
+
|
|
386
388
|
filter_tags?: string[];
|
|
387
389
|
|
|
388
390
|
interest_tags?: string[];
|
|
@@ -443,6 +445,8 @@ export interface ActivityResponse {
|
|
|
443
445
|
|
|
444
446
|
own_reactions: FeedsReactionResponse[];
|
|
445
447
|
|
|
448
|
+
collections: Record<string, EnrichedCollectionResponse>;
|
|
449
|
+
|
|
446
450
|
custom: Record<string, any>;
|
|
447
451
|
|
|
448
452
|
reaction_groups: Record<string, ReactionGroupResponse>;
|
|
@@ -551,6 +555,8 @@ export interface AddActivityRequest {
|
|
|
551
555
|
|
|
552
556
|
attachments?: Attachment[];
|
|
553
557
|
|
|
558
|
+
collection_refs?: string[];
|
|
559
|
+
|
|
554
560
|
filter_tags?: string[];
|
|
555
561
|
|
|
556
562
|
interest_tags?: string[];
|
|
@@ -1672,6 +1678,28 @@ export interface ChannelResponse {
|
|
|
1672
1678
|
truncated_by?: UserResponse;
|
|
1673
1679
|
}
|
|
1674
1680
|
|
|
1681
|
+
export interface CollectionRequest {
|
|
1682
|
+
name: string;
|
|
1683
|
+
|
|
1684
|
+
custom: Record<string, any>;
|
|
1685
|
+
|
|
1686
|
+
id?: string;
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
export interface CollectionResponse {
|
|
1690
|
+
created_at: Date;
|
|
1691
|
+
|
|
1692
|
+
id: string;
|
|
1693
|
+
|
|
1694
|
+
name: string;
|
|
1695
|
+
|
|
1696
|
+
updated_at: Date;
|
|
1697
|
+
|
|
1698
|
+
custom: Record<string, any>;
|
|
1699
|
+
|
|
1700
|
+
user_id?: string;
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1675
1703
|
export interface Command {
|
|
1676
1704
|
args: string;
|
|
1677
1705
|
|
|
@@ -1960,6 +1988,16 @@ export interface CreateBlockListResponse {
|
|
|
1960
1988
|
blocklist?: BlockListResponse;
|
|
1961
1989
|
}
|
|
1962
1990
|
|
|
1991
|
+
export interface CreateCollectionsRequest {
|
|
1992
|
+
collections: CollectionRequest[];
|
|
1993
|
+
}
|
|
1994
|
+
|
|
1995
|
+
export interface CreateCollectionsResponse {
|
|
1996
|
+
duration: string;
|
|
1997
|
+
|
|
1998
|
+
collections: CollectionResponse[];
|
|
1999
|
+
}
|
|
2000
|
+
|
|
1963
2001
|
export interface CreateDeviceRequest {
|
|
1964
2002
|
id: string;
|
|
1965
2003
|
|
|
@@ -2086,6 +2124,10 @@ export interface DeleteBookmarkResponse {
|
|
|
2086
2124
|
bookmark: BookmarkResponse;
|
|
2087
2125
|
}
|
|
2088
2126
|
|
|
2127
|
+
export interface DeleteCollectionsResponse {
|
|
2128
|
+
duration: string;
|
|
2129
|
+
}
|
|
2130
|
+
|
|
2089
2131
|
export interface DeleteCommentReactionResponse {
|
|
2090
2132
|
duration: string;
|
|
2091
2133
|
|
|
@@ -2306,6 +2348,22 @@ export interface EnrichedActivity {
|
|
|
2306
2348
|
target?: Data;
|
|
2307
2349
|
}
|
|
2308
2350
|
|
|
2351
|
+
export interface EnrichedCollectionResponse {
|
|
2352
|
+
created_at: Date;
|
|
2353
|
+
|
|
2354
|
+
id: string;
|
|
2355
|
+
|
|
2356
|
+
name: string;
|
|
2357
|
+
|
|
2358
|
+
status: 'ok' | 'notfound';
|
|
2359
|
+
|
|
2360
|
+
updated_at: Date;
|
|
2361
|
+
|
|
2362
|
+
custom: Record<string, any>;
|
|
2363
|
+
|
|
2364
|
+
user_id?: string;
|
|
2365
|
+
}
|
|
2366
|
+
|
|
2309
2367
|
export interface EnrichedReaction {
|
|
2310
2368
|
activity_id: string;
|
|
2311
2369
|
|
|
@@ -4704,6 +4762,12 @@ export interface ReactionResponse {
|
|
|
4704
4762
|
user: UserResponse;
|
|
4705
4763
|
}
|
|
4706
4764
|
|
|
4765
|
+
export interface ReadCollectionsResponse {
|
|
4766
|
+
duration: string;
|
|
4767
|
+
|
|
4768
|
+
collections: CollectionResponse[];
|
|
4769
|
+
}
|
|
4770
|
+
|
|
4707
4771
|
export interface ReadReceipts {
|
|
4708
4772
|
enabled: boolean;
|
|
4709
4773
|
}
|
|
@@ -5344,6 +5408,8 @@ export interface UpdateActivityRequest {
|
|
|
5344
5408
|
|
|
5345
5409
|
attachments?: Attachment[];
|
|
5346
5410
|
|
|
5411
|
+
collection_refs?: string[];
|
|
5412
|
+
|
|
5347
5413
|
feeds?: string[];
|
|
5348
5414
|
|
|
5349
5415
|
filter_tags?: string[];
|
|
@@ -5405,6 +5471,24 @@ export interface UpdateBookmarkResponse {
|
|
|
5405
5471
|
bookmark: BookmarkResponse;
|
|
5406
5472
|
}
|
|
5407
5473
|
|
|
5474
|
+
export interface UpdateCollectionRequest {
|
|
5475
|
+
id: string;
|
|
5476
|
+
|
|
5477
|
+
name: string;
|
|
5478
|
+
|
|
5479
|
+
custom: Record<string, any>;
|
|
5480
|
+
}
|
|
5481
|
+
|
|
5482
|
+
export interface UpdateCollectionsRequest {
|
|
5483
|
+
collections: UpdateCollectionRequest[];
|
|
5484
|
+
}
|
|
5485
|
+
|
|
5486
|
+
export interface UpdateCollectionsResponse {
|
|
5487
|
+
duration: string;
|
|
5488
|
+
|
|
5489
|
+
collections: CollectionResponse[];
|
|
5490
|
+
}
|
|
5491
|
+
|
|
5408
5492
|
export interface UpdateCommentRequest {
|
|
5409
5493
|
comment?: string;
|
|
5410
5494
|
|
package/src/index.ts
CHANGED
package/src/types.ts
CHANGED
|
@@ -3,17 +3,15 @@ import type {
|
|
|
3
3
|
UnhandledErrorEvent,
|
|
4
4
|
} from './common/real-time/event-models';
|
|
5
5
|
import type { NetworkChangedEvent } from './common/types';
|
|
6
|
-
import type {
|
|
7
|
-
|
|
8
|
-
WSEvent,
|
|
9
|
-
} from './gen/models';
|
|
10
|
-
import type {
|
|
11
|
-
ActivityResponse,
|
|
12
|
-
CommentResponse,
|
|
13
|
-
} from './gen/models';
|
|
6
|
+
import type { PagerResponse, WSEvent } from './gen/models';
|
|
7
|
+
import type { ActivityResponse, CommentResponse } from './gen/models';
|
|
14
8
|
import type { FeedsClient } from './feeds-client';
|
|
15
9
|
|
|
16
|
-
export type FeedsEvent =
|
|
10
|
+
export type FeedsEvent =
|
|
11
|
+
| WSEvent
|
|
12
|
+
| ConnectionChangedEvent
|
|
13
|
+
| NetworkChangedEvent
|
|
14
|
+
| UnhandledErrorEvent;
|
|
17
15
|
export type ActivityIdOrCommentId = string;
|
|
18
16
|
|
|
19
17
|
export type GetCommentsRequest = Parameters<FeedsClient['getComments']>[0];
|
|
@@ -33,6 +31,6 @@ export type TokenOrProvider = string | TokenProvider;
|
|
|
33
31
|
|
|
34
32
|
export type TokenProvider = () => Promise<string>;
|
|
35
33
|
|
|
36
|
-
export type StreamFile = File | { name: string
|
|
34
|
+
export type StreamFile = File | { name: string; uri: string; type: string };
|
|
37
35
|
|
|
38
36
|
export type CommentParent = ActivityResponse | CommentResponse;
|