@stream-io/node-sdk 0.7.62 → 0.7.63

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.
@@ -25,6 +25,8 @@ import {
25
25
  BatchQueryCommentReactionsRequest,
26
26
  BatchQueryCommentReactionsResponse,
27
27
  CastPollVoteRequest,
28
+ ChangeFeedVisibilityRequest,
29
+ ChangeFeedVisibilityResponse,
28
30
  CreateCollectionsRequest,
29
31
  CreateCollectionsResponse,
30
32
  CreateFeedGroupRequest,
@@ -88,6 +90,7 @@ import {
88
90
  QueryActivitiesResponse,
89
91
  QueryActivityReactionsRequest,
90
92
  QueryActivityReactionsResponse,
93
+ QueryActivitySharesResponse,
91
94
  QueryBookmarkFoldersRequest,
92
95
  QueryBookmarkFoldersResponse,
93
96
  QueryBookmarksRequest,
@@ -126,6 +129,10 @@ import {
126
129
  SingleFollowResponse,
127
130
  TrackActivityMetricsRequest,
128
131
  TrackActivityMetricsResponse,
132
+ TranslateActivityRequest,
133
+ TranslateActivityResponse,
134
+ TranslateCommentRequest,
135
+ TranslateCommentResponse,
129
136
  UnfollowBatchRequest,
130
137
  UnfollowBatchResponse,
131
138
  UnfollowResponse,
@@ -180,6 +187,7 @@ export class FeedsApi {
180
187
  feeds: request?.feeds,
181
188
  copy_custom_to_notification: request?.copy_custom_to_notification,
182
189
  create_notification_activity: request?.create_notification_activity,
190
+ create_users: request?.create_users,
183
191
  enrich_own_fields: request?.enrich_own_fields,
184
192
  expires_at: request?.expires_at,
185
193
  force_moderation: request?.force_moderation,
@@ -224,6 +232,7 @@ export class FeedsApi {
224
232
  ): Promise<StreamResponse<UpsertActivitiesResponse>> {
225
233
  const body = {
226
234
  activities: request?.activities,
235
+ create_users: request?.create_users,
227
236
  enrich_own_fields: request?.enrich_own_fields,
228
237
  force_moderation: request?.force_moderation,
229
238
  };
@@ -321,8 +330,15 @@ export class FeedsApi {
321
330
  }
322
331
 
323
332
  async queryActivities(
324
- request?: QueryActivitiesRequest,
333
+ request?: QueryActivitiesRequest & {
334
+ language?: string;
335
+ translate_text?: boolean;
336
+ },
325
337
  ): Promise<StreamResponse<QueryActivitiesResponse>> {
338
+ const queryParams = {
339
+ language: request?.language,
340
+ translate_text: request?.translate_text,
341
+ };
326
342
  const body = {
327
343
  enrich_own_fields: request?.enrich_own_fields,
328
344
  include_expired_activities: request?.include_expired_activities,
@@ -343,7 +359,7 @@ export class FeedsApi {
343
359
  'POST',
344
360
  '/api/v2/feeds/activities/query',
345
361
  undefined,
346
- undefined,
362
+ queryParams,
347
363
  body,
348
364
  'application/json',
349
365
  );
@@ -569,9 +585,11 @@ export class FeedsApi {
569
585
  type: request?.type,
570
586
  copy_custom_to_notification: request?.copy_custom_to_notification,
571
587
  create_notification_activity: request?.create_notification_activity,
588
+ create_users: request?.create_users,
572
589
  enforce_unique: request?.enforce_unique,
573
590
  skip_push: request?.skip_push,
574
591
  user_id: request?.user_id,
592
+ target_feeds: request?.target_feeds,
575
593
  custom: request?.custom,
576
594
  user: request?.user,
577
595
  };
@@ -651,6 +669,35 @@ export class FeedsApi {
651
669
  return { ...response.body, metadata: response.metadata };
652
670
  }
653
671
 
672
+ async queryActivityShares(request: {
673
+ activity_id: string;
674
+ limit?: number;
675
+ prev?: string;
676
+ next?: string;
677
+ }): Promise<StreamResponse<QueryActivitySharesResponse>> {
678
+ const queryParams = {
679
+ limit: request?.limit,
680
+ prev: request?.prev,
681
+ next: request?.next,
682
+ };
683
+ const pathParams = {
684
+ activity_id: request?.activity_id,
685
+ };
686
+
687
+ const response = await this.apiClient.sendRequest<
688
+ StreamResponse<QueryActivitySharesResponse>
689
+ >(
690
+ 'GET',
691
+ '/api/v2/feeds/activities/{activity_id}/shares',
692
+ pathParams,
693
+ queryParams,
694
+ );
695
+
696
+ decoders.QueryActivitySharesResponse?.(response.body);
697
+
698
+ return { ...response.body, metadata: response.metadata };
699
+ }
700
+
654
701
  async deleteActivity(request: {
655
702
  id: string;
656
703
  hard_delete?: boolean;
@@ -678,11 +725,15 @@ export class FeedsApi {
678
725
  comment_sort?: string;
679
726
  comment_limit?: number;
680
727
  user_id?: string;
728
+ language?: string;
729
+ translate_text?: boolean;
681
730
  }): Promise<StreamResponse<GetActivityResponse>> {
682
731
  const queryParams = {
683
732
  comment_sort: request?.comment_sort,
684
733
  comment_limit: request?.comment_limit,
685
734
  user_id: request?.user_id,
735
+ language: request?.language,
736
+ translate_text: request?.translate_text,
686
737
  };
687
738
  const pathParams = {
688
739
  id: request?.id,
@@ -812,6 +863,32 @@ export class FeedsApi {
812
863
  return { ...response.body, metadata: response.metadata };
813
864
  }
814
865
 
866
+ async translateActivity(
867
+ request: TranslateActivityRequest & { id: string },
868
+ ): Promise<StreamResponse<TranslateActivityResponse>> {
869
+ const pathParams = {
870
+ id: request?.id,
871
+ };
872
+ const body = {
873
+ language: request?.language,
874
+ };
875
+
876
+ const response = await this.apiClient.sendRequest<
877
+ StreamResponse<TranslateActivityResponse>
878
+ >(
879
+ 'POST',
880
+ '/api/v2/feeds/activities/{id}/translate',
881
+ pathParams,
882
+ undefined,
883
+ body,
884
+ 'application/json',
885
+ );
886
+
887
+ decoders.TranslateActivityResponse?.(response.body);
888
+
889
+ return { ...response.body, metadata: response.metadata };
890
+ }
891
+
815
892
  async queryBookmarkFolders(
816
893
  request?: QueryBookmarkFoldersRequest,
817
894
  ): Promise<StreamResponse<QueryBookmarkFoldersResponse>> {
@@ -890,15 +967,24 @@ export class FeedsApi {
890
967
  }
891
968
 
892
969
  async queryBookmarks(
893
- request?: QueryBookmarksRequest,
970
+ request?: QueryBookmarksRequest & {
971
+ language?: string;
972
+ translate_text?: boolean;
973
+ },
894
974
  ): Promise<StreamResponse<QueryBookmarksResponse>> {
975
+ const queryParams = {
976
+ language: request?.language,
977
+ translate_text: request?.translate_text,
978
+ };
895
979
  const body = {
896
980
  enrich_own_fields: request?.enrich_own_fields,
897
981
  limit: request?.limit,
898
982
  next: request?.next,
899
983
  prev: request?.prev,
984
+ user_id: request?.user_id,
900
985
  sort: request?.sort,
901
986
  filter: request?.filter,
987
+ user: request?.user,
902
988
  };
903
989
 
904
990
  const response = await this.apiClient.sendRequest<
@@ -907,7 +993,7 @@ export class FeedsApi {
907
993
  'POST',
908
994
  '/api/v2/feeds/bookmarks/query',
909
995
  undefined,
910
- undefined,
996
+ queryParams,
911
997
  body,
912
998
  'application/json',
913
999
  );
@@ -1060,6 +1146,8 @@ export class FeedsApi {
1060
1146
  sort?: string;
1061
1147
  replies_limit?: number;
1062
1148
  id_around?: string;
1149
+ language?: string;
1150
+ translate_text?: boolean;
1063
1151
  user_id?: string;
1064
1152
  limit?: number;
1065
1153
  prev?: string;
@@ -1072,6 +1160,8 @@ export class FeedsApi {
1072
1160
  sort: request?.sort,
1073
1161
  replies_limit: request?.replies_limit,
1074
1162
  id_around: request?.id_around,
1163
+ language: request?.language,
1164
+ translate_text: request?.translate_text,
1075
1165
  user_id: request?.user_id,
1076
1166
  limit: request?.limit,
1077
1167
  prev: request?.prev,
@@ -1148,8 +1238,15 @@ export class FeedsApi {
1148
1238
  }
1149
1239
 
1150
1240
  async queryComments(
1151
- request: QueryCommentsRequest,
1241
+ request: QueryCommentsRequest & {
1242
+ language?: string;
1243
+ translate_text?: boolean;
1244
+ },
1152
1245
  ): Promise<StreamResponse<QueryCommentsResponse>> {
1246
+ const queryParams = {
1247
+ language: request?.language,
1248
+ translate_text: request?.translate_text,
1249
+ };
1153
1250
  const body = {
1154
1251
  filter: request?.filter,
1155
1252
  id_around: request?.id_around,
@@ -1167,7 +1264,7 @@ export class FeedsApi {
1167
1264
  'POST',
1168
1265
  '/api/v2/feeds/comments/query',
1169
1266
  undefined,
1170
- undefined,
1267
+ queryParams,
1171
1268
  body,
1172
1269
  'application/json',
1173
1270
  );
@@ -1320,9 +1417,13 @@ export class FeedsApi {
1320
1417
  async getComment(request: {
1321
1418
  id: string;
1322
1419
  user_id?: string;
1420
+ language?: string;
1421
+ translate_text?: boolean;
1323
1422
  }): Promise<StreamResponse<GetCommentResponse>> {
1324
1423
  const queryParams = {
1325
1424
  user_id: request?.user_id,
1425
+ language: request?.language,
1426
+ translate_text: request?.translate_text,
1326
1427
  };
1327
1428
  const pathParams = {
1328
1429
  id: request?.id,
@@ -1420,6 +1521,7 @@ export class FeedsApi {
1420
1521
  enforce_unique: request?.enforce_unique,
1421
1522
  skip_push: request?.skip_push,
1422
1523
  user_id: request?.user_id,
1524
+ target_feeds: request?.target_feeds,
1423
1525
  custom: request?.custom,
1424
1526
  user: request?.user,
1425
1527
  };
@@ -1505,6 +1607,8 @@ export class FeedsApi {
1505
1607
  sort?: string;
1506
1608
  replies_limit?: number;
1507
1609
  id_around?: string;
1610
+ language?: string;
1611
+ translate_text?: boolean;
1508
1612
  user_id?: string;
1509
1613
  limit?: number;
1510
1614
  prev?: string;
@@ -1515,6 +1619,8 @@ export class FeedsApi {
1515
1619
  sort: request?.sort,
1516
1620
  replies_limit: request?.replies_limit,
1517
1621
  id_around: request?.id_around,
1622
+ language: request?.language,
1623
+ translate_text: request?.translate_text,
1518
1624
  user_id: request?.user_id,
1519
1625
  limit: request?.limit,
1520
1626
  prev: request?.prev,
@@ -1560,6 +1666,32 @@ export class FeedsApi {
1560
1666
  return { ...response.body, metadata: response.metadata };
1561
1667
  }
1562
1668
 
1669
+ async translateComment(
1670
+ request: TranslateCommentRequest & { id: string },
1671
+ ): Promise<StreamResponse<TranslateCommentResponse>> {
1672
+ const pathParams = {
1673
+ id: request?.id,
1674
+ };
1675
+ const body = {
1676
+ language: request?.language,
1677
+ };
1678
+
1679
+ const response = await this.apiClient.sendRequest<
1680
+ StreamResponse<TranslateCommentResponse>
1681
+ >(
1682
+ 'POST',
1683
+ '/api/v2/feeds/comments/{id}/translate',
1684
+ pathParams,
1685
+ undefined,
1686
+ body,
1687
+ 'application/json',
1688
+ );
1689
+
1690
+ decoders.TranslateCommentResponse?.(response.body);
1691
+
1692
+ return { ...response.body, metadata: response.metadata };
1693
+ }
1694
+
1563
1695
  async listFeedGroups(request?: {
1564
1696
  include_soft_deleted?: boolean;
1565
1697
  }): Promise<StreamResponse<ListFeedGroupsResponse>> {
@@ -1642,8 +1774,14 @@ export class FeedsApi {
1642
1774
  request: GetOrCreateFeedRequest & {
1643
1775
  feed_group_id: string;
1644
1776
  feed_id: string;
1777
+ language?: string;
1778
+ translate_text?: boolean;
1645
1779
  },
1646
1780
  ): Promise<StreamResponse<GetOrCreateFeedResponse>> {
1781
+ const queryParams = {
1782
+ language: request?.language,
1783
+ translate_text: request?.translate_text,
1784
+ };
1647
1785
  const pathParams = {
1648
1786
  feed_group_id: request?.feed_group_id,
1649
1787
  feed_id: request?.feed_id,
@@ -1652,6 +1790,7 @@ export class FeedsApi {
1652
1790
  id_around: request?.id_around,
1653
1791
  limit: request?.limit,
1654
1792
  next: request?.next,
1793
+ overwrite_interest_weights: request?.overwrite_interest_weights,
1655
1794
  prev: request?.prev,
1656
1795
  user_id: request?.user_id,
1657
1796
  view: request?.view,
@@ -1674,7 +1813,7 @@ export class FeedsApi {
1674
1813
  'POST',
1675
1814
  '/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}',
1676
1815
  pathParams,
1677
- undefined,
1816
+ queryParams,
1678
1817
  body,
1679
1818
  'application/json',
1680
1819
  );
@@ -1814,6 +1953,37 @@ export class FeedsApi {
1814
1953
  return { ...response.body, metadata: response.metadata };
1815
1954
  }
1816
1955
 
1956
+ async changeFeedVisibility(
1957
+ request: ChangeFeedVisibilityRequest & {
1958
+ feed_group_id: string;
1959
+ feed_id: string;
1960
+ },
1961
+ ): Promise<StreamResponse<ChangeFeedVisibilityResponse>> {
1962
+ const pathParams = {
1963
+ feed_group_id: request?.feed_group_id,
1964
+ feed_id: request?.feed_id,
1965
+ };
1966
+ const body = {
1967
+ visibility: request?.visibility,
1968
+ pending_follows_action: request?.pending_follows_action,
1969
+ };
1970
+
1971
+ const response = await this.apiClient.sendRequest<
1972
+ StreamResponse<ChangeFeedVisibilityResponse>
1973
+ >(
1974
+ 'POST',
1975
+ '/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/change_visibility',
1976
+ pathParams,
1977
+ undefined,
1978
+ body,
1979
+ 'application/json',
1980
+ );
1981
+
1982
+ decoders.ChangeFeedVisibilityResponse?.(response.body);
1983
+
1984
+ return { ...response.body, metadata: response.metadata };
1985
+ }
1986
+
1817
1987
  async updateFeedMembers(
1818
1988
  request: UpdateFeedMembersRequest & {
1819
1989
  feed_group_id: string;
@@ -1948,8 +2118,14 @@ export class FeedsApi {
1948
2118
  request: QueryPinnedActivitiesRequest & {
1949
2119
  feed_group_id: string;
1950
2120
  feed_id: string;
2121
+ language?: string;
2122
+ translate_text?: boolean;
1951
2123
  },
1952
2124
  ): Promise<StreamResponse<QueryPinnedActivitiesResponse>> {
2125
+ const queryParams = {
2126
+ language: request?.language,
2127
+ translate_text: request?.translate_text,
2128
+ };
1953
2129
  const pathParams = {
1954
2130
  feed_group_id: request?.feed_group_id,
1955
2131
  feed_id: request?.feed_id,
@@ -1969,7 +2145,7 @@ export class FeedsApi {
1969
2145
  'POST',
1970
2146
  '/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/pinned_activities/query',
1971
2147
  pathParams,
1972
- undefined,
2148
+ queryParams,
1973
2149
  body,
1974
2150
  'application/json',
1975
2151
  );