@stream-io/node-sdk 0.8.15 → 0.9.1

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/__tests__/docs-snippets/README.md +4 -4
  3. package/dist/index.cjs.js +328 -8340
  4. package/dist/index.cjs.js.map +1 -1
  5. package/dist/index.d.ts +1 -0
  6. package/dist/index.es.mjs +321 -8341
  7. package/dist/index.es.mjs.map +1 -1
  8. package/dist/src/StreamVideoClient.d.ts +7 -0
  9. package/dist/src/gen/chat/ChannelApi.d.ts +4 -1
  10. package/dist/src/gen/chat/ChatApi.d.ts +18 -1
  11. package/dist/src/gen/common/CommonApi.d.ts +4 -3
  12. package/dist/src/gen/feeds/FeedApi.d.ts +5 -1
  13. package/dist/src/gen/feeds/FeedsApi.d.ts +18 -3
  14. package/dist/src/gen/models/index.d.ts +2530 -1033
  15. package/dist/src/gen/models/timestamp-guard.d.ts +22 -0
  16. package/dist/src/gen/moderation/ModerationApi.d.ts +11 -4
  17. package/dist/src/gen/video/CallApi.d.ts +3 -3
  18. package/dist/src/gen/video/VideoApi.d.ts +3 -3
  19. package/dist/src/types.d.ts +14 -1
  20. package/dist/src/utils/time.d.ts +67 -0
  21. package/index.ts +10 -0
  22. package/package.json +1 -1
  23. package/src/ApiClient.ts +1 -0
  24. package/src/StreamVideoClient.ts +7 -0
  25. package/src/gen/chat/ChannelApi.ts +54 -0
  26. package/src/gen/chat/ChatApi.ts +184 -0
  27. package/src/gen/common/CommonApi.ts +27 -2
  28. package/src/gen/feeds/FeedApi.ts +12 -0
  29. package/src/gen/feeds/FeedsApi.ts +106 -2
  30. package/src/gen/model-decoders/decoders.ts +3 -6472
  31. package/src/gen/models/index.ts +2682 -1252
  32. package/src/gen/models/timestamp-guard.ts +27 -0
  33. package/src/gen/moderation/ModerationApi.ts +89 -12
  34. package/src/gen/video/CallApi.ts +3 -2
  35. package/src/gen/video/VideoApi.ts +3 -2
  36. package/src/types.ts +8 -0
  37. package/src/utils/time.ts +84 -0
