@stream-io/node-sdk 0.6.5 → 0.6.7

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 CHANGED
@@ -894,6 +894,7 @@ decoders.Channel = (input) => {
894
894
  members: { type: 'ChannelMember', isSingle: false },
895
895
  config: { type: 'ChannelConfig', isSingle: true },
896
896
  created_by: { type: 'User', isSingle: true },
897
+ members_lookup: { type: 'ChannelMemberLookup', isSingle: false },
897
898
  truncated_by: { type: 'User', isSingle: true },
898
899
  };
899
900
  return decode(typeMappings, input);
@@ -954,6 +955,14 @@ decoders.ChannelMember = (input) => {
954
955
  };
955
956
  return decode(typeMappings, input);
956
957
  };
958
+ decoders.ChannelMemberLookup = (input) => {
959
+ const typeMappings = {
960
+ archived_at: { type: 'DatetimeType', isSingle: true },
961
+ ban_expires: { type: 'DatetimeType', isSingle: true },
962
+ pinned_at: { type: 'DatetimeType', isSingle: true },
963
+ };
964
+ return decode(typeMappings, input);
965
+ };
957
966
  decoders.ChannelMute = (input) => {
958
967
  const typeMappings = {
959
968
  created_at: { type: 'DatetimeType', isSingle: true },
@@ -1306,6 +1315,13 @@ decoders.DeleteCommentReactionResponse = (input) => {
1306
1315
  };
1307
1316
  return decode(typeMappings, input);
1308
1317
  };
1318
+ decoders.DeleteCommentResponse = (input) => {
1319
+ const typeMappings = {
1320
+ activity: { type: 'ActivityResponse', isSingle: true },
1321
+ comment: { type: 'CommentResponse', isSingle: true },
1322
+ };
1323
+ return decode(typeMappings, input);
1324
+ };
1309
1325
  decoders.DeleteMessageResponse = (input) => {
1310
1326
  const typeMappings = {
1311
1327
  message: { type: 'MessageResponse', isSingle: true },
@@ -1616,6 +1632,7 @@ decoders.GetCallReportResponse = (input) => {
1616
1632
  const typeMappings = {
1617
1633
  video_reactions: { type: 'VideoReactionsResponse', isSingle: false },
1618
1634
  chat_activity: { type: 'ChatActivityStatsResponse', isSingle: true },
1635
+ session: { type: 'CallSessionResponse', isSingle: true },
1619
1636
  };
1620
1637
  return decode(typeMappings, input);
1621
1638
  };
@@ -2035,6 +2052,7 @@ decoders.MessageReadEvent = (input) => {
2035
2052
  const typeMappings = {
2036
2053
  created_at: { type: 'DatetimeType', isSingle: true },
2037
2054
  channel_last_message_at: { type: 'DatetimeType', isSingle: true },
2055
+ channel: { type: 'ChannelResponse', isSingle: true },
2038
2056
  thread: { type: 'ThreadResponse', isSingle: true },
2039
2057
  user: { type: 'UserResponseCommonFields', isSingle: true },
2040
2058
  };
@@ -3845,6 +3863,14 @@ class CommonApi {
3845
3863
  decoders.PollVotesResponse?.(response.body);
3846
3864
  return { ...response.body, metadata: response.metadata };
3847
3865
  }
3866
+ async updatePushNotificationPreferences(request) {
3867
+ const body = {
3868
+ preferences: request?.preferences,
3869
+ };
3870
+ const response = await this.apiClient.sendRequest('POST', '/api/v2/push_preferences', undefined, undefined, body, 'application/json');
3871
+ decoders.UpsertPushPreferencesResponse?.(response.body);
3872
+ return { ...response.body, metadata: response.metadata };
3873
+ }
3848
3874
  async listPushProviders() {
3849
3875
  const response = await this.apiClient.sendRequest('GET', '/api/v2/push_providers', undefined, undefined);
3850
3876
  decoders.ListPushProvidersResponse?.(response.body);
@@ -3867,6 +3893,27 @@ class CommonApi {
3867
3893
  decoders.Response?.(response.body);
3868
3894
  return { ...response.body, metadata: response.metadata };
3869
3895
  }
3896
+ async getPushTemplates(request) {
3897
+ const queryParams = {
3898
+ push_provider_type: request?.push_provider_type,
3899
+ push_provider_name: request?.push_provider_name,
3900
+ };
3901
+ const response = await this.apiClient.sendRequest('GET', '/api/v2/push_templates', undefined, queryParams);
3902
+ decoders.GetPushTemplatesResponse?.(response.body);
3903
+ return { ...response.body, metadata: response.metadata };
3904
+ }
3905
+ async upsertPushTemplate(request) {
3906
+ const body = {
3907
+ event_type: request?.event_type,
3908
+ push_provider_type: request?.push_provider_type,
3909
+ enable_push: request?.enable_push,
3910
+ push_provider_name: request?.push_provider_name,
3911
+ template: request?.template,
3912
+ };
3913
+ const response = await this.apiClient.sendRequest('POST', '/api/v2/push_templates', undefined, undefined, body, 'application/json');
3914
+ decoders.UpsertPushTemplateResponse?.(response.body);
3915
+ return { ...response.body, metadata: response.metadata };
3916
+ }
3870
3917
  async getRateLimits(request) {
3871
3918
  const queryParams = {
3872
3919
  server_side: request?.server_side,
@@ -4439,6 +4486,7 @@ class VideoApi {
4439
4486
  enable_transcription: request?.enable_transcription,
4440
4487
  external_storage: request?.external_storage,
4441
4488
  language: request?.language,
4489
+ speech_segment_config: request?.speech_segment_config,
4442
4490
  };
4443
4491
  const response = await this.apiClient.sendRequest('POST', '/api/v2/video/call/{type}/{id}/start_closed_captions', pathParams, undefined, body, 'application/json');
4444
4492
  decoders.StartClosedCaptionsResponse?.(response.body);
@@ -5617,6 +5665,21 @@ class ChatApi {
5617
5665
  decoders.MessageResponse?.(response.body);
5618
5666
  return { ...response.body, metadata: response.metadata };
5619
5667
  }
5668
+ async ephemeralMessageUpdate(request) {
5669
+ const pathParams = {
5670
+ id: request?.id,
5671
+ };
5672
+ const body = {
5673
+ skip_enrich_url: request?.skip_enrich_url,
5674
+ user_id: request?.user_id,
5675
+ unset: request?.unset,
5676
+ set: request?.set,
5677
+ user: request?.user,
5678
+ };
5679
+ const response = await this.apiClient.sendRequest('PATCH', '/api/v2/chat/messages/{id}/ephemeral', pathParams, undefined, body, 'application/json');
5680
+ decoders.UpdateMessagePartialResponse?.(response.body);
5681
+ return { ...response.body, metadata: response.metadata };
5682
+ }
5620
5683
  async sendReaction(request) {
5621
5684
  const pathParams = {
5622
5685
  id: request?.id,
@@ -5812,35 +5875,6 @@ class ChatApi {
5812
5875
  decoders.UnmuteResponse?.(response.body);
5813
5876
  return { ...response.body, metadata: response.metadata };
5814
5877
  }
5815
- async updatePushNotificationPreferences(request) {
5816
- const body = {
5817
- preferences: request?.preferences,
5818
- };
5819
- const response = await this.apiClient.sendRequest('POST', '/api/v2/chat/push_preferences', undefined, undefined, body, 'application/json');
5820
- decoders.UpsertPushPreferencesResponse?.(response.body);
5821
- return { ...response.body, metadata: response.metadata };
5822
- }
5823
- async getPushTemplates(request) {
5824
- const queryParams = {
5825
- push_provider_type: request?.push_provider_type,
5826
- push_provider_name: request?.push_provider_name,
5827
- };
5828
- const response = await this.apiClient.sendRequest('GET', '/api/v2/chat/push_templates', undefined, queryParams);
5829
- decoders.GetPushTemplatesResponse?.(response.body);
5830
- return { ...response.body, metadata: response.metadata };
5831
- }
5832
- async upsertPushTemplate(request) {
5833
- const body = {
5834
- event_type: request?.event_type,
5835
- push_provider_type: request?.push_provider_type,
5836
- enable_push: request?.enable_push,
5837
- push_provider_name: request?.push_provider_name,
5838
- template: request?.template,
5839
- };
5840
- const response = await this.apiClient.sendRequest('POST', '/api/v2/chat/push_templates', undefined, undefined, body, 'application/json');
5841
- decoders.UpsertPushTemplateResponse?.(response.body);
5842
- return { ...response.body, metadata: response.metadata };
5843
- }
5844
5878
  async queryBannedUsers(request) {
5845
5879
  const queryParams = {
5846
5880
  payload: request?.payload,
@@ -6593,7 +6627,7 @@ class ApiClient {
6593
6627
  const headers = {
6594
6628
  Authorization: this.apiConfig.token,
6595
6629
  'stream-auth-type': 'jwt',
6596
- 'X-Stream-Client': 'stream-node-' + "0.6.5",
6630
+ 'X-Stream-Client': 'stream-node-' + "0.6.7",
6597
6631
  'Accept-Encoding': 'gzip',
6598
6632
  'x-client-request-id': clientRequestId,
6599
6633
  };
@@ -6914,6 +6948,7 @@ class FeedsApi {
6914
6948
  user_id: request?.user_id,
6915
6949
  visibility: request?.visibility,
6916
6950
  attachments: request?.attachments,
6951
+ feeds: request?.feeds,
6917
6952
  filter_tags: request?.filter_tags,
6918
6953
  interest_tags: request?.interest_tags,
6919
6954
  custom: request?.custom,
@@ -7416,6 +7451,19 @@ class FeedsApi {
7416
7451
  decoders.UpdateFeedViewResponse?.(response.body);
7417
7452
  return { ...response.body, metadata: response.metadata };
7418
7453
  }
7454
+ async listFeedVisibilities() {
7455
+ const response = await this.apiClient.sendRequest('GET', '/api/v2/feeds/feed_visibilities', undefined, undefined);
7456
+ decoders.ListFeedVisibilitiesResponse?.(response.body);
7457
+ return { ...response.body, metadata: response.metadata };
7458
+ }
7459
+ async getFeedVisibility(request) {
7460
+ const pathParams = {
7461
+ name: request?.name,
7462
+ };
7463
+ const response = await this.apiClient.sendRequest('GET', '/api/v2/feeds/feed_visibilities/{name}', pathParams, undefined);
7464
+ decoders.GetFeedVisibilityResponse?.(response.body);
7465
+ return { ...response.body, metadata: response.metadata };
7466
+ }
7419
7467
  async createFeedsBatch(request) {
7420
7468
  const body = {
7421
7469
  feeds: request?.feeds,
@@ -7882,35 +7930,34 @@ const ChannelOwnCapability = {
7882
7930
  };
7883
7931
  const FeedOwnCapability = {
7884
7932
  ADD_ACTIVITY: 'add-activity',
7933
+ ADD_ACTIVITY_BOOKMARK: 'add-activity-bookmark',
7885
7934
  ADD_ACTIVITY_REACTION: 'add-activity-reaction',
7886
7935
  ADD_COMMENT: 'add-comment',
7887
7936
  ADD_COMMENT_REACTION: 'add-comment-reaction',
7888
- BOOKMARK_ACTIVITY: 'bookmark-activity',
7889
7937
  CREATE_FEED: 'create-feed',
7890
- DELETE_BOOKMARK: 'delete-bookmark',
7891
- DELETE_COMMENT: 'delete-comment',
7938
+ DELETE_ANY_ACTIVITY: 'delete-any-activity',
7939
+ DELETE_ANY_COMMENT: 'delete-any-comment',
7892
7940
  DELETE_FEED: 'delete-feed',
7893
- EDIT_BOOKMARK: 'edit-bookmark',
7941
+ DELETE_OWN_ACTIVITY: 'delete-own-activity',
7942
+ DELETE_OWN_ACTIVITY_BOOKMARK: 'delete-own-activity-bookmark',
7943
+ DELETE_OWN_ACTIVITY_REACTION: 'delete-own-activity-reaction',
7944
+ DELETE_OWN_COMMENT: 'delete-own-comment',
7945
+ DELETE_OWN_COMMENT_REACTION: 'delete-own-comment-reaction',
7894
7946
  FOLLOW: 'follow',
7895
- INVITE_FEED: 'invite-feed',
7896
- JOIN_FEED: 'join-feed',
7897
- LEAVE_FEED: 'leave-feed',
7898
- MANAGE_FEED_GROUP: 'manage-feed-group',
7899
- MARK_ACTIVITY: 'mark-activity',
7900
7947
  PIN_ACTIVITY: 'pin-activity',
7901
7948
  QUERY_FEED_MEMBERS: 'query-feed-members',
7902
7949
  QUERY_FOLLOWS: 'query-follows',
7903
7950
  READ_ACTIVITIES: 'read-activities',
7904
7951
  READ_FEED: 'read-feed',
7905
- REMOVE_ACTIVITY: 'remove-activity',
7906
- REMOVE_ACTIVITY_REACTION: 'remove-activity-reaction',
7907
- REMOVE_COMMENT_REACTION: 'remove-comment-reaction',
7908
7952
  UNFOLLOW: 'unfollow',
7909
- UPDATE_ACTIVITY: 'update-activity',
7910
- UPDATE_COMMENT: 'update-comment',
7953
+ UPDATE_ANY_ACTIVITY: 'update-any-activity',
7954
+ UPDATE_ANY_COMMENT: 'update-any-comment',
7911
7955
  UPDATE_FEED: 'update-feed',
7912
7956
  UPDATE_FEED_FOLLOWERS: 'update-feed-followers',
7913
7957
  UPDATE_FEED_MEMBERS: 'update-feed-members',
7958
+ UPDATE_OWN_ACTIVITY: 'update-own-activity',
7959
+ UPDATE_OWN_ACTIVITY_BOOKMARK: 'update-own-activity-bookmark',
7960
+ UPDATE_OWN_COMMENT: 'update-own-comment',
7914
7961
  };
7915
7962
  const OwnCapability = {
7916
7963
  BLOCK_USERS: 'block-users',