@stream-io/feeds-client 0.3.16 → 0.3.17
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 +13 -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-BGF3utPy.js} +132 -115
- package/dist/feeds-client-BGF3utPy.js.map +1 -0
- package/dist/{feeds-client-Bh01VLai.mjs → feeds-client-Bq_SWnZW.mjs} +132 -115
- package/dist/feeds-client-Bq_SWnZW.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/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/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
|
@@ -14,13 +14,15 @@ import type {
|
|
|
14
14
|
FileUploadRequest,
|
|
15
15
|
FollowBatchRequest,
|
|
16
16
|
FollowRequest,
|
|
17
|
+
FollowResponse,
|
|
17
18
|
GetOrCreateFeedRequest,
|
|
18
19
|
ImageUploadRequest,
|
|
19
|
-
|
|
20
|
+
OwnBatchRequest,
|
|
20
21
|
PollResponse,
|
|
21
22
|
PollVotesResponse,
|
|
22
23
|
QueryFeedsRequest,
|
|
23
24
|
QueryPollVotesRequest,
|
|
25
|
+
UnfollowBatchRequest,
|
|
24
26
|
UpdateActivityRequest,
|
|
25
27
|
UpdateActivityResponse,
|
|
26
28
|
UpdateCommentRequest,
|
|
@@ -93,7 +95,6 @@ import { getFeed } from '../activity-with-state-updates/get-feed';
|
|
|
93
95
|
|
|
94
96
|
export type FeedsClientState = {
|
|
95
97
|
connected_user: ConnectedUser | undefined;
|
|
96
|
-
is_anonymous: boolean;
|
|
97
98
|
is_ws_connection_healthy: boolean;
|
|
98
99
|
own_capabilities_by_fid: Record<string, FeedResponse['own_capabilities']>;
|
|
99
100
|
};
|
|
@@ -137,7 +138,6 @@ export class FeedsClient extends FeedsApi {
|
|
|
137
138
|
super(apiClient);
|
|
138
139
|
this.state = new StateStore<FeedsClientState>({
|
|
139
140
|
connected_user: undefined,
|
|
140
|
-
is_anonymous: false,
|
|
141
141
|
is_ws_connection_healthy: false,
|
|
142
142
|
own_capabilities_by_fid: {},
|
|
143
143
|
});
|
|
@@ -286,7 +286,7 @@ export class FeedsClient extends FeedsApi {
|
|
|
286
286
|
cancelTimer: cancel,
|
|
287
287
|
} = throttle<GetBatchedOwnCapabilitiesThrottledCallback>(
|
|
288
288
|
(feeds, callback) => {
|
|
289
|
-
this.
|
|
289
|
+
this.ownBatch({
|
|
290
290
|
feeds,
|
|
291
291
|
}).catch((error) => {
|
|
292
292
|
this.eventDispatcher.dispatch({
|
|
@@ -393,25 +393,7 @@ export class FeedsClient extends FeedsApi {
|
|
|
393
393
|
this.state.partialNext({ own_capabilities_by_fid: ownCapabilitiesCache });
|
|
394
394
|
}
|
|
395
395
|
|
|
396
|
-
|
|
397
|
-
this.connectionIdManager.resolveConnectionidPromise();
|
|
398
|
-
this.tokenManager.setTokenOrProvider(undefined);
|
|
399
|
-
this.setGetBatchOwnCapabilitiesThrottlingInterval(
|
|
400
|
-
this.query_batch_own_capabilties_throttling_interval,
|
|
401
|
-
);
|
|
402
|
-
this.state.partialNext({
|
|
403
|
-
connected_user: undefined,
|
|
404
|
-
is_anonymous: true,
|
|
405
|
-
is_ws_connection_healthy: false,
|
|
406
|
-
});
|
|
407
|
-
|
|
408
|
-
return Promise.resolve();
|
|
409
|
-
};
|
|
410
|
-
|
|
411
|
-
connectUser = async (
|
|
412
|
-
user: UserRequest | { id: '!anon' },
|
|
413
|
-
tokenProvider?: TokenOrProvider,
|
|
414
|
-
) => {
|
|
396
|
+
connectUser = async (user: UserRequest, tokenProvider?: TokenOrProvider) => {
|
|
415
397
|
if (
|
|
416
398
|
this.state.getLatestValue().connected_user !== undefined ||
|
|
417
399
|
this.wsConnection
|
|
@@ -745,12 +727,12 @@ export class FeedsClient extends FeedsApi {
|
|
|
745
727
|
};
|
|
746
728
|
}
|
|
747
729
|
|
|
748
|
-
async
|
|
749
|
-
const response = await super.
|
|
750
|
-
const feedResponses = Object.entries(response.
|
|
751
|
-
([feed,
|
|
730
|
+
async ownBatch(request: OwnBatchRequest) {
|
|
731
|
+
const response = await super.ownBatch(request);
|
|
732
|
+
const feedResponses = Object.entries(response.data).map(
|
|
733
|
+
([feed, ownFields]) => ({
|
|
752
734
|
feed,
|
|
753
|
-
own_capabilities,
|
|
735
|
+
own_capabilities: ownFields.own_capabilities,
|
|
754
736
|
}),
|
|
755
737
|
);
|
|
756
738
|
this.hydrateCapabilitiesCache(feedResponses);
|
|
@@ -784,36 +766,41 @@ export class FeedsClient extends FeedsApi {
|
|
|
784
766
|
// For follow API endpoints we update the state after HTTP response to allow queryFeeds with watch: false
|
|
785
767
|
async follow(request: FollowRequest) {
|
|
786
768
|
const response = await super.follow(request);
|
|
787
|
-
|
|
788
|
-
[
|
|
789
|
-
response.follow.source_feed.feed,
|
|
790
|
-
response.follow.target_feed.feed,
|
|
791
|
-
].forEach((fid) => {
|
|
792
|
-
const feeds = this.findAllActiveFeedsByFid(fid);
|
|
793
|
-
feeds.forEach((f) => handleFollowCreated.bind(f)(response, false));
|
|
794
|
-
});
|
|
769
|
+
this.updateStateFromFollows([response.follow]);
|
|
795
770
|
|
|
796
771
|
return response;
|
|
797
772
|
}
|
|
798
773
|
|
|
774
|
+
/**
|
|
775
|
+
* @deprecated Use getOrCreateFollows instead
|
|
776
|
+
* @param request
|
|
777
|
+
* @returns
|
|
778
|
+
*/
|
|
799
779
|
async followBatch(request: FollowBatchRequest) {
|
|
800
780
|
const response = await super.followBatch(request);
|
|
781
|
+
this.updateStateFromFollows(response.follows);
|
|
801
782
|
|
|
802
|
-
response
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
783
|
+
return response;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
async getOrCreateFollows(request: FollowBatchRequest) {
|
|
787
|
+
const response = await super.getOrCreateFollows(request);
|
|
788
|
+
|
|
789
|
+
this.updateStateFromFollows(response.created);
|
|
806
790
|
|
|
807
791
|
return response;
|
|
808
792
|
}
|
|
809
793
|
|
|
810
|
-
async unfollow(request:
|
|
794
|
+
async unfollow(request: { source: string; target: string }) {
|
|
811
795
|
const response = await super.unfollow(request);
|
|
796
|
+
this.updateStateFromUnfollows([response.follow]);
|
|
812
797
|
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
798
|
+
return response;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
async getOrCreateUnfollows(request: UnfollowBatchRequest) {
|
|
802
|
+
const response = await super.getOrCreateUnfollows(request);
|
|
803
|
+
this.updateStateFromUnfollows(response.follows);
|
|
817
804
|
|
|
818
805
|
return response;
|
|
819
806
|
}
|
|
@@ -942,4 +929,24 @@ export class FeedsClient extends FeedsApi {
|
|
|
942
929
|
.map((a) => getFeed.call(a)!),
|
|
943
930
|
];
|
|
944
931
|
}
|
|
932
|
+
|
|
933
|
+
private updateStateFromFollows(follows: FollowResponse[]) {
|
|
934
|
+
follows.forEach((follow) => {
|
|
935
|
+
const feeds = [
|
|
936
|
+
...this.findAllActiveFeedsByFid(follow.source_feed.feed),
|
|
937
|
+
...this.findAllActiveFeedsByFid(follow.target_feed.feed),
|
|
938
|
+
];
|
|
939
|
+
feeds.forEach((f) => handleFollowCreated.bind(f)({ follow }, false));
|
|
940
|
+
});
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
private updateStateFromUnfollows(follows: FollowResponse[]) {
|
|
944
|
+
follows.forEach((follow) => {
|
|
945
|
+
const feeds = [
|
|
946
|
+
...this.findAllActiveFeedsByFid(follow.source_feed.feed),
|
|
947
|
+
...this.findAllActiveFeedsByFid(follow.target_feed.feed),
|
|
948
|
+
];
|
|
949
|
+
feeds.forEach((f) => handleFollowDeleted.bind(f)({ follow }, false));
|
|
950
|
+
});
|
|
951
|
+
}
|
|
945
952
|
}
|
|
@@ -62,8 +62,8 @@ import type {
|
|
|
62
62
|
ListBlockListResponse,
|
|
63
63
|
ListDevicesResponse,
|
|
64
64
|
MarkActivityRequest,
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
OwnBatchRequest,
|
|
66
|
+
OwnBatchResponse,
|
|
67
67
|
PinActivityRequest,
|
|
68
68
|
PinActivityResponse,
|
|
69
69
|
PollOptionResponse,
|
|
@@ -104,6 +104,8 @@ import type {
|
|
|
104
104
|
SingleFollowResponse,
|
|
105
105
|
UnblockUsersRequest,
|
|
106
106
|
UnblockUsersResponse,
|
|
107
|
+
UnfollowBatchRequest,
|
|
108
|
+
UnfollowBatchResponse,
|
|
107
109
|
UnfollowResponse,
|
|
108
110
|
UnpinActivityResponse,
|
|
109
111
|
UpdateActivityPartialRequest,
|
|
@@ -979,14 +981,14 @@ export class FeedsApi {
|
|
|
979
981
|
}
|
|
980
982
|
|
|
981
983
|
async addComment(
|
|
982
|
-
request
|
|
984
|
+
request?: AddCommentRequest,
|
|
983
985
|
): Promise<StreamResponse<AddCommentResponse>> {
|
|
984
986
|
const body = {
|
|
985
|
-
object_id: request?.object_id,
|
|
986
|
-
object_type: request?.object_type,
|
|
987
987
|
comment: request?.comment,
|
|
988
988
|
create_notification_activity: request?.create_notification_activity,
|
|
989
989
|
id: request?.id,
|
|
990
|
+
object_id: request?.object_id,
|
|
991
|
+
object_type: request?.object_type,
|
|
990
992
|
parent_id: request?.parent_id,
|
|
991
993
|
skip_enrich_url: request?.skip_enrich_url,
|
|
992
994
|
skip_push: request?.skip_push,
|
|
@@ -1621,28 +1623,29 @@ export class FeedsApi {
|
|
|
1621
1623
|
return { ...response.body, metadata: response.metadata };
|
|
1622
1624
|
}
|
|
1623
1625
|
|
|
1624
|
-
async
|
|
1625
|
-
request:
|
|
1626
|
-
): Promise<StreamResponse<
|
|
1626
|
+
async ownBatch(
|
|
1627
|
+
request: OwnBatchRequest & { connection_id?: string },
|
|
1628
|
+
): Promise<StreamResponse<OwnBatchResponse>> {
|
|
1627
1629
|
const queryParams = {
|
|
1628
1630
|
connection_id: request?.connection_id,
|
|
1629
1631
|
};
|
|
1630
1632
|
const body = {
|
|
1631
1633
|
feeds: request?.feeds,
|
|
1634
|
+
fields: request?.fields,
|
|
1632
1635
|
};
|
|
1633
1636
|
|
|
1634
1637
|
const response = await this.apiClient.sendRequest<
|
|
1635
|
-
StreamResponse<
|
|
1638
|
+
StreamResponse<OwnBatchResponse>
|
|
1636
1639
|
>(
|
|
1637
1640
|
'POST',
|
|
1638
|
-
'/api/v2/feeds/feeds/
|
|
1641
|
+
'/api/v2/feeds/feeds/own/batch',
|
|
1639
1642
|
undefined,
|
|
1640
1643
|
queryParams,
|
|
1641
1644
|
body,
|
|
1642
1645
|
'application/json',
|
|
1643
1646
|
);
|
|
1644
1647
|
|
|
1645
|
-
decoders.
|
|
1648
|
+
decoders.OwnBatchResponse?.(response.body);
|
|
1646
1649
|
|
|
1647
1650
|
return { ...response.body, metadata: response.metadata };
|
|
1648
1651
|
}
|
|
@@ -1783,6 +1786,29 @@ export class FeedsApi {
|
|
|
1783
1786
|
return { ...response.body, metadata: response.metadata };
|
|
1784
1787
|
}
|
|
1785
1788
|
|
|
1789
|
+
async getOrCreateFollows(
|
|
1790
|
+
request: FollowBatchRequest,
|
|
1791
|
+
): Promise<StreamResponse<FollowBatchResponse>> {
|
|
1792
|
+
const body = {
|
|
1793
|
+
follows: request?.follows,
|
|
1794
|
+
};
|
|
1795
|
+
|
|
1796
|
+
const response = await this.apiClient.sendRequest<
|
|
1797
|
+
StreamResponse<FollowBatchResponse>
|
|
1798
|
+
>(
|
|
1799
|
+
'POST',
|
|
1800
|
+
'/api/v2/feeds/follows/batch/upsert',
|
|
1801
|
+
undefined,
|
|
1802
|
+
undefined,
|
|
1803
|
+
body,
|
|
1804
|
+
'application/json',
|
|
1805
|
+
);
|
|
1806
|
+
|
|
1807
|
+
decoders.FollowBatchResponse?.(response.body);
|
|
1808
|
+
|
|
1809
|
+
return { ...response.body, metadata: response.metadata };
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1786
1812
|
async queryFollows(
|
|
1787
1813
|
request?: QueryFollowsRequest,
|
|
1788
1814
|
): Promise<StreamResponse<QueryFollowsResponse>> {
|
|
@@ -1857,6 +1883,29 @@ export class FeedsApi {
|
|
|
1857
1883
|
return { ...response.body, metadata: response.metadata };
|
|
1858
1884
|
}
|
|
1859
1885
|
|
|
1886
|
+
async getOrCreateUnfollows(
|
|
1887
|
+
request: UnfollowBatchRequest,
|
|
1888
|
+
): Promise<StreamResponse<UnfollowBatchResponse>> {
|
|
1889
|
+
const body = {
|
|
1890
|
+
follows: request?.follows,
|
|
1891
|
+
};
|
|
1892
|
+
|
|
1893
|
+
const response = await this.apiClient.sendRequest<
|
|
1894
|
+
StreamResponse<UnfollowBatchResponse>
|
|
1895
|
+
>(
|
|
1896
|
+
'POST',
|
|
1897
|
+
'/api/v2/feeds/unfollow/batch/upsert',
|
|
1898
|
+
undefined,
|
|
1899
|
+
undefined,
|
|
1900
|
+
body,
|
|
1901
|
+
'application/json',
|
|
1902
|
+
);
|
|
1903
|
+
|
|
1904
|
+
decoders.UnfollowBatchResponse?.(response.body);
|
|
1905
|
+
|
|
1906
|
+
return { ...response.body, metadata: response.metadata };
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1860
1909
|
async createGuest(
|
|
1861
1910
|
request: CreateGuestRequest,
|
|
1862
1911
|
): Promise<StreamResponse<CreateGuestResponse>> {
|
|
@@ -68,8 +68,6 @@ decoders.ActivityAddedEvent = (input?: Record<string, any>) => {
|
|
|
68
68
|
activity: { type: 'ActivityResponse', isSingle: true },
|
|
69
69
|
|
|
70
70
|
received_at: { type: 'DatetimeType', isSingle: true },
|
|
71
|
-
|
|
72
|
-
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
73
71
|
};
|
|
74
72
|
return decode(typeMappings, input);
|
|
75
73
|
};
|
|
@@ -81,8 +79,6 @@ decoders.ActivityDeletedEvent = (input?: Record<string, any>) => {
|
|
|
81
79
|
activity: { type: 'ActivityResponse', isSingle: true },
|
|
82
80
|
|
|
83
81
|
received_at: { type: 'DatetimeType', isSingle: true },
|
|
84
|
-
|
|
85
|
-
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
86
82
|
};
|
|
87
83
|
return decode(typeMappings, input);
|
|
88
84
|
};
|
|
@@ -92,8 +88,6 @@ decoders.ActivityFeedbackEvent = (input?: Record<string, any>) => {
|
|
|
92
88
|
created_at: { type: 'DatetimeType', isSingle: true },
|
|
93
89
|
|
|
94
90
|
received_at: { type: 'DatetimeType', isSingle: true },
|
|
95
|
-
|
|
96
|
-
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
97
91
|
};
|
|
98
92
|
return decode(typeMappings, input);
|
|
99
93
|
};
|
|
@@ -103,8 +97,6 @@ decoders.ActivityMarkEvent = (input?: Record<string, any>) => {
|
|
|
103
97
|
created_at: { type: 'DatetimeType', isSingle: true },
|
|
104
98
|
|
|
105
99
|
received_at: { type: 'DatetimeType', isSingle: true },
|
|
106
|
-
|
|
107
|
-
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
108
100
|
};
|
|
109
101
|
return decode(typeMappings, input);
|
|
110
102
|
};
|
|
@@ -129,8 +121,6 @@ decoders.ActivityPinnedEvent = (input?: Record<string, any>) => {
|
|
|
129
121
|
pinned_activity: { type: 'PinActivityResponse', isSingle: true },
|
|
130
122
|
|
|
131
123
|
received_at: { type: 'DatetimeType', isSingle: true },
|
|
132
|
-
|
|
133
|
-
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
134
124
|
};
|
|
135
125
|
return decode(typeMappings, input);
|
|
136
126
|
};
|
|
@@ -144,8 +134,6 @@ decoders.ActivityReactionAddedEvent = (input?: Record<string, any>) => {
|
|
|
144
134
|
reaction: { type: 'FeedsReactionResponse', isSingle: true },
|
|
145
135
|
|
|
146
136
|
received_at: { type: 'DatetimeType', isSingle: true },
|
|
147
|
-
|
|
148
|
-
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
149
137
|
};
|
|
150
138
|
return decode(typeMappings, input);
|
|
151
139
|
};
|
|
@@ -159,8 +147,6 @@ decoders.ActivityReactionDeletedEvent = (input?: Record<string, any>) => {
|
|
|
159
147
|
reaction: { type: 'FeedsReactionResponse', isSingle: true },
|
|
160
148
|
|
|
161
149
|
received_at: { type: 'DatetimeType', isSingle: true },
|
|
162
|
-
|
|
163
|
-
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
164
150
|
};
|
|
165
151
|
return decode(typeMappings, input);
|
|
166
152
|
};
|
|
@@ -174,8 +160,6 @@ decoders.ActivityReactionUpdatedEvent = (input?: Record<string, any>) => {
|
|
|
174
160
|
reaction: { type: 'FeedsReactionResponse', isSingle: true },
|
|
175
161
|
|
|
176
162
|
received_at: { type: 'DatetimeType', isSingle: true },
|
|
177
|
-
|
|
178
|
-
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
179
163
|
};
|
|
180
164
|
return decode(typeMappings, input);
|
|
181
165
|
};
|
|
@@ -187,8 +171,6 @@ decoders.ActivityRemovedFromFeedEvent = (input?: Record<string, any>) => {
|
|
|
187
171
|
activity: { type: 'ActivityResponse', isSingle: true },
|
|
188
172
|
|
|
189
173
|
received_at: { type: 'DatetimeType', isSingle: true },
|
|
190
|
-
|
|
191
|
-
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
192
174
|
};
|
|
193
175
|
return decode(typeMappings, input);
|
|
194
176
|
};
|
|
@@ -237,8 +219,6 @@ decoders.ActivityUnpinnedEvent = (input?: Record<string, any>) => {
|
|
|
237
219
|
pinned_activity: { type: 'PinActivityResponse', isSingle: true },
|
|
238
220
|
|
|
239
221
|
received_at: { type: 'DatetimeType', isSingle: true },
|
|
240
|
-
|
|
241
|
-
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
242
222
|
};
|
|
243
223
|
return decode(typeMappings, input);
|
|
244
224
|
};
|
|
@@ -250,8 +230,6 @@ decoders.ActivityUpdatedEvent = (input?: Record<string, any>) => {
|
|
|
250
230
|
activity: { type: 'ActivityResponse', isSingle: true },
|
|
251
231
|
|
|
252
232
|
received_at: { type: 'DatetimeType', isSingle: true },
|
|
253
|
-
|
|
254
|
-
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
255
233
|
};
|
|
256
234
|
return decode(typeMappings, input);
|
|
257
235
|
};
|
|
@@ -371,8 +349,6 @@ decoders.BookmarkAddedEvent = (input?: Record<string, any>) => {
|
|
|
371
349
|
bookmark: { type: 'BookmarkResponse', isSingle: true },
|
|
372
350
|
|
|
373
351
|
received_at: { type: 'DatetimeType', isSingle: true },
|
|
374
|
-
|
|
375
|
-
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
376
352
|
};
|
|
377
353
|
return decode(typeMappings, input);
|
|
378
354
|
};
|
|
@@ -384,8 +360,6 @@ decoders.BookmarkDeletedEvent = (input?: Record<string, any>) => {
|
|
|
384
360
|
bookmark: { type: 'BookmarkResponse', isSingle: true },
|
|
385
361
|
|
|
386
362
|
received_at: { type: 'DatetimeType', isSingle: true },
|
|
387
|
-
|
|
388
|
-
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
389
363
|
};
|
|
390
364
|
return decode(typeMappings, input);
|
|
391
365
|
};
|
|
@@ -397,8 +371,6 @@ decoders.BookmarkFolderDeletedEvent = (input?: Record<string, any>) => {
|
|
|
397
371
|
bookmark_folder: { type: 'BookmarkFolderResponse', isSingle: true },
|
|
398
372
|
|
|
399
373
|
received_at: { type: 'DatetimeType', isSingle: true },
|
|
400
|
-
|
|
401
|
-
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
402
374
|
};
|
|
403
375
|
return decode(typeMappings, input);
|
|
404
376
|
};
|
|
@@ -409,7 +381,7 @@ decoders.BookmarkFolderResponse = (input?: Record<string, any>) => {
|
|
|
409
381
|
|
|
410
382
|
updated_at: { type: 'DatetimeType', isSingle: true },
|
|
411
383
|
|
|
412
|
-
user: { type: '
|
|
384
|
+
user: { type: 'UserResponse', isSingle: true },
|
|
413
385
|
};
|
|
414
386
|
return decode(typeMappings, input);
|
|
415
387
|
};
|
|
@@ -421,8 +393,6 @@ decoders.BookmarkFolderUpdatedEvent = (input?: Record<string, any>) => {
|
|
|
421
393
|
bookmark_folder: { type: 'BookmarkFolderResponse', isSingle: true },
|
|
422
394
|
|
|
423
395
|
received_at: { type: 'DatetimeType', isSingle: true },
|
|
424
|
-
|
|
425
|
-
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
426
396
|
};
|
|
427
397
|
return decode(typeMappings, input);
|
|
428
398
|
};
|
|
@@ -435,7 +405,7 @@ decoders.BookmarkResponse = (input?: Record<string, any>) => {
|
|
|
435
405
|
|
|
436
406
|
activity: { type: 'ActivityResponse', isSingle: true },
|
|
437
407
|
|
|
438
|
-
user: { type: '
|
|
408
|
+
user: { type: 'UserResponse', isSingle: true },
|
|
439
409
|
|
|
440
410
|
folder: { type: 'BookmarkFolderResponse', isSingle: true },
|
|
441
411
|
};
|
|
@@ -449,8 +419,6 @@ decoders.BookmarkUpdatedEvent = (input?: Record<string, any>) => {
|
|
|
449
419
|
bookmark: { type: 'BookmarkResponse', isSingle: true },
|
|
450
420
|
|
|
451
421
|
received_at: { type: 'DatetimeType', isSingle: true },
|
|
452
|
-
|
|
453
|
-
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
454
422
|
};
|
|
455
423
|
return decode(typeMappings, input);
|
|
456
424
|
};
|
|
@@ -679,8 +647,6 @@ decoders.CommentAddedEvent = (input?: Record<string, any>) => {
|
|
|
679
647
|
comment: { type: 'CommentResponse', isSingle: true },
|
|
680
648
|
|
|
681
649
|
received_at: { type: 'DatetimeType', isSingle: true },
|
|
682
|
-
|
|
683
|
-
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
684
650
|
};
|
|
685
651
|
return decode(typeMappings, input);
|
|
686
652
|
};
|
|
@@ -692,8 +658,6 @@ decoders.CommentDeletedEvent = (input?: Record<string, any>) => {
|
|
|
692
658
|
comment: { type: 'CommentResponse', isSingle: true },
|
|
693
659
|
|
|
694
660
|
received_at: { type: 'DatetimeType', isSingle: true },
|
|
695
|
-
|
|
696
|
-
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
697
661
|
};
|
|
698
662
|
return decode(typeMappings, input);
|
|
699
663
|
};
|
|
@@ -709,8 +673,6 @@ decoders.CommentReactionAddedEvent = (input?: Record<string, any>) => {
|
|
|
709
673
|
reaction: { type: 'FeedsReactionResponse', isSingle: true },
|
|
710
674
|
|
|
711
675
|
received_at: { type: 'DatetimeType', isSingle: true },
|
|
712
|
-
|
|
713
|
-
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
714
676
|
};
|
|
715
677
|
return decode(typeMappings, input);
|
|
716
678
|
};
|
|
@@ -739,8 +701,6 @@ decoders.CommentReactionUpdatedEvent = (input?: Record<string, any>) => {
|
|
|
739
701
|
reaction: { type: 'FeedsReactionResponse', isSingle: true },
|
|
740
702
|
|
|
741
703
|
received_at: { type: 'DatetimeType', isSingle: true },
|
|
742
|
-
|
|
743
|
-
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
744
704
|
};
|
|
745
705
|
return decode(typeMappings, input);
|
|
746
706
|
};
|
|
@@ -773,8 +733,6 @@ decoders.CommentUpdatedEvent = (input?: Record<string, any>) => {
|
|
|
773
733
|
comment: { type: 'CommentResponse', isSingle: true },
|
|
774
734
|
|
|
775
735
|
received_at: { type: 'DatetimeType', isSingle: true },
|
|
776
|
-
|
|
777
|
-
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
778
736
|
};
|
|
779
737
|
return decode(typeMappings, input);
|
|
780
738
|
};
|
|
@@ -927,8 +885,6 @@ decoders.FeedCreatedEvent = (input?: Record<string, any>) => {
|
|
|
927
885
|
|
|
928
886
|
feed: { type: 'FeedResponse', isSingle: true },
|
|
929
887
|
|
|
930
|
-
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
931
|
-
|
|
932
888
|
received_at: { type: 'DatetimeType', isSingle: true },
|
|
933
889
|
};
|
|
934
890
|
return decode(typeMappings, input);
|
|
@@ -939,8 +895,6 @@ decoders.FeedDeletedEvent = (input?: Record<string, any>) => {
|
|
|
939
895
|
created_at: { type: 'DatetimeType', isSingle: true },
|
|
940
896
|
|
|
941
897
|
received_at: { type: 'DatetimeType', isSingle: true },
|
|
942
|
-
|
|
943
|
-
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
944
898
|
};
|
|
945
899
|
return decode(typeMappings, input);
|
|
946
900
|
};
|
|
@@ -950,8 +904,6 @@ decoders.FeedGroupChangedEvent = (input?: Record<string, any>) => {
|
|
|
950
904
|
created_at: { type: 'DatetimeType', isSingle: true },
|
|
951
905
|
|
|
952
906
|
received_at: { type: 'DatetimeType', isSingle: true },
|
|
953
|
-
|
|
954
|
-
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
955
907
|
};
|
|
956
908
|
return decode(typeMappings, input);
|
|
957
909
|
};
|
|
@@ -972,8 +924,6 @@ decoders.FeedMemberAddedEvent = (input?: Record<string, any>) => {
|
|
|
972
924
|
member: { type: 'FeedMemberResponse', isSingle: true },
|
|
973
925
|
|
|
974
926
|
received_at: { type: 'DatetimeType', isSingle: true },
|
|
975
|
-
|
|
976
|
-
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
977
927
|
};
|
|
978
928
|
return decode(typeMappings, input);
|
|
979
929
|
};
|
|
@@ -983,8 +933,6 @@ decoders.FeedMemberRemovedEvent = (input?: Record<string, any>) => {
|
|
|
983
933
|
created_at: { type: 'DatetimeType', isSingle: true },
|
|
984
934
|
|
|
985
935
|
received_at: { type: 'DatetimeType', isSingle: true },
|
|
986
|
-
|
|
987
|
-
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
988
936
|
};
|
|
989
937
|
return decode(typeMappings, input);
|
|
990
938
|
};
|
|
@@ -1013,8 +961,15 @@ decoders.FeedMemberUpdatedEvent = (input?: Record<string, any>) => {
|
|
|
1013
961
|
member: { type: 'FeedMemberResponse', isSingle: true },
|
|
1014
962
|
|
|
1015
963
|
received_at: { type: 'DatetimeType', isSingle: true },
|
|
964
|
+
};
|
|
965
|
+
return decode(typeMappings, input);
|
|
966
|
+
};
|
|
967
|
+
|
|
968
|
+
decoders.FeedOwnData = (input?: Record<string, any>) => {
|
|
969
|
+
const typeMappings: TypeMapping = {
|
|
970
|
+
own_follows: { type: 'FollowResponse', isSingle: false },
|
|
1016
971
|
|
|
1017
|
-
|
|
972
|
+
own_membership: { type: 'FeedMemberResponse', isSingle: true },
|
|
1018
973
|
};
|
|
1019
974
|
return decode(typeMappings, input);
|
|
1020
975
|
};
|
|
@@ -1060,8 +1015,6 @@ decoders.FeedUpdatedEvent = (input?: Record<string, any>) => {
|
|
|
1060
1015
|
feed: { type: 'FeedResponse', isSingle: true },
|
|
1061
1016
|
|
|
1062
1017
|
received_at: { type: 'DatetimeType', isSingle: true },
|
|
1063
|
-
|
|
1064
|
-
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
1065
1018
|
};
|
|
1066
1019
|
return decode(typeMappings, input);
|
|
1067
1020
|
};
|
|
@@ -1079,6 +1032,8 @@ decoders.FeedsReactionResponse = (input?: Record<string, any>) => {
|
|
|
1079
1032
|
|
|
1080
1033
|
decoders.FollowBatchResponse = (input?: Record<string, any>) => {
|
|
1081
1034
|
const typeMappings: TypeMapping = {
|
|
1035
|
+
created: { type: 'FollowResponse', isSingle: false },
|
|
1036
|
+
|
|
1082
1037
|
follows: { type: 'FollowResponse', isSingle: false },
|
|
1083
1038
|
};
|
|
1084
1039
|
return decode(typeMappings, input);
|
|
@@ -1434,8 +1389,6 @@ decoders.NotificationFeedUpdatedEvent = (input?: Record<string, any>) => {
|
|
|
1434
1389
|
},
|
|
1435
1390
|
|
|
1436
1391
|
notification_status: { type: 'NotificationStatusResponse', isSingle: true },
|
|
1437
|
-
|
|
1438
|
-
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
1439
1392
|
};
|
|
1440
1393
|
return decode(typeMappings, input);
|
|
1441
1394
|
};
|
|
@@ -1449,6 +1402,13 @@ decoders.NotificationStatusResponse = (input?: Record<string, any>) => {
|
|
|
1449
1402
|
return decode(typeMappings, input);
|
|
1450
1403
|
};
|
|
1451
1404
|
|
|
1405
|
+
decoders.OwnBatchResponse = (input?: Record<string, any>) => {
|
|
1406
|
+
const typeMappings: TypeMapping = {
|
|
1407
|
+
data: { type: 'FeedOwnData', isSingle: false },
|
|
1408
|
+
};
|
|
1409
|
+
return decode(typeMappings, input);
|
|
1410
|
+
};
|
|
1411
|
+
|
|
1452
1412
|
decoders.OwnUser = (input?: Record<string, any>) => {
|
|
1453
1413
|
const typeMappings: TypeMapping = {
|
|
1454
1414
|
created_at: { type: 'DatetimeType', isSingle: true },
|
|
@@ -1899,8 +1859,6 @@ decoders.StoriesFeedUpdatedEvent = (input?: Record<string, any>) => {
|
|
|
1899
1859
|
type: 'AggregatedActivityResponse',
|
|
1900
1860
|
isSingle: false,
|
|
1901
1861
|
},
|
|
1902
|
-
|
|
1903
|
-
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
1904
1862
|
};
|
|
1905
1863
|
return decode(typeMappings, input);
|
|
1906
1864
|
};
|
|
@@ -1935,6 +1893,13 @@ decoders.ThreadedCommentResponse = (input?: Record<string, any>) => {
|
|
|
1935
1893
|
return decode(typeMappings, input);
|
|
1936
1894
|
};
|
|
1937
1895
|
|
|
1896
|
+
decoders.UnfollowBatchResponse = (input?: Record<string, any>) => {
|
|
1897
|
+
const typeMappings: TypeMapping = {
|
|
1898
|
+
follows: { type: 'FollowResponse', isSingle: false },
|
|
1899
|
+
};
|
|
1900
|
+
return decode(typeMappings, input);
|
|
1901
|
+
};
|
|
1902
|
+
|
|
1938
1903
|
decoders.UnfollowResponse = (input?: Record<string, any>) => {
|
|
1939
1904
|
const typeMappings: TypeMapping = {
|
|
1940
1905
|
follow: { type: 'FollowResponse', isSingle: true },
|
|
@@ -2159,23 +2124,6 @@ decoders.UserResponse = (input?: Record<string, any>) => {
|
|
|
2159
2124
|
return decode(typeMappings, input);
|
|
2160
2125
|
};
|
|
2161
2126
|
|
|
2162
|
-
decoders.UserResponseCommonFields = (input?: Record<string, any>) => {
|
|
2163
|
-
const typeMappings: TypeMapping = {
|
|
2164
|
-
created_at: { type: 'DatetimeType', isSingle: true },
|
|
2165
|
-
|
|
2166
|
-
updated_at: { type: 'DatetimeType', isSingle: true },
|
|
2167
|
-
|
|
2168
|
-
deactivated_at: { type: 'DatetimeType', isSingle: true },
|
|
2169
|
-
|
|
2170
|
-
deleted_at: { type: 'DatetimeType', isSingle: true },
|
|
2171
|
-
|
|
2172
|
-
last_active: { type: 'DatetimeType', isSingle: true },
|
|
2173
|
-
|
|
2174
|
-
revoke_tokens_issued_before: { type: 'DatetimeType', isSingle: true },
|
|
2175
|
-
};
|
|
2176
|
-
return decode(typeMappings, input);
|
|
2177
|
-
};
|
|
2178
|
-
|
|
2179
2127
|
decoders.UserUpdatedEvent = (input?: Record<string, any>) => {
|
|
2180
2128
|
const typeMappings: TypeMapping = {
|
|
2181
2129
|
created_at: { type: 'DatetimeType', isSingle: true },
|