@stream-io/node-sdk 0.6.6 → 0.7.0

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.es.mjs CHANGED
@@ -875,6 +875,7 @@ decoders.Channel = (input) => {
875
875
  members: { type: 'ChannelMember', isSingle: false },
876
876
  config: { type: 'ChannelConfig', isSingle: true },
877
877
  created_by: { type: 'User', isSingle: true },
878
+ members_lookup: { type: 'ChannelMemberLookup', isSingle: false },
878
879
  truncated_by: { type: 'User', isSingle: true },
879
880
  };
880
881
  return decode(typeMappings, input);
@@ -935,6 +936,14 @@ decoders.ChannelMember = (input) => {
935
936
  };
936
937
  return decode(typeMappings, input);
937
938
  };
939
+ decoders.ChannelMemberLookup = (input) => {
940
+ const typeMappings = {
941
+ archived_at: { type: 'DatetimeType', isSingle: true },
942
+ ban_expires: { type: 'DatetimeType', isSingle: true },
943
+ pinned_at: { type: 'DatetimeType', isSingle: true },
944
+ };
945
+ return decode(typeMappings, input);
946
+ };
938
947
  decoders.ChannelMute = (input) => {
939
948
  const typeMappings = {
940
949
  created_at: { type: 'DatetimeType', isSingle: true },
@@ -1287,6 +1296,13 @@ decoders.DeleteCommentReactionResponse = (input) => {
1287
1296
  };
1288
1297
  return decode(typeMappings, input);
1289
1298
  };
1299
+ decoders.DeleteCommentResponse = (input) => {
1300
+ const typeMappings = {
1301
+ activity: { type: 'ActivityResponse', isSingle: true },
1302
+ comment: { type: 'CommentResponse', isSingle: true },
1303
+ };
1304
+ return decode(typeMappings, input);
1305
+ };
1290
1306
  decoders.DeleteMessageResponse = (input) => {
1291
1307
  const typeMappings = {
1292
1308
  message: { type: 'MessageResponse', isSingle: true },
@@ -1457,6 +1473,7 @@ decoders.FeedResponse = (input) => {
1457
1473
  created_by: { type: 'UserResponse', isSingle: true },
1458
1474
  deleted_at: { type: 'DatetimeType', isSingle: true },
1459
1475
  own_follows: { type: 'FollowResponse', isSingle: false },
1476
+ own_membership: { type: 'FeedMemberResponse', isSingle: true },
1460
1477
  };
1461
1478
  return decode(typeMappings, input);
1462
1479
  };
@@ -1597,6 +1614,7 @@ decoders.GetCallReportResponse = (input) => {
1597
1614
  const typeMappings = {
1598
1615
  video_reactions: { type: 'VideoReactionsResponse', isSingle: false },
1599
1616
  chat_activity: { type: 'ChatActivityStatsResponse', isSingle: true },
1617
+ session: { type: 'CallSessionResponse', isSingle: true },
1600
1618
  };
1601
1619
  return decode(typeMappings, input);
1602
1620
  };
@@ -1726,9 +1744,7 @@ decoders.GetOrCreateFeedResponse = (input) => {
1726
1744
  members: { type: 'FeedMemberResponse', isSingle: false },
1727
1745
  pinned_activities: { type: 'ActivityPinResponse', isSingle: false },
1728
1746
  feed: { type: 'FeedResponse', isSingle: true },
1729
- own_follows: { type: 'FollowResponse', isSingle: false },
1730
1747
  notification_status: { type: 'NotificationStatusResponse', isSingle: true },
1731
- own_membership: { type: 'FeedMemberResponse', isSingle: true },
1732
1748
  };
1733
1749
  return decode(typeMappings, input);
1734
1750
  };
@@ -2016,6 +2032,7 @@ decoders.MessageReadEvent = (input) => {
2016
2032
  const typeMappings = {
2017
2033
  created_at: { type: 'DatetimeType', isSingle: true },
2018
2034
  channel_last_message_at: { type: 'DatetimeType', isSingle: true },
2035
+ channel: { type: 'ChannelResponse', isSingle: true },
2019
2036
  thread: { type: 'ThreadResponse', isSingle: true },
2020
2037
  user: { type: 'UserResponseCommonFields', isSingle: true },
2021
2038
  };
@@ -3826,6 +3843,14 @@ class CommonApi {
3826
3843
  decoders.PollVotesResponse?.(response.body);
3827
3844
  return { ...response.body, metadata: response.metadata };
3828
3845
  }
3846
+ async updatePushNotificationPreferences(request) {
3847
+ const body = {
3848
+ preferences: request?.preferences,
3849
+ };
3850
+ const response = await this.apiClient.sendRequest('POST', '/api/v2/push_preferences', undefined, undefined, body, 'application/json');
3851
+ decoders.UpsertPushPreferencesResponse?.(response.body);
3852
+ return { ...response.body, metadata: response.metadata };
3853
+ }
3829
3854
  async listPushProviders() {
3830
3855
  const response = await this.apiClient.sendRequest('GET', '/api/v2/push_providers', undefined, undefined);
3831
3856
  decoders.ListPushProvidersResponse?.(response.body);
@@ -3848,6 +3873,27 @@ class CommonApi {
3848
3873
  decoders.Response?.(response.body);
3849
3874
  return { ...response.body, metadata: response.metadata };
3850
3875
  }
3876
+ async getPushTemplates(request) {
3877
+ const queryParams = {
3878
+ push_provider_type: request?.push_provider_type,
3879
+ push_provider_name: request?.push_provider_name,
3880
+ };
3881
+ const response = await this.apiClient.sendRequest('GET', '/api/v2/push_templates', undefined, queryParams);
3882
+ decoders.GetPushTemplatesResponse?.(response.body);
3883
+ return { ...response.body, metadata: response.metadata };
3884
+ }
3885
+ async upsertPushTemplate(request) {
3886
+ const body = {
3887
+ event_type: request?.event_type,
3888
+ push_provider_type: request?.push_provider_type,
3889
+ enable_push: request?.enable_push,
3890
+ push_provider_name: request?.push_provider_name,
3891
+ template: request?.template,
3892
+ };
3893
+ const response = await this.apiClient.sendRequest('POST', '/api/v2/push_templates', undefined, undefined, body, 'application/json');
3894
+ decoders.UpsertPushTemplateResponse?.(response.body);
3895
+ return { ...response.body, metadata: response.metadata };
3896
+ }
3851
3897
  async getRateLimits(request) {
3852
3898
  const queryParams = {
3853
3899
  server_side: request?.server_side,
@@ -4420,6 +4466,7 @@ class VideoApi {
4420
4466
  enable_transcription: request?.enable_transcription,
4421
4467
  external_storage: request?.external_storage,
4422
4468
  language: request?.language,
4469
+ speech_segment_config: request?.speech_segment_config,
4423
4470
  };
4424
4471
  const response = await this.apiClient.sendRequest('POST', '/api/v2/video/call/{type}/{id}/start_closed_captions', pathParams, undefined, body, 'application/json');
4425
4472
  decoders.StartClosedCaptionsResponse?.(response.body);
@@ -5598,6 +5645,21 @@ class ChatApi {
5598
5645
  decoders.MessageResponse?.(response.body);
5599
5646
  return { ...response.body, metadata: response.metadata };
5600
5647
  }
5648
+ async ephemeralMessageUpdate(request) {
5649
+ const pathParams = {
5650
+ id: request?.id,
5651
+ };
5652
+ const body = {
5653
+ skip_enrich_url: request?.skip_enrich_url,
5654
+ user_id: request?.user_id,
5655
+ unset: request?.unset,
5656
+ set: request?.set,
5657
+ user: request?.user,
5658
+ };
5659
+ const response = await this.apiClient.sendRequest('PATCH', '/api/v2/chat/messages/{id}/ephemeral', pathParams, undefined, body, 'application/json');
5660
+ decoders.UpdateMessagePartialResponse?.(response.body);
5661
+ return { ...response.body, metadata: response.metadata };
5662
+ }
5601
5663
  async sendReaction(request) {
5602
5664
  const pathParams = {
5603
5665
  id: request?.id,
@@ -5793,35 +5855,6 @@ class ChatApi {
5793
5855
  decoders.UnmuteResponse?.(response.body);
5794
5856
  return { ...response.body, metadata: response.metadata };
5795
5857
  }
5796
- async updatePushNotificationPreferences(request) {
5797
- const body = {
5798
- preferences: request?.preferences,
5799
- };
5800
- const response = await this.apiClient.sendRequest('POST', '/api/v2/chat/push_preferences', undefined, undefined, body, 'application/json');
5801
- decoders.UpsertPushPreferencesResponse?.(response.body);
5802
- return { ...response.body, metadata: response.metadata };
5803
- }
5804
- async getPushTemplates(request) {
5805
- const queryParams = {
5806
- push_provider_type: request?.push_provider_type,
5807
- push_provider_name: request?.push_provider_name,
5808
- };
5809
- const response = await this.apiClient.sendRequest('GET', '/api/v2/chat/push_templates', undefined, queryParams);
5810
- decoders.GetPushTemplatesResponse?.(response.body);
5811
- return { ...response.body, metadata: response.metadata };
5812
- }
5813
- async upsertPushTemplate(request) {
5814
- const body = {
5815
- event_type: request?.event_type,
5816
- push_provider_type: request?.push_provider_type,
5817
- enable_push: request?.enable_push,
5818
- push_provider_name: request?.push_provider_name,
5819
- template: request?.template,
5820
- };
5821
- const response = await this.apiClient.sendRequest('POST', '/api/v2/chat/push_templates', undefined, undefined, body, 'application/json');
5822
- decoders.UpsertPushTemplateResponse?.(response.body);
5823
- return { ...response.body, metadata: response.metadata };
5824
- }
5825
5858
  async queryBannedUsers(request) {
5826
5859
  const queryParams = {
5827
5860
  payload: request?.payload,
@@ -6574,7 +6607,7 @@ class ApiClient {
6574
6607
  const headers = {
6575
6608
  Authorization: this.apiConfig.token,
6576
6609
  'stream-auth-type': 'jwt',
6577
- 'X-Stream-Client': 'stream-node-' + "0.6.6",
6610
+ 'X-Stream-Client': 'stream-node-' + "0.7.0",
6578
6611
  'Accept-Encoding': 'gzip',
6579
6612
  'x-client-request-id': clientRequestId,
6580
6613
  };
@@ -6815,6 +6848,7 @@ class FeedsApi {
6815
6848
  const body = {
6816
6849
  type: request?.type,
6817
6850
  create_notification_activity: request?.create_notification_activity,
6851
+ enforce_unique: request?.enforce_unique,
6818
6852
  skip_push: request?.skip_push,
6819
6853
  user_id: request?.user_id,
6820
6854
  custom: request?.custom,
@@ -6895,6 +6929,7 @@ class FeedsApi {
6895
6929
  user_id: request?.user_id,
6896
6930
  visibility: request?.visibility,
6897
6931
  attachments: request?.attachments,
6932
+ feeds: request?.feeds,
6898
6933
  filter_tags: request?.filter_tags,
6899
6934
  interest_tags: request?.interest_tags,
6900
6935
  custom: request?.custom,
@@ -7043,6 +7078,7 @@ class FeedsApi {
7043
7078
  const body = {
7044
7079
  type: request?.type,
7045
7080
  create_notification_activity: request?.create_notification_activity,
7081
+ enforce_unique: request?.enforce_unique,
7046
7082
  skip_push: request?.skip_push,
7047
7083
  user_id: request?.user_id,
7048
7084
  custom: request?.custom,
@@ -7397,6 +7433,19 @@ class FeedsApi {
7397
7433
  decoders.UpdateFeedViewResponse?.(response.body);
7398
7434
  return { ...response.body, metadata: response.metadata };
7399
7435
  }
7436
+ async listFeedVisibilities() {
7437
+ const response = await this.apiClient.sendRequest('GET', '/api/v2/feeds/feed_visibilities', undefined, undefined);
7438
+ decoders.ListFeedVisibilitiesResponse?.(response.body);
7439
+ return { ...response.body, metadata: response.metadata };
7440
+ }
7441
+ async getFeedVisibility(request) {
7442
+ const pathParams = {
7443
+ name: request?.name,
7444
+ };
7445
+ const response = await this.apiClient.sendRequest('GET', '/api/v2/feeds/feed_visibilities/{name}', pathParams, undefined);
7446
+ decoders.GetFeedVisibilityResponse?.(response.body);
7447
+ return { ...response.body, metadata: response.metadata };
7448
+ }
7400
7449
  async createFeedsBatch(request) {
7401
7450
  const body = {
7402
7451
  feeds: request?.feeds,
@@ -7863,35 +7912,34 @@ const ChannelOwnCapability = {
7863
7912
  };
7864
7913
  const FeedOwnCapability = {
7865
7914
  ADD_ACTIVITY: 'add-activity',
7915
+ ADD_ACTIVITY_BOOKMARK: 'add-activity-bookmark',
7866
7916
  ADD_ACTIVITY_REACTION: 'add-activity-reaction',
7867
7917
  ADD_COMMENT: 'add-comment',
7868
7918
  ADD_COMMENT_REACTION: 'add-comment-reaction',
7869
- BOOKMARK_ACTIVITY: 'bookmark-activity',
7870
7919
  CREATE_FEED: 'create-feed',
7871
- DELETE_BOOKMARK: 'delete-bookmark',
7872
- DELETE_COMMENT: 'delete-comment',
7920
+ DELETE_ANY_ACTIVITY: 'delete-any-activity',
7921
+ DELETE_ANY_COMMENT: 'delete-any-comment',
7873
7922
  DELETE_FEED: 'delete-feed',
7874
- EDIT_BOOKMARK: 'edit-bookmark',
7923
+ DELETE_OWN_ACTIVITY: 'delete-own-activity',
7924
+ DELETE_OWN_ACTIVITY_BOOKMARK: 'delete-own-activity-bookmark',
7925
+ DELETE_OWN_ACTIVITY_REACTION: 'delete-own-activity-reaction',
7926
+ DELETE_OWN_COMMENT: 'delete-own-comment',
7927
+ DELETE_OWN_COMMENT_REACTION: 'delete-own-comment-reaction',
7875
7928
  FOLLOW: 'follow',
7876
- INVITE_FEED: 'invite-feed',
7877
- JOIN_FEED: 'join-feed',
7878
- LEAVE_FEED: 'leave-feed',
7879
- MANAGE_FEED_GROUP: 'manage-feed-group',
7880
- MARK_ACTIVITY: 'mark-activity',
7881
7929
  PIN_ACTIVITY: 'pin-activity',
7882
7930
  QUERY_FEED_MEMBERS: 'query-feed-members',
7883
7931
  QUERY_FOLLOWS: 'query-follows',
7884
7932
  READ_ACTIVITIES: 'read-activities',
7885
7933
  READ_FEED: 'read-feed',
7886
- REMOVE_ACTIVITY: 'remove-activity',
7887
- REMOVE_ACTIVITY_REACTION: 'remove-activity-reaction',
7888
- REMOVE_COMMENT_REACTION: 'remove-comment-reaction',
7889
7934
  UNFOLLOW: 'unfollow',
7890
- UPDATE_ACTIVITY: 'update-activity',
7891
- UPDATE_COMMENT: 'update-comment',
7935
+ UPDATE_ANY_ACTIVITY: 'update-any-activity',
7936
+ UPDATE_ANY_COMMENT: 'update-any-comment',
7892
7937
  UPDATE_FEED: 'update-feed',
7893
7938
  UPDATE_FEED_FOLLOWERS: 'update-feed-followers',
7894
7939
  UPDATE_FEED_MEMBERS: 'update-feed-members',
7940
+ UPDATE_OWN_ACTIVITY: 'update-own-activity',
7941
+ UPDATE_OWN_ACTIVITY_BOOKMARK: 'update-own-activity-bookmark',
7942
+ UPDATE_OWN_COMMENT: 'update-own-comment',
7895
7943
  };
7896
7944
  const OwnCapability = {
7897
7945
  BLOCK_USERS: 'block-users',