@stream-io/node-sdk 0.8.1 → 0.8.3
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 +19 -0
- package/dist/index.cjs.js +39 -18
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.mjs +39 -18
- package/dist/index.es.mjs.map +1 -1
- package/dist/src/ApiClient.d.ts +1 -0
- package/dist/src/gen/common/CommonApi.d.ts +2 -2
- package/dist/src/gen/feeds/FeedApi.d.ts +2 -1
- package/dist/src/gen/feeds/FeedsApi.d.ts +5 -1
- package/dist/src/gen/models/index.d.ts +65 -4
- package/package.json +1 -1
- package/src/ApiClient.ts +18 -6
- package/src/StreamClient.ts +4 -14
- package/src/gen/chat/ChatApi.ts +1 -0
- package/src/gen/common/CommonApi.ts +5 -3
- package/src/gen/feeds/FeedApi.ts +8 -0
- package/src/gen/feeds/FeedsApi.ts +24 -0
- package/src/gen/models/index.ts +87 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.8.3](https://github.com/GetStream/stream-node/compare/v0.8.2...v0.8.3) (2026-08-24)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add activity processor tag extraction thresholds ([#339](https://github.com/GetStream/stream-node/issues/339)) ([740fda1](https://github.com/GetStream/stream-node/commit/740fda1c5ac263da4fdbdcb76e55731dfd0aa48b))
|
|
9
|
+
|
|
10
|
+
## [0.8.2](https://github.com/GetStream/stream-node/compare/v0.8.1...v0.8.2) (2026-08-21)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* feed counts endpoint ([#335](https://github.com/GetStream/stream-node/issues/335)) ([cd55e36](https://github.com/GetStream/stream-node/commit/cd55e36bb548ca928eccc0a8f2bca30f985062d7))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* JSON-encode object fields in multipart request bodies ([#337](https://github.com/GetStream/stream-node/issues/337)) ([5ed3f5b](https://github.com/GetStream/stream-node/commit/5ed3f5b6ef627fdb1497bb6fbf669db213c31b0e))
|
|
21
|
+
|
|
3
22
|
## [0.8.1](https://github.com/GetStream/stream-node/compare/v0.8.0...v0.8.1) (2026-08-18)
|
|
4
23
|
|
|
5
24
|
|
package/dist/index.cjs.js
CHANGED
|
@@ -8572,11 +8572,12 @@ var CommonApi = class {
|
|
|
8572
8572
|
async createPermission(request) {
|
|
8573
8573
|
const body = {
|
|
8574
8574
|
action: request?.action,
|
|
8575
|
+
id: request?.id,
|
|
8575
8576
|
name: request?.name,
|
|
8577
|
+
condition: request?.condition,
|
|
8576
8578
|
description: request?.description,
|
|
8577
8579
|
owner: request?.owner,
|
|
8578
|
-
same_team: request?.same_team
|
|
8579
|
-
condition: request?.condition
|
|
8580
|
+
same_team: request?.same_team
|
|
8580
8581
|
};
|
|
8581
8582
|
const response = await this.apiClient.sendRequest("POST", "/api/v2/permissions", void 0, void 0, body, "application/json");
|
|
8582
8583
|
decoders["Response"]?.(response.body);
|
|
@@ -8608,10 +8609,10 @@ var CommonApi = class {
|
|
|
8608
8609
|
const body = {
|
|
8609
8610
|
action: request?.action,
|
|
8610
8611
|
name: request?.name,
|
|
8612
|
+
condition: request?.condition,
|
|
8611
8613
|
description: request?.description,
|
|
8612
8614
|
owner: request?.owner,
|
|
8613
|
-
same_team: request?.same_team
|
|
8614
|
-
condition: request?.condition
|
|
8615
|
+
same_team: request?.same_team
|
|
8615
8616
|
};
|
|
8616
8617
|
const response = await this.apiClient.sendRequest("PUT", "/api/v2/permissions/{id}", pathParams, void 0, body, "application/json");
|
|
8617
8618
|
decoders["Response"]?.(response.body);
|
|
@@ -11330,6 +11331,7 @@ var ChatApi = class {
|
|
|
11330
11331
|
custom_events: request?.custom_events,
|
|
11331
11332
|
delivery_events: request?.delivery_events,
|
|
11332
11333
|
mark_messages_pending: request?.mark_messages_pending,
|
|
11334
|
+
message_retention: request?.message_retention,
|
|
11333
11335
|
mutes: request?.mutes,
|
|
11334
11336
|
partition_size: request?.partition_size,
|
|
11335
11337
|
partition_ttl: request?.partition_ttl,
|
|
@@ -13209,16 +13211,13 @@ var ApiClient = class {
|
|
|
13209
13211
|
const headers = {
|
|
13210
13212
|
Authorization: this.apiConfig.token,
|
|
13211
13213
|
"stream-auth-type": "jwt",
|
|
13212
|
-
"X-Stream-Client": "stream-node-0.8.
|
|
13214
|
+
"X-Stream-Client": "stream-node-0.8.3",
|
|
13213
13215
|
"Accept-Encoding": "gzip",
|
|
13214
13216
|
"x-client-request-id": clientRequestId
|
|
13215
13217
|
};
|
|
13216
13218
|
if (requestContentType !== "multipart/form-data") headers["Content-Type"] = requestContentType ?? "application/json";
|
|
13217
13219
|
const signal = AbortSignal.timeout(this.apiConfig.timeout);
|
|
13218
|
-
const encodedBody = requestContentType === "multipart/form-data" ?
|
|
13219
|
-
if (requestContentType === "multipart/form-data") Object.keys(body).forEach((key) => {
|
|
13220
|
-
encodedBody.append(key, body[key]);
|
|
13221
|
-
});
|
|
13220
|
+
const encodedBody = requestContentType === "multipart/form-data" ? this.multipartBodyStringify(body) : JSON.stringify(body);
|
|
13222
13221
|
try {
|
|
13223
13222
|
const response = await fetch(`${this.apiConfig.baseUrl}${url}`, {
|
|
13224
13223
|
signal: requestContentType === "multipart/form-data" ? void 0 : signal,
|
|
@@ -13257,6 +13256,17 @@ var ApiClient = class {
|
|
|
13257
13256
|
else throw new StreamError(`The request failed due to an unexpected error`, metadata, error);
|
|
13258
13257
|
}
|
|
13259
13258
|
};
|
|
13259
|
+
multipartBodyStringify = (body) => {
|
|
13260
|
+
const formData = new FormData();
|
|
13261
|
+
for (const key in body) {
|
|
13262
|
+
const value = body[key];
|
|
13263
|
+
if (value === null || value === void 0) continue;
|
|
13264
|
+
if (value instanceof Blob) formData.append(key, value);
|
|
13265
|
+
else if (isScalar(value)) formData.append(key, String(value));
|
|
13266
|
+
else formData.append(key, JSON.stringify(value));
|
|
13267
|
+
}
|
|
13268
|
+
return formData;
|
|
13269
|
+
};
|
|
13260
13270
|
queryParamsStringify = (params) => {
|
|
13261
13271
|
const newParams = [];
|
|
13262
13272
|
for (const k in params) {
|
|
@@ -14295,6 +14305,18 @@ var FeedsApi = class {
|
|
|
14295
14305
|
metadata: response.metadata
|
|
14296
14306
|
};
|
|
14297
14307
|
}
|
|
14308
|
+
async getFeedCounts(request) {
|
|
14309
|
+
const pathParams = {
|
|
14310
|
+
feed_group_id: request?.feed_group_id,
|
|
14311
|
+
feed_id: request?.feed_id
|
|
14312
|
+
};
|
|
14313
|
+
const response = await this.apiClient.sendRequest("GET", "/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/counts", pathParams, void 0);
|
|
14314
|
+
decoders["GetFeedCountsResponse"]?.(response.body);
|
|
14315
|
+
return {
|
|
14316
|
+
...response.body,
|
|
14317
|
+
metadata: response.metadata
|
|
14318
|
+
};
|
|
14319
|
+
}
|
|
14298
14320
|
async updateFeedMembers(request) {
|
|
14299
14321
|
const pathParams = {
|
|
14300
14322
|
feed_group_id: request?.feed_group_id,
|
|
@@ -15001,6 +15023,12 @@ var FeedApi = class {
|
|
|
15001
15023
|
...request
|
|
15002
15024
|
});
|
|
15003
15025
|
}
|
|
15026
|
+
getFeedCounts() {
|
|
15027
|
+
return this.feedsApi.getFeedCounts({
|
|
15028
|
+
feed_id: this.id,
|
|
15029
|
+
feed_group_id: this.group
|
|
15030
|
+
});
|
|
15031
|
+
}
|
|
15004
15032
|
updateFeedMembers(request) {
|
|
15005
15033
|
return this.feedsApi.updateFeedMembers({
|
|
15006
15034
|
feed_id: this.id,
|
|
@@ -15140,17 +15168,10 @@ var StreamClient = class StreamClient extends CommonApi {
|
|
|
15140
15168
|
return this.chat.queryBannedUsers(request);
|
|
15141
15169
|
};
|
|
15142
15170
|
uploadFile = (request) => {
|
|
15143
|
-
return super.uploadFile(
|
|
15144
|
-
file: request.file,
|
|
15145
|
-
user: JSON.stringify(request.user)
|
|
15146
|
-
});
|
|
15171
|
+
return super.uploadFile(request);
|
|
15147
15172
|
};
|
|
15148
15173
|
uploadImage = (request) => {
|
|
15149
|
-
return super.uploadImage(
|
|
15150
|
-
file: request.file,
|
|
15151
|
-
user: JSON.stringify(request.user),
|
|
15152
|
-
upload_sizes: JSON.stringify(request.upload_sizes)
|
|
15153
|
-
});
|
|
15174
|
+
return super.uploadImage(request);
|
|
15154
15175
|
};
|
|
15155
15176
|
/**
|
|
15156
15177
|
*
|