@stream-io/feeds-client 0.3.16 → 0.3.18
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 +20 -0
- package/README.md +27 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/react-bindings.js +5 -11
- 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 +5 -11
- package/dist/es/react-bindings.mjs.map +1 -1
- package/dist/{feeds-client-B6L006tr.js → feeds-client-Be5gS8Xx.js} +154 -139
- package/dist/feeds-client-Be5gS8Xx.js.map +1 -0
- package/dist/{feeds-client-Bh01VLai.mjs → feeds-client-DT_p8LU4.mjs} +154 -139
- package/dist/feeds-client-DT_p8LU4.mjs.map +1 -0
- package/dist/types/bindings/react/hooks/useCreateFeedsClient.d.ts +3 -3
- package/dist/types/bindings/react/hooks/useCreateFeedsClient.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.map +1 -1
- package/dist/types/feed/event-handlers/bookmark/handle-bookmark-added.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/bookmark/handle-bookmark-deleted.d.ts.map +1 -1
- package/dist/types/feed/feed.d.ts.map +1 -1
- package/dist/types/feeds-client/feeds-client.d.ts +16 -8
- package/dist/types/feeds-client/feeds-client.d.ts.map +1 -1
- package/dist/types/gen/feeds/FeedsApi.d.ts +6 -4
- package/dist/types/gen/feeds/FeedsApi.d.ts.map +1 -1
- package/dist/types/gen/models/index.d.ts +26 -7
- package/dist/types/gen/models/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/bindings/react/hooks/useCreateFeedsClient.ts +12 -23
- package/src/feed/event-handlers/activity/handle-activity-updated.ts +0 -11
- package/src/feed/event-handlers/activity-updater.ts +0 -8
- package/src/feed/event-handlers/bookmark/handle-bookmark-added.ts +2 -10
- package/src/feed/event-handlers/bookmark/handle-bookmark-deleted.ts +2 -10
- package/src/feed/event-handlers/bookmark/handle-bookmark-updated.ts +2 -2
- package/src/feed/feed.ts +28 -0
- package/src/feeds-client/feeds-client.ts +52 -45
- package/src/gen/feeds/FeedsApi.ts +60 -11
- package/src/gen/model-decoders/decoders.ts +26 -78
- package/src/gen/models/index.ts +39 -9
- package/dist/feeds-client-B6L006tr.js.map +0 -1
- package/dist/feeds-client-Bh01VLai.mjs.map +0 -1
|
@@ -67,8 +67,7 @@ decoders.ActivityAddedEvent = (input) => {
|
|
|
67
67
|
const typeMappings = {
|
|
68
68
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
69
69
|
activity: { type: "ActivityResponse", isSingle: true },
|
|
70
|
-
received_at: { type: "DatetimeType", isSingle: true }
|
|
71
|
-
user: { type: "UserResponseCommonFields", isSingle: true }
|
|
70
|
+
received_at: { type: "DatetimeType", isSingle: true }
|
|
72
71
|
};
|
|
73
72
|
return decode(typeMappings, input);
|
|
74
73
|
};
|
|
@@ -76,24 +75,21 @@ decoders.ActivityDeletedEvent = (input) => {
|
|
|
76
75
|
const typeMappings = {
|
|
77
76
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
78
77
|
activity: { type: "ActivityResponse", isSingle: true },
|
|
79
|
-
received_at: { type: "DatetimeType", isSingle: true }
|
|
80
|
-
user: { type: "UserResponseCommonFields", isSingle: true }
|
|
78
|
+
received_at: { type: "DatetimeType", isSingle: true }
|
|
81
79
|
};
|
|
82
80
|
return decode(typeMappings, input);
|
|
83
81
|
};
|
|
84
82
|
decoders.ActivityFeedbackEvent = (input) => {
|
|
85
83
|
const typeMappings = {
|
|
86
84
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
87
|
-
received_at: { type: "DatetimeType", isSingle: true }
|
|
88
|
-
user: { type: "UserResponseCommonFields", isSingle: true }
|
|
85
|
+
received_at: { type: "DatetimeType", isSingle: true }
|
|
89
86
|
};
|
|
90
87
|
return decode(typeMappings, input);
|
|
91
88
|
};
|
|
92
89
|
decoders.ActivityMarkEvent = (input) => {
|
|
93
90
|
const typeMappings = {
|
|
94
91
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
95
|
-
received_at: { type: "DatetimeType", isSingle: true }
|
|
96
|
-
user: { type: "UserResponseCommonFields", isSingle: true }
|
|
92
|
+
received_at: { type: "DatetimeType", isSingle: true }
|
|
97
93
|
};
|
|
98
94
|
return decode(typeMappings, input);
|
|
99
95
|
};
|
|
@@ -110,8 +106,7 @@ decoders.ActivityPinnedEvent = (input) => {
|
|
|
110
106
|
const typeMappings = {
|
|
111
107
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
112
108
|
pinned_activity: { type: "PinActivityResponse", isSingle: true },
|
|
113
|
-
received_at: { type: "DatetimeType", isSingle: true }
|
|
114
|
-
user: { type: "UserResponseCommonFields", isSingle: true }
|
|
109
|
+
received_at: { type: "DatetimeType", isSingle: true }
|
|
115
110
|
};
|
|
116
111
|
return decode(typeMappings, input);
|
|
117
112
|
};
|
|
@@ -120,8 +115,7 @@ decoders.ActivityReactionAddedEvent = (input) => {
|
|
|
120
115
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
121
116
|
activity: { type: "ActivityResponse", isSingle: true },
|
|
122
117
|
reaction: { type: "FeedsReactionResponse", isSingle: true },
|
|
123
|
-
received_at: { type: "DatetimeType", isSingle: true }
|
|
124
|
-
user: { type: "UserResponseCommonFields", isSingle: true }
|
|
118
|
+
received_at: { type: "DatetimeType", isSingle: true }
|
|
125
119
|
};
|
|
126
120
|
return decode(typeMappings, input);
|
|
127
121
|
};
|
|
@@ -130,8 +124,7 @@ decoders.ActivityReactionDeletedEvent = (input) => {
|
|
|
130
124
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
131
125
|
activity: { type: "ActivityResponse", isSingle: true },
|
|
132
126
|
reaction: { type: "FeedsReactionResponse", isSingle: true },
|
|
133
|
-
received_at: { type: "DatetimeType", isSingle: true }
|
|
134
|
-
user: { type: "UserResponseCommonFields", isSingle: true }
|
|
127
|
+
received_at: { type: "DatetimeType", isSingle: true }
|
|
135
128
|
};
|
|
136
129
|
return decode(typeMappings, input);
|
|
137
130
|
};
|
|
@@ -140,8 +133,7 @@ decoders.ActivityReactionUpdatedEvent = (input) => {
|
|
|
140
133
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
141
134
|
activity: { type: "ActivityResponse", isSingle: true },
|
|
142
135
|
reaction: { type: "FeedsReactionResponse", isSingle: true },
|
|
143
|
-
received_at: { type: "DatetimeType", isSingle: true }
|
|
144
|
-
user: { type: "UserResponseCommonFields", isSingle: true }
|
|
136
|
+
received_at: { type: "DatetimeType", isSingle: true }
|
|
145
137
|
};
|
|
146
138
|
return decode(typeMappings, input);
|
|
147
139
|
};
|
|
@@ -149,8 +141,7 @@ decoders.ActivityRemovedFromFeedEvent = (input) => {
|
|
|
149
141
|
const typeMappings = {
|
|
150
142
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
151
143
|
activity: { type: "ActivityResponse", isSingle: true },
|
|
152
|
-
received_at: { type: "DatetimeType", isSingle: true }
|
|
153
|
-
user: { type: "UserResponseCommonFields", isSingle: true }
|
|
144
|
+
received_at: { type: "DatetimeType", isSingle: true }
|
|
154
145
|
};
|
|
155
146
|
return decode(typeMappings, input);
|
|
156
147
|
};
|
|
@@ -179,8 +170,7 @@ decoders.ActivityUnpinnedEvent = (input) => {
|
|
|
179
170
|
const typeMappings = {
|
|
180
171
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
181
172
|
pinned_activity: { type: "PinActivityResponse", isSingle: true },
|
|
182
|
-
received_at: { type: "DatetimeType", isSingle: true }
|
|
183
|
-
user: { type: "UserResponseCommonFields", isSingle: true }
|
|
173
|
+
received_at: { type: "DatetimeType", isSingle: true }
|
|
184
174
|
};
|
|
185
175
|
return decode(typeMappings, input);
|
|
186
176
|
};
|
|
@@ -188,8 +178,7 @@ decoders.ActivityUpdatedEvent = (input) => {
|
|
|
188
178
|
const typeMappings = {
|
|
189
179
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
190
180
|
activity: { type: "ActivityResponse", isSingle: true },
|
|
191
|
-
received_at: { type: "DatetimeType", isSingle: true }
|
|
192
|
-
user: { type: "UserResponseCommonFields", isSingle: true }
|
|
181
|
+
received_at: { type: "DatetimeType", isSingle: true }
|
|
193
182
|
};
|
|
194
183
|
return decode(typeMappings, input);
|
|
195
184
|
};
|
|
@@ -281,8 +270,7 @@ decoders.BookmarkAddedEvent = (input) => {
|
|
|
281
270
|
const typeMappings = {
|
|
282
271
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
283
272
|
bookmark: { type: "BookmarkResponse", isSingle: true },
|
|
284
|
-
received_at: { type: "DatetimeType", isSingle: true }
|
|
285
|
-
user: { type: "UserResponseCommonFields", isSingle: true }
|
|
273
|
+
received_at: { type: "DatetimeType", isSingle: true }
|
|
286
274
|
};
|
|
287
275
|
return decode(typeMappings, input);
|
|
288
276
|
};
|
|
@@ -290,8 +278,7 @@ decoders.BookmarkDeletedEvent = (input) => {
|
|
|
290
278
|
const typeMappings = {
|
|
291
279
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
292
280
|
bookmark: { type: "BookmarkResponse", isSingle: true },
|
|
293
|
-
received_at: { type: "DatetimeType", isSingle: true }
|
|
294
|
-
user: { type: "UserResponseCommonFields", isSingle: true }
|
|
281
|
+
received_at: { type: "DatetimeType", isSingle: true }
|
|
295
282
|
};
|
|
296
283
|
return decode(typeMappings, input);
|
|
297
284
|
};
|
|
@@ -299,8 +286,7 @@ decoders.BookmarkFolderDeletedEvent = (input) => {
|
|
|
299
286
|
const typeMappings = {
|
|
300
287
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
301
288
|
bookmark_folder: { type: "BookmarkFolderResponse", isSingle: true },
|
|
302
|
-
received_at: { type: "DatetimeType", isSingle: true }
|
|
303
|
-
user: { type: "UserResponseCommonFields", isSingle: true }
|
|
289
|
+
received_at: { type: "DatetimeType", isSingle: true }
|
|
304
290
|
};
|
|
305
291
|
return decode(typeMappings, input);
|
|
306
292
|
};
|
|
@@ -308,7 +294,7 @@ decoders.BookmarkFolderResponse = (input) => {
|
|
|
308
294
|
const typeMappings = {
|
|
309
295
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
310
296
|
updated_at: { type: "DatetimeType", isSingle: true },
|
|
311
|
-
user: { type: "
|
|
297
|
+
user: { type: "UserResponse", isSingle: true }
|
|
312
298
|
};
|
|
313
299
|
return decode(typeMappings, input);
|
|
314
300
|
};
|
|
@@ -316,8 +302,7 @@ decoders.BookmarkFolderUpdatedEvent = (input) => {
|
|
|
316
302
|
const typeMappings = {
|
|
317
303
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
318
304
|
bookmark_folder: { type: "BookmarkFolderResponse", isSingle: true },
|
|
319
|
-
received_at: { type: "DatetimeType", isSingle: true }
|
|
320
|
-
user: { type: "UserResponseCommonFields", isSingle: true }
|
|
305
|
+
received_at: { type: "DatetimeType", isSingle: true }
|
|
321
306
|
};
|
|
322
307
|
return decode(typeMappings, input);
|
|
323
308
|
};
|
|
@@ -326,7 +311,7 @@ decoders.BookmarkResponse = (input) => {
|
|
|
326
311
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
327
312
|
updated_at: { type: "DatetimeType", isSingle: true },
|
|
328
313
|
activity: { type: "ActivityResponse", isSingle: true },
|
|
329
|
-
user: { type: "
|
|
314
|
+
user: { type: "UserResponse", isSingle: true },
|
|
330
315
|
folder: { type: "BookmarkFolderResponse", isSingle: true }
|
|
331
316
|
};
|
|
332
317
|
return decode(typeMappings, input);
|
|
@@ -335,8 +320,7 @@ decoders.BookmarkUpdatedEvent = (input) => {
|
|
|
335
320
|
const typeMappings = {
|
|
336
321
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
337
322
|
bookmark: { type: "BookmarkResponse", isSingle: true },
|
|
338
|
-
received_at: { type: "DatetimeType", isSingle: true }
|
|
339
|
-
user: { type: "UserResponseCommonFields", isSingle: true }
|
|
323
|
+
received_at: { type: "DatetimeType", isSingle: true }
|
|
340
324
|
};
|
|
341
325
|
return decode(typeMappings, input);
|
|
342
326
|
};
|
|
@@ -485,8 +469,7 @@ decoders.CommentAddedEvent = (input) => {
|
|
|
485
469
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
486
470
|
activity: { type: "ActivityResponse", isSingle: true },
|
|
487
471
|
comment: { type: "CommentResponse", isSingle: true },
|
|
488
|
-
received_at: { type: "DatetimeType", isSingle: true }
|
|
489
|
-
user: { type: "UserResponseCommonFields", isSingle: true }
|
|
472
|
+
received_at: { type: "DatetimeType", isSingle: true }
|
|
490
473
|
};
|
|
491
474
|
return decode(typeMappings, input);
|
|
492
475
|
};
|
|
@@ -494,8 +477,7 @@ decoders.CommentDeletedEvent = (input) => {
|
|
|
494
477
|
const typeMappings = {
|
|
495
478
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
496
479
|
comment: { type: "CommentResponse", isSingle: true },
|
|
497
|
-
received_at: { type: "DatetimeType", isSingle: true }
|
|
498
|
-
user: { type: "UserResponseCommonFields", isSingle: true }
|
|
480
|
+
received_at: { type: "DatetimeType", isSingle: true }
|
|
499
481
|
};
|
|
500
482
|
return decode(typeMappings, input);
|
|
501
483
|
};
|
|
@@ -505,8 +487,7 @@ decoders.CommentReactionAddedEvent = (input) => {
|
|
|
505
487
|
activity: { type: "ActivityResponse", isSingle: true },
|
|
506
488
|
comment: { type: "CommentResponse", isSingle: true },
|
|
507
489
|
reaction: { type: "FeedsReactionResponse", isSingle: true },
|
|
508
|
-
received_at: { type: "DatetimeType", isSingle: true }
|
|
509
|
-
user: { type: "UserResponseCommonFields", isSingle: true }
|
|
490
|
+
received_at: { type: "DatetimeType", isSingle: true }
|
|
510
491
|
};
|
|
511
492
|
return decode(typeMappings, input);
|
|
512
493
|
};
|
|
@@ -525,8 +506,7 @@ decoders.CommentReactionUpdatedEvent = (input) => {
|
|
|
525
506
|
activity: { type: "ActivityResponse", isSingle: true },
|
|
526
507
|
comment: { type: "CommentResponse", isSingle: true },
|
|
527
508
|
reaction: { type: "FeedsReactionResponse", isSingle: true },
|
|
528
|
-
received_at: { type: "DatetimeType", isSingle: true }
|
|
529
|
-
user: { type: "UserResponseCommonFields", isSingle: true }
|
|
509
|
+
received_at: { type: "DatetimeType", isSingle: true }
|
|
530
510
|
};
|
|
531
511
|
return decode(typeMappings, input);
|
|
532
512
|
};
|
|
@@ -547,8 +527,7 @@ decoders.CommentUpdatedEvent = (input) => {
|
|
|
547
527
|
const typeMappings = {
|
|
548
528
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
549
529
|
comment: { type: "CommentResponse", isSingle: true },
|
|
550
|
-
received_at: { type: "DatetimeType", isSingle: true }
|
|
551
|
-
user: { type: "UserResponseCommonFields", isSingle: true }
|
|
530
|
+
received_at: { type: "DatetimeType", isSingle: true }
|
|
552
531
|
};
|
|
553
532
|
return decode(typeMappings, input);
|
|
554
533
|
};
|
|
@@ -667,7 +646,6 @@ decoders.FeedCreatedEvent = (input) => {
|
|
|
667
646
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
668
647
|
members: { type: "FeedMemberResponse", isSingle: false },
|
|
669
648
|
feed: { type: "FeedResponse", isSingle: true },
|
|
670
|
-
user: { type: "UserResponseCommonFields", isSingle: true },
|
|
671
649
|
received_at: { type: "DatetimeType", isSingle: true }
|
|
672
650
|
};
|
|
673
651
|
return decode(typeMappings, input);
|
|
@@ -675,16 +653,14 @@ decoders.FeedCreatedEvent = (input) => {
|
|
|
675
653
|
decoders.FeedDeletedEvent = (input) => {
|
|
676
654
|
const typeMappings = {
|
|
677
655
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
678
|
-
received_at: { type: "DatetimeType", isSingle: true }
|
|
679
|
-
user: { type: "UserResponseCommonFields", isSingle: true }
|
|
656
|
+
received_at: { type: "DatetimeType", isSingle: true }
|
|
680
657
|
};
|
|
681
658
|
return decode(typeMappings, input);
|
|
682
659
|
};
|
|
683
660
|
decoders.FeedGroupChangedEvent = (input) => {
|
|
684
661
|
const typeMappings = {
|
|
685
662
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
686
|
-
received_at: { type: "DatetimeType", isSingle: true }
|
|
687
|
-
user: { type: "UserResponseCommonFields", isSingle: true }
|
|
663
|
+
received_at: { type: "DatetimeType", isSingle: true }
|
|
688
664
|
};
|
|
689
665
|
return decode(typeMappings, input);
|
|
690
666
|
};
|
|
@@ -699,16 +675,14 @@ decoders.FeedMemberAddedEvent = (input) => {
|
|
|
699
675
|
const typeMappings = {
|
|
700
676
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
701
677
|
member: { type: "FeedMemberResponse", isSingle: true },
|
|
702
|
-
received_at: { type: "DatetimeType", isSingle: true }
|
|
703
|
-
user: { type: "UserResponseCommonFields", isSingle: true }
|
|
678
|
+
received_at: { type: "DatetimeType", isSingle: true }
|
|
704
679
|
};
|
|
705
680
|
return decode(typeMappings, input);
|
|
706
681
|
};
|
|
707
682
|
decoders.FeedMemberRemovedEvent = (input) => {
|
|
708
683
|
const typeMappings = {
|
|
709
684
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
710
|
-
received_at: { type: "DatetimeType", isSingle: true }
|
|
711
|
-
user: { type: "UserResponseCommonFields", isSingle: true }
|
|
685
|
+
received_at: { type: "DatetimeType", isSingle: true }
|
|
712
686
|
};
|
|
713
687
|
return decode(typeMappings, input);
|
|
714
688
|
};
|
|
@@ -727,8 +701,14 @@ decoders.FeedMemberUpdatedEvent = (input) => {
|
|
|
727
701
|
const typeMappings = {
|
|
728
702
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
729
703
|
member: { type: "FeedMemberResponse", isSingle: true },
|
|
730
|
-
received_at: { type: "DatetimeType", isSingle: true }
|
|
731
|
-
|
|
704
|
+
received_at: { type: "DatetimeType", isSingle: true }
|
|
705
|
+
};
|
|
706
|
+
return decode(typeMappings, input);
|
|
707
|
+
};
|
|
708
|
+
decoders.FeedOwnData = (input) => {
|
|
709
|
+
const typeMappings = {
|
|
710
|
+
own_follows: { type: "FollowResponse", isSingle: false },
|
|
711
|
+
own_membership: { type: "FeedMemberResponse", isSingle: true }
|
|
732
712
|
};
|
|
733
713
|
return decode(typeMappings, input);
|
|
734
714
|
};
|
|
@@ -758,8 +738,7 @@ decoders.FeedUpdatedEvent = (input) => {
|
|
|
758
738
|
const typeMappings = {
|
|
759
739
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
760
740
|
feed: { type: "FeedResponse", isSingle: true },
|
|
761
|
-
received_at: { type: "DatetimeType", isSingle: true }
|
|
762
|
-
user: { type: "UserResponseCommonFields", isSingle: true }
|
|
741
|
+
received_at: { type: "DatetimeType", isSingle: true }
|
|
763
742
|
};
|
|
764
743
|
return decode(typeMappings, input);
|
|
765
744
|
};
|
|
@@ -773,6 +752,7 @@ decoders.FeedsReactionResponse = (input) => {
|
|
|
773
752
|
};
|
|
774
753
|
decoders.FollowBatchResponse = (input) => {
|
|
775
754
|
const typeMappings = {
|
|
755
|
+
created: { type: "FollowResponse", isSingle: false },
|
|
776
756
|
follows: { type: "FollowResponse", isSingle: false }
|
|
777
757
|
};
|
|
778
758
|
return decode(typeMappings, input);
|
|
@@ -1018,8 +998,7 @@ decoders.NotificationFeedUpdatedEvent = (input) => {
|
|
|
1018
998
|
type: "AggregatedActivityResponse",
|
|
1019
999
|
isSingle: false
|
|
1020
1000
|
},
|
|
1021
|
-
notification_status: { type: "NotificationStatusResponse", isSingle: true }
|
|
1022
|
-
user: { type: "UserResponseCommonFields", isSingle: true }
|
|
1001
|
+
notification_status: { type: "NotificationStatusResponse", isSingle: true }
|
|
1023
1002
|
};
|
|
1024
1003
|
return decode(typeMappings, input);
|
|
1025
1004
|
};
|
|
@@ -1030,6 +1009,12 @@ decoders.NotificationStatusResponse = (input) => {
|
|
|
1030
1009
|
};
|
|
1031
1010
|
return decode(typeMappings, input);
|
|
1032
1011
|
};
|
|
1012
|
+
decoders.OwnBatchResponse = (input) => {
|
|
1013
|
+
const typeMappings = {
|
|
1014
|
+
data: { type: "FeedOwnData", isSingle: false }
|
|
1015
|
+
};
|
|
1016
|
+
return decode(typeMappings, input);
|
|
1017
|
+
};
|
|
1033
1018
|
decoders.OwnUser = (input) => {
|
|
1034
1019
|
const typeMappings = {
|
|
1035
1020
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
@@ -1361,8 +1346,7 @@ decoders.StoriesFeedUpdatedEvent = (input) => {
|
|
|
1361
1346
|
aggregated_activities: {
|
|
1362
1347
|
type: "AggregatedActivityResponse",
|
|
1363
1348
|
isSingle: false
|
|
1364
|
-
}
|
|
1365
|
-
user: { type: "UserResponseCommonFields", isSingle: true }
|
|
1349
|
+
}
|
|
1366
1350
|
};
|
|
1367
1351
|
return decode(typeMappings, input);
|
|
1368
1352
|
};
|
|
@@ -1386,6 +1370,12 @@ decoders.ThreadedCommentResponse = (input) => {
|
|
|
1386
1370
|
};
|
|
1387
1371
|
return decode(typeMappings, input);
|
|
1388
1372
|
};
|
|
1373
|
+
decoders.UnfollowBatchResponse = (input) => {
|
|
1374
|
+
const typeMappings = {
|
|
1375
|
+
follows: { type: "FollowResponse", isSingle: false }
|
|
1376
|
+
};
|
|
1377
|
+
return decode(typeMappings, input);
|
|
1378
|
+
};
|
|
1389
1379
|
decoders.UnfollowResponse = (input) => {
|
|
1390
1380
|
const typeMappings = {
|
|
1391
1381
|
follow: { type: "FollowResponse", isSingle: true }
|
|
@@ -1558,17 +1548,6 @@ decoders.UserResponse = (input) => {
|
|
|
1558
1548
|
};
|
|
1559
1549
|
return decode(typeMappings, input);
|
|
1560
1550
|
};
|
|
1561
|
-
decoders.UserResponseCommonFields = (input) => {
|
|
1562
|
-
const typeMappings = {
|
|
1563
|
-
created_at: { type: "DatetimeType", isSingle: true },
|
|
1564
|
-
updated_at: { type: "DatetimeType", isSingle: true },
|
|
1565
|
-
deactivated_at: { type: "DatetimeType", isSingle: true },
|
|
1566
|
-
deleted_at: { type: "DatetimeType", isSingle: true },
|
|
1567
|
-
last_active: { type: "DatetimeType", isSingle: true },
|
|
1568
|
-
revoke_tokens_issued_before: { type: "DatetimeType", isSingle: true }
|
|
1569
|
-
};
|
|
1570
|
-
return decode(typeMappings, input);
|
|
1571
|
-
};
|
|
1572
1551
|
decoders.UserUpdatedEvent = (input) => {
|
|
1573
1552
|
const typeMappings = {
|
|
1574
1553
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
@@ -2142,11 +2121,11 @@ class FeedsApi {
|
|
|
2142
2121
|
}
|
|
2143
2122
|
async addComment(request) {
|
|
2144
2123
|
const body = {
|
|
2145
|
-
object_id: request?.object_id,
|
|
2146
|
-
object_type: request?.object_type,
|
|
2147
2124
|
comment: request?.comment,
|
|
2148
2125
|
create_notification_activity: request?.create_notification_activity,
|
|
2149
2126
|
id: request?.id,
|
|
2127
|
+
object_id: request?.object_id,
|
|
2128
|
+
object_type: request?.object_type,
|
|
2150
2129
|
parent_id: request?.parent_id,
|
|
2151
2130
|
skip_enrich_url: request?.skip_enrich_url,
|
|
2152
2131
|
skip_push: request?.skip_push,
|
|
@@ -2568,22 +2547,23 @@ class FeedsApi {
|
|
|
2568
2547
|
decoders.CreateFeedsBatchResponse?.(response.body);
|
|
2569
2548
|
return { ...response.body, metadata: response.metadata };
|
|
2570
2549
|
}
|
|
2571
|
-
async
|
|
2550
|
+
async ownBatch(request) {
|
|
2572
2551
|
const queryParams = {
|
|
2573
2552
|
connection_id: request?.connection_id
|
|
2574
2553
|
};
|
|
2575
2554
|
const body = {
|
|
2576
|
-
feeds: request?.feeds
|
|
2555
|
+
feeds: request?.feeds,
|
|
2556
|
+
fields: request?.fields
|
|
2577
2557
|
};
|
|
2578
2558
|
const response = await this.apiClient.sendRequest(
|
|
2579
2559
|
"POST",
|
|
2580
|
-
"/api/v2/feeds/feeds/
|
|
2560
|
+
"/api/v2/feeds/feeds/own/batch",
|
|
2581
2561
|
void 0,
|
|
2582
2562
|
queryParams,
|
|
2583
2563
|
body,
|
|
2584
2564
|
"application/json"
|
|
2585
2565
|
);
|
|
2586
|
-
decoders.
|
|
2566
|
+
decoders.OwnBatchResponse?.(response.body);
|
|
2587
2567
|
return { ...response.body, metadata: response.metadata };
|
|
2588
2568
|
}
|
|
2589
2569
|
async _queryFeeds(request) {
|
|
@@ -2682,6 +2662,21 @@ class FeedsApi {
|
|
|
2682
2662
|
decoders.FollowBatchResponse?.(response.body);
|
|
2683
2663
|
return { ...response.body, metadata: response.metadata };
|
|
2684
2664
|
}
|
|
2665
|
+
async getOrCreateFollows(request) {
|
|
2666
|
+
const body = {
|
|
2667
|
+
follows: request?.follows
|
|
2668
|
+
};
|
|
2669
|
+
const response = await this.apiClient.sendRequest(
|
|
2670
|
+
"POST",
|
|
2671
|
+
"/api/v2/feeds/follows/batch/upsert",
|
|
2672
|
+
void 0,
|
|
2673
|
+
void 0,
|
|
2674
|
+
body,
|
|
2675
|
+
"application/json"
|
|
2676
|
+
);
|
|
2677
|
+
decoders.FollowBatchResponse?.(response.body);
|
|
2678
|
+
return { ...response.body, metadata: response.metadata };
|
|
2679
|
+
}
|
|
2685
2680
|
async queryFollows(request) {
|
|
2686
2681
|
const body = {
|
|
2687
2682
|
limit: request?.limit,
|
|
@@ -2731,6 +2726,21 @@ class FeedsApi {
|
|
|
2731
2726
|
decoders.UnfollowResponse?.(response.body);
|
|
2732
2727
|
return { ...response.body, metadata: response.metadata };
|
|
2733
2728
|
}
|
|
2729
|
+
async getOrCreateUnfollows(request) {
|
|
2730
|
+
const body = {
|
|
2731
|
+
follows: request?.follows
|
|
2732
|
+
};
|
|
2733
|
+
const response = await this.apiClient.sendRequest(
|
|
2734
|
+
"POST",
|
|
2735
|
+
"/api/v2/feeds/unfollow/batch/upsert",
|
|
2736
|
+
void 0,
|
|
2737
|
+
void 0,
|
|
2738
|
+
body,
|
|
2739
|
+
"application/json"
|
|
2740
|
+
);
|
|
2741
|
+
decoders.UnfollowBatchResponse?.(response.body);
|
|
2742
|
+
return { ...response.body, metadata: response.metadata };
|
|
2743
|
+
}
|
|
2734
2744
|
async createGuest(request) {
|
|
2735
2745
|
const body = {
|
|
2736
2746
|
user: request?.user
|
|
@@ -3922,7 +3932,7 @@ const getRateLimitFromResponseHeader = (response_headers) => {
|
|
|
3922
3932
|
};
|
|
3923
3933
|
return result;
|
|
3924
3934
|
};
|
|
3925
|
-
const version = "0.3.
|
|
3935
|
+
const version = "0.3.18";
|
|
3926
3936
|
class ApiClient {
|
|
3927
3937
|
constructor(apiKey, tokenManager, connectionIdManager, options) {
|
|
3928
3938
|
this.apiKey = apiKey;
|
|
@@ -5287,13 +5297,10 @@ const sharedUpdateActivity$6 = ({
|
|
|
5287
5297
|
if (eventBelongsToCurrentUser) {
|
|
5288
5298
|
newOwnBookmarks = [...newOwnBookmarks, event.bookmark];
|
|
5289
5299
|
}
|
|
5290
|
-
if (!event.bookmark.activity.current_feed && event.bookmark.activity.feeds.length === 1 && currentActivity.current_feed) {
|
|
5291
|
-
event.bookmark.activity.current_feed = currentActivity.current_feed;
|
|
5292
|
-
}
|
|
5293
5300
|
return {
|
|
5294
|
-
...
|
|
5295
|
-
|
|
5296
|
-
|
|
5301
|
+
...currentActivity,
|
|
5302
|
+
bookmark_count: event.bookmark.activity.bookmark_count,
|
|
5303
|
+
own_bookmarks: newOwnBookmarks
|
|
5297
5304
|
};
|
|
5298
5305
|
};
|
|
5299
5306
|
const addBookmarkToActivities = (event, activities, eventBelongsToCurrentUser) => updateEntityInArray({
|
|
@@ -5363,13 +5370,10 @@ const sharedUpdateActivity$5 = ({
|
|
|
5363
5370
|
(bookmark) => !isSameBookmark(bookmark, event.bookmark)
|
|
5364
5371
|
);
|
|
5365
5372
|
}
|
|
5366
|
-
if (!event.bookmark.activity.current_feed && event.bookmark.activity.feeds.length === 1 && currentActivity.current_feed) {
|
|
5367
|
-
event.bookmark.activity.current_feed = currentActivity.current_feed;
|
|
5368
|
-
}
|
|
5369
5373
|
return {
|
|
5370
|
-
...
|
|
5371
|
-
|
|
5372
|
-
|
|
5374
|
+
...currentActivity,
|
|
5375
|
+
bookmark_count: event.bookmark.activity.bookmark_count,
|
|
5376
|
+
own_bookmarks: newOwnBookmarks
|
|
5373
5377
|
};
|
|
5374
5378
|
};
|
|
5375
5379
|
const removeBookmarkFromActivities = (event, activities, eventBelongsToCurrentUser) => updateEntityInArray({
|
|
@@ -5441,9 +5445,9 @@ const sharedUpdateActivity$4 = ({
|
|
|
5441
5445
|
}
|
|
5442
5446
|
}
|
|
5443
5447
|
return {
|
|
5444
|
-
...
|
|
5445
|
-
|
|
5446
|
-
|
|
5448
|
+
...currentActivity,
|
|
5449
|
+
bookmark_count: event.bookmark.activity.bookmark_count,
|
|
5450
|
+
own_bookmarks: newOwnBookmarks
|
|
5447
5451
|
};
|
|
5448
5452
|
};
|
|
5449
5453
|
const updateBookmarkInActivities = (event, activities, eventBelongsToCurrentUser) => updateEntityInArray({
|
|
@@ -5601,9 +5605,6 @@ const updateActivity = ({
|
|
|
5601
5605
|
currentActivity,
|
|
5602
5606
|
newActivtiy
|
|
5603
5607
|
}) => {
|
|
5604
|
-
if (!newActivtiy.current_feed && newActivtiy.feeds.length === 1 && currentActivity.current_feed) {
|
|
5605
|
-
newActivtiy.current_feed = currentActivity.current_feed;
|
|
5606
|
-
}
|
|
5607
5608
|
return {
|
|
5608
5609
|
...newActivtiy,
|
|
5609
5610
|
own_reactions: currentActivity.own_reactions,
|
|
@@ -5653,12 +5654,6 @@ function handleActivityUpdated(payload, fromWs) {
|
|
|
5653
5654
|
activities: currentActivities,
|
|
5654
5655
|
pinned_activities: currentPinnedActivities
|
|
5655
5656
|
} = this.currentState;
|
|
5656
|
-
const currentActivity = currentActivities?.find(
|
|
5657
|
-
(a) => a.id === payload.activity.id
|
|
5658
|
-
);
|
|
5659
|
-
if (!payload.activity.current_feed && payload.activity.feeds.length === 1 && currentActivity?.current_feed) {
|
|
5660
|
-
payload.activity.current_feed = currentActivity.current_feed;
|
|
5661
|
-
}
|
|
5662
5657
|
const [result1, result2] = [
|
|
5663
5658
|
this.hasActivity(payload.activity.id) ? updateActivityInState(payload, currentActivities) : void 0,
|
|
5664
5659
|
updatePinnedActivityInState(payload, currentPinnedActivities)
|
|
@@ -6822,6 +6817,19 @@ const _Feed = class _Feed extends FeedApi {
|
|
|
6822
6817
|
handleWSEvent(event) {
|
|
6823
6818
|
const eventHandler = this.eventHandlers[event.type];
|
|
6824
6819
|
if (eventHandler !== _Feed.noop) {
|
|
6820
|
+
if ("activity" in event && this.hasActivity(event.activity.id)) {
|
|
6821
|
+
const currentActivity = this.currentState.activities?.find(
|
|
6822
|
+
(a) => a.id === event.activity.id
|
|
6823
|
+
);
|
|
6824
|
+
if (event.activity.feeds.length > 1 && !event.activity.current_feed && currentActivity?.current_feed) {
|
|
6825
|
+
event.activity.current_feed = currentActivity.current_feed;
|
|
6826
|
+
}
|
|
6827
|
+
if (event.activity.feeds.length === 1 && event.activity.current_feed && currentActivity?.current_feed) {
|
|
6828
|
+
event.activity.current_feed.own_capabilities = currentActivity.current_feed.own_capabilities;
|
|
6829
|
+
event.activity.current_feed.own_follows = currentActivity.current_feed.own_follows;
|
|
6830
|
+
event.activity.current_feed.own_membership = currentActivity.current_feed.own_membership;
|
|
6831
|
+
}
|
|
6832
|
+
}
|
|
6825
6833
|
eventHandler?.(event);
|
|
6826
6834
|
}
|
|
6827
6835
|
if (typeof eventHandler === "undefined") {
|
|
@@ -7138,7 +7146,7 @@ class FeedsClient extends FeedsApi {
|
|
|
7138
7146
|
cancelTimer: cancel
|
|
7139
7147
|
} = throttle(
|
|
7140
7148
|
(feeds, callback) => {
|
|
7141
|
-
this.
|
|
7149
|
+
this.ownBatch({
|
|
7142
7150
|
feeds
|
|
7143
7151
|
}).catch((error) => {
|
|
7144
7152
|
this.eventDispatcher.dispatch({
|
|
@@ -7180,19 +7188,6 @@ class FeedsClient extends FeedsApi {
|
|
|
7180
7188
|
}
|
|
7181
7189
|
};
|
|
7182
7190
|
this.pollFromState = (id) => this.polls_by_id.get(id);
|
|
7183
|
-
this.connectAnonymous = () => {
|
|
7184
|
-
this.connectionIdManager.resolveConnectionidPromise();
|
|
7185
|
-
this.tokenManager.setTokenOrProvider(void 0);
|
|
7186
|
-
this.setGetBatchOwnCapabilitiesThrottlingInterval(
|
|
7187
|
-
this.query_batch_own_capabilties_throttling_interval
|
|
7188
|
-
);
|
|
7189
|
-
this.state.partialNext({
|
|
7190
|
-
connected_user: void 0,
|
|
7191
|
-
is_anonymous: true,
|
|
7192
|
-
is_ws_connection_healthy: false
|
|
7193
|
-
});
|
|
7194
|
-
return Promise.resolve();
|
|
7195
|
-
};
|
|
7196
7191
|
this.connectUser = async (user, tokenProvider) => {
|
|
7197
7192
|
if (this.state.getLatestValue().connected_user !== void 0 || this.wsConnection) {
|
|
7198
7193
|
throw new Error(`Can't connect a new user, call "disconnectUser" first`);
|
|
@@ -7427,7 +7422,6 @@ class FeedsClient extends FeedsApi {
|
|
|
7427
7422
|
};
|
|
7428
7423
|
this.state = new stateStore.StateStore({
|
|
7429
7424
|
connected_user: void 0,
|
|
7430
|
-
is_anonymous: false,
|
|
7431
7425
|
is_ws_connection_healthy: false,
|
|
7432
7426
|
own_capabilities_by_fid: {}
|
|
7433
7427
|
});
|
|
@@ -7615,12 +7609,12 @@ class FeedsClient extends FeedsApi {
|
|
|
7615
7609
|
duration: response.duration
|
|
7616
7610
|
};
|
|
7617
7611
|
}
|
|
7618
|
-
async
|
|
7619
|
-
const response = await super.
|
|
7620
|
-
const feedResponses = Object.entries(response.
|
|
7621
|
-
([feed,
|
|
7612
|
+
async ownBatch(request) {
|
|
7613
|
+
const response = await super.ownBatch(request);
|
|
7614
|
+
const feedResponses = Object.entries(response.data).map(
|
|
7615
|
+
([feed, ownFields]) => ({
|
|
7622
7616
|
feed,
|
|
7623
|
-
own_capabilities
|
|
7617
|
+
own_capabilities: ownFields.own_capabilities
|
|
7624
7618
|
})
|
|
7625
7619
|
);
|
|
7626
7620
|
this.hydrateCapabilitiesCache(feedResponses);
|
|
@@ -7640,29 +7634,32 @@ class FeedsClient extends FeedsApi {
|
|
|
7640
7634
|
// For follow API endpoints we update the state after HTTP response to allow queryFeeds with watch: false
|
|
7641
7635
|
async follow(request) {
|
|
7642
7636
|
const response = await super.follow(request);
|
|
7643
|
-
[
|
|
7644
|
-
response.follow.source_feed.feed,
|
|
7645
|
-
response.follow.target_feed.feed
|
|
7646
|
-
].forEach((fid) => {
|
|
7647
|
-
const feeds = this.findAllActiveFeedsByFid(fid);
|
|
7648
|
-
feeds.forEach((f) => handleFollowCreated.bind(f)(response, false));
|
|
7649
|
-
});
|
|
7637
|
+
this.updateStateFromFollows([response.follow]);
|
|
7650
7638
|
return response;
|
|
7651
7639
|
}
|
|
7640
|
+
/**
|
|
7641
|
+
* @deprecated Use getOrCreateFollows instead
|
|
7642
|
+
* @param request
|
|
7643
|
+
* @returns
|
|
7644
|
+
*/
|
|
7652
7645
|
async followBatch(request) {
|
|
7653
7646
|
const response = await super.followBatch(request);
|
|
7654
|
-
response.follows
|
|
7655
|
-
|
|
7656
|
-
|
|
7657
|
-
|
|
7647
|
+
this.updateStateFromFollows(response.follows);
|
|
7648
|
+
return response;
|
|
7649
|
+
}
|
|
7650
|
+
async getOrCreateFollows(request) {
|
|
7651
|
+
const response = await super.getOrCreateFollows(request);
|
|
7652
|
+
this.updateStateFromFollows(response.created);
|
|
7658
7653
|
return response;
|
|
7659
7654
|
}
|
|
7660
7655
|
async unfollow(request) {
|
|
7661
7656
|
const response = await super.unfollow(request);
|
|
7662
|
-
[
|
|
7663
|
-
|
|
7664
|
-
|
|
7665
|
-
|
|
7657
|
+
this.updateStateFromUnfollows([response.follow]);
|
|
7658
|
+
return response;
|
|
7659
|
+
}
|
|
7660
|
+
async getOrCreateUnfollows(request) {
|
|
7661
|
+
const response = await super.getOrCreateUnfollows(request);
|
|
7662
|
+
this.updateStateFromUnfollows(response.follows);
|
|
7666
7663
|
return response;
|
|
7667
7664
|
}
|
|
7668
7665
|
async stopWatchingFeed(request) {
|
|
@@ -7727,6 +7724,24 @@ class FeedsClient extends FeedsApi {
|
|
|
7727
7724
|
}).map((a) => getFeed.call(a))
|
|
7728
7725
|
];
|
|
7729
7726
|
}
|
|
7727
|
+
updateStateFromFollows(follows) {
|
|
7728
|
+
follows.forEach((follow) => {
|
|
7729
|
+
const feeds = [
|
|
7730
|
+
...this.findAllActiveFeedsByFid(follow.source_feed.feed),
|
|
7731
|
+
...this.findAllActiveFeedsByFid(follow.target_feed.feed)
|
|
7732
|
+
];
|
|
7733
|
+
feeds.forEach((f) => handleFollowCreated.bind(f)({ follow }, false));
|
|
7734
|
+
});
|
|
7735
|
+
}
|
|
7736
|
+
updateStateFromUnfollows(follows) {
|
|
7737
|
+
follows.forEach((follow) => {
|
|
7738
|
+
const feeds = [
|
|
7739
|
+
...this.findAllActiveFeedsByFid(follow.source_feed.feed),
|
|
7740
|
+
...this.findAllActiveFeedsByFid(follow.target_feed.feed)
|
|
7741
|
+
];
|
|
7742
|
+
feeds.forEach((f) => handleFollowDeleted.bind(f)({ follow }, false));
|
|
7743
|
+
});
|
|
7744
|
+
}
|
|
7730
7745
|
}
|
|
7731
7746
|
exports.ActivityWithStateUpdates = ActivityWithStateUpdates;
|
|
7732
7747
|
exports.Constants = Constants;
|
|
@@ -7749,4 +7764,4 @@ exports.replaceUniqueArrayMerge = replaceUniqueArrayMerge;
|
|
|
7749
7764
|
exports.shouldUpdateState = shouldUpdateState;
|
|
7750
7765
|
exports.uniqueArrayMerge = uniqueArrayMerge;
|
|
7751
7766
|
exports.updateEntityInArray = updateEntityInArray;
|
|
7752
|
-
//# sourceMappingURL=feeds-client-
|
|
7767
|
+
//# sourceMappingURL=feeds-client-Be5gS8Xx.js.map
|