@stream-io/node-sdk 0.8.11 → 0.8.13

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.d.ts CHANGED
@@ -6,4 +6,5 @@ export * from './src/StreamVideoClient';
6
6
  export * from './src/gen/models';
7
7
  export * from './src/StreamFeedsClient';
8
8
  export * from './src/StreamFeed';
9
- export { InvalidWebhookError, InvalidWebhookErrorMessages, } from './src/utils/webhook';
9
+ export { InvalidWebhookError, InvalidWebhookErrorMessages, verifyAndParseWebhook, } from './src/utils/webhook';
10
+ export { StreamError } from './src/types';
package/dist/index.es.mjs CHANGED
@@ -821,6 +821,26 @@ decoders["AsyncExportErrorEvent"] = (input) => {
821
821
  }
822
822
  }, input);
823
823
  };
824
+ decoders["AsyncExportLabelResultsEvent"] = (input) => {
825
+ return decode({
826
+ created_at: {
827
+ type: "DatetimeType",
828
+ isSingle: true
829
+ },
830
+ finished_at: {
831
+ type: "DatetimeType",
832
+ isSingle: true
833
+ },
834
+ started_at: {
835
+ type: "DatetimeType",
836
+ isSingle: true
837
+ },
838
+ received_at: {
839
+ type: "DatetimeType",
840
+ isSingle: true
841
+ }
842
+ }, input);
843
+ };
824
844
  decoders["AsyncExportModerationLogsEvent"] = (input) => {
825
845
  return decode({
826
846
  created_at: {
@@ -881,6 +901,46 @@ decoders["AsyncExportUsersEvent"] = (input) => {
881
901
  }
882
902
  }, input);
883
903
  };
904
+ decoders["AsyncImportErrorEvent"] = (input) => {
905
+ return decode({
906
+ created_at: {
907
+ type: "DatetimeType",
908
+ isSingle: true
909
+ },
910
+ finished_at: {
911
+ type: "DatetimeType",
912
+ isSingle: true
913
+ },
914
+ received_at: {
915
+ type: "DatetimeType",
916
+ isSingle: true
917
+ },
918
+ started_at: {
919
+ type: "DatetimeType",
920
+ isSingle: true
921
+ }
922
+ }, input);
923
+ };
924
+ decoders["AsyncImportSuccessEvent"] = (input) => {
925
+ return decode({
926
+ created_at: {
927
+ type: "DatetimeType",
928
+ isSingle: true
929
+ },
930
+ finished_at: {
931
+ type: "DatetimeType",
932
+ isSingle: true
933
+ },
934
+ received_at: {
935
+ type: "DatetimeType",
936
+ isSingle: true
937
+ },
938
+ started_at: {
939
+ type: "DatetimeType",
940
+ isSingle: true
941
+ }
942
+ }, input);
943
+ };
884
944
  decoders["AutomodDetailsResponse"] = (input) => {
885
945
  return decode({ result: {
886
946
  type: "MessageModerationResult",
@@ -1597,6 +1657,22 @@ decoders["CallRingEvent"] = (input) => {
1597
1657
  }
1598
1658
  }, input);
1599
1659
  };
1660
+ decoders["CallRingSettledEvent"] = (input) => {
1661
+ return decode({
1662
+ created_at: {
1663
+ type: "DatetimeType",
1664
+ isSingle: true
1665
+ },
1666
+ rang_at: {
1667
+ type: "DatetimeType",
1668
+ isSingle: true
1669
+ },
1670
+ settled_at: {
1671
+ type: "DatetimeType",
1672
+ isSingle: true
1673
+ }
1674
+ }, input);
1675
+ };
1600
1676
  decoders["CallRtmpBroadcastFailedEvent"] = (input) => {
1601
1677
  return decode({ created_at: {
1602
1678
  type: "DatetimeType",
@@ -2777,6 +2853,22 @@ decoders["CommentDeletedEvent"] = (input) => {
2777
2853
  }
2778
2854
  }, input);
2779
2855
  };
2856
+ decoders["CommentFeedbackEvent"] = (input) => {
2857
+ return decode({
2858
+ created_at: {
2859
+ type: "DatetimeType",
2860
+ isSingle: true
2861
+ },
2862
+ received_at: {
2863
+ type: "DatetimeType",
2864
+ isSingle: true
2865
+ },
2866
+ user: {
2867
+ type: "UserResponseCommonFields",
2868
+ isSingle: true
2869
+ }
2870
+ }, input);
2871
+ };
2780
2872
  decoders["CommentReactionAddedEvent"] = (input) => {
2781
2873
  return decode({
2782
2874
  created_at: {
@@ -3703,6 +3795,12 @@ decoders["FeedsReactionResponse"] = (input) => {
3703
3795
  }
3704
3796
  }, input);
3705
3797
  };
3798
+ decoders["FeedsRetentionPolicy"] = (input) => {
3799
+ return decode({ enabled_at: {
3800
+ type: "DatetimeType",
3801
+ isSingle: true
3802
+ } }, input);
3803
+ };
3706
3804
  decoders["FeedsShareResponse"] = (input) => {
3707
3805
  return decode({
3708
3806
  created_at: {
@@ -4213,7 +4311,7 @@ decoders["GetFeedViewResponse"] = (input) => {
4213
4311
  };
4214
4312
  decoders["GetFeedsRetentionPolicyResponse"] = (input) => {
4215
4313
  return decode({ policies: {
4216
- type: "RetentionPolicy",
4314
+ type: "FeedsRetentionPolicy",
4217
4315
  isSingle: false
4218
4316
  } }, input);
4219
4317
  };
@@ -5941,6 +6039,12 @@ decoders["QueryCallParticipantsResponse"] = (input) => {
5941
6039
  }
5942
6040
  }, input);
5943
6041
  };
6042
+ decoders["QueryCallRingAttemptsResponse"] = (input) => {
6043
+ return decode({ ring_attempts: {
6044
+ type: "RingAttemptResponse",
6045
+ isSingle: false
6046
+ } }, input);
6047
+ };
5944
6048
  decoders["QueryCallSessionParticipantStatsResponse"] = (input) => {
5945
6049
  return decode({
5946
6050
  participants: {
@@ -6677,6 +6781,66 @@ decoders["RevisionHistoryResponse"] = (input) => {
6677
6781
  isSingle: true
6678
6782
  } }, input);
6679
6783
  };
6784
+ decoders["RingAttemptResponse"] = (input) => {
6785
+ return decode({
6786
+ created_at: {
6787
+ type: "DatetimeType",
6788
+ isSingle: true
6789
+ },
6790
+ expires_at: {
6791
+ type: "DatetimeType",
6792
+ isSingle: true
6793
+ },
6794
+ targets: {
6795
+ type: "RingTargetResponse",
6796
+ isSingle: false
6797
+ },
6798
+ deleted_at: {
6799
+ type: "DatetimeType",
6800
+ isSingle: true
6801
+ },
6802
+ settled_at: {
6803
+ type: "DatetimeType",
6804
+ isSingle: true
6805
+ }
6806
+ }, input);
6807
+ };
6808
+ decoders["RingDeliveryResponse"] = (input) => {
6809
+ return decode({
6810
+ sent_at: {
6811
+ type: "DatetimeType",
6812
+ isSingle: true
6813
+ },
6814
+ acked_at: {
6815
+ type: "DatetimeType",
6816
+ isSingle: true
6817
+ },
6818
+ displayed_at: {
6819
+ type: "DatetimeType",
6820
+ isSingle: true
6821
+ },
6822
+ fetched_at: {
6823
+ type: "DatetimeType",
6824
+ isSingle: true
6825
+ },
6826
+ provider_accepted_at: {
6827
+ type: "DatetimeType",
6828
+ isSingle: true
6829
+ }
6830
+ }, input);
6831
+ };
6832
+ decoders["RingTargetResponse"] = (input) => {
6833
+ return decode({
6834
+ state_at: {
6835
+ type: "DatetimeType",
6836
+ isSingle: true
6837
+ },
6838
+ deliveries: {
6839
+ type: "RingDeliveryResponse",
6840
+ isSingle: false
6841
+ }
6842
+ }, input);
6843
+ };
6680
6844
  decoders["Role"] = (input) => {
6681
6845
  return decode({
6682
6846
  created_at: {
@@ -6891,7 +7055,7 @@ decoders["SessionWarningResponse"] = (input) => {
6891
7055
  };
6892
7056
  decoders["SetFeedsRetentionPolicyResponse"] = (input) => {
6893
7057
  return decode({ policy: {
6894
- type: "RetentionPolicy",
7058
+ type: "FeedsRetentionPolicy",
6895
7059
  isSingle: true
6896
7060
  } }, input);
6897
7061
  };
@@ -8248,6 +8412,16 @@ var CommonApi = class {
8248
8412
  decoders["UpdateBlockListResponse"]?.(response);
8249
8413
  return response;
8250
8414
  }
8415
+ async checkGCPPubSub(request) {
8416
+ const body = {
8417
+ gcp_pubsub_event_based_ordering_key_enabled: request?.gcp_pubsub_event_based_ordering_key_enabled,
8418
+ gcp_pubsub_region: request?.gcp_pubsub_region,
8419
+ gcp_pubsub_topic: request?.gcp_pubsub_topic
8420
+ };
8421
+ const response = await this.apiClient.sendRequest("POST", "/api/v2/check_gcp_pubsub", void 0, void 0, body);
8422
+ decoders["CheckGCPPubSubResponse"]?.(response);
8423
+ return response;
8424
+ }
8251
8425
  async checkPush(request) {
8252
8426
  const body = {
8253
8427
  apn_template: request?.apn_template,
@@ -9029,6 +9203,16 @@ var VideoApi = class {
9029
9203
  decoders["QueryCallMembersResponse"]?.(response);
9030
9204
  return response;
9031
9205
  }
9206
+ async queryCallRingAttempts(request) {
9207
+ const body = {
9208
+ id: request?.id,
9209
+ type: request?.type,
9210
+ call_session_id: request?.call_session_id
9211
+ };
9212
+ const response = await this.apiClient.sendRequest("POST", "/api/v2/video/call/ring_attempts", void 0, void 0, body);
9213
+ decoders["QueryCallRingAttemptsResponse"]?.(response);
9214
+ return response;
9215
+ }
9032
9216
  async queryCallStats(request) {
9033
9217
  const body = {
9034
9218
  limit: request?.limit,
@@ -11583,6 +11767,12 @@ var StreamChannel = class extends ChannelApi {
11583
11767
  ...request?.payload ?? { filter_conditions: {} }
11584
11768
  } });
11585
11769
  }
11770
+ uploadChannelFile = (request) => {
11771
+ return super.uploadChannelFile(request);
11772
+ };
11773
+ uploadChannelImage = (request) => {
11774
+ return super.uploadChannelImage(request);
11775
+ };
11586
11776
  };
11587
11777
  //#endregion
11588
11778
  //#region src/StreamChatClient.ts
@@ -11590,6 +11780,12 @@ var StreamChatClient = class extends ChatApi {
11590
11780
  channel = (type, id) => {
11591
11781
  return new StreamChannel(this, type, id);
11592
11782
  };
11783
+ uploadChannelFile = (request) => {
11784
+ return super.uploadChannelFile(request);
11785
+ };
11786
+ uploadChannelImage = (request) => {
11787
+ return super.uploadChannelImage(request);
11788
+ };
11593
11789
  };
11594
11790
  //#endregion
11595
11791
  //#region src/gen/moderation/ModerationApi.ts
@@ -11742,9 +11938,11 @@ var ModerationApi = class {
11742
11938
  async ban(request) {
11743
11939
  const body = {
11744
11940
  target_user_id: request?.target_user_id,
11941
+ ban_from_future_channels: request?.ban_from_future_channels,
11745
11942
  banned_by_id: request?.banned_by_id,
11746
11943
  channel_cid: request?.channel_cid,
11747
11944
  delete_messages: request?.delete_messages,
11945
+ delete_reactions: request?.delete_reactions,
11748
11946
  ip_ban: request?.ip_ban,
11749
11947
  reason: request?.reason,
11750
11948
  shadow: request?.shadow,
@@ -12299,7 +12497,7 @@ var ApiClient = class {
12299
12497
  const headers = {
12300
12498
  Authorization: this.apiConfig.token,
12301
12499
  "stream-auth-type": "jwt",
12302
- "X-Stream-Client": "stream-node-0.8.11",
12500
+ "X-Stream-Client": "stream-node-0.8.13",
12303
12501
  "Accept-Encoding": "gzip",
12304
12502
  "x-client-request-id": clientRequestId
12305
12503
  };
@@ -12340,8 +12538,8 @@ var ApiClient = class {
12340
12538
  clientRequestId,
12341
12539
  responseCode: error.status
12342
12540
  };
12343
- if (error.name === "AbortError" || error.name === "TimeoutError") throw new StreamError(`The request was aborted due to to the ${this.apiConfig.timeout}ms timeout, you can set the timeout in the StreamClient constructor`, metadata, void 0, error);
12344
- else throw new StreamError(`The request failed due to an unexpected error`, metadata, error);
12541
+ if (error.name === "AbortError" || error.name === "TimeoutError") throw new StreamError(`The request was aborted due to to the ${this.apiConfig.timeout}ms timeout, you can set the timeout in the StreamClient constructor`, metadata, void 0, { cause: error });
12542
+ else throw new StreamError(`The request failed due to an unexpected error`, metadata, void 0, { cause: error });
12345
12543
  }
12346
12544
  };
12347
12545
  multipartBodyStringify = (body) => {
@@ -12976,6 +13174,17 @@ var FeedsApi = class {
12976
13174
  decoders["UpdateCommentResponse"]?.(response);
12977
13175
  return response;
12978
13176
  }
13177
+ async commentFeedback(request) {
13178
+ const pathParams = { id: request?.id };
13179
+ const body = {
13180
+ hide: request?.hide,
13181
+ user_id: request?.user_id,
13182
+ user: request?.user
13183
+ };
13184
+ const response = await this.apiClient.sendRequest("POST", "/api/v2/feeds/comments/{id}/feedback", pathParams, void 0, body);
13185
+ decoders["CommentFeedbackResponse"]?.(response);
13186
+ return response;
13187
+ }
12979
13188
  async updateCommentPartial(request) {
12980
13189
  const pathParams = { id: request?.id };
12981
13190
  const body = {
@@ -13129,6 +13338,7 @@ var FeedsApi = class {
13129
13338
  user_id: request?.user_id,
13130
13339
  view: request?.view,
13131
13340
  watch: request?.watch,
13341
+ discard_actors: request?.discard_actors,
13132
13342
  data: request?.data,
13133
13343
  enrichment_options: request?.enrichment_options,
13134
13344
  external_ranking: request?.external_ranking,
@@ -13138,7 +13348,8 @@ var FeedsApi = class {
13138
13348
  friend_reactions_options: request?.friend_reactions_options,
13139
13349
  interest_weights: request?.interest_weights,
13140
13350
  member_pagination: request?.member_pagination,
13141
- user: request?.user
13351
+ user: request?.user,
13352
+ viewer_location: request?.viewer_location
13142
13353
  };
13143
13354
  const response = await this.apiClient.sendRequest("POST", "/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}", pathParams, queryParams, body);
13144
13355
  decoders["GetOrCreateFeedResponse"]?.(response);
@@ -13689,7 +13900,8 @@ var FeedsApi = class {
13689
13900
  const body = {
13690
13901
  max_age_hours: request?.max_age_hours,
13691
13902
  policy: request?.policy,
13692
- enabled: request?.enabled
13903
+ enabled: request?.enabled,
13904
+ feed_groups: request?.feed_groups
13693
13905
  };
13694
13906
  const response = await this.apiClient.sendRequest("POST", "/api/v2/feeds/retention_policy", void 0, void 0, body);
13695
13907
  decoders["SetFeedsRetentionPolicyResponse"]?.(response);
@@ -14020,11 +14232,15 @@ var StreamClient = class StreamClient extends CommonApi {
14020
14232
  * - iat - issued at date of the token, unix timestamp in seconds, by default it's now
14021
14233
  */
14022
14234
  generateUserToken = (payload) => {
14235
+ const { validity_in_seconds, ...claims } = payload;
14023
14236
  const defaultIat = Math.floor((Date.now() - 1e3) / 1e3);
14024
- payload.iat = payload.iat ?? defaultIat;
14025
- const validityInSeconds = payload.validity_in_seconds ?? 3600;
14026
- payload.exp = payload.exp ?? payload.iat + validityInSeconds;
14027
- return JWTUserToken(this.secret, payload);
14237
+ const iat = claims.iat ?? defaultIat;
14238
+ const exp = claims.exp ?? iat + (validity_in_seconds ?? 3600);
14239
+ return JWTUserToken(this.secret, {
14240
+ ...claims,
14241
+ iat,
14242
+ exp
14243
+ });
14028
14244
  };
14029
14245
  /**
14030
14246
  *
@@ -14034,8 +14250,10 @@ var StreamClient = class StreamClient extends CommonApi {
14034
14250
  */
14035
14251
  generatePermanentUserToken = (payload) => {
14036
14252
  const defaultIat = Math.floor((Date.now() - 1e3) / 1e3);
14037
- payload.iat = payload.iat ?? defaultIat;
14038
- return JWTUserToken(this.secret, payload);
14253
+ return JWTUserToken(this.secret, {
14254
+ ...payload,
14255
+ iat: payload.iat ?? defaultIat
14256
+ });
14039
14257
  };
14040
14258
  /**
14041
14259
  *
@@ -14246,6 +14464,6 @@ var OwnCapability = {
14246
14464
  UPDATE_CALL_SETTINGS: "update-call-settings"
14247
14465
  };
14248
14466
  //#endregion
14249
- export { ChannelOwnCapability, FeedOwnCapability, InvalidWebhookError, InvalidWebhookErrorMessages, OwnCapability, StreamCall, StreamChannel, StreamChatClient, StreamClient, StreamFeed, StreamFeedsClient, StreamVideoClient };
14467
+ export { ChannelOwnCapability, FeedOwnCapability, InvalidWebhookError, InvalidWebhookErrorMessages, OwnCapability, StreamCall, StreamChannel, StreamChatClient, StreamClient, StreamError, StreamFeed, StreamFeedsClient, StreamVideoClient, verifyAndParseWebhook };
14250
14468
 
14251
14469
  //# sourceMappingURL=index.es.mjs.map