@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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.9.2](https://github.com/GetStream/stream-node/compare/v0.9.1...v0.9.2) (2026-11-13)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* regenerate OpenAPI clients from latest spec ([#392](https://github.com/GetStream/stream-node/issues/392)) ([315e419](https://github.com/GetStream/stream-node/commit/315e419fd043f8758bdb75b887395273d1a8e7d6))
|
|
9
|
+
|
|
10
|
+
## [0.9.1](https://github.com/GetStream/stream-node/compare/v0.9.0...v0.9.1) (2026-11-09)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* deprecate connectOpenAi in favour of Vision Agents ([#381](https://github.com/GetStream/stream-node/issues/381)) ([bdae28d](https://github.com/GetStream/stream-node/commit/bdae28d3c3b69f57196b12c519ae71038c36153b))
|
|
16
|
+
* expose the parsed API error on StreamError ([#388](https://github.com/GetStream/stream-node/issues/388)) ([13770c8](https://github.com/GetStream/stream-node/commit/13770c82dd505bf97bb55315625bdae6a378270e))
|
|
17
|
+
|
|
3
18
|
## [0.9.0](https://github.com/GetStream/stream-node/compare/v0.8.15...v0.9.0) (2026-11-06)
|
|
4
19
|
|
|
5
20
|
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// \0rolldown/runtime.js
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -20,14 +20,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
20
20
|
value: mod,
|
|
21
21
|
enumerable: true
|
|
22
22
|
}) : target, mod));
|
|
23
|
-
//#endregion
|
|
24
23
|
let jsonwebtoken = require("jsonwebtoken");
|
|
25
24
|
jsonwebtoken = __toESM(jsonwebtoken);
|
|
26
25
|
let crypto = require("crypto");
|
|
27
26
|
crypto = __toESM(crypto);
|
|
28
27
|
let zlib = require("zlib");
|
|
29
28
|
zlib = __toESM(zlib);
|
|
30
|
-
|
|
29
|
+
// src/utils/create-token.ts
|
|
31
30
|
function JWTUserToken(apiSecret, payload) {
|
|
32
31
|
if (jsonwebtoken.default?.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.`);
|
|
33
32
|
const opts = {
|
|
@@ -45,8 +44,7 @@ function JWTServerToken(apiSecret, jwtOptions = {}) {
|
|
|
45
44
|
}, jwtOptions);
|
|
46
45
|
return jsonwebtoken.default.sign(payload, apiSecret, opts);
|
|
47
46
|
}
|
|
48
|
-
|
|
49
|
-
//#region src/utils/webhook.ts
|
|
47
|
+
// src/utils/webhook.ts
|
|
50
48
|
/**
|
|
51
49
|
* Canonical failure-mode messages for {@link InvalidWebhookError}.
|
|
52
50
|
*
|
|
@@ -199,8 +197,7 @@ function parseSqs(messageBody) {
|
|
|
199
197
|
function parseSns(notificationBody) {
|
|
200
198
|
return parseEvent(decodeSnsPayload(notificationBody));
|
|
201
199
|
}
|
|
202
|
-
|
|
203
|
-
//#region src/gen/model-decoders/decoders.ts
|
|
200
|
+
// src/gen/model-decoders/decoders.ts
|
|
204
201
|
var decoders = {};
|
|
205
202
|
var decodeDatetimeType = (input) => typeof input === "number" ? new Date(Math.floor(input / 1e6)) : new Date(input);
|
|
206
203
|
decoders.DatetimeType = decodeDatetimeType;
|
|
@@ -245,8 +242,7 @@ decoders["GetApplicationResponse"] = (input) => {
|
|
|
245
242
|
isSingle: true
|
|
246
243
|
} }, input);
|
|
247
244
|
};
|
|
248
|
-
|
|
249
|
-
//#region src/gen/common/CommonApi.ts
|
|
245
|
+
// src/gen/common/CommonApi.ts
|
|
250
246
|
var CommonApi = class {
|
|
251
247
|
apiClient;
|
|
252
248
|
constructor(apiClient) {
|
|
@@ -309,6 +305,7 @@ var CommonApi = class {
|
|
|
309
305
|
user_search_disallowed_roles: request?.user_search_disallowed_roles,
|
|
310
306
|
webhook_events: request?.webhook_events,
|
|
311
307
|
activity_metrics_config: request?.activity_metrics_config,
|
|
308
|
+
agent_review: request?.agent_review,
|
|
312
309
|
apn_config: request?.apn_config,
|
|
313
310
|
async_moderation_config: request?.async_moderation_config,
|
|
314
311
|
datadog_info: request?.datadog_info,
|
|
@@ -534,8 +531,12 @@ var CommonApi = class {
|
|
|
534
531
|
decoders["CreateImportURLResponse"]?.(response);
|
|
535
532
|
return response;
|
|
536
533
|
}
|
|
537
|
-
async listImports() {
|
|
538
|
-
const
|
|
534
|
+
async listImports(request) {
|
|
535
|
+
const queryParams = {
|
|
536
|
+
limit: request?.limit,
|
|
537
|
+
offset: request?.offset
|
|
538
|
+
};
|
|
539
|
+
const response = await this.apiClient.sendRequest("GET", "/api/v2/imports", void 0, queryParams);
|
|
539
540
|
decoders["ListImportsResponse"]?.(response);
|
|
540
541
|
return response;
|
|
541
542
|
}
|
|
@@ -1166,8 +1167,7 @@ var CommonApi = class {
|
|
|
1166
1167
|
return response;
|
|
1167
1168
|
}
|
|
1168
1169
|
};
|
|
1169
|
-
|
|
1170
|
-
//#region src/gen/video/VideoApi.ts
|
|
1170
|
+
// src/gen/video/VideoApi.ts
|
|
1171
1171
|
var VideoApi = class {
|
|
1172
1172
|
apiClient;
|
|
1173
1173
|
constructor(apiClient) {
|
|
@@ -1997,8 +1997,7 @@ var VideoApi = class {
|
|
|
1997
1997
|
return response;
|
|
1998
1998
|
}
|
|
1999
1999
|
};
|
|
2000
|
-
|
|
2001
|
-
//#region src/gen/video/CallApi.ts
|
|
2000
|
+
// src/gen/video/CallApi.ts
|
|
2002
2001
|
var CallApi = class {
|
|
2003
2002
|
videoApi;
|
|
2004
2003
|
type;
|
|
@@ -2282,8 +2281,7 @@ var CallApi = class {
|
|
|
2282
2281
|
});
|
|
2283
2282
|
}
|
|
2284
2283
|
};
|
|
2285
|
-
|
|
2286
|
-
//#region src/StreamCall.ts
|
|
2284
|
+
// src/StreamCall.ts
|
|
2287
2285
|
var StreamCall = class extends CallApi {
|
|
2288
2286
|
type;
|
|
2289
2287
|
id;
|
|
@@ -2324,8 +2322,7 @@ var StreamCall = class extends CallApi {
|
|
|
2324
2322
|
return { address: this.data.ingress.srt.address.replace("{passphrase}", segments[2]).replace("{token}", token) };
|
|
2325
2323
|
};
|
|
2326
2324
|
};
|
|
2327
|
-
|
|
2328
|
-
//#region src/StreamVideoClient.ts
|
|
2325
|
+
// src/StreamVideoClient.ts
|
|
2329
2326
|
var StreamVideoClient = class extends VideoApi {
|
|
2330
2327
|
streamClient;
|
|
2331
2328
|
constructor({ streamClient, apiClient }) {
|
|
@@ -2335,6 +2332,13 @@ var StreamVideoClient = class extends VideoApi {
|
|
|
2335
2332
|
call = (type, id) => {
|
|
2336
2333
|
return new StreamCall(this, type, id, this.streamClient);
|
|
2337
2334
|
};
|
|
2335
|
+
/**
|
|
2336
|
+
* Connects an OpenAI Realtime agent to a call through Stream's `/video/connect_agent` proxy.
|
|
2337
|
+
*
|
|
2338
|
+
* @deprecated The OpenAI Realtime proxy is deprecated and will be removed in a
|
|
2339
|
+
* future major release. Build voice and video AI agents with Vision Agents
|
|
2340
|
+
* instead: https://visionagents.ai/integrations/llm/openai
|
|
2341
|
+
*/
|
|
2338
2342
|
connectOpenAi = async (options) => {
|
|
2339
2343
|
let doCreateRealtimeClient;
|
|
2340
2344
|
try {
|
|
@@ -2360,8 +2364,7 @@ var StreamVideoClient = class extends VideoApi {
|
|
|
2360
2364
|
return realtimeClient;
|
|
2361
2365
|
};
|
|
2362
2366
|
};
|
|
2363
|
-
|
|
2364
|
-
//#region src/gen/chat/ChatApi.ts
|
|
2367
|
+
// src/gen/chat/ChatApi.ts
|
|
2365
2368
|
var ChatApi = class {
|
|
2366
2369
|
apiClient;
|
|
2367
2370
|
constructor(apiClient) {
|
|
@@ -2584,6 +2587,7 @@ var ChatApi = class {
|
|
|
2584
2587
|
messages_id_gt: request?.messages_id_gt,
|
|
2585
2588
|
messages_id_gte: request?.messages_id_gte,
|
|
2586
2589
|
messages_id_around: request?.messages_id_around,
|
|
2590
|
+
include_soft_deleted_channel: request?.include_soft_deleted_channel,
|
|
2587
2591
|
user_id: request?.user_id
|
|
2588
2592
|
};
|
|
2589
2593
|
const pathParams = {
|
|
@@ -3547,6 +3551,17 @@ var ChatApi = class {
|
|
|
3547
3551
|
decoders["SearchResponse"]?.(response);
|
|
3548
3552
|
return response;
|
|
3549
3553
|
}
|
|
3554
|
+
async searchAll(request) {
|
|
3555
|
+
const body = {
|
|
3556
|
+
limit: request?.limit,
|
|
3557
|
+
query: request?.query,
|
|
3558
|
+
entities: request?.entities,
|
|
3559
|
+
next: request?.next
|
|
3560
|
+
};
|
|
3561
|
+
const response = await this.apiClient.sendRequest("POST", "/api/v2/chat/search/all", void 0, void 0, body);
|
|
3562
|
+
decoders["SearchAllResponse"]?.(response);
|
|
3563
|
+
return response;
|
|
3564
|
+
}
|
|
3550
3565
|
async createSegment(request) {
|
|
3551
3566
|
const body = {
|
|
3552
3567
|
type: request?.type,
|
|
@@ -3708,8 +3723,7 @@ var ChatApi = class {
|
|
|
3708
3723
|
return response;
|
|
3709
3724
|
}
|
|
3710
3725
|
};
|
|
3711
|
-
|
|
3712
|
-
//#region src/gen/chat/ChannelApi.ts
|
|
3726
|
+
// src/gen/chat/ChannelApi.ts
|
|
3713
3727
|
var ChannelApi = class {
|
|
3714
3728
|
chatApi;
|
|
3715
3729
|
type;
|
|
@@ -3920,8 +3934,7 @@ var ChannelApi = class {
|
|
|
3920
3934
|
});
|
|
3921
3935
|
}
|
|
3922
3936
|
};
|
|
3923
|
-
|
|
3924
|
-
//#region src/StreamChannel.ts
|
|
3937
|
+
// src/StreamChannel.ts
|
|
3925
3938
|
var StreamChannel = class extends ChannelApi {
|
|
3926
3939
|
get cid() {
|
|
3927
3940
|
return `${this.type}:${this.id}`;
|
|
@@ -3954,8 +3967,7 @@ var StreamChannel = class extends ChannelApi {
|
|
|
3954
3967
|
return super.uploadChannelImage(request);
|
|
3955
3968
|
};
|
|
3956
3969
|
};
|
|
3957
|
-
|
|
3958
|
-
//#region src/StreamChatClient.ts
|
|
3970
|
+
// src/StreamChatClient.ts
|
|
3959
3971
|
var StreamChatClient = class extends ChatApi {
|
|
3960
3972
|
channel = (type, id) => {
|
|
3961
3973
|
return new StreamChannel(this, type, id);
|
|
@@ -3967,8 +3979,7 @@ var StreamChatClient = class extends ChatApi {
|
|
|
3967
3979
|
return super.uploadChannelImage(request);
|
|
3968
3980
|
};
|
|
3969
3981
|
};
|
|
3970
|
-
|
|
3971
|
-
//#region src/gen/moderation/ModerationApi.ts
|
|
3982
|
+
// src/gen/moderation/ModerationApi.ts
|
|
3972
3983
|
var ModerationApi = class {
|
|
3973
3984
|
apiClient;
|
|
3974
3985
|
constructor(apiClient) {
|
|
@@ -4045,6 +4056,33 @@ var ModerationApi = class {
|
|
|
4045
4056
|
decoders["InsertActionLogResponse"]?.(response);
|
|
4046
4057
|
return response;
|
|
4047
4058
|
}
|
|
4059
|
+
async listAgentFeedback(request) {
|
|
4060
|
+
const queryParams = {
|
|
4061
|
+
limit: request?.limit,
|
|
4062
|
+
next: request?.next
|
|
4063
|
+
};
|
|
4064
|
+
const response = await this.apiClient.sendRequest("GET", "/api/v2/moderation/agent_feedback", void 0, queryParams);
|
|
4065
|
+
decoders["ListAgentFeedbackResponse"]?.(response);
|
|
4066
|
+
return response;
|
|
4067
|
+
}
|
|
4068
|
+
async submitAgentFeedback(request) {
|
|
4069
|
+
const body = {
|
|
4070
|
+
item_id: request?.item_id,
|
|
4071
|
+
moderator_action: request?.moderator_action,
|
|
4072
|
+
improvement: request?.improvement,
|
|
4073
|
+
reason: request?.reason,
|
|
4074
|
+
user_id: request?.user_id,
|
|
4075
|
+
user: request?.user
|
|
4076
|
+
};
|
|
4077
|
+
const response = await this.apiClient.sendRequest("POST", "/api/v2/moderation/agent_feedback", void 0, void 0, body);
|
|
4078
|
+
decoders["SubmitAgentFeedbackResponse"]?.(response);
|
|
4079
|
+
return response;
|
|
4080
|
+
}
|
|
4081
|
+
async getAgentReviewStatus() {
|
|
4082
|
+
const response = await this.apiClient.sendRequest("GET", "/api/v2/moderation/agent_review_status", void 0, void 0);
|
|
4083
|
+
decoders["GetAgentReviewStatusResponse"]?.(response);
|
|
4084
|
+
return response;
|
|
4085
|
+
}
|
|
4048
4086
|
async analyze(request) {
|
|
4049
4087
|
const body = {
|
|
4050
4088
|
async_response: request?.async_response,
|
|
@@ -4206,6 +4244,37 @@ var ModerationApi = class {
|
|
|
4206
4244
|
decoders["UpsertConfigResponse"]?.(response);
|
|
4207
4245
|
return response;
|
|
4208
4246
|
}
|
|
4247
|
+
async saveConfigVersion(request) {
|
|
4248
|
+
const body = {
|
|
4249
|
+
base_version: request?.base_version,
|
|
4250
|
+
key: request?.key,
|
|
4251
|
+
async: request?.async,
|
|
4252
|
+
team: request?.team,
|
|
4253
|
+
user_id: request?.user_id,
|
|
4254
|
+
ai_audio_config: request?.ai_audio_config,
|
|
4255
|
+
ai_image_config: request?.ai_image_config,
|
|
4256
|
+
ai_text_config: request?.ai_text_config,
|
|
4257
|
+
ai_video_config: request?.ai_video_config,
|
|
4258
|
+
automod_platform_circumvention_config: request?.automod_platform_circumvention_config,
|
|
4259
|
+
automod_semantic_filters_config: request?.automod_semantic_filters_config,
|
|
4260
|
+
automod_toxicity_config: request?.automod_toxicity_config,
|
|
4261
|
+
aws_rekognition_config: request?.aws_rekognition_config,
|
|
4262
|
+
block_list_config: request?.block_list_config,
|
|
4263
|
+
bodyguard_config: request?.bodyguard_config,
|
|
4264
|
+
engine: request?.engine,
|
|
4265
|
+
flood_config: request?.flood_config,
|
|
4266
|
+
google_vision_config: request?.google_vision_config,
|
|
4267
|
+
intent_config: request?.intent_config,
|
|
4268
|
+
llm_config: request?.llm_config,
|
|
4269
|
+
rule_builder_config: request?.rule_builder_config,
|
|
4270
|
+
user: request?.user,
|
|
4271
|
+
velocity_filter_config: request?.velocity_filter_config,
|
|
4272
|
+
video_call_rule_config: request?.video_call_rule_config
|
|
4273
|
+
};
|
|
4274
|
+
const response = await this.apiClient.sendRequest("POST", "/api/v2/moderation/config/versions", void 0, void 0, body);
|
|
4275
|
+
decoders["SaveConfigVersionResponse"]?.(response);
|
|
4276
|
+
return response;
|
|
4277
|
+
}
|
|
4209
4278
|
async deleteConfig(request) {
|
|
4210
4279
|
const queryParams = {
|
|
4211
4280
|
team: request?.team,
|
|
@@ -4223,6 +4292,37 @@ var ModerationApi = class {
|
|
|
4223
4292
|
decoders["GetConfigResponse"]?.(response);
|
|
4224
4293
|
return response;
|
|
4225
4294
|
}
|
|
4295
|
+
async listConfigVersions(request) {
|
|
4296
|
+
const queryParams = { team: request?.team };
|
|
4297
|
+
const pathParams = { key: request?.key };
|
|
4298
|
+
const response = await this.apiClient.sendRequest("GET", "/api/v2/moderation/config/{key}/versions", pathParams, queryParams);
|
|
4299
|
+
decoders["ListConfigVersionsResponse"]?.(response);
|
|
4300
|
+
return response;
|
|
4301
|
+
}
|
|
4302
|
+
async getConfigVersion(request) {
|
|
4303
|
+
const queryParams = { team: request?.team };
|
|
4304
|
+
const pathParams = {
|
|
4305
|
+
key: request?.key,
|
|
4306
|
+
version: request?.version
|
|
4307
|
+
};
|
|
4308
|
+
const response = await this.apiClient.sendRequest("GET", "/api/v2/moderation/config/{key}/versions/{version}", pathParams, queryParams);
|
|
4309
|
+
decoders["GetConfigVersionResponse"]?.(response);
|
|
4310
|
+
return response;
|
|
4311
|
+
}
|
|
4312
|
+
async publishConfigVersion(request) {
|
|
4313
|
+
const pathParams = {
|
|
4314
|
+
key: request?.key,
|
|
4315
|
+
version: request?.version
|
|
4316
|
+
};
|
|
4317
|
+
const body = {
|
|
4318
|
+
team: request?.team,
|
|
4319
|
+
user_id: request?.user_id,
|
|
4320
|
+
user: request?.user
|
|
4321
|
+
};
|
|
4322
|
+
const response = await this.apiClient.sendRequest("POST", "/api/v2/moderation/config/{key}/versions/{version}/publish", pathParams, void 0, body);
|
|
4323
|
+
decoders["PublishConfigVersionResponse"]?.(response);
|
|
4324
|
+
return response;
|
|
4325
|
+
}
|
|
4226
4326
|
async queryModerationConfigs(request) {
|
|
4227
4327
|
const body = {
|
|
4228
4328
|
limit: request?.limit,
|
|
@@ -4549,6 +4649,16 @@ var ModerationApi = class {
|
|
|
4549
4649
|
decoders["QueryReviewQueueResponse"]?.(response);
|
|
4550
4650
|
return response;
|
|
4551
4651
|
}
|
|
4652
|
+
async countReviewQueue(request) {
|
|
4653
|
+
const body = {
|
|
4654
|
+
user_id: request?.user_id,
|
|
4655
|
+
filter: request?.filter,
|
|
4656
|
+
user: request?.user
|
|
4657
|
+
};
|
|
4658
|
+
const response = await this.apiClient.sendRequest("POST", "/api/v2/moderation/review_queue/count", void 0, void 0, body);
|
|
4659
|
+
decoders["CountReviewQueueResponse"]?.(response);
|
|
4660
|
+
return response;
|
|
4661
|
+
}
|
|
4552
4662
|
async getReviewQueueItem(request) {
|
|
4553
4663
|
const pathParams = { id: request?.id };
|
|
4554
4664
|
const response = await this.apiClient.sendRequest("GET", "/api/v2/moderation/review_queue/{id}", pathParams, void 0);
|
|
@@ -4576,6 +4686,7 @@ var ModerationApi = class {
|
|
|
4576
4686
|
appeal_id: request?.appeal_id,
|
|
4577
4687
|
item_id: request?.item_id,
|
|
4578
4688
|
user_id: request?.user_id,
|
|
4689
|
+
agent_recommendation: request?.agent_recommendation,
|
|
4579
4690
|
ban: request?.ban,
|
|
4580
4691
|
block: request?.block,
|
|
4581
4692
|
bypass: request?.bypass,
|
|
@@ -4633,7 +4744,8 @@ var ModerationApi = class {
|
|
|
4633
4744
|
const queryParams = {
|
|
4634
4745
|
target_user_id: request?.target_user_id,
|
|
4635
4746
|
channel_cid: request?.channel_cid,
|
|
4636
|
-
created_by: request?.created_by
|
|
4747
|
+
created_by: request?.created_by,
|
|
4748
|
+
remove_future_channels_ban: request?.remove_future_channels_ban
|
|
4637
4749
|
};
|
|
4638
4750
|
const body = {
|
|
4639
4751
|
unbanned_by_id: request?.unbanned_by_id,
|
|
@@ -4654,22 +4766,21 @@ var ModerationApi = class {
|
|
|
4654
4766
|
return response;
|
|
4655
4767
|
}
|
|
4656
4768
|
};
|
|
4657
|
-
|
|
4658
|
-
//#region src/StreamModerationClient.ts
|
|
4769
|
+
// src/StreamModerationClient.ts
|
|
4659
4770
|
var StreamModerationClient = class extends ModerationApi {};
|
|
4660
|
-
|
|
4661
|
-
//#region src/types.ts
|
|
4771
|
+
// src/types.ts
|
|
4662
4772
|
var StreamError = class extends Error {
|
|
4663
4773
|
metadata;
|
|
4664
4774
|
code;
|
|
4665
|
-
|
|
4775
|
+
apiError;
|
|
4776
|
+
constructor(message, metadata, code, errorOptions, apiError) {
|
|
4666
4777
|
super(message, errorOptions);
|
|
4667
4778
|
this.metadata = metadata;
|
|
4668
4779
|
this.code = code;
|
|
4780
|
+
this.apiError = apiError;
|
|
4669
4781
|
}
|
|
4670
4782
|
};
|
|
4671
|
-
|
|
4672
|
-
//#region src/utils/rate-limit.ts
|
|
4783
|
+
// src/utils/rate-limit.ts
|
|
4673
4784
|
var getRateLimitFromResponseHeader = (responseHeaders) => {
|
|
4674
4785
|
return {
|
|
4675
4786
|
rateLimit: responseHeaders.has("x-ratelimit-limit") ? +responseHeaders.get("x-ratelimit-limit") : void 0,
|
|
@@ -4677,8 +4788,7 @@ var getRateLimitFromResponseHeader = (responseHeaders) => {
|
|
|
4677
4788
|
rateLimitReset: responseHeaders.has("x-ratelimit-reset") ? /* @__PURE__ */ new Date(+responseHeaders.get("x-ratelimit-reset") * 1e3) : void 0
|
|
4678
4789
|
};
|
|
4679
4790
|
};
|
|
4680
|
-
|
|
4681
|
-
//#region src/utils/query-params.ts
|
|
4791
|
+
// src/utils/query-params.ts
|
|
4682
4792
|
var isScalar = (value) => {
|
|
4683
4793
|
const type = typeof value;
|
|
4684
4794
|
return type === "string" || type === "number" || type === "boolean";
|
|
@@ -4698,8 +4808,7 @@ var stringifyArrayParam = (param) => {
|
|
|
4698
4808
|
}
|
|
4699
4809
|
return allScalar ? entries.join(",") : JSON.stringify(entries);
|
|
4700
4810
|
};
|
|
4701
|
-
|
|
4702
|
-
//#region src/ApiClient.ts
|
|
4811
|
+
// src/ApiClient.ts
|
|
4703
4812
|
var ApiClient = class {
|
|
4704
4813
|
apiConfig;
|
|
4705
4814
|
dispatcher;
|
|
@@ -4716,14 +4825,14 @@ var ApiClient = class {
|
|
|
4716
4825
|
queryParams.api_key = this.apiConfig.apiKey;
|
|
4717
4826
|
const encodedParams = this.queryParamsStringify(queryParams);
|
|
4718
4827
|
if (pathParams) Object.keys(pathParams).forEach((paramName) => {
|
|
4719
|
-
url = url.replace(`{${paramName}}`, pathParams[paramName]);
|
|
4828
|
+
url = url.replace(`{${paramName}}`, encodeURIComponent(pathParams[paramName]));
|
|
4720
4829
|
});
|
|
4721
4830
|
url += `?${encodedParams}`;
|
|
4722
4831
|
const clientRequestId = (0, crypto.randomUUID)();
|
|
4723
4832
|
const headers = {
|
|
4724
4833
|
Authorization: this.apiConfig.token,
|
|
4725
4834
|
"stream-auth-type": "jwt",
|
|
4726
|
-
"X-Stream-Client": "stream-node-0.9.
|
|
4835
|
+
"X-Stream-Client": "stream-node-0.9.2",
|
|
4727
4836
|
"Accept-Encoding": "gzip",
|
|
4728
4837
|
"x-client-request-id": clientRequestId
|
|
4729
4838
|
};
|
|
@@ -4752,7 +4861,7 @@ var ApiClient = class {
|
|
|
4752
4861
|
} catch {
|
|
4753
4862
|
throw new StreamError(`Stream error: ${response.status} - ${response.statusText}`, metadata, response.status);
|
|
4754
4863
|
}
|
|
4755
|
-
throw new StreamError(`Stream error code ${error.code}: ${error.message}`, metadata, error.code, void 0);
|
|
4864
|
+
throw new StreamError(`Stream error code ${error.code}: ${error.message}`, metadata, error.code, void 0, error);
|
|
4756
4865
|
}
|
|
4757
4866
|
return {
|
|
4758
4867
|
...await response.json(),
|
|
@@ -4792,8 +4901,7 @@ var ApiClient = class {
|
|
|
4792
4901
|
return newParams.join("&");
|
|
4793
4902
|
};
|
|
4794
4903
|
};
|
|
4795
|
-
|
|
4796
|
-
//#region src/gen/feeds/FeedsApi.ts
|
|
4904
|
+
// src/gen/feeds/FeedsApi.ts
|
|
4797
4905
|
var FeedsApi = class {
|
|
4798
4906
|
apiClient;
|
|
4799
4907
|
constructor(apiClient) {
|
|
@@ -5067,7 +5175,8 @@ var FeedsApi = class {
|
|
|
5067
5175
|
translate_text: request?.translate_text,
|
|
5068
5176
|
include_top_level_comment_count: request?.include_top_level_comment_count,
|
|
5069
5177
|
include_soft_deleted_activities: request?.include_soft_deleted_activities,
|
|
5070
|
-
include_moderated_activities: request?.include_moderated_activities
|
|
5178
|
+
include_moderated_activities: request?.include_moderated_activities,
|
|
5179
|
+
skip_viewer_visibility: request?.skip_viewer_visibility
|
|
5071
5180
|
};
|
|
5072
5181
|
const pathParams = { id: request?.id };
|
|
5073
5182
|
const response = await this.apiClient.sendRequest("GET", "/api/v2/feeds/activities/{id}", pathParams, queryParams);
|
|
@@ -6294,8 +6403,7 @@ var FeedsApi = class {
|
|
|
6294
6403
|
return response;
|
|
6295
6404
|
}
|
|
6296
6405
|
};
|
|
6297
|
-
|
|
6298
|
-
//#region src/gen/feeds/FeedApi.ts
|
|
6406
|
+
// src/gen/feeds/FeedApi.ts
|
|
6299
6407
|
var FeedApi = class {
|
|
6300
6408
|
feedsApi;
|
|
6301
6409
|
group;
|
|
@@ -6403,15 +6511,13 @@ var FeedApi = class {
|
|
|
6403
6511
|
});
|
|
6404
6512
|
}
|
|
6405
6513
|
};
|
|
6406
|
-
|
|
6407
|
-
//#region src/StreamFeed.ts
|
|
6514
|
+
// src/StreamFeed.ts
|
|
6408
6515
|
var StreamFeed = class extends FeedApi {
|
|
6409
6516
|
get feed() {
|
|
6410
6517
|
return `${this.group}:${this.id}`;
|
|
6411
6518
|
}
|
|
6412
6519
|
};
|
|
6413
|
-
|
|
6414
|
-
//#region src/StreamFeedsClient.ts
|
|
6520
|
+
// src/StreamFeedsClient.ts
|
|
6415
6521
|
var StreamFeedsClient = class extends FeedsApi {
|
|
6416
6522
|
feed = (group, id) => {
|
|
6417
6523
|
return new StreamFeed(this, group, id);
|
|
@@ -6438,8 +6544,7 @@ var StreamFeedsClient = class extends FeedsApi {
|
|
|
6438
6544
|
return super.unfollowBatch(request);
|
|
6439
6545
|
};
|
|
6440
6546
|
};
|
|
6441
|
-
|
|
6442
|
-
//#region src/StreamClient.ts
|
|
6547
|
+
// src/StreamClient.ts
|
|
6443
6548
|
var StreamClient = class StreamClient extends CommonApi {
|
|
6444
6549
|
apiKey;
|
|
6445
6550
|
secret;
|
|
@@ -6636,8 +6741,7 @@ var StreamClient = class StreamClient extends CommonApi {
|
|
|
6636
6741
|
*/
|
|
6637
6742
|
parseSns = (notificationBody) => parseSns(notificationBody);
|
|
6638
6743
|
};
|
|
6639
|
-
|
|
6640
|
-
//#region src/gen/models/index.ts
|
|
6744
|
+
// src/gen/models/index.ts
|
|
6641
6745
|
var ChannelOwnCapability = {
|
|
6642
6746
|
BAN_CHANNEL_MEMBERS: "ban-channel-members",
|
|
6643
6747
|
CAST_POLL_VOTE: "cast-poll-vote",
|
|
@@ -6752,8 +6856,7 @@ var OwnCapability = {
|
|
|
6752
6856
|
UPDATE_CALL_PERMISSIONS: "update-call-permissions",
|
|
6753
6857
|
UPDATE_CALL_SETTINGS: "update-call-settings"
|
|
6754
6858
|
};
|
|
6755
|
-
|
|
6756
|
-
//#region src/utils/time.ts
|
|
6859
|
+
// src/utils/time.ts
|
|
6757
6860
|
/**
|
|
6758
6861
|
* Unit conversions between the API's timestamps and JavaScript's.
|
|
6759
6862
|
*
|
|
@@ -6828,7 +6931,6 @@ var convertTimestampToDate = (timestamp) => {
|
|
|
6828
6931
|
if (timestamp == null || !Number.isFinite(timestamp)) return void 0;
|
|
6829
6932
|
return nsToDate(timestamp);
|
|
6830
6933
|
};
|
|
6831
|
-
//#endregion
|
|
6832
6934
|
exports.ChannelOwnCapability = ChannelOwnCapability;
|
|
6833
6935
|
exports.FeedOwnCapability = FeedOwnCapability;
|
|
6834
6936
|
exports.InvalidWebhookError = InvalidWebhookError;
|