@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.cjs.js +94 -46
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.mjs +94 -46
- package/dist/index.es.mjs.map +1 -1
- package/dist/src/gen/chat/ChatApi.d.ts +4 -7
- package/dist/src/gen/common/CommonApi.d.ts +7 -1
- package/dist/src/gen/feeds/FeedsApi.d.ts +5 -1
- package/dist/src/gen/models/index.d.ts +97 -34
- package/package.json +1 -1
- package/src/gen/chat/ChatApi.ts +30 -73
- package/src/gen/common/CommonApi.ts +73 -0
- package/src/gen/feeds/FeedsApi.ts +33 -0
- package/src/gen/model-decoders/decoders.ts +28 -4
- package/src/gen/models/index.ts +153 -42
- package/src/gen/video/VideoApi.ts +1 -0
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 },
|
|
@@ -1476,6 +1492,7 @@ decoders.FeedResponse = (input) => {
|
|
|
1476
1492
|
created_by: { type: 'UserResponse', isSingle: true },
|
|
1477
1493
|
deleted_at: { type: 'DatetimeType', isSingle: true },
|
|
1478
1494
|
own_follows: { type: 'FollowResponse', isSingle: false },
|
|
1495
|
+
own_membership: { type: 'FeedMemberResponse', isSingle: true },
|
|
1479
1496
|
};
|
|
1480
1497
|
return decode(typeMappings, input);
|
|
1481
1498
|
};
|
|
@@ -1616,6 +1633,7 @@ decoders.GetCallReportResponse = (input) => {
|
|
|
1616
1633
|
const typeMappings = {
|
|
1617
1634
|
video_reactions: { type: 'VideoReactionsResponse', isSingle: false },
|
|
1618
1635
|
chat_activity: { type: 'ChatActivityStatsResponse', isSingle: true },
|
|
1636
|
+
session: { type: 'CallSessionResponse', isSingle: true },
|
|
1619
1637
|
};
|
|
1620
1638
|
return decode(typeMappings, input);
|
|
1621
1639
|
};
|
|
@@ -1745,9 +1763,7 @@ decoders.GetOrCreateFeedResponse = (input) => {
|
|
|
1745
1763
|
members: { type: 'FeedMemberResponse', isSingle: false },
|
|
1746
1764
|
pinned_activities: { type: 'ActivityPinResponse', isSingle: false },
|
|
1747
1765
|
feed: { type: 'FeedResponse', isSingle: true },
|
|
1748
|
-
own_follows: { type: 'FollowResponse', isSingle: false },
|
|
1749
1766
|
notification_status: { type: 'NotificationStatusResponse', isSingle: true },
|
|
1750
|
-
own_membership: { type: 'FeedMemberResponse', isSingle: true },
|
|
1751
1767
|
};
|
|
1752
1768
|
return decode(typeMappings, input);
|
|
1753
1769
|
};
|
|
@@ -2035,6 +2051,7 @@ decoders.MessageReadEvent = (input) => {
|
|
|
2035
2051
|
const typeMappings = {
|
|
2036
2052
|
created_at: { type: 'DatetimeType', isSingle: true },
|
|
2037
2053
|
channel_last_message_at: { type: 'DatetimeType', isSingle: true },
|
|
2054
|
+
channel: { type: 'ChannelResponse', isSingle: true },
|
|
2038
2055
|
thread: { type: 'ThreadResponse', isSingle: true },
|
|
2039
2056
|
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
2040
2057
|
};
|
|
@@ -3845,6 +3862,14 @@ class CommonApi {
|
|
|
3845
3862
|
decoders.PollVotesResponse?.(response.body);
|
|
3846
3863
|
return { ...response.body, metadata: response.metadata };
|
|
3847
3864
|
}
|
|
3865
|
+
async updatePushNotificationPreferences(request) {
|
|
3866
|
+
const body = {
|
|
3867
|
+
preferences: request?.preferences,
|
|
3868
|
+
};
|
|
3869
|
+
const response = await this.apiClient.sendRequest('POST', '/api/v2/push_preferences', undefined, undefined, body, 'application/json');
|
|
3870
|
+
decoders.UpsertPushPreferencesResponse?.(response.body);
|
|
3871
|
+
return { ...response.body, metadata: response.metadata };
|
|
3872
|
+
}
|
|
3848
3873
|
async listPushProviders() {
|
|
3849
3874
|
const response = await this.apiClient.sendRequest('GET', '/api/v2/push_providers', undefined, undefined);
|
|
3850
3875
|
decoders.ListPushProvidersResponse?.(response.body);
|
|
@@ -3867,6 +3892,27 @@ class CommonApi {
|
|
|
3867
3892
|
decoders.Response?.(response.body);
|
|
3868
3893
|
return { ...response.body, metadata: response.metadata };
|
|
3869
3894
|
}
|
|
3895
|
+
async getPushTemplates(request) {
|
|
3896
|
+
const queryParams = {
|
|
3897
|
+
push_provider_type: request?.push_provider_type,
|
|
3898
|
+
push_provider_name: request?.push_provider_name,
|
|
3899
|
+
};
|
|
3900
|
+
const response = await this.apiClient.sendRequest('GET', '/api/v2/push_templates', undefined, queryParams);
|
|
3901
|
+
decoders.GetPushTemplatesResponse?.(response.body);
|
|
3902
|
+
return { ...response.body, metadata: response.metadata };
|
|
3903
|
+
}
|
|
3904
|
+
async upsertPushTemplate(request) {
|
|
3905
|
+
const body = {
|
|
3906
|
+
event_type: request?.event_type,
|
|
3907
|
+
push_provider_type: request?.push_provider_type,
|
|
3908
|
+
enable_push: request?.enable_push,
|
|
3909
|
+
push_provider_name: request?.push_provider_name,
|
|
3910
|
+
template: request?.template,
|
|
3911
|
+
};
|
|
3912
|
+
const response = await this.apiClient.sendRequest('POST', '/api/v2/push_templates', undefined, undefined, body, 'application/json');
|
|
3913
|
+
decoders.UpsertPushTemplateResponse?.(response.body);
|
|
3914
|
+
return { ...response.body, metadata: response.metadata };
|
|
3915
|
+
}
|
|
3870
3916
|
async getRateLimits(request) {
|
|
3871
3917
|
const queryParams = {
|
|
3872
3918
|
server_side: request?.server_side,
|
|
@@ -4439,6 +4485,7 @@ class VideoApi {
|
|
|
4439
4485
|
enable_transcription: request?.enable_transcription,
|
|
4440
4486
|
external_storage: request?.external_storage,
|
|
4441
4487
|
language: request?.language,
|
|
4488
|
+
speech_segment_config: request?.speech_segment_config,
|
|
4442
4489
|
};
|
|
4443
4490
|
const response = await this.apiClient.sendRequest('POST', '/api/v2/video/call/{type}/{id}/start_closed_captions', pathParams, undefined, body, 'application/json');
|
|
4444
4491
|
decoders.StartClosedCaptionsResponse?.(response.body);
|
|
@@ -5617,6 +5664,21 @@ class ChatApi {
|
|
|
5617
5664
|
decoders.MessageResponse?.(response.body);
|
|
5618
5665
|
return { ...response.body, metadata: response.metadata };
|
|
5619
5666
|
}
|
|
5667
|
+
async ephemeralMessageUpdate(request) {
|
|
5668
|
+
const pathParams = {
|
|
5669
|
+
id: request?.id,
|
|
5670
|
+
};
|
|
5671
|
+
const body = {
|
|
5672
|
+
skip_enrich_url: request?.skip_enrich_url,
|
|
5673
|
+
user_id: request?.user_id,
|
|
5674
|
+
unset: request?.unset,
|
|
5675
|
+
set: request?.set,
|
|
5676
|
+
user: request?.user,
|
|
5677
|
+
};
|
|
5678
|
+
const response = await this.apiClient.sendRequest('PATCH', '/api/v2/chat/messages/{id}/ephemeral', pathParams, undefined, body, 'application/json');
|
|
5679
|
+
decoders.UpdateMessagePartialResponse?.(response.body);
|
|
5680
|
+
return { ...response.body, metadata: response.metadata };
|
|
5681
|
+
}
|
|
5620
5682
|
async sendReaction(request) {
|
|
5621
5683
|
const pathParams = {
|
|
5622
5684
|
id: request?.id,
|
|
@@ -5812,35 +5874,6 @@ class ChatApi {
|
|
|
5812
5874
|
decoders.UnmuteResponse?.(response.body);
|
|
5813
5875
|
return { ...response.body, metadata: response.metadata };
|
|
5814
5876
|
}
|
|
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
5877
|
async queryBannedUsers(request) {
|
|
5845
5878
|
const queryParams = {
|
|
5846
5879
|
payload: request?.payload,
|
|
@@ -6593,7 +6626,7 @@ class ApiClient {
|
|
|
6593
6626
|
const headers = {
|
|
6594
6627
|
Authorization: this.apiConfig.token,
|
|
6595
6628
|
'stream-auth-type': 'jwt',
|
|
6596
|
-
'X-Stream-Client': 'stream-node-' + "0.
|
|
6629
|
+
'X-Stream-Client': 'stream-node-' + "0.7.0",
|
|
6597
6630
|
'Accept-Encoding': 'gzip',
|
|
6598
6631
|
'x-client-request-id': clientRequestId,
|
|
6599
6632
|
};
|
|
@@ -6834,6 +6867,7 @@ class FeedsApi {
|
|
|
6834
6867
|
const body = {
|
|
6835
6868
|
type: request?.type,
|
|
6836
6869
|
create_notification_activity: request?.create_notification_activity,
|
|
6870
|
+
enforce_unique: request?.enforce_unique,
|
|
6837
6871
|
skip_push: request?.skip_push,
|
|
6838
6872
|
user_id: request?.user_id,
|
|
6839
6873
|
custom: request?.custom,
|
|
@@ -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,
|
|
@@ -7062,6 +7097,7 @@ class FeedsApi {
|
|
|
7062
7097
|
const body = {
|
|
7063
7098
|
type: request?.type,
|
|
7064
7099
|
create_notification_activity: request?.create_notification_activity,
|
|
7100
|
+
enforce_unique: request?.enforce_unique,
|
|
7065
7101
|
skip_push: request?.skip_push,
|
|
7066
7102
|
user_id: request?.user_id,
|
|
7067
7103
|
custom: request?.custom,
|
|
@@ -7416,6 +7452,19 @@ class FeedsApi {
|
|
|
7416
7452
|
decoders.UpdateFeedViewResponse?.(response.body);
|
|
7417
7453
|
return { ...response.body, metadata: response.metadata };
|
|
7418
7454
|
}
|
|
7455
|
+
async listFeedVisibilities() {
|
|
7456
|
+
const response = await this.apiClient.sendRequest('GET', '/api/v2/feeds/feed_visibilities', undefined, undefined);
|
|
7457
|
+
decoders.ListFeedVisibilitiesResponse?.(response.body);
|
|
7458
|
+
return { ...response.body, metadata: response.metadata };
|
|
7459
|
+
}
|
|
7460
|
+
async getFeedVisibility(request) {
|
|
7461
|
+
const pathParams = {
|
|
7462
|
+
name: request?.name,
|
|
7463
|
+
};
|
|
7464
|
+
const response = await this.apiClient.sendRequest('GET', '/api/v2/feeds/feed_visibilities/{name}', pathParams, undefined);
|
|
7465
|
+
decoders.GetFeedVisibilityResponse?.(response.body);
|
|
7466
|
+
return { ...response.body, metadata: response.metadata };
|
|
7467
|
+
}
|
|
7419
7468
|
async createFeedsBatch(request) {
|
|
7420
7469
|
const body = {
|
|
7421
7470
|
feeds: request?.feeds,
|
|
@@ -7882,35 +7931,34 @@ const ChannelOwnCapability = {
|
|
|
7882
7931
|
};
|
|
7883
7932
|
const FeedOwnCapability = {
|
|
7884
7933
|
ADD_ACTIVITY: 'add-activity',
|
|
7934
|
+
ADD_ACTIVITY_BOOKMARK: 'add-activity-bookmark',
|
|
7885
7935
|
ADD_ACTIVITY_REACTION: 'add-activity-reaction',
|
|
7886
7936
|
ADD_COMMENT: 'add-comment',
|
|
7887
7937
|
ADD_COMMENT_REACTION: 'add-comment-reaction',
|
|
7888
|
-
BOOKMARK_ACTIVITY: 'bookmark-activity',
|
|
7889
7938
|
CREATE_FEED: 'create-feed',
|
|
7890
|
-
|
|
7891
|
-
|
|
7939
|
+
DELETE_ANY_ACTIVITY: 'delete-any-activity',
|
|
7940
|
+
DELETE_ANY_COMMENT: 'delete-any-comment',
|
|
7892
7941
|
DELETE_FEED: 'delete-feed',
|
|
7893
|
-
|
|
7942
|
+
DELETE_OWN_ACTIVITY: 'delete-own-activity',
|
|
7943
|
+
DELETE_OWN_ACTIVITY_BOOKMARK: 'delete-own-activity-bookmark',
|
|
7944
|
+
DELETE_OWN_ACTIVITY_REACTION: 'delete-own-activity-reaction',
|
|
7945
|
+
DELETE_OWN_COMMENT: 'delete-own-comment',
|
|
7946
|
+
DELETE_OWN_COMMENT_REACTION: 'delete-own-comment-reaction',
|
|
7894
7947
|
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
7948
|
PIN_ACTIVITY: 'pin-activity',
|
|
7901
7949
|
QUERY_FEED_MEMBERS: 'query-feed-members',
|
|
7902
7950
|
QUERY_FOLLOWS: 'query-follows',
|
|
7903
7951
|
READ_ACTIVITIES: 'read-activities',
|
|
7904
7952
|
READ_FEED: 'read-feed',
|
|
7905
|
-
REMOVE_ACTIVITY: 'remove-activity',
|
|
7906
|
-
REMOVE_ACTIVITY_REACTION: 'remove-activity-reaction',
|
|
7907
|
-
REMOVE_COMMENT_REACTION: 'remove-comment-reaction',
|
|
7908
7953
|
UNFOLLOW: 'unfollow',
|
|
7909
|
-
|
|
7910
|
-
|
|
7954
|
+
UPDATE_ANY_ACTIVITY: 'update-any-activity',
|
|
7955
|
+
UPDATE_ANY_COMMENT: 'update-any-comment',
|
|
7911
7956
|
UPDATE_FEED: 'update-feed',
|
|
7912
7957
|
UPDATE_FEED_FOLLOWERS: 'update-feed-followers',
|
|
7913
7958
|
UPDATE_FEED_MEMBERS: 'update-feed-members',
|
|
7959
|
+
UPDATE_OWN_ACTIVITY: 'update-own-activity',
|
|
7960
|
+
UPDATE_OWN_ACTIVITY_BOOKMARK: 'update-own-activity-bookmark',
|
|
7961
|
+
UPDATE_OWN_COMMENT: 'update-own-comment',
|
|
7914
7962
|
};
|
|
7915
7963
|
const OwnCapability = {
|
|
7916
7964
|
BLOCK_USERS: 'block-users',
|