@stream-io/node-sdk 0.7.44 → 0.7.45
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 +114 -15
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.mjs +114 -15
- package/dist/index.es.mjs.map +1 -1
- package/dist/src/gen/chat/ChatApi.d.ts +2 -1
- package/dist/src/gen/common/CommonApi.d.ts +4 -4
- package/dist/src/gen/feeds/FeedsApi.d.ts +6 -1
- package/dist/src/gen/models/index.d.ts +190 -5
- package/dist/src/gen/moderation/ModerationApi.d.ts +2 -1
- package/dist/src/gen/video/VideoApi.d.ts +2 -1
- package/package.json +26 -26
- package/src/ApiClient.ts +3 -3
- package/src/gen/chat/ChatApi.ts +30 -0
- package/src/gen/common/CommonApi.ts +27 -12
- package/src/gen/feeds/FeedsApi.ts +90 -0
- package/src/gen/model-decoders/decoders.ts +31 -7
- package/src/gen/models/index.ts +342 -9
- package/src/gen/moderation/ModerationApi.ts +25 -0
- package/src/gen/video/VideoApi.ts +35 -2
package/dist/index.cjs.js
CHANGED
|
@@ -546,6 +546,7 @@ decoders.CallEndedEvent = (input) => {
|
|
|
546
546
|
const typeMappings = {
|
|
547
547
|
created_at: { type: 'DatetimeType', isSingle: true },
|
|
548
548
|
call: { type: 'CallResponse', isSingle: true },
|
|
549
|
+
members: { type: 'MemberResponse', isSingle: false },
|
|
549
550
|
user: { type: 'UserResponse', isSingle: true },
|
|
550
551
|
};
|
|
551
552
|
return decode(typeMappings, input);
|
|
@@ -1186,12 +1187,6 @@ decoders.ChatActivityStatsResponse = (input) => {
|
|
|
1186
1187
|
};
|
|
1187
1188
|
return decode(typeMappings, input);
|
|
1188
1189
|
};
|
|
1189
|
-
decoders.CheckResponse = (input) => {
|
|
1190
|
-
const typeMappings = {
|
|
1191
|
-
item: { type: 'ReviewQueueItemResponse', isSingle: true },
|
|
1192
|
-
};
|
|
1193
|
-
return decode(typeMappings, input);
|
|
1194
|
-
};
|
|
1195
1190
|
decoders.ClosedCaptionEvent = (input) => {
|
|
1196
1191
|
const typeMappings = {
|
|
1197
1192
|
created_at: { type: 'DatetimeType', isSingle: true },
|
|
@@ -1276,6 +1271,15 @@ decoders.CommentResponse = (input) => {
|
|
|
1276
1271
|
};
|
|
1277
1272
|
return decode(typeMappings, input);
|
|
1278
1273
|
};
|
|
1274
|
+
decoders.CommentRestoredEvent = (input) => {
|
|
1275
|
+
const typeMappings = {
|
|
1276
|
+
created_at: { type: 'DatetimeType', isSingle: true },
|
|
1277
|
+
comment: { type: 'CommentResponse', isSingle: true },
|
|
1278
|
+
received_at: { type: 'DatetimeType', isSingle: true },
|
|
1279
|
+
user: { type: 'UserResponseCommonFields', isSingle: true },
|
|
1280
|
+
};
|
|
1281
|
+
return decode(typeMappings, input);
|
|
1282
|
+
};
|
|
1279
1283
|
decoders.CommentUpdatedEvent = (input) => {
|
|
1280
1284
|
const typeMappings = {
|
|
1281
1285
|
created_at: { type: 'DatetimeType', isSingle: true },
|
|
@@ -2788,6 +2792,12 @@ decoders.QueryCampaignsResponse = (input) => {
|
|
|
2788
2792
|
};
|
|
2789
2793
|
return decode(typeMappings, input);
|
|
2790
2794
|
};
|
|
2795
|
+
decoders.QueryCollectionsResponse = (input) => {
|
|
2796
|
+
const typeMappings = {
|
|
2797
|
+
collections: { type: 'CollectionResponse', isSingle: false },
|
|
2798
|
+
};
|
|
2799
|
+
return decode(typeMappings, input);
|
|
2800
|
+
};
|
|
2791
2801
|
decoders.QueryCommentReactionsResponse = (input) => {
|
|
2792
2802
|
const typeMappings = {
|
|
2793
2803
|
reactions: { type: 'FeedsReactionResponse', isSingle: false },
|
|
@@ -3085,6 +3095,13 @@ decoders.RestoreActivityResponse = (input) => {
|
|
|
3085
3095
|
};
|
|
3086
3096
|
return decode(typeMappings, input);
|
|
3087
3097
|
};
|
|
3098
|
+
decoders.RestoreCommentResponse = (input) => {
|
|
3099
|
+
const typeMappings = {
|
|
3100
|
+
activity: { type: 'ActivityResponse', isSingle: true },
|
|
3101
|
+
comment: { type: 'CommentResponse', isSingle: true },
|
|
3102
|
+
};
|
|
3103
|
+
return decode(typeMappings, input);
|
|
3104
|
+
};
|
|
3088
3105
|
decoders.RestoreFeedGroupResponse = (input) => {
|
|
3089
3106
|
const typeMappings = {
|
|
3090
3107
|
feed_group: { type: 'FeedGroupResponse', isSingle: true },
|
|
@@ -3917,6 +3934,7 @@ class CommonApi {
|
|
|
3917
3934
|
migrate_permissions_to_v2: request?.migrate_permissions_to_v2,
|
|
3918
3935
|
moderation_analytics_enabled: request?.moderation_analytics_enabled,
|
|
3919
3936
|
moderation_enabled: request?.moderation_enabled,
|
|
3937
|
+
moderation_s3_image_access_role_arn: request?.moderation_s3_image_access_role_arn,
|
|
3920
3938
|
moderation_webhook_url: request?.moderation_webhook_url,
|
|
3921
3939
|
multi_tenant_enabled: request?.multi_tenant_enabled,
|
|
3922
3940
|
permission_version: request?.permission_version,
|
|
@@ -3937,6 +3955,7 @@ class CommonApi {
|
|
|
3937
3955
|
image_moderation_labels: request?.image_moderation_labels,
|
|
3938
3956
|
user_search_disallowed_roles: request?.user_search_disallowed_roles,
|
|
3939
3957
|
webhook_events: request?.webhook_events,
|
|
3958
|
+
activity_metrics_config: request?.activity_metrics_config,
|
|
3940
3959
|
apn_config: request?.apn_config,
|
|
3941
3960
|
async_moderation_config: request?.async_moderation_config,
|
|
3942
3961
|
datadog_info: request?.datadog_info,
|
|
@@ -4590,15 +4609,19 @@ class CommonApi {
|
|
|
4590
4609
|
decoders.UpdateUserGroupResponse?.(response.body);
|
|
4591
4610
|
return { ...response.body, metadata: response.metadata };
|
|
4592
4611
|
}
|
|
4593
|
-
async
|
|
4612
|
+
async addUserGroupMembers(request) {
|
|
4594
4613
|
const pathParams = {
|
|
4595
4614
|
id: request?.id,
|
|
4596
4615
|
};
|
|
4597
|
-
const
|
|
4598
|
-
|
|
4616
|
+
const body = {
|
|
4617
|
+
member_ids: request?.member_ids,
|
|
4618
|
+
team_id: request?.team_id,
|
|
4619
|
+
};
|
|
4620
|
+
const response = await this.apiClient.sendRequest('POST', '/api/v2/usergroups/{id}/members', pathParams, undefined, body, 'application/json');
|
|
4621
|
+
decoders.AddUserGroupMembersResponse?.(response.body);
|
|
4599
4622
|
return { ...response.body, metadata: response.metadata };
|
|
4600
4623
|
}
|
|
4601
|
-
async
|
|
4624
|
+
async removeUserGroupMembers(request) {
|
|
4602
4625
|
const pathParams = {
|
|
4603
4626
|
id: request?.id,
|
|
4604
4627
|
};
|
|
@@ -4606,8 +4629,8 @@ class CommonApi {
|
|
|
4606
4629
|
member_ids: request?.member_ids,
|
|
4607
4630
|
team_id: request?.team_id,
|
|
4608
4631
|
};
|
|
4609
|
-
const response = await this.apiClient.sendRequest('POST', '/api/v2/usergroups/{id}/members', pathParams, undefined, body, 'application/json');
|
|
4610
|
-
decoders.
|
|
4632
|
+
const response = await this.apiClient.sendRequest('POST', '/api/v2/usergroups/{id}/members/delete', pathParams, undefined, body, 'application/json');
|
|
4633
|
+
decoders.RemoveUserGroupMembersResponse?.(response.body);
|
|
4611
4634
|
return { ...response.body, metadata: response.metadata };
|
|
4612
4635
|
}
|
|
4613
4636
|
async queryUsers(request) {
|
|
@@ -5473,6 +5496,17 @@ class VideoApi {
|
|
|
5473
5496
|
decoders.GetEdgesResponse?.(response.body);
|
|
5474
5497
|
return { ...response.body, metadata: response.metadata };
|
|
5475
5498
|
}
|
|
5499
|
+
async resolveSipAuth(request) {
|
|
5500
|
+
const body = {
|
|
5501
|
+
sip_caller_number: request?.sip_caller_number,
|
|
5502
|
+
sip_trunk_number: request?.sip_trunk_number,
|
|
5503
|
+
from_host: request?.from_host,
|
|
5504
|
+
source_ip: request?.source_ip,
|
|
5505
|
+
};
|
|
5506
|
+
const response = await this.apiClient.sendRequest('POST', '/api/v2/video/sip/auth', undefined, undefined, body, 'application/json');
|
|
5507
|
+
decoders.ResolveSipAuthResponse?.(response.body);
|
|
5508
|
+
return { ...response.body, metadata: response.metadata };
|
|
5509
|
+
}
|
|
5476
5510
|
async listSIPInboundRoutingRule() {
|
|
5477
5511
|
const response = await this.apiClient.sendRequest('GET', '/api/v2/video/sip/inbound_routing_rules', undefined, undefined);
|
|
5478
5512
|
decoders.ListSIPInboundRoutingRuleResponse?.(response.body);
|
|
@@ -5508,9 +5542,9 @@ class VideoApi {
|
|
|
5508
5542
|
};
|
|
5509
5543
|
const body = {
|
|
5510
5544
|
name: request?.name,
|
|
5511
|
-
called_numbers: request?.called_numbers,
|
|
5512
5545
|
trunk_ids: request?.trunk_ids,
|
|
5513
5546
|
caller_configs: request?.caller_configs,
|
|
5547
|
+
called_numbers: request?.called_numbers,
|
|
5514
5548
|
caller_numbers: request?.caller_numbers,
|
|
5515
5549
|
call_configs: request?.call_configs,
|
|
5516
5550
|
direct_routing_configs: request?.direct_routing_configs,
|
|
@@ -5530,6 +5564,8 @@ class VideoApi {
|
|
|
5530
5564
|
const body = {
|
|
5531
5565
|
name: request?.name,
|
|
5532
5566
|
numbers: request?.numbers,
|
|
5567
|
+
password: request?.password,
|
|
5568
|
+
allowed_ips: request?.allowed_ips,
|
|
5533
5569
|
};
|
|
5534
5570
|
const response = await this.apiClient.sendRequest('POST', '/api/v2/video/sip/inbound_trunks', undefined, undefined, body, 'application/json');
|
|
5535
5571
|
decoders.CreateSIPTrunkResponse?.(response.body);
|
|
@@ -5550,6 +5586,8 @@ class VideoApi {
|
|
|
5550
5586
|
const body = {
|
|
5551
5587
|
name: request?.name,
|
|
5552
5588
|
numbers: request?.numbers,
|
|
5589
|
+
password: request?.password,
|
|
5590
|
+
allowed_ips: request?.allowed_ips,
|
|
5553
5591
|
};
|
|
5554
5592
|
const response = await this.apiClient.sendRequest('PUT', '/api/v2/video/sip/inbound_trunks/{id}', pathParams, undefined, body, 'application/json');
|
|
5555
5593
|
decoders.UpdateSIPTrunkResponse?.(response.body);
|
|
@@ -5559,8 +5597,9 @@ class VideoApi {
|
|
|
5559
5597
|
const body = {
|
|
5560
5598
|
sip_caller_number: request?.sip_caller_number,
|
|
5561
5599
|
sip_trunk_number: request?.sip_trunk_number,
|
|
5562
|
-
challenge: request?.challenge,
|
|
5563
5600
|
routing_number: request?.routing_number,
|
|
5601
|
+
trunk_id: request?.trunk_id,
|
|
5602
|
+
challenge: request?.challenge,
|
|
5564
5603
|
sip_headers: request?.sip_headers,
|
|
5565
5604
|
};
|
|
5566
5605
|
const response = await this.apiClient.sendRequest('POST', '/api/v2/video/sip/resolve', undefined, undefined, body, 'application/json');
|
|
@@ -5973,6 +6012,17 @@ class ChatApi {
|
|
|
5973
6012
|
decoders.QueryChannelsResponse?.(response.body);
|
|
5974
6013
|
return { ...response.body, metadata: response.metadata };
|
|
5975
6014
|
}
|
|
6015
|
+
async channelBatchUpdate(request) {
|
|
6016
|
+
const body = {
|
|
6017
|
+
operation: request?.operation,
|
|
6018
|
+
filter: request?.filter,
|
|
6019
|
+
members: request?.members,
|
|
6020
|
+
data: request?.data,
|
|
6021
|
+
};
|
|
6022
|
+
const response = await this.apiClient.sendRequest('PUT', '/api/v2/chat/channels/batch', undefined, undefined, body, 'application/json');
|
|
6023
|
+
decoders.ChannelBatchUpdateResponse?.(response.body);
|
|
6024
|
+
return { ...response.body, metadata: response.metadata };
|
|
6025
|
+
}
|
|
5976
6026
|
async deleteChannels(request) {
|
|
5977
6027
|
const body = {
|
|
5978
6028
|
cids: request?.cids,
|
|
@@ -6343,6 +6393,7 @@ class ChatApi {
|
|
|
6343
6393
|
blocklists: request?.blocklists,
|
|
6344
6394
|
commands: request?.commands,
|
|
6345
6395
|
permissions: request?.permissions,
|
|
6396
|
+
chat_preferences: request?.chat_preferences,
|
|
6346
6397
|
grants: request?.grants,
|
|
6347
6398
|
};
|
|
6348
6399
|
const response = await this.apiClient.sendRequest('POST', '/api/v2/chat/channeltypes', undefined, undefined, body, 'application/json');
|
|
@@ -6403,6 +6454,7 @@ class ChatApi {
|
|
|
6403
6454
|
commands: request?.commands,
|
|
6404
6455
|
permissions: request?.permissions,
|
|
6405
6456
|
automod_thresholds: request?.automod_thresholds,
|
|
6457
|
+
chat_preferences: request?.chat_preferences,
|
|
6406
6458
|
grants: request?.grants,
|
|
6407
6459
|
};
|
|
6408
6460
|
const response = await this.apiClient.sendRequest('PUT', '/api/v2/chat/channeltypes/{name}', pathParams, undefined, body, 'application/json');
|
|
@@ -7279,6 +7331,14 @@ class ModerationApi {
|
|
|
7279
7331
|
decoders.CheckResponse?.(response.body);
|
|
7280
7332
|
return { ...response.body, metadata: response.metadata };
|
|
7281
7333
|
}
|
|
7334
|
+
async checkS3Access(request) {
|
|
7335
|
+
const body = {
|
|
7336
|
+
s3_url: request?.s3_url,
|
|
7337
|
+
};
|
|
7338
|
+
const response = await this.apiClient.sendRequest('POST', '/api/v2/moderation/check_s3_access', undefined, undefined, body, 'application/json');
|
|
7339
|
+
decoders.CheckS3AccessResponse?.(response.body);
|
|
7340
|
+
return { ...response.body, metadata: response.metadata };
|
|
7341
|
+
}
|
|
7282
7342
|
async upsertConfig(request) {
|
|
7283
7343
|
const body = {
|
|
7284
7344
|
key: request?.key,
|
|
@@ -7598,7 +7658,7 @@ class ApiClient {
|
|
|
7598
7658
|
const headers = {
|
|
7599
7659
|
Authorization: this.apiConfig.token,
|
|
7600
7660
|
'stream-auth-type': 'jwt',
|
|
7601
|
-
'X-Stream-Client': 'stream-node-' + "0.7.
|
|
7661
|
+
'X-Stream-Client': 'stream-node-' + "0.7.45",
|
|
7602
7662
|
'Accept-Encoding': 'gzip',
|
|
7603
7663
|
'x-client-request-id': clientRequestId,
|
|
7604
7664
|
};
|
|
@@ -7750,6 +7810,16 @@ class FeedsApi {
|
|
|
7750
7810
|
decoders.DeleteActivitiesResponse?.(response.body);
|
|
7751
7811
|
return { ...response.body, metadata: response.metadata };
|
|
7752
7812
|
}
|
|
7813
|
+
async trackActivityMetrics(request) {
|
|
7814
|
+
const body = {
|
|
7815
|
+
events: request?.events,
|
|
7816
|
+
user_id: request?.user_id,
|
|
7817
|
+
user: request?.user,
|
|
7818
|
+
};
|
|
7819
|
+
const response = await this.apiClient.sendRequest('POST', '/api/v2/feeds/activities/metrics/track', undefined, undefined, body, 'application/json');
|
|
7820
|
+
decoders.TrackActivityMetricsResponse?.(response.body);
|
|
7821
|
+
return { ...response.body, metadata: response.metadata };
|
|
7822
|
+
}
|
|
7753
7823
|
async queryActivities(request) {
|
|
7754
7824
|
const body = {
|
|
7755
7825
|
enrich_own_fields: request?.enrich_own_fields,
|
|
@@ -8075,6 +8145,20 @@ class FeedsApi {
|
|
|
8075
8145
|
decoders.UpsertCollectionsResponse?.(response.body);
|
|
8076
8146
|
return { ...response.body, metadata: response.metadata };
|
|
8077
8147
|
}
|
|
8148
|
+
async queryCollections(request) {
|
|
8149
|
+
const body = {
|
|
8150
|
+
limit: request?.limit,
|
|
8151
|
+
next: request?.next,
|
|
8152
|
+
prev: request?.prev,
|
|
8153
|
+
user_id: request?.user_id,
|
|
8154
|
+
sort: request?.sort,
|
|
8155
|
+
filter: request?.filter,
|
|
8156
|
+
user: request?.user,
|
|
8157
|
+
};
|
|
8158
|
+
const response = await this.apiClient.sendRequest('POST', '/api/v2/feeds/collections/query', undefined, undefined, body, 'application/json');
|
|
8159
|
+
decoders.QueryCollectionsResponse?.(response.body);
|
|
8160
|
+
return { ...response.body, metadata: response.metadata };
|
|
8161
|
+
}
|
|
8078
8162
|
async getComments(request) {
|
|
8079
8163
|
const queryParams = {
|
|
8080
8164
|
object_id: request?.object_id,
|
|
@@ -8123,10 +8207,13 @@ class FeedsApi {
|
|
|
8123
8207
|
async queryComments(request) {
|
|
8124
8208
|
const body = {
|
|
8125
8209
|
filter: request?.filter,
|
|
8210
|
+
id_around: request?.id_around,
|
|
8126
8211
|
limit: request?.limit,
|
|
8127
8212
|
next: request?.next,
|
|
8128
8213
|
prev: request?.prev,
|
|
8129
8214
|
sort: request?.sort,
|
|
8215
|
+
user_id: request?.user_id,
|
|
8216
|
+
user: request?.user,
|
|
8130
8217
|
};
|
|
8131
8218
|
const response = await this.apiClient.sendRequest('POST', '/api/v2/feeds/comments/query', undefined, undefined, body, 'application/json');
|
|
8132
8219
|
decoders.QueryCommentsResponse?.(response.body);
|
|
@@ -8235,6 +8322,18 @@ class FeedsApi {
|
|
|
8235
8322
|
decoders.GetCommentRepliesResponse?.(response.body);
|
|
8236
8323
|
return { ...response.body, metadata: response.metadata };
|
|
8237
8324
|
}
|
|
8325
|
+
async restoreComment(request) {
|
|
8326
|
+
const pathParams = {
|
|
8327
|
+
id: request?.id,
|
|
8328
|
+
};
|
|
8329
|
+
const body = {
|
|
8330
|
+
user_id: request?.user_id,
|
|
8331
|
+
user: request?.user,
|
|
8332
|
+
};
|
|
8333
|
+
const response = await this.apiClient.sendRequest('POST', '/api/v2/feeds/comments/{id}/restore', pathParams, undefined, body, 'application/json');
|
|
8334
|
+
decoders.RestoreCommentResponse?.(response.body);
|
|
8335
|
+
return { ...response.body, metadata: response.metadata };
|
|
8336
|
+
}
|
|
8238
8337
|
async listFeedGroups(request) {
|
|
8239
8338
|
const queryParams = {
|
|
8240
8339
|
include_soft_deleted: request?.include_soft_deleted,
|