@@ -14,6 +14,8 @@ import {
14
14
  CheckSNSResponse,
15
15
  CheckSQSRequest,
16
16
  CheckSQSResponse,
17
+ ClaimGuestUserRequest,
18
+ ClaimGuestUserResponse,
17
19
  CreateBlockListRequest,
18
20
  CreateBlockListResponse,
19
21
  CreateDeviceRequest,
@@ -76,6 +78,7 @@ import {
76
78
  PollOptionResponse,
77
79
  PollResponse,
78
80
  PollVotesResponse,
81
+ PushProviderName,
79
82
  QueryPollVotesRequest,
80
83
  QueryPollsRequest,
81
84
  QueryPollsResponse,
@@ -186,6 +189,7 @@ export class CommonApi {
186
189
  sqs_key: request?.sqs_key,
187
190
  sqs_secret: request?.sqs_secret,
188
191
  sqs_url: request?.sqs_url,
192
+ two_way_block_effect_enabled: request?.two_way_block_effect_enabled,
189
193
  user_response_time_enabled: request?.user_response_time_enabled,
190
194
  video_primary_use_case: request?.video_primary_use_case,
191
195
  webhook_url: request?.webhook_url,
@@ -1430,7 +1434,7 @@ export class CommonApi {
1430
1434
  }
1431
1435
 
1432
1436
  async deletePushProvider(request: {
1433
- type: string;
1437
+ type: PushProviderName;
1434
1438
  name: string;
1435
1439
  }): Promise<StreamResponse<Response>> {
1436
1440
  const pathParams = {
@@ -1451,7 +1455,7 @@ export class CommonApi {
1451
1455
  }
1452
1456
 
1453
1457
  async getPushTemplates(request: {
1454
- push_provider_type: string;
1458
+ push_provider_type: PushProviderName;
1455
1459
  push_provider_name?: string;
1456
1460
  }): Promise<StreamResponse<GetPushTemplatesResponse>> {
1457
1461
  const queryParams = {
@@ -2008,6 +2012,27 @@ export class CommonApi {
2008
2012
  return response;
2009
2013
  }
2010
2014
 
2015
+ async claimGuestUser(
2016
+ request: ClaimGuestUserRequest,
2017
+ ): Promise<StreamResponse<ClaimGuestUserResponse>> {
2018
+ const body = {
2019
+ guest_user_id: request?.guest_user_id,
2020
+ user_id: request?.user_id,
2021
+ };
2022
+
2023
+ const response = await this.apiClient.sendRequest<ClaimGuestUserResponse>(
2024
+ 'POST',
2025
+ '/api/v2/users/claim_guest',
2026
+ undefined,
2027
+ undefined,
2028
+ body,
2029
+ );
2030
+
2031
+ decoders['ClaimGuestUserResponse']?.(response);
2032
+
2033
+ return response;
2034
+ }
2035
+
2011
2036
  async deactivateUsers(
2012
2037
  request: DeactivateUsersRequest,
2013
2038
  ): Promise<StreamResponse<DeactivateUsersResponse>> {
@@ -6,6 +6,7 @@ import {
6
6
  ChangeFeedVisibilityResponse,
7
7
  DeleteFeedResponse,
8
8
  GetFeedCountsResponse,
9
+ GetNotificationStatusResponse,
9
10
  GetOrCreateFeedRequest,
10
11
  GetOrCreateFeedResponse,
11
12
  MarkActivityRequest,
@@ -155,6 +156,17 @@ export class FeedApi {
155
156
  });
156
157
  }
157
158
 
159
+ getNotificationStatus(request?: {
160
+ view?: string;
161
+ user_id?: string;
162
+ }): Promise<StreamResponse<GetNotificationStatusResponse>> {
163
+ return this.feedsApi.getNotificationStatus({
164
+ feed_id: this.id,
165
+ feed_group_id: this.group,
166
+ ...request,
167
+ });
168
+ }
169
+
158
170
  queryPinnedActivities(
159
171
  request?: QueryPinnedActivitiesRequest & {
160
172
  language?: string;
@@ -24,6 +24,7 @@ import {
24
24
  BatchQueryActivityReactionsResponse,
25
25
  BatchQueryCommentReactionsRequest,
26
26
  BatchQueryCommentReactionsResponse,
27
+ CancelExportFeedsResponse,
27
28
  CastPollVoteRequest,
28
29
  ChangeFeedVisibilityRequest,
29
30
  ChangeFeedVisibilityResponse,
@@ -60,6 +61,10 @@ import {
60
61
  DeleteFeedsRetentionPolicyResponse,
61
62
  DeleteUserInterestsResponse,
62
63
  ExportFeedUserDataResponse,
64
+ ExportFeedsAppRequest,
65
+ ExportFeedsByTypeRequest,
66
+ ExportFeedsResponse,
67
+ FeedVisibility,
63
68
  FollowBatchRequest,
64
69
  FollowBatchResponse,
65
70
  FollowRequest,
@@ -76,6 +81,7 @@ import {
76
81
  GetFeedsRetentionPolicyRunsRequest,
77
82
  GetFeedsRetentionPolicyRunsResponse,
78
83
  GetFollowSuggestionsResponse,
84
+ GetNotificationStatusResponse,
79
85
  GetOrCreateFeedGroupRequest,
80
86
  GetOrCreateFeedGroupResponse,
81
87
  GetOrCreateFeedRequest,
@@ -1675,6 +1681,74 @@ export class FeedsApi {
1675
1681
  return response;
1676
1682
  }
1677
1683
 
1684
+ async exportFeedsApp(
1685
+ request?: ExportFeedsAppRequest,
1686
+ ): Promise<StreamResponse<ExportFeedsResponse>> {
1687
+ const body = {
1688
+ include_deleted: request?.include_deleted,
1689
+ types: request?.types,
1690
+ };
1691
+
1692
+ const response = await this.apiClient.sendRequest<ExportFeedsResponse>(
1693
+ 'POST',
1694
+ '/api/v2/feeds/export/app',
1695
+ undefined,
1696
+ undefined,
1697
+ body,
1698
+ );
1699
+
1700
+ decoders['ExportFeedsResponse']?.(response);
1701
+
1702
+ return response;
1703
+ }
1704
+
1705
+ async cancelExportFeeds(request: {
1706
+ task_id: string;
1707
+ }): Promise<StreamResponse<CancelExportFeedsResponse>> {
1708
+ const pathParams = {
1709
+ task_id: request?.task_id,
1710
+ };
1711
+
1712
+ const response =
1713
+ await this.apiClient.sendRequest<CancelExportFeedsResponse>(
1714
+ 'POST',
1715
+ '/api/v2/feeds/export/{task_id}/cancel',
1716
+ pathParams,
1717
+ undefined,
1718
+ );
1719
+
1720
+ decoders['CancelExportFeedsResponse']?.(response);
1721
+
1722
+ return response;
1723
+ }
1724
+
1725
+ async exportFeedsByType(
1726
+ request: ExportFeedsByTypeRequest & { type: string },
1727
+ ): Promise<StreamResponse<ExportFeedsResponse>> {
1728
+ const pathParams = {
1729
+ type: request?.type,
1730
+ };
1731
+ const body = {
1732
+ created_at_from: request?.created_at_from,
1733
+ created_at_to: request?.created_at_to,
1734
+ include_deleted: request?.include_deleted,
1735
+ user_id: request?.user_id,
1736
+ activity_ids: request?.activity_ids,
1737
+ };
1738
+
1739
+ const response = await this.apiClient.sendRequest<ExportFeedsResponse>(
1740
+ 'POST',
1741
+ '/api/v2/feeds/export/{type}',
1742
+ pathParams,
1743
+ undefined,
1744
+ body,
1745
+ );
1746
+
1747
+ decoders['ExportFeedsResponse']?.(response);
1748
+
1749
+ return response;
1750
+ }
1751
+
1678
1752
  async listFeedGroups(request?: {
1679
1753
  include_soft_deleted?: boolean;
1680
1754
  }): Promise<StreamResponse<ListFeedGroupsResponse>> {
@@ -2098,6 +2172,34 @@ export class FeedsApi {
2098
2172
  return response;
2099
2173
  }
2100
2174
 
2175
+ async getNotificationStatus(request: {
2176
+ feed_group_id: string;
2177
+ feed_id: string;
2178
+ view?: string;
2179
+ user_id?: string;
2180
+ }): Promise<StreamResponse<GetNotificationStatusResponse>> {
2181
+ const queryParams = {
2182
+ view: request?.view,
2183
+ user_id: request?.user_id,
2184
+ };
2185
+ const pathParams = {
2186
+ feed_group_id: request?.feed_group_id,
2187
+ feed_id: request?.feed_id,
2188
+ };
2189
+
2190
+ const response =
2191
+ await this.apiClient.sendRequest<GetNotificationStatusResponse>(
2192
+ 'GET',
2193
+ '/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/notification_status',
2194
+ pathParams,
2195
+ queryParams,
2196
+ );
2197
+
2198
+ decoders['GetNotificationStatusResponse']?.(response);
2199
+
2200
+ return response;
2201
+ }
2202
+
2101
2203
  async queryPinnedActivities(
2102
2204
  request: QueryPinnedActivitiesRequest & {
2103
2205
  feed_group_id: string;
@@ -2446,7 +2548,7 @@ export class FeedsApi {
2446
2548
  }
2447
2549
 
2448
2550
  async getFeedVisibility(request: {
2449
- name: string;
2551
+ name: FeedVisibility;
2450
2552
  }): Promise<StreamResponse<GetFeedVisibilityResponse>> {
2451
2553
  const pathParams = {
2452
2554
  name: request?.name,
@@ -2466,7 +2568,7 @@ export class FeedsApi {
2466
2568
  }
2467
2569
 
2468
2570
  async updateFeedVisibility(
2469
- request: UpdateFeedVisibilityRequest & { name: string },
2571
+ request: UpdateFeedVisibilityRequest & { name: FeedVisibility },
2470
2572
  ): Promise<StreamResponse<UpdateFeedVisibilityResponse>> {
2471
2573
  const pathParams = {
2472
2574
  name: request?.name,
@@ -2699,6 +2801,7 @@ export class FeedsApi {
2699
2801
  return response;
2700
2802
  }
2701
2803
 
2804
+ /** @deprecated This endpoint is deprecated. */
2702
2805
  async followBatch(
2703
2806
  request: FollowBatchRequest,
2704
2807
  ): Promise<StreamResponse<FollowBatchResponse>> {
@@ -3082,6 +3185,7 @@ export class FeedsApi {
3082
3185
  return response;
3083
3186
  }
3084
3187
 
3188
+ /** @deprecated This endpoint is deprecated. */
3085
3189
  async unfollowBatch(
3086
3190
  request: UnfollowBatchRequest,
3087
3191
  ): Promise<StreamResponse<UnfollowBatchResponse>> {