@stream-io/node-sdk 0.7.18 → 0.7.19
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/dist/index.cjs.js +87 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.mjs +87 -1
- package/dist/index.es.mjs.map +1 -1
- package/dist/src/gen/feeds/FeedsApi.d.ts +11 -1
- package/dist/src/gen/models/index.d.ts +64 -0
- package/package.json +1 -1
- package/src/gen/feeds/FeedsApi.ts +117 -0
- package/src/gen/model-decoders/decoders.ts +48 -0
- package/src/gen/models/index.ts +104 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiClient, StreamResponse } from '../../gen-imports';
|
|
2
|
-
import { AcceptFeedMemberInviteRequest, AcceptFeedMemberInviteResponse, AcceptFollowRequest, AcceptFollowResponse, ActivityFeedbackRequest, ActivityFeedbackResponse, AddActivityRequest, AddActivityResponse, AddBookmarkRequest, AddBookmarkResponse, AddCommentReactionRequest, AddCommentReactionResponse, AddCommentRequest, AddCommentResponse, AddCommentsBatchRequest, AddCommentsBatchResponse, AddReactionRequest, AddReactionResponse, CastPollVoteRequest, CreateFeedGroupRequest, CreateFeedGroupResponse, CreateFeedViewRequest, CreateFeedViewResponse, CreateFeedsBatchRequest, CreateFeedsBatchResponse, CreateMembershipLevelRequest, CreateMembershipLevelResponse, DeleteActivitiesRequest, DeleteActivitiesResponse, DeleteActivityReactionResponse, DeleteActivityResponse, DeleteBookmarkFolderResponse, DeleteBookmarkResponse, DeleteCommentReactionResponse, DeleteCommentResponse, DeleteFeedGroupResponse, DeleteFeedResponse, DeleteFeedUserDataResponse, DeleteFeedViewResponse, ExportFeedUserDataResponse, FollowBatchRequest, FollowBatchResponse, FollowRequest, GetActivityResponse, GetCommentRepliesResponse, GetCommentResponse, GetCommentsResponse, GetFeedGroupResponse, GetFeedViewResponse, GetFeedVisibilityResponse, GetFeedsRateLimitsResponse, GetFollowSuggestionsResponse, GetOrCreateFeedGroupRequest, GetOrCreateFeedGroupResponse, GetOrCreateFeedRequest, GetOrCreateFeedResponse, GetOrCreateFeedViewRequest, GetOrCreateFeedViewResponse, ListFeedGroupsResponse, ListFeedViewsResponse, ListFeedVisibilitiesResponse, MarkActivityRequest, OwnCapabilitiesBatchRequest, OwnCapabilitiesBatchResponse, PinActivityRequest, PinActivityResponse, PollVoteResponse, QueryActivitiesRequest, QueryActivitiesResponse, QueryActivityReactionsRequest, QueryActivityReactionsResponse, QueryBookmarkFoldersRequest, QueryBookmarkFoldersResponse, QueryBookmarksRequest, QueryBookmarksResponse, QueryCommentReactionsRequest, QueryCommentReactionsResponse, QueryCommentsRequest, QueryCommentsResponse, QueryFeedMembersRequest, QueryFeedMembersResponse, QueryFeedsRequest, QueryFeedsResponse, QueryFeedsUsageStatsRequest, QueryFeedsUsageStatsResponse, QueryFollowsRequest, QueryFollowsResponse, QueryMembershipLevelsRequest, QueryMembershipLevelsResponse, RejectFeedMemberInviteRequest, RejectFeedMemberInviteResponse, RejectFollowRequest, RejectFollowResponse, Response, SingleFollowResponse, UnfollowBatchRequest, UnfollowBatchResponse, UnfollowResponse, UnpinActivityResponse, UpdateActivityPartialRequest, UpdateActivityPartialResponse, UpdateActivityRequest, UpdateActivityResponse, UpdateBookmarkFolderRequest, UpdateBookmarkFolderResponse, UpdateBookmarkRequest, UpdateBookmarkResponse, UpdateCommentRequest, UpdateCommentResponse, UpdateFeedGroupRequest, UpdateFeedGroupResponse, UpdateFeedMembersRequest, UpdateFeedMembersResponse, UpdateFeedRequest, UpdateFeedResponse, UpdateFeedViewRequest, UpdateFeedViewResponse, UpdateFeedVisibilityRequest, UpdateFeedVisibilityResponse, UpdateFollowRequest, UpdateFollowResponse, UpdateMembershipLevelRequest, UpdateMembershipLevelResponse, UpsertActivitiesRequest, UpsertActivitiesResponse } from '../models';
|
|
2
|
+
import { AcceptFeedMemberInviteRequest, AcceptFeedMemberInviteResponse, AcceptFollowRequest, AcceptFollowResponse, ActivityFeedbackRequest, ActivityFeedbackResponse, AddActivityRequest, AddActivityResponse, AddBookmarkRequest, AddBookmarkResponse, AddCommentReactionRequest, AddCommentReactionResponse, AddCommentRequest, AddCommentResponse, AddCommentsBatchRequest, AddCommentsBatchResponse, AddReactionRequest, AddReactionResponse, CastPollVoteRequest, CreateCollectionsRequest, CreateCollectionsResponse, CreateFeedGroupRequest, CreateFeedGroupResponse, CreateFeedViewRequest, CreateFeedViewResponse, CreateFeedsBatchRequest, CreateFeedsBatchResponse, CreateMembershipLevelRequest, CreateMembershipLevelResponse, DeleteActivitiesRequest, DeleteActivitiesResponse, DeleteActivityReactionResponse, DeleteActivityResponse, DeleteBookmarkFolderResponse, DeleteBookmarkResponse, DeleteCollectionsResponse, DeleteCommentReactionResponse, DeleteCommentResponse, DeleteFeedGroupResponse, DeleteFeedResponse, DeleteFeedUserDataResponse, DeleteFeedViewResponse, ExportFeedUserDataResponse, FollowBatchRequest, FollowBatchResponse, FollowRequest, GetActivityResponse, GetCommentRepliesResponse, GetCommentResponse, GetCommentsResponse, GetFeedGroupResponse, GetFeedViewResponse, GetFeedVisibilityResponse, GetFeedsRateLimitsResponse, GetFollowSuggestionsResponse, GetOrCreateFeedGroupRequest, GetOrCreateFeedGroupResponse, GetOrCreateFeedRequest, GetOrCreateFeedResponse, GetOrCreateFeedViewRequest, GetOrCreateFeedViewResponse, ListFeedGroupsResponse, ListFeedViewsResponse, ListFeedVisibilitiesResponse, MarkActivityRequest, OwnCapabilitiesBatchRequest, OwnCapabilitiesBatchResponse, PinActivityRequest, PinActivityResponse, PollVoteResponse, QueryActivitiesRequest, QueryActivitiesResponse, QueryActivityReactionsRequest, QueryActivityReactionsResponse, QueryBookmarkFoldersRequest, QueryBookmarkFoldersResponse, QueryBookmarksRequest, QueryBookmarksResponse, QueryCommentReactionsRequest, QueryCommentReactionsResponse, QueryCommentsRequest, QueryCommentsResponse, QueryFeedMembersRequest, QueryFeedMembersResponse, QueryFeedsRequest, QueryFeedsResponse, QueryFeedsUsageStatsRequest, QueryFeedsUsageStatsResponse, QueryFollowsRequest, QueryFollowsResponse, QueryMembershipLevelsRequest, QueryMembershipLevelsResponse, ReadCollectionsResponse, RejectFeedMemberInviteRequest, RejectFeedMemberInviteResponse, RejectFollowRequest, RejectFollowResponse, Response, SingleFollowResponse, UnfollowBatchRequest, UnfollowBatchResponse, UnfollowResponse, UnpinActivityResponse, UpdateActivityPartialRequest, UpdateActivityPartialResponse, UpdateActivityRequest, UpdateActivityResponse, UpdateBookmarkFolderRequest, UpdateBookmarkFolderResponse, UpdateBookmarkRequest, UpdateBookmarkResponse, UpdateCollectionsRequest, UpdateCollectionsResponse, UpdateCommentRequest, UpdateCommentResponse, UpdateFeedGroupRequest, UpdateFeedGroupResponse, UpdateFeedMembersRequest, UpdateFeedMembersResponse, UpdateFeedRequest, UpdateFeedResponse, UpdateFeedViewRequest, UpdateFeedViewResponse, UpdateFeedVisibilityRequest, UpdateFeedVisibilityResponse, UpdateFollowRequest, UpdateFollowResponse, UpdateMembershipLevelRequest, UpdateMembershipLevelResponse, UpsertActivitiesRequest, UpsertActivitiesResponse, UpsertCollectionsRequest, UpsertCollectionsResponse } from '../models';
|
|
3
3
|
export declare class FeedsApi {
|
|
4
4
|
readonly apiClient: ApiClient;
|
|
5
5
|
constructor(apiClient: ApiClient);
|
|
@@ -63,6 +63,16 @@ export declare class FeedsApi {
|
|
|
63
63
|
folder_id: string;
|
|
64
64
|
}): Promise<StreamResponse<UpdateBookmarkFolderResponse>>;
|
|
65
65
|
queryBookmarks(request?: QueryBookmarksRequest): Promise<StreamResponse<QueryBookmarksResponse>>;
|
|
66
|
+
deleteCollections(request: {
|
|
67
|
+
collection_refs: string[];
|
|
68
|
+
}): Promise<StreamResponse<DeleteCollectionsResponse>>;
|
|
69
|
+
readCollections(request: {
|
|
70
|
+
collection_refs: string[];
|
|
71
|
+
user_id?: string;
|
|
72
|
+
}): Promise<StreamResponse<ReadCollectionsResponse>>;
|
|
73
|
+
updateCollections(request: UpdateCollectionsRequest): Promise<StreamResponse<UpdateCollectionsResponse>>;
|
|
74
|
+
createCollections(request: CreateCollectionsRequest): Promise<StreamResponse<CreateCollectionsResponse>>;
|
|
75
|
+
upsertCollections(request: UpsertCollectionsRequest): Promise<StreamResponse<UpsertCollectionsResponse>>;
|
|
66
76
|
getComments(request: {
|
|
67
77
|
object_id: string;
|
|
68
78
|
object_type: string;
|
|
@@ -289,6 +289,7 @@ export interface ActivityRequest {
|
|
|
289
289
|
visibility?: 'public' | 'private' | 'tag';
|
|
290
290
|
visibility_tag?: string;
|
|
291
291
|
attachments?: Attachment[];
|
|
292
|
+
collection_refs?: string[];
|
|
292
293
|
filter_tags?: string[];
|
|
293
294
|
interest_tags?: string[];
|
|
294
295
|
mentioned_user_ids?: string[];
|
|
@@ -320,6 +321,7 @@ export interface ActivityResponse {
|
|
|
320
321
|
mentioned_users: UserResponse[];
|
|
321
322
|
own_bookmarks: BookmarkResponse[];
|
|
322
323
|
own_reactions: FeedsReactionResponse[];
|
|
324
|
+
collections: Record<string, EnrichedCollectionResponse>;
|
|
323
325
|
custom: Record<string, any>;
|
|
324
326
|
reaction_groups: Record<string, ReactionGroupResponse>;
|
|
325
327
|
search_data: Record<string, any>;
|
|
@@ -387,6 +389,7 @@ export interface AddActivityRequest {
|
|
|
387
389
|
visibility?: 'public' | 'private' | 'tag';
|
|
388
390
|
visibility_tag?: string;
|
|
389
391
|
attachments?: Attachment[];
|
|
392
|
+
collection_refs?: string[];
|
|
390
393
|
filter_tags?: string[];
|
|
391
394
|
interest_tags?: string[];
|
|
392
395
|
mentioned_user_ids?: string[];
|
|
@@ -2050,6 +2053,20 @@ export interface CollectUserFeedbackRequest {
|
|
|
2050
2053
|
export interface CollectUserFeedbackResponse {
|
|
2051
2054
|
duration: string;
|
|
2052
2055
|
}
|
|
2056
|
+
export interface CollectionRequest {
|
|
2057
|
+
name: string;
|
|
2058
|
+
custom: Record<string, any>;
|
|
2059
|
+
id?: string;
|
|
2060
|
+
user_id?: string;
|
|
2061
|
+
}
|
|
2062
|
+
export interface CollectionResponse {
|
|
2063
|
+
created_at: Date;
|
|
2064
|
+
id: string;
|
|
2065
|
+
name: string;
|
|
2066
|
+
updated_at: Date;
|
|
2067
|
+
custom: Record<string, any>;
|
|
2068
|
+
user_id?: string;
|
|
2069
|
+
}
|
|
2053
2070
|
export interface Command {
|
|
2054
2071
|
args: string;
|
|
2055
2072
|
description: string;
|
|
@@ -2294,6 +2311,15 @@ export interface CreateChannelTypeResponse {
|
|
|
2294
2311
|
blocklists?: BlockListOptions[];
|
|
2295
2312
|
automod_thresholds?: Thresholds;
|
|
2296
2313
|
}
|
|
2314
|
+
export interface CreateCollectionsRequest {
|
|
2315
|
+
collections: CollectionRequest[];
|
|
2316
|
+
user_id?: string;
|
|
2317
|
+
user?: UserRequest;
|
|
2318
|
+
}
|
|
2319
|
+
export interface CreateCollectionsResponse {
|
|
2320
|
+
duration: string;
|
|
2321
|
+
collections: CollectionResponse[];
|
|
2322
|
+
}
|
|
2297
2323
|
export interface CreateCommandRequest {
|
|
2298
2324
|
description: string;
|
|
2299
2325
|
name: string;
|
|
@@ -2578,6 +2604,9 @@ export interface DeleteChannelsResultResponse {
|
|
|
2578
2604
|
status: string;
|
|
2579
2605
|
error?: string;
|
|
2580
2606
|
}
|
|
2607
|
+
export interface DeleteCollectionsResponse {
|
|
2608
|
+
duration: string;
|
|
2609
|
+
}
|
|
2581
2610
|
export interface DeleteCommandResponse {
|
|
2582
2611
|
duration: string;
|
|
2583
2612
|
name: string;
|
|
@@ -2794,6 +2823,15 @@ export interface EnrichedActivity {
|
|
|
2794
2823
|
reaction_counts?: Record<string, number>;
|
|
2795
2824
|
target?: Data;
|
|
2796
2825
|
}
|
|
2826
|
+
export interface EnrichedCollectionResponse {
|
|
2827
|
+
created_at: Date;
|
|
2828
|
+
id: string;
|
|
2829
|
+
name: string;
|
|
2830
|
+
status: 'ok' | 'notfound';
|
|
2831
|
+
updated_at: Date;
|
|
2832
|
+
custom: Record<string, any>;
|
|
2833
|
+
user_id?: string;
|
|
2834
|
+
}
|
|
2797
2835
|
export interface EnrichedReaction {
|
|
2798
2836
|
activity_id: string;
|
|
2799
2837
|
kind: string;
|
|
@@ -5916,6 +5954,10 @@ export interface ReactivateUsersResponse {
|
|
|
5916
5954
|
duration: string;
|
|
5917
5955
|
task_id: string;
|
|
5918
5956
|
}
|
|
5957
|
+
export interface ReadCollectionsResponse {
|
|
5958
|
+
duration: string;
|
|
5959
|
+
collections: CollectionResponse[];
|
|
5960
|
+
}
|
|
5919
5961
|
export interface ReadReceipts {
|
|
5920
5962
|
enabled: boolean;
|
|
5921
5963
|
}
|
|
@@ -6880,6 +6922,7 @@ export interface UpdateActivityRequest {
|
|
|
6880
6922
|
user_id?: string;
|
|
6881
6923
|
visibility?: string;
|
|
6882
6924
|
attachments?: Attachment[];
|
|
6925
|
+
collection_refs?: string[];
|
|
6883
6926
|
feeds?: string[];
|
|
6884
6927
|
filter_tags?: string[];
|
|
6885
6928
|
interest_tags?: string[];
|
|
@@ -7115,6 +7158,20 @@ export interface UpdateChannelTypeResponse {
|
|
|
7115
7158
|
blocklists?: BlockListOptions[];
|
|
7116
7159
|
automod_thresholds?: Thresholds;
|
|
7117
7160
|
}
|
|
7161
|
+
export interface UpdateCollectionRequest {
|
|
7162
|
+
id: string;
|
|
7163
|
+
name: string;
|
|
7164
|
+
custom: Record<string, any>;
|
|
7165
|
+
}
|
|
7166
|
+
export interface UpdateCollectionsRequest {
|
|
7167
|
+
collections: UpdateCollectionRequest[];
|
|
7168
|
+
user_id?: string;
|
|
7169
|
+
user?: UserRequest;
|
|
7170
|
+
}
|
|
7171
|
+
export interface UpdateCollectionsResponse {
|
|
7172
|
+
duration: string;
|
|
7173
|
+
collections: CollectionResponse[];
|
|
7174
|
+
}
|
|
7118
7175
|
export interface UpdateCommandRequest {
|
|
7119
7176
|
description: string;
|
|
7120
7177
|
args?: string;
|
|
@@ -7369,6 +7426,13 @@ export interface UpsertActivitiesResponse {
|
|
|
7369
7426
|
duration: string;
|
|
7370
7427
|
activities: ActivityResponse[];
|
|
7371
7428
|
}
|
|
7429
|
+
export interface UpsertCollectionsRequest {
|
|
7430
|
+
collections: CollectionRequest[];
|
|
7431
|
+
}
|
|
7432
|
+
export interface UpsertCollectionsResponse {
|
|
7433
|
+
duration: string;
|
|
7434
|
+
collections: CollectionResponse[];
|
|
7435
|
+
}
|
|
7372
7436
|
export interface UpsertConfigRequest {
|
|
7373
7437
|
key: string;
|
|
7374
7438
|
async?: boolean;
|
package/package.json
CHANGED
|
@@ -19,6 +19,8 @@ import {
|
|
|
19
19
|
AddReactionRequest,
|
|
20
20
|
AddReactionResponse,
|
|
21
21
|
CastPollVoteRequest,
|
|
22
|
+
CreateCollectionsRequest,
|
|
23
|
+
CreateCollectionsResponse,
|
|
22
24
|
CreateFeedGroupRequest,
|
|
23
25
|
CreateFeedGroupResponse,
|
|
24
26
|
CreateFeedViewRequest,
|
|
@@ -33,6 +35,7 @@ import {
|
|
|
33
35
|
DeleteActivityResponse,
|
|
34
36
|
DeleteBookmarkFolderResponse,
|
|
35
37
|
DeleteBookmarkResponse,
|
|
38
|
+
DeleteCollectionsResponse,
|
|
36
39
|
DeleteCommentReactionResponse,
|
|
37
40
|
DeleteCommentResponse,
|
|
38
41
|
DeleteFeedGroupResponse,
|
|
@@ -89,6 +92,7 @@ import {
|
|
|
89
92
|
QueryFollowsResponse,
|
|
90
93
|
QueryMembershipLevelsRequest,
|
|
91
94
|
QueryMembershipLevelsResponse,
|
|
95
|
+
ReadCollectionsResponse,
|
|
92
96
|
RejectFeedMemberInviteRequest,
|
|
93
97
|
RejectFeedMemberInviteResponse,
|
|
94
98
|
RejectFollowRequest,
|
|
@@ -107,6 +111,8 @@ import {
|
|
|
107
111
|
UpdateBookmarkFolderResponse,
|
|
108
112
|
UpdateBookmarkRequest,
|
|
109
113
|
UpdateBookmarkResponse,
|
|
114
|
+
UpdateCollectionsRequest,
|
|
115
|
+
UpdateCollectionsResponse,
|
|
110
116
|
UpdateCommentRequest,
|
|
111
117
|
UpdateCommentResponse,
|
|
112
118
|
UpdateFeedGroupRequest,
|
|
@@ -125,6 +131,8 @@ import {
|
|
|
125
131
|
UpdateMembershipLevelResponse,
|
|
126
132
|
UpsertActivitiesRequest,
|
|
127
133
|
UpsertActivitiesResponse,
|
|
134
|
+
UpsertCollectionsRequest,
|
|
135
|
+
UpsertCollectionsResponse,
|
|
128
136
|
} from '../models';
|
|
129
137
|
import { decoders } from '../model-decoders/decoders';
|
|
130
138
|
|
|
@@ -147,6 +155,7 @@ export class FeedsApi {
|
|
|
147
155
|
visibility: request?.visibility,
|
|
148
156
|
visibility_tag: request?.visibility_tag,
|
|
149
157
|
attachments: request?.attachments,
|
|
158
|
+
collection_refs: request?.collection_refs,
|
|
150
159
|
filter_tags: request?.filter_tags,
|
|
151
160
|
interest_tags: request?.interest_tags,
|
|
152
161
|
mentioned_user_ids: request?.mentioned_user_ids,
|
|
@@ -594,6 +603,7 @@ export class FeedsApi {
|
|
|
594
603
|
user_id: request?.user_id,
|
|
595
604
|
visibility: request?.visibility,
|
|
596
605
|
attachments: request?.attachments,
|
|
606
|
+
collection_refs: request?.collection_refs,
|
|
597
607
|
feeds: request?.feeds,
|
|
598
608
|
filter_tags: request?.filter_tags,
|
|
599
609
|
interest_tags: request?.interest_tags,
|
|
@@ -722,6 +732,113 @@ export class FeedsApi {
|
|
|
722
732
|
return { ...response.body, metadata: response.metadata };
|
|
723
733
|
}
|
|
724
734
|
|
|
735
|
+
async deleteCollections(request: {
|
|
736
|
+
collection_refs: string[];
|
|
737
|
+
}): Promise<StreamResponse<DeleteCollectionsResponse>> {
|
|
738
|
+
const queryParams = {
|
|
739
|
+
collection_refs: request?.collection_refs,
|
|
740
|
+
};
|
|
741
|
+
|
|
742
|
+
const response = await this.apiClient.sendRequest<
|
|
743
|
+
StreamResponse<DeleteCollectionsResponse>
|
|
744
|
+
>('DELETE', '/api/v2/feeds/collections', undefined, queryParams);
|
|
745
|
+
|
|
746
|
+
decoders.DeleteCollectionsResponse?.(response.body);
|
|
747
|
+
|
|
748
|
+
return { ...response.body, metadata: response.metadata };
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
async readCollections(request: {
|
|
752
|
+
collection_refs: string[];
|
|
753
|
+
user_id?: string;
|
|
754
|
+
}): Promise<StreamResponse<ReadCollectionsResponse>> {
|
|
755
|
+
const queryParams = {
|
|
756
|
+
collection_refs: request?.collection_refs,
|
|
757
|
+
user_id: request?.user_id,
|
|
758
|
+
};
|
|
759
|
+
|
|
760
|
+
const response = await this.apiClient.sendRequest<
|
|
761
|
+
StreamResponse<ReadCollectionsResponse>
|
|
762
|
+
>('GET', '/api/v2/feeds/collections', undefined, queryParams);
|
|
763
|
+
|
|
764
|
+
decoders.ReadCollectionsResponse?.(response.body);
|
|
765
|
+
|
|
766
|
+
return { ...response.body, metadata: response.metadata };
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
async updateCollections(
|
|
770
|
+
request: UpdateCollectionsRequest,
|
|
771
|
+
): Promise<StreamResponse<UpdateCollectionsResponse>> {
|
|
772
|
+
const body = {
|
|
773
|
+
collections: request?.collections,
|
|
774
|
+
user_id: request?.user_id,
|
|
775
|
+
user: request?.user,
|
|
776
|
+
};
|
|
777
|
+
|
|
778
|
+
const response = await this.apiClient.sendRequest<
|
|
779
|
+
StreamResponse<UpdateCollectionsResponse>
|
|
780
|
+
>(
|
|
781
|
+
'PATCH',
|
|
782
|
+
'/api/v2/feeds/collections',
|
|
783
|
+
undefined,
|
|
784
|
+
undefined,
|
|
785
|
+
body,
|
|
786
|
+
'application/json',
|
|
787
|
+
);
|
|
788
|
+
|
|
789
|
+
decoders.UpdateCollectionsResponse?.(response.body);
|
|
790
|
+
|
|
791
|
+
return { ...response.body, metadata: response.metadata };
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
async createCollections(
|
|
795
|
+
request: CreateCollectionsRequest,
|
|
796
|
+
): Promise<StreamResponse<CreateCollectionsResponse>> {
|
|
797
|
+
const body = {
|
|
798
|
+
collections: request?.collections,
|
|
799
|
+
user_id: request?.user_id,
|
|
800
|
+
user: request?.user,
|
|
801
|
+
};
|
|
802
|
+
|
|
803
|
+
const response = await this.apiClient.sendRequest<
|
|
804
|
+
StreamResponse<CreateCollectionsResponse>
|
|
805
|
+
>(
|
|
806
|
+
'POST',
|
|
807
|
+
'/api/v2/feeds/collections',
|
|
808
|
+
undefined,
|
|
809
|
+
undefined,
|
|
810
|
+
body,
|
|
811
|
+
'application/json',
|
|
812
|
+
);
|
|
813
|
+
|
|
814
|
+
decoders.CreateCollectionsResponse?.(response.body);
|
|
815
|
+
|
|
816
|
+
return { ...response.body, metadata: response.metadata };
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
async upsertCollections(
|
|
820
|
+
request: UpsertCollectionsRequest,
|
|
821
|
+
): Promise<StreamResponse<UpsertCollectionsResponse>> {
|
|
822
|
+
const body = {
|
|
823
|
+
collections: request?.collections,
|
|
824
|
+
};
|
|
825
|
+
|
|
826
|
+
const response = await this.apiClient.sendRequest<
|
|
827
|
+
StreamResponse<UpsertCollectionsResponse>
|
|
828
|
+
>(
|
|
829
|
+
'PUT',
|
|
830
|
+
'/api/v2/feeds/collections',
|
|
831
|
+
undefined,
|
|
832
|
+
undefined,
|
|
833
|
+
body,
|
|
834
|
+
'application/json',
|
|
835
|
+
);
|
|
836
|
+
|
|
837
|
+
decoders.UpsertCollectionsResponse?.(response.body);
|
|
838
|
+
|
|
839
|
+
return { ...response.body, metadata: response.metadata };
|
|
840
|
+
}
|
|
841
|
+
|
|
725
842
|
async getComments(request: {
|
|
726
843
|
object_id: string;
|
|
727
844
|
object_type: string;
|
|
@@ -216,6 +216,8 @@ decoders.ActivityResponse = (input?: Record<string, any>) => {
|
|
|
216
216
|
|
|
217
217
|
own_reactions: { type: 'FeedsReactionResponse', isSingle: false },
|
|
218
218
|
|
|
219
|
+
collections: { type: 'EnrichedCollectionResponse', isSingle: false },
|
|
220
|
+
|
|
219
221
|
reaction_groups: { type: 'ReactionGroupResponse', isSingle: false },
|
|
220
222
|
|
|
221
223
|
user: { type: 'UserResponse', isSingle: true },
|
|
@@ -1512,6 +1514,15 @@ decoders.ClosedCaptionEvent = (input?: Record<string, any>) => {
|
|
|
1512
1514
|
return decode(typeMappings, input);
|
|
1513
1515
|
};
|
|
1514
1516
|
|
|
1517
|
+
decoders.CollectionResponse = (input?: Record<string, any>) => {
|
|
1518
|
+
const typeMappings: TypeMapping = {
|
|
1519
|
+
created_at: { type: 'DatetimeType', isSingle: true },
|
|
1520
|
+
|
|
1521
|
+
updated_at: { type: 'DatetimeType', isSingle: true },
|
|
1522
|
+
};
|
|
1523
|
+
return decode(typeMappings, input);
|
|
1524
|
+
};
|
|
1525
|
+
|
|
1515
1526
|
decoders.Command = (input?: Record<string, any>) => {
|
|
1516
1527
|
const typeMappings: TypeMapping = {
|
|
1517
1528
|
created_at: { type: 'DatetimeType', isSingle: true },
|
|
@@ -1671,6 +1682,13 @@ decoders.CreateChannelTypeResponse = (input?: Record<string, any>) => {
|
|
|
1671
1682
|
return decode(typeMappings, input);
|
|
1672
1683
|
};
|
|
1673
1684
|
|
|
1685
|
+
decoders.CreateCollectionsResponse = (input?: Record<string, any>) => {
|
|
1686
|
+
const typeMappings: TypeMapping = {
|
|
1687
|
+
collections: { type: 'CollectionResponse', isSingle: false },
|
|
1688
|
+
};
|
|
1689
|
+
return decode(typeMappings, input);
|
|
1690
|
+
};
|
|
1691
|
+
|
|
1674
1692
|
decoders.CreateCommandResponse = (input?: Record<string, any>) => {
|
|
1675
1693
|
const typeMappings: TypeMapping = {
|
|
1676
1694
|
command: { type: 'Command', isSingle: true },
|
|
@@ -1857,6 +1875,15 @@ decoders.EgressRTMPResponse = (input?: Record<string, any>) => {
|
|
|
1857
1875
|
return decode(typeMappings, input);
|
|
1858
1876
|
};
|
|
1859
1877
|
|
|
1878
|
+
decoders.EnrichedCollectionResponse = (input?: Record<string, any>) => {
|
|
1879
|
+
const typeMappings: TypeMapping = {
|
|
1880
|
+
created_at: { type: 'DatetimeType', isSingle: true },
|
|
1881
|
+
|
|
1882
|
+
updated_at: { type: 'DatetimeType', isSingle: true },
|
|
1883
|
+
};
|
|
1884
|
+
return decode(typeMappings, input);
|
|
1885
|
+
};
|
|
1886
|
+
|
|
1860
1887
|
decoders.EntityCreatorResponse = (input?: Record<string, any>) => {
|
|
1861
1888
|
const typeMappings: TypeMapping = {
|
|
1862
1889
|
created_at: { type: 'DatetimeType', isSingle: true },
|
|
@@ -3672,6 +3699,13 @@ decoders.ReactivateUserResponse = (input?: Record<string, any>) => {
|
|
|
3672
3699
|
return decode(typeMappings, input);
|
|
3673
3700
|
};
|
|
3674
3701
|
|
|
3702
|
+
decoders.ReadCollectionsResponse = (input?: Record<string, any>) => {
|
|
3703
|
+
const typeMappings: TypeMapping = {
|
|
3704
|
+
collections: { type: 'CollectionResponse', isSingle: false },
|
|
3705
|
+
};
|
|
3706
|
+
return decode(typeMappings, input);
|
|
3707
|
+
};
|
|
3708
|
+
|
|
3675
3709
|
decoders.ReadStateResponse = (input?: Record<string, any>) => {
|
|
3676
3710
|
const typeMappings: TypeMapping = {
|
|
3677
3711
|
last_read: { type: 'DatetimeType', isSingle: true },
|
|
@@ -4278,6 +4312,13 @@ decoders.UpdateChannelTypeResponse = (input?: Record<string, any>) => {
|
|
|
4278
4312
|
return decode(typeMappings, input);
|
|
4279
4313
|
};
|
|
4280
4314
|
|
|
4315
|
+
decoders.UpdateCollectionsResponse = (input?: Record<string, any>) => {
|
|
4316
|
+
const typeMappings: TypeMapping = {
|
|
4317
|
+
collections: { type: 'CollectionResponse', isSingle: false },
|
|
4318
|
+
};
|
|
4319
|
+
return decode(typeMappings, input);
|
|
4320
|
+
};
|
|
4321
|
+
|
|
4281
4322
|
decoders.UpdateCommandResponse = (input?: Record<string, any>) => {
|
|
4282
4323
|
const typeMappings: TypeMapping = {
|
|
4283
4324
|
command: { type: 'Command', isSingle: true },
|
|
@@ -4394,6 +4435,13 @@ decoders.UpsertActivitiesResponse = (input?: Record<string, any>) => {
|
|
|
4394
4435
|
return decode(typeMappings, input);
|
|
4395
4436
|
};
|
|
4396
4437
|
|
|
4438
|
+
decoders.UpsertCollectionsResponse = (input?: Record<string, any>) => {
|
|
4439
|
+
const typeMappings: TypeMapping = {
|
|
4440
|
+
collections: { type: 'CollectionResponse', isSingle: false },
|
|
4441
|
+
};
|
|
4442
|
+
return decode(typeMappings, input);
|
|
4443
|
+
};
|
|
4444
|
+
|
|
4397
4445
|
decoders.UpsertConfigResponse = (input?: Record<string, any>) => {
|
|
4398
4446
|
const typeMappings: TypeMapping = {
|
|
4399
4447
|
config: { type: 'ConfigResponse', isSingle: true },
|
package/src/gen/models/index.ts
CHANGED
|
@@ -511,6 +511,8 @@ export interface ActivityRequest {
|
|
|
511
511
|
|
|
512
512
|
attachments?: Attachment[];
|
|
513
513
|
|
|
514
|
+
collection_refs?: string[];
|
|
515
|
+
|
|
514
516
|
filter_tags?: string[];
|
|
515
517
|
|
|
516
518
|
interest_tags?: string[];
|
|
@@ -571,6 +573,8 @@ export interface ActivityResponse {
|
|
|
571
573
|
|
|
572
574
|
own_reactions: FeedsReactionResponse[];
|
|
573
575
|
|
|
576
|
+
collections: Record<string, EnrichedCollectionResponse>;
|
|
577
|
+
|
|
574
578
|
custom: Record<string, any>;
|
|
575
579
|
|
|
576
580
|
reaction_groups: Record<string, ReactionGroupResponse>;
|
|
@@ -701,6 +705,8 @@ export interface AddActivityRequest {
|
|
|
701
705
|
|
|
702
706
|
attachments?: Attachment[];
|
|
703
707
|
|
|
708
|
+
collection_refs?: string[];
|
|
709
|
+
|
|
704
710
|
filter_tags?: string[];
|
|
705
711
|
|
|
706
712
|
interest_tags?: string[];
|
|
@@ -3638,6 +3644,30 @@ export interface CollectUserFeedbackResponse {
|
|
|
3638
3644
|
duration: string;
|
|
3639
3645
|
}
|
|
3640
3646
|
|
|
3647
|
+
export interface CollectionRequest {
|
|
3648
|
+
name: string;
|
|
3649
|
+
|
|
3650
|
+
custom: Record<string, any>;
|
|
3651
|
+
|
|
3652
|
+
id?: string;
|
|
3653
|
+
|
|
3654
|
+
user_id?: string;
|
|
3655
|
+
}
|
|
3656
|
+
|
|
3657
|
+
export interface CollectionResponse {
|
|
3658
|
+
created_at: Date;
|
|
3659
|
+
|
|
3660
|
+
id: string;
|
|
3661
|
+
|
|
3662
|
+
name: string;
|
|
3663
|
+
|
|
3664
|
+
updated_at: Date;
|
|
3665
|
+
|
|
3666
|
+
custom: Record<string, any>;
|
|
3667
|
+
|
|
3668
|
+
user_id?: string;
|
|
3669
|
+
}
|
|
3670
|
+
|
|
3641
3671
|
export interface Command {
|
|
3642
3672
|
args: string;
|
|
3643
3673
|
|
|
@@ -4088,6 +4118,20 @@ export interface CreateChannelTypeResponse {
|
|
|
4088
4118
|
automod_thresholds?: Thresholds;
|
|
4089
4119
|
}
|
|
4090
4120
|
|
|
4121
|
+
export interface CreateCollectionsRequest {
|
|
4122
|
+
collections: CollectionRequest[];
|
|
4123
|
+
|
|
4124
|
+
user_id?: string;
|
|
4125
|
+
|
|
4126
|
+
user?: UserRequest;
|
|
4127
|
+
}
|
|
4128
|
+
|
|
4129
|
+
export interface CreateCollectionsResponse {
|
|
4130
|
+
duration: string;
|
|
4131
|
+
|
|
4132
|
+
collections: CollectionResponse[];
|
|
4133
|
+
}
|
|
4134
|
+
|
|
4091
4135
|
export interface CreateCommandRequest {
|
|
4092
4136
|
description: string;
|
|
4093
4137
|
|
|
@@ -4547,6 +4591,10 @@ export interface DeleteChannelsResultResponse {
|
|
|
4547
4591
|
error?: string;
|
|
4548
4592
|
}
|
|
4549
4593
|
|
|
4594
|
+
export interface DeleteCollectionsResponse {
|
|
4595
|
+
duration: string;
|
|
4596
|
+
}
|
|
4597
|
+
|
|
4550
4598
|
export interface DeleteCommandResponse {
|
|
4551
4599
|
duration: string;
|
|
4552
4600
|
|
|
@@ -4901,6 +4949,22 @@ export interface EnrichedActivity {
|
|
|
4901
4949
|
target?: Data;
|
|
4902
4950
|
}
|
|
4903
4951
|
|
|
4952
|
+
export interface EnrichedCollectionResponse {
|
|
4953
|
+
created_at: Date;
|
|
4954
|
+
|
|
4955
|
+
id: string;
|
|
4956
|
+
|
|
4957
|
+
name: string;
|
|
4958
|
+
|
|
4959
|
+
status: 'ok' | 'notfound';
|
|
4960
|
+
|
|
4961
|
+
updated_at: Date;
|
|
4962
|
+
|
|
4963
|
+
custom: Record<string, any>;
|
|
4964
|
+
|
|
4965
|
+
user_id?: string;
|
|
4966
|
+
}
|
|
4967
|
+
|
|
4904
4968
|
export interface EnrichedReaction {
|
|
4905
4969
|
activity_id: string;
|
|
4906
4970
|
|
|
@@ -10337,6 +10401,12 @@ export interface ReactivateUsersResponse {
|
|
|
10337
10401
|
task_id: string;
|
|
10338
10402
|
}
|
|
10339
10403
|
|
|
10404
|
+
export interface ReadCollectionsResponse {
|
|
10405
|
+
duration: string;
|
|
10406
|
+
|
|
10407
|
+
collections: CollectionResponse[];
|
|
10408
|
+
}
|
|
10409
|
+
|
|
10340
10410
|
export interface ReadReceipts {
|
|
10341
10411
|
enabled: boolean;
|
|
10342
10412
|
}
|
|
@@ -12216,6 +12286,8 @@ export interface UpdateActivityRequest {
|
|
|
12216
12286
|
|
|
12217
12287
|
attachments?: Attachment[];
|
|
12218
12288
|
|
|
12289
|
+
collection_refs?: string[];
|
|
12290
|
+
|
|
12219
12291
|
feeds?: string[];
|
|
12220
12292
|
|
|
12221
12293
|
filter_tags?: string[];
|
|
@@ -12645,6 +12717,28 @@ export interface UpdateChannelTypeResponse {
|
|
|
12645
12717
|
automod_thresholds?: Thresholds;
|
|
12646
12718
|
}
|
|
12647
12719
|
|
|
12720
|
+
export interface UpdateCollectionRequest {
|
|
12721
|
+
id: string;
|
|
12722
|
+
|
|
12723
|
+
name: string;
|
|
12724
|
+
|
|
12725
|
+
custom: Record<string, any>;
|
|
12726
|
+
}
|
|
12727
|
+
|
|
12728
|
+
export interface UpdateCollectionsRequest {
|
|
12729
|
+
collections: UpdateCollectionRequest[];
|
|
12730
|
+
|
|
12731
|
+
user_id?: string;
|
|
12732
|
+
|
|
12733
|
+
user?: UserRequest;
|
|
12734
|
+
}
|
|
12735
|
+
|
|
12736
|
+
export interface UpdateCollectionsResponse {
|
|
12737
|
+
duration: string;
|
|
12738
|
+
|
|
12739
|
+
collections: CollectionResponse[];
|
|
12740
|
+
}
|
|
12741
|
+
|
|
12648
12742
|
export interface UpdateCommandRequest {
|
|
12649
12743
|
description: string;
|
|
12650
12744
|
|
|
@@ -13064,6 +13158,16 @@ export interface UpsertActivitiesResponse {
|
|
|
13064
13158
|
activities: ActivityResponse[];
|
|
13065
13159
|
}
|
|
13066
13160
|
|
|
13161
|
+
export interface UpsertCollectionsRequest {
|
|
13162
|
+
collections: CollectionRequest[];
|
|
13163
|
+
}
|
|
13164
|
+
|
|
13165
|
+
export interface UpsertCollectionsResponse {
|
|
13166
|
+
duration: string;
|
|
13167
|
+
|
|
13168
|
+
collections: CollectionResponse[];
|
|
13169
|
+
}
|
|
13170
|
+
|
|
13067
13171
|
export interface UpsertConfigRequest {
|
|
13068
13172
|
key: string;
|
|
13069
13173
|
|