@stream-io/node-sdk 0.9.0 → 0.9.2
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/CHANGELOG.md +15 -0
- package/dist/index.cjs.js +162 -60
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.mjs +161 -58
- package/dist/index.es.mjs.map +1 -1
- package/dist/src/ApiClient.d.ts +1 -1
- package/dist/src/StreamVideoClient.d.ts +7 -0
- package/dist/src/gen/chat/ChannelApi.d.ts +1 -0
- package/dist/src/gen/chat/ChatApi.d.ts +3 -1
- package/dist/src/gen/common/CommonApi.d.ts +4 -1
- package/dist/src/gen/feeds/FeedsApi.d.ts +1 -0
- package/dist/src/gen/models/index.d.ts +683 -17
- package/dist/src/gen/moderation/ModerationApi.d.ts +23 -1
- package/dist/src/types.d.ts +14 -1
- package/package.json +11 -11
- package/src/ApiClient.ts +6 -2
- package/src/StreamVideoClient.ts +7 -0
- package/src/gen/chat/ChannelApi.ts +1 -0
- package/src/gen/chat/ChatApi.ts +27 -0
- package/src/gen/common/CommonApi.ts +11 -2
- package/src/gen/feeds/FeedsApi.ts +2 -0
- package/src/gen/models/index.ts +772 -17
- package/src/gen/moderation/ModerationApi.ts +222 -0
- package/src/types.ts +8 -0
package/dist/index.es.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import jwt from "jsonwebtoken";
|
|
2
2
|
import crypto, { randomUUID } from "crypto";
|
|
3
3
|
import zlib from "zlib";
|
|
4
|
-
|
|
4
|
+
// src/utils/create-token.ts
|
|
5
5
|
function JWTUserToken(apiSecret, payload) {
|
|
6
6
|
if (jwt?.sign == null) throw Error(`Unable to find jwt crypto, if you are getting this error is probably because you are trying to generate tokens on browser or React Native (or other environment where crypto functions are not available). Please Note: token should only be generated server-side.`);
|
|
7
7
|
const opts = {
|
|
@@ -19,8 +19,7 @@ function JWTServerToken(apiSecret, jwtOptions = {}) {
|
|
|
19
19
|
}, jwtOptions);
|
|
20
20
|
return jwt.sign(payload, apiSecret, opts);
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
//#region src/utils/webhook.ts
|
|
22
|
+
// src/utils/webhook.ts
|
|
24
23
|
/**
|
|
25
24
|
* Canonical failure-mode messages for {@link InvalidWebhookError}.
|
|
26
25
|
*
|
|
@@ -173,8 +172,7 @@ function parseSqs(messageBody) {
|
|
|
173
172
|
function parseSns(notificationBody) {
|
|
174
173
|
return parseEvent(decodeSnsPayload(notificationBody));
|
|
175
174
|
}
|
|
176
|
-
|
|
177
|
-
//#region src/gen/model-decoders/decoders.ts
|
|
175
|
+
// src/gen/model-decoders/decoders.ts
|
|
178
176
|
var decoders = {};
|
|
179
177
|
var decodeDatetimeType = (input) => typeof input === "number" ? new Date(Math.floor(input / 1e6)) : new Date(input);
|
|
180
178
|
decoders.DatetimeType = decodeDatetimeType;
|
|
@@ -219,8 +217,7 @@ decoders["GetApplicationResponse"] = (input) => {
|
|
|
219
217
|
isSingle: true
|
|
220
218
|
} }, input);
|
|
221
219
|
};
|
|
222
|
-
|
|
223
|
-
//#region src/gen/common/CommonApi.ts
|
|
220
|
+
// src/gen/common/CommonApi.ts
|
|
224
221
|
var CommonApi = class {
|
|
225
222
|
apiClient;
|
|
226
223
|
constructor(apiClient) {
|
|
@@ -283,6 +280,7 @@ var CommonApi = class {
|
|
|
283
280
|
user_search_disallowed_roles: request?.user_search_disallowed_roles,
|
|
284
281
|
webhook_events: request?.webhook_events,
|
|
285
282
|
activity_metrics_config: request?.activity_metrics_config,
|
|
283
|
+
agent_review: request?.agent_review,
|
|
286
284
|
apn_config: request?.apn_config,
|
|
287
285
|
async_moderation_config: request?.async_moderation_config,
|
|
288
286
|
datadog_info: request?.datadog_info,
|
|
@@ -508,8 +506,12 @@ var CommonApi = class {
|
|
|
508
506
|
decoders["CreateImportURLResponse"]?.(response);
|
|
509
507
|
return response;
|
|
510
508
|
}
|
|
511
|
-
async listImports() {
|
|
512
|
-
const
|
|
509
|
+
async listImports(request) {
|
|
510
|
+
const queryParams = {
|
|
511
|
+
limit: request?.limit,
|
|
512
|
+
offset: request?.offset
|
|
513
|
+
};
|
|
514
|
+
const response = await this.apiClient.sendRequest("GET", "/api/v2/imports", void 0, queryParams);
|
|
513
515
|
decoders["ListImportsResponse"]?.(response);
|
|
514
516
|
return response;
|
|
515
517
|
}
|
|
@@ -1140,8 +1142,7 @@ var CommonApi = class {
|
|
|
1140
1142
|
return response;
|
|
1141
1143
|
}
|
|
1142
1144
|
};
|
|
1143
|
-
|
|
1144
|
-
//#region src/gen/video/VideoApi.ts
|
|
1145
|
+
// src/gen/video/VideoApi.ts
|
|
1145
1146
|
var VideoApi = class {
|
|
1146
1147
|
apiClient;
|
|
1147
1148
|
constructor(apiClient) {
|
|
@@ -1971,8 +1972,7 @@ var VideoApi = class {
|
|
|
1971
1972
|
return response;
|
|
1972
1973
|
}
|
|
1973
1974
|
};
|
|
1974
|
-
|
|
1975
|
-
//#region src/gen/video/CallApi.ts
|
|
1975
|
+
// src/gen/video/CallApi.ts
|
|
1976
1976
|
var CallApi = class {
|
|
1977
1977
|
videoApi;
|
|
1978
1978
|
type;
|
|
@@ -2256,8 +2256,7 @@ var CallApi = class {
|
|
|
2256
2256
|
});
|
|
2257
2257
|
}
|
|
2258
2258
|
};
|
|
2259
|
-
|
|
2260
|
-
//#region src/StreamCall.ts
|
|
2259
|
+
// src/StreamCall.ts
|
|
2261
2260
|
var StreamCall = class extends CallApi {
|
|
2262
2261
|
type;
|
|
2263
2262
|
id;
|
|
@@ -2298,8 +2297,7 @@ var StreamCall = class extends CallApi {
|
|
|
2298
2297
|
return { address: this.data.ingress.srt.address.replace("{passphrase}", segments[2]).replace("{token}", token) };
|
|
2299
2298
|
};
|
|
2300
2299
|
};
|
|
2301
|
-
|
|
2302
|
-
//#region src/StreamVideoClient.ts
|
|
2300
|
+
// src/StreamVideoClient.ts
|
|
2303
2301
|
var StreamVideoClient = class extends VideoApi {
|
|
2304
2302
|
streamClient;
|
|
2305
2303
|
constructor({ streamClient, apiClient }) {
|
|
@@ -2309,6 +2307,13 @@ var StreamVideoClient = class extends VideoApi {
|
|
|
2309
2307
|
call = (type, id) => {
|
|
2310
2308
|
return new StreamCall(this, type, id, this.streamClient);
|
|
2311
2309
|
};
|
|
2310
|
+
/**
|
|
2311
|
+
* Connects an OpenAI Realtime agent to a call through Stream's `/video/connect_agent` proxy.
|
|
2312
|
+
*
|
|
2313
|
+
* @deprecated The OpenAI Realtime proxy is deprecated and will be removed in a
|
|
2314
|
+
* future major release. Build voice and video AI agents with Vision Agents
|
|
2315
|
+
* instead: https://visionagents.ai/integrations/llm/openai
|
|
2316
|
+
*/
|
|
2312
2317
|
connectOpenAi = async (options) => {
|
|
2313
2318
|
let doCreateRealtimeClient;
|
|
2314
2319
|
try {
|
|
@@ -2334,8 +2339,7 @@ var StreamVideoClient = class extends VideoApi {
|
|
|
2334
2339
|
return realtimeClient;
|
|
2335
2340
|
};
|
|
2336
2341
|
};
|
|
2337
|
-
|
|
2338
|
-
//#region src/gen/chat/ChatApi.ts
|
|
2342
|
+
// src/gen/chat/ChatApi.ts
|
|
2339
2343
|
var ChatApi = class {
|
|
2340
2344
|
apiClient;
|
|
2341
2345
|
constructor(apiClient) {
|
|
@@ -2558,6 +2562,7 @@ var ChatApi = class {
|
|
|
2558
2562
|
messages_id_gt: request?.messages_id_gt,
|
|
2559
2563
|
messages_id_gte: request?.messages_id_gte,
|
|
2560
2564
|
messages_id_around: request?.messages_id_around,
|
|
2565
|
+
include_soft_deleted_channel: request?.include_soft_deleted_channel,
|
|
2561
2566
|
user_id: request?.user_id
|
|
2562
2567
|
};
|
|
2563
2568
|
const pathParams = {
|
|
@@ -3521,6 +3526,17 @@ var ChatApi = class {
|
|
|
3521
3526
|
decoders["SearchResponse"]?.(response);
|
|
3522
3527
|
return response;
|
|
3523
3528
|
}
|
|
3529
|
+
async searchAll(request) {
|
|
3530
|
+
const body = {
|
|
3531
|
+
limit: request?.limit,
|
|
3532
|
+
query: request?.query,
|
|
3533
|
+
entities: request?.entities,
|
|
3534
|
+
next: request?.next
|
|
3535
|
+
};
|
|
3536
|
+
const response = await this.apiClient.sendRequest("POST", "/api/v2/chat/search/all", void 0, void 0, body);
|
|
3537
|
+
decoders["SearchAllResponse"]?.(response);
|
|
3538
|
+
return response;
|
|
3539
|
+
}
|
|
3524
3540
|
async createSegment(request) {
|
|
3525
3541
|
const body = {
|
|
3526
3542
|
type: request?.type,
|
|
@@ -3682,8 +3698,7 @@ var ChatApi = class {
|
|
|
3682
3698
|
return response;
|
|
3683
3699
|
}
|
|
3684
3700
|
};
|
|
3685
|
-
|
|
3686
|
-
//#region src/gen/chat/ChannelApi.ts
|
|
3701
|
+
// src/gen/chat/ChannelApi.ts
|
|
3687
3702
|
var ChannelApi = class {
|
|
3688
3703
|
chatApi;
|
|
3689
3704
|
type;
|
|
@@ -3894,8 +3909,7 @@ var ChannelApi = class {
|
|
|
3894
3909
|
});
|
|
3895
3910
|
}
|
|
3896
3911
|
};
|
|
3897
|
-
|
|
3898
|
-
//#region src/StreamChannel.ts
|
|
3912
|
+
// src/StreamChannel.ts
|
|
3899
3913
|
var StreamChannel = class extends ChannelApi {
|
|
3900
3914
|
get cid() {
|
|
3901
3915
|
return `${this.type}:${this.id}`;
|
|
@@ -3928,8 +3942,7 @@ var StreamChannel = class extends ChannelApi {
|
|
|
3928
3942
|
return super.uploadChannelImage(request);
|
|
3929
3943
|
};
|
|
3930
3944
|
};
|
|
3931
|
-
|
|
3932
|
-
//#region src/StreamChatClient.ts
|
|
3945
|
+
// src/StreamChatClient.ts
|
|
3933
3946
|
var StreamChatClient = class extends ChatApi {
|
|
3934
3947
|
channel = (type, id) => {
|
|
3935
3948
|
return new StreamChannel(this, type, id);
|
|
@@ -3941,8 +3954,7 @@ var StreamChatClient = class extends ChatApi {
|
|
|
3941
3954
|
return super.uploadChannelImage(request);
|
|
3942
3955
|
};
|
|
3943
3956
|
};
|
|
3944
|
-
|
|
3945
|
-
//#region src/gen/moderation/ModerationApi.ts
|
|
3957
|
+
// src/gen/moderation/ModerationApi.ts
|
|
3946
3958
|
var ModerationApi = class {
|
|
3947
3959
|
apiClient;
|
|
3948
3960
|
constructor(apiClient) {
|
|
@@ -4019,6 +4031,33 @@ var ModerationApi = class {
|
|
|
4019
4031
|
decoders["InsertActionLogResponse"]?.(response);
|
|
4020
4032
|
return response;
|
|
4021
4033
|
}
|
|
4034
|
+
async listAgentFeedback(request) {
|
|
4035
|
+
const queryParams = {
|
|
4036
|
+
limit: request?.limit,
|
|
4037
|
+
next: request?.next
|
|
4038
|
+
};
|
|
4039
|
+
const response = await this.apiClient.sendRequest("GET", "/api/v2/moderation/agent_feedback", void 0, queryParams);
|
|
4040
|
+
decoders["ListAgentFeedbackResponse"]?.(response);
|
|
4041
|
+
return response;
|
|
4042
|
+
}
|
|
4043
|
+
async submitAgentFeedback(request) {
|
|
4044
|
+
const body = {
|
|
4045
|
+
item_id: request?.item_id,
|
|
4046
|
+
moderator_action: request?.moderator_action,
|
|
4047
|
+
improvement: request?.improvement,
|
|
4048
|
+
reason: request?.reason,
|
|
4049
|
+
user_id: request?.user_id,
|
|
4050
|
+
user: request?.user
|
|
4051
|
+
};
|
|
4052
|
+
const response = await this.apiClient.sendRequest("POST", "/api/v2/moderation/agent_feedback", void 0, void 0, body);
|
|
4053
|
+
decoders["SubmitAgentFeedbackResponse"]?.(response);
|
|
4054
|
+
return response;
|
|
4055
|
+
}
|
|
4056
|
+
async getAgentReviewStatus() {
|
|
4057
|
+
const response = await this.apiClient.sendRequest("GET", "/api/v2/moderation/agent_review_status", void 0, void 0);
|
|
4058
|
+
decoders["GetAgentReviewStatusResponse"]?.(response);
|
|
4059
|
+
return response;
|
|
4060
|
+
}
|
|
4022
4061
|
async analyze(request) {
|
|
4023
4062
|
const body = {
|
|
4024
4063
|
async_response: request?.async_response,
|
|
@@ -4180,6 +4219,37 @@ var ModerationApi = class {
|
|
|
4180
4219
|
decoders["UpsertConfigResponse"]?.(response);
|
|
4181
4220
|
return response;
|
|
4182
4221
|
}
|
|
4222
|
+
async saveConfigVersion(request) {
|
|
4223
|
+
const body = {
|
|
4224
|
+
base_version: request?.base_version,
|
|
4225
|
+
key: request?.key,
|
|
4226
|
+
async: request?.async,
|
|
4227
|
+
team: request?.team,
|
|
4228
|
+
user_id: request?.user_id,
|
|
4229
|
+
ai_audio_config: request?.ai_audio_config,
|
|
4230
|
+
ai_image_config: request?.ai_image_config,
|
|
4231
|
+
ai_text_config: request?.ai_text_config,
|
|
4232
|
+
ai_video_config: request?.ai_video_config,
|
|
4233
|
+
automod_platform_circumvention_config: request?.automod_platform_circumvention_config,
|
|
4234
|
+
automod_semantic_filters_config: request?.automod_semantic_filters_config,
|
|
4235
|
+
automod_toxicity_config: request?.automod_toxicity_config,
|
|
4236
|
+
aws_rekognition_config: request?.aws_rekognition_config,
|
|
4237
|
+
block_list_config: request?.block_list_config,
|
|
4238
|
+
bodyguard_config: request?.bodyguard_config,
|
|
4239
|
+
engine: request?.engine,
|
|
4240
|
+
flood_config: request?.flood_config,
|
|
4241
|
+
google_vision_config: request?.google_vision_config,
|
|
4242
|
+
intent_config: request?.intent_config,
|
|
4243
|
+
llm_config: request?.llm_config,
|
|
4244
|
+
rule_builder_config: request?.rule_builder_config,
|
|
4245
|
+
user: request?.user,
|
|
4246
|
+
velocity_filter_config: request?.velocity_filter_config,
|
|
4247
|
+
video_call_rule_config: request?.video_call_rule_config
|
|
4248
|
+
};
|
|
4249
|
+
const response = await this.apiClient.sendRequest("POST", "/api/v2/moderation/config/versions", void 0, void 0, body);
|
|
4250
|
+
decoders["SaveConfigVersionResponse"]?.(response);
|
|
4251
|
+
return response;
|
|
4252
|
+
}
|
|
4183
4253
|
async deleteConfig(request) {
|
|
4184
4254
|
const queryParams = {
|
|
4185
4255
|
team: request?.team,
|
|
@@ -4197,6 +4267,37 @@ var ModerationApi = class {
|
|
|
4197
4267
|
decoders["GetConfigResponse"]?.(response);
|
|
4198
4268
|
return response;
|
|
4199
4269
|
}
|
|
4270
|
+
async listConfigVersions(request) {
|
|
4271
|
+
const queryParams = { team: request?.team };
|
|
4272
|
+
const pathParams = { key: request?.key };
|
|
4273
|
+
const response = await this.apiClient.sendRequest("GET", "/api/v2/moderation/config/{key}/versions", pathParams, queryParams);
|
|
4274
|
+
decoders["ListConfigVersionsResponse"]?.(response);
|
|
4275
|
+
return response;
|
|
4276
|
+
}
|
|
4277
|
+
async getConfigVersion(request) {
|
|
4278
|
+
const queryParams = { team: request?.team };
|
|
4279
|
+
const pathParams = {
|
|
4280
|
+
key: request?.key,
|
|
4281
|
+
version: request?.version
|
|
4282
|
+
};
|
|
4283
|
+
const response = await this.apiClient.sendRequest("GET", "/api/v2/moderation/config/{key}/versions/{version}", pathParams, queryParams);
|
|
4284
|
+
decoders["GetConfigVersionResponse"]?.(response);
|
|
4285
|
+
return response;
|
|
4286
|
+
}
|
|
4287
|
+
async publishConfigVersion(request) {
|
|
4288
|
+
const pathParams = {
|
|
4289
|
+
key: request?.key,
|
|
4290
|
+
version: request?.version
|
|
4291
|
+
};
|
|
4292
|
+
const body = {
|
|
4293
|
+
team: request?.team,
|
|
4294
|
+
user_id: request?.user_id,
|
|
4295
|
+
user: request?.user
|
|
4296
|
+
};
|
|
4297
|
+
const response = await this.apiClient.sendRequest("POST", "/api/v2/moderation/config/{key}/versions/{version}/publish", pathParams, void 0, body);
|
|
4298
|
+
decoders["PublishConfigVersionResponse"]?.(response);
|
|
4299
|
+
return response;
|
|
4300
|
+
}
|
|
4200
4301
|
async queryModerationConfigs(request) {
|
|
4201
4302
|
const body = {
|
|
4202
4303
|
limit: request?.limit,
|
|
@@ -4523,6 +4624,16 @@ var ModerationApi = class {
|
|
|
4523
4624
|
decoders["QueryReviewQueueResponse"]?.(response);
|
|
4524
4625
|
return response;
|
|
4525
4626
|
}
|
|
4627
|
+
async countReviewQueue(request) {
|
|
4628
|
+
const body = {
|
|
4629
|
+
user_id: request?.user_id,
|
|
4630
|
+
filter: request?.filter,
|
|
4631
|
+
user: request?.user
|
|
4632
|
+
};
|
|
4633
|
+
const response = await this.apiClient.sendRequest("POST", "/api/v2/moderation/review_queue/count", void 0, void 0, body);
|
|
4634
|
+
decoders["CountReviewQueueResponse"]?.(response);
|
|
4635
|
+
return response;
|
|
4636
|
+
}
|
|
4526
4637
|
async getReviewQueueItem(request) {
|
|
4527
4638
|
const pathParams = { id: request?.id };
|
|
4528
4639
|
const response = await this.apiClient.sendRequest("GET", "/api/v2/moderation/review_queue/{id}", pathParams, void 0);
|
|
@@ -4550,6 +4661,7 @@ var ModerationApi = class {
|
|
|
4550
4661
|
appeal_id: request?.appeal_id,
|
|
4551
4662
|
item_id: request?.item_id,
|
|
4552
4663
|
user_id: request?.user_id,
|
|
4664
|
+
agent_recommendation: request?.agent_recommendation,
|
|
4553
4665
|
ban: request?.ban,
|
|
4554
4666
|
block: request?.block,
|
|
4555
4667
|
bypass: request?.bypass,
|
|
@@ -4607,7 +4719,8 @@ var ModerationApi = class {
|
|
|
4607
4719
|
const queryParams = {
|
|
4608
4720
|
target_user_id: request?.target_user_id,
|
|
4609
4721
|
channel_cid: request?.channel_cid,
|
|
4610
|
-
created_by: request?.created_by
|
|
4722
|
+
created_by: request?.created_by,
|
|
4723
|
+
remove_future_channels_ban: request?.remove_future_channels_ban
|
|
4611
4724
|
};
|
|
4612
4725
|
const body = {
|
|
4613
4726
|
unbanned_by_id: request?.unbanned_by_id,
|
|
@@ -4628,22 +4741,21 @@ var ModerationApi = class {
|
|
|
4628
4741
|
return response;
|
|
4629
4742
|
}
|
|
4630
4743
|
};
|
|
4631
|
-
|
|
4632
|
-
//#region src/StreamModerationClient.ts
|
|
4744
|
+
// src/StreamModerationClient.ts
|
|
4633
4745
|
var StreamModerationClient = class extends ModerationApi {};
|
|
4634
|
-
|
|
4635
|
-
//#region src/types.ts
|
|
4746
|
+
// src/types.ts
|
|
4636
4747
|
var StreamError = class extends Error {
|
|
4637
4748
|
metadata;
|
|
4638
4749
|
code;
|
|
4639
|
-
|
|
4750
|
+
apiError;
|
|
4751
|
+
constructor(message, metadata, code, errorOptions, apiError) {
|
|
4640
4752
|
super(message, errorOptions);
|
|
4641
4753
|
this.metadata = metadata;
|
|
4642
4754
|
this.code = code;
|
|
4755
|
+
this.apiError = apiError;
|
|
4643
4756
|
}
|
|
4644
4757
|
};
|
|
4645
|
-
|
|
4646
|
-
//#region src/utils/rate-limit.ts
|
|
4758
|
+
// src/utils/rate-limit.ts
|
|
4647
4759
|
var getRateLimitFromResponseHeader = (responseHeaders) => {
|
|
4648
4760
|
return {
|
|
4649
4761
|
rateLimit: responseHeaders.has("x-ratelimit-limit") ? +responseHeaders.get("x-ratelimit-limit") : void 0,
|
|
@@ -4651,8 +4763,7 @@ var getRateLimitFromResponseHeader = (responseHeaders) => {
|
|
|
4651
4763
|
rateLimitReset: responseHeaders.has("x-ratelimit-reset") ? /* @__PURE__ */ new Date(+responseHeaders.get("x-ratelimit-reset") * 1e3) : void 0
|
|
4652
4764
|
};
|
|
4653
4765
|
};
|
|
4654
|
-
|
|
4655
|
-
//#region src/utils/query-params.ts
|
|
4766
|
+
// src/utils/query-params.ts
|
|
4656
4767
|
var isScalar = (value) => {
|
|
4657
4768
|
const type = typeof value;
|
|
4658
4769
|
return type === "string" || type === "number" || type === "boolean";
|
|
@@ -4672,8 +4783,7 @@ var stringifyArrayParam = (param) => {
|
|
|
4672
4783
|
}
|
|
4673
4784
|
return allScalar ? entries.join(",") : JSON.stringify(entries);
|
|
4674
4785
|
};
|
|
4675
|
-
|
|
4676
|
-
//#region src/ApiClient.ts
|
|
4786
|
+
// src/ApiClient.ts
|
|
4677
4787
|
var ApiClient = class {
|
|
4678
4788
|
apiConfig;
|
|
4679
4789
|
dispatcher;
|
|
@@ -4690,14 +4800,14 @@ var ApiClient = class {
|
|
|
4690
4800
|
queryParams.api_key = this.apiConfig.apiKey;
|
|
4691
4801
|
const encodedParams = this.queryParamsStringify(queryParams);
|
|
4692
4802
|
if (pathParams) Object.keys(pathParams).forEach((paramName) => {
|
|
4693
|
-
url = url.replace(`{${paramName}}`, pathParams[paramName]);
|
|
4803
|
+
url = url.replace(`{${paramName}}`, encodeURIComponent(pathParams[paramName]));
|
|
4694
4804
|
});
|
|
4695
4805
|
url += `?${encodedParams}`;
|
|
4696
4806
|
const clientRequestId = randomUUID();
|
|
4697
4807
|
const headers = {
|
|
4698
4808
|
Authorization: this.apiConfig.token,
|
|
4699
4809
|
"stream-auth-type": "jwt",
|
|
4700
|
-
"X-Stream-Client": "stream-node-0.9.
|
|
4810
|
+
"X-Stream-Client": "stream-node-0.9.2",
|
|
4701
4811
|
"Accept-Encoding": "gzip",
|
|
4702
4812
|
"x-client-request-id": clientRequestId
|
|
4703
4813
|
};
|
|
@@ -4726,7 +4836,7 @@ var ApiClient = class {
|
|
|
4726
4836
|
} catch {
|
|
4727
4837
|
throw new StreamError(`Stream error: ${response.status} - ${response.statusText}`, metadata, response.status);
|
|
4728
4838
|
}
|
|
4729
|
-
throw new StreamError(`Stream error code ${error.code}: ${error.message}`, metadata, error.code, void 0);
|
|
4839
|
+
throw new StreamError(`Stream error code ${error.code}: ${error.message}`, metadata, error.code, void 0, error);
|
|
4730
4840
|
}
|
|
4731
4841
|
return {
|
|
4732
4842
|
...await response.json(),
|
|
@@ -4766,8 +4876,7 @@ var ApiClient = class {
|
|
|
4766
4876
|
return newParams.join("&");
|
|
4767
4877
|
};
|
|
4768
4878
|
};
|
|
4769
|
-
|
|
4770
|
-
//#region src/gen/feeds/FeedsApi.ts
|
|
4879
|
+
// src/gen/feeds/FeedsApi.ts
|
|
4771
4880
|
var FeedsApi = class {
|
|
4772
4881
|
apiClient;
|
|
4773
4882
|
constructor(apiClient) {
|
|
@@ -5041,7 +5150,8 @@ var FeedsApi = class {
|
|
|
5041
5150
|
translate_text: request?.translate_text,
|
|
5042
5151
|
include_top_level_comment_count: request?.include_top_level_comment_count,
|
|
5043
5152
|
include_soft_deleted_activities: request?.include_soft_deleted_activities,
|
|
5044
|
-
include_moderated_activities: request?.include_moderated_activities
|
|
5153
|
+
include_moderated_activities: request?.include_moderated_activities,
|
|
5154
|
+
skip_viewer_visibility: request?.skip_viewer_visibility
|
|
5045
5155
|
};
|
|
5046
5156
|
const pathParams = { id: request?.id };
|
|
5047
5157
|
const response = await this.apiClient.sendRequest("GET", "/api/v2/feeds/activities/{id}", pathParams, queryParams);
|
|
@@ -6268,8 +6378,7 @@ var FeedsApi = class {
|
|
|
6268
6378
|
return response;
|
|
6269
6379
|
}
|
|
6270
6380
|
};
|
|
6271
|
-
|
|
6272
|
-
//#region src/gen/feeds/FeedApi.ts
|
|
6381
|
+
// src/gen/feeds/FeedApi.ts
|
|
6273
6382
|
var FeedApi = class {
|
|
6274
6383
|
feedsApi;
|
|
6275
6384
|
group;
|
|
@@ -6377,15 +6486,13 @@ var FeedApi = class {
|
|
|
6377
6486
|
});
|
|
6378
6487
|
}
|
|
6379
6488
|
};
|
|
6380
|
-
|
|
6381
|
-
//#region src/StreamFeed.ts
|
|
6489
|
+
// src/StreamFeed.ts
|
|
6382
6490
|
var StreamFeed = class extends FeedApi {
|
|
6383
6491
|
get feed() {
|
|
6384
6492
|
return `${this.group}:${this.id}`;
|
|
6385
6493
|
}
|
|
6386
6494
|
};
|
|
6387
|
-
|
|
6388
|
-
//#region src/StreamFeedsClient.ts
|
|
6495
|
+
// src/StreamFeedsClient.ts
|
|
6389
6496
|
var StreamFeedsClient = class extends FeedsApi {
|
|
6390
6497
|
feed = (group, id) => {
|
|
6391
6498
|
return new StreamFeed(this, group, id);
|
|
@@ -6412,8 +6519,7 @@ var StreamFeedsClient = class extends FeedsApi {
|
|
|
6412
6519
|
return super.unfollowBatch(request);
|
|
6413
6520
|
};
|
|
6414
6521
|
};
|
|
6415
|
-
|
|
6416
|
-
//#region src/StreamClient.ts
|
|
6522
|
+
// src/StreamClient.ts
|
|
6417
6523
|
var StreamClient = class StreamClient extends CommonApi {
|
|
6418
6524
|
apiKey;
|
|
6419
6525
|
secret;
|
|
@@ -6610,8 +6716,7 @@ var StreamClient = class StreamClient extends CommonApi {
|
|
|
6610
6716
|
*/
|
|
6611
6717
|
parseSns = (notificationBody) => parseSns(notificationBody);
|
|
6612
6718
|
};
|
|
6613
|
-
|
|
6614
|
-
//#region src/gen/models/index.ts
|
|
6719
|
+
// src/gen/models/index.ts
|
|
6615
6720
|
var ChannelOwnCapability = {
|
|
6616
6721
|
BAN_CHANNEL_MEMBERS: "ban-channel-members",
|
|
6617
6722
|
CAST_POLL_VOTE: "cast-poll-vote",
|
|
@@ -6726,8 +6831,7 @@ var OwnCapability = {
|
|
|
6726
6831
|
UPDATE_CALL_PERMISSIONS: "update-call-permissions",
|
|
6727
6832
|
UPDATE_CALL_SETTINGS: "update-call-settings"
|
|
6728
6833
|
};
|
|
6729
|
-
|
|
6730
|
-
//#region src/utils/time.ts
|
|
6834
|
+
// src/utils/time.ts
|
|
6731
6835
|
/**
|
|
6732
6836
|
* Unit conversions between the API's timestamps and JavaScript's.
|
|
6733
6837
|
*
|
|
@@ -6802,7 +6906,6 @@ var convertTimestampToDate = (timestamp) => {
|
|
|
6802
6906
|
if (timestamp == null || !Number.isFinite(timestamp)) return void 0;
|
|
6803
6907
|
return nsToDate(timestamp);
|
|
6804
6908
|
};
|
|
6805
|
-
//#endregion
|
|
6806
6909
|
export { ChannelOwnCapability, FeedOwnCapability, InvalidWebhookError, InvalidWebhookErrorMessages, NS_PER_MS, OwnCapability, StreamCall, StreamChannel, StreamChatClient, StreamClient, StreamError, StreamFeed, StreamFeedsClient, StreamVideoClient, convertTimestampToDate, dateToNs, msToNs, nowNs, nsToDate, nsToMs, nsToRfc3339, verifyAndParseWebhook };
|
|
6807
6910
|
|
|
6808
6911
|
//# sourceMappingURL=index.es.mjs.map
|