@stream-io/feeds-client 0.3.34 → 0.3.36
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 +12 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/react-bindings.js +1 -1
- package/dist/es/index.mjs +2 -2
- package/dist/es/index.mjs.map +1 -1
- package/dist/es/react-bindings.mjs +1 -1
- package/dist/{feeds-client-C-2_fdH1.mjs → feeds-client-BAM-n--9.mjs} +97 -8
- package/dist/feeds-client-BAM-n--9.mjs.map +1 -0
- package/dist/{feeds-client-Xj6kDjVH.js → feeds-client-DxM97oeZ.js} +97 -8
- package/dist/feeds-client-DxM97oeZ.js.map +1 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/types/gen/feeds/FeedsApi.d.ts +4 -0
- package/dist/types/gen/feeds/FeedsApi.d.ts.map +1 -1
- package/dist/types/gen/models/index.d.ts +104 -3
- package/dist/types/gen/models/index.d.ts.map +1 -1
- package/dist/types/gen/moderation/ModerationApi.d.ts +6 -1
- package/dist/types/gen/moderation/ModerationApi.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/gen/feeds/FeedsApi.ts +25 -3
- package/src/gen/model-decoders/decoders.ts +29 -0
- package/src/gen/models/index.ts +181 -6
- package/src/gen/moderation/ModerationApi.ts +78 -0
- package/dist/feeds-client-C-2_fdH1.mjs.map +0 -1
- package/dist/feeds-client-Xj6kDjVH.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useStateStore } from "@stream-io/state-store/react-bindings";
|
|
2
2
|
export * from "@stream-io/state-store/react-bindings";
|
|
3
3
|
import { useState, useEffect, createContext, useContext, useRef, useCallback, useMemo } from "react";
|
|
4
|
-
import { F as FeedsClient, g as isCommentResponse, c as checkHasAnotherPage } from "../feeds-client-
|
|
4
|
+
import { F as FeedsClient, g as isCommentResponse, c as checkHasAnotherPage } from "../feeds-client-BAM-n--9.mjs";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
const useCreateFeedsClient = ({
|
|
7
7
|
apiKey,
|
|
@@ -217,6 +217,14 @@ decoders.AppUpdatedEvent = (input) => {
|
|
|
217
217
|
};
|
|
218
218
|
return decode(typeMappings, input);
|
|
219
219
|
};
|
|
220
|
+
decoders.AppealItemResponse = (input) => {
|
|
221
|
+
const typeMappings = {
|
|
222
|
+
created_at: { type: "DatetimeType", isSingle: true },
|
|
223
|
+
updated_at: { type: "DatetimeType", isSingle: true },
|
|
224
|
+
user: { type: "UserResponse", isSingle: true }
|
|
225
|
+
};
|
|
226
|
+
return decode(typeMappings, input);
|
|
227
|
+
};
|
|
220
228
|
decoders.Ban = (input) => {
|
|
221
229
|
const typeMappings = {
|
|
222
230
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
@@ -798,6 +806,12 @@ decoders.GetActivityResponse = (input) => {
|
|
|
798
806
|
};
|
|
799
807
|
return decode(typeMappings, input);
|
|
800
808
|
};
|
|
809
|
+
decoders.GetAppealResponse = (input) => {
|
|
810
|
+
const typeMappings = {
|
|
811
|
+
item: { type: "AppealItemResponse", isSingle: true }
|
|
812
|
+
};
|
|
813
|
+
return decode(typeMappings, input);
|
|
814
|
+
};
|
|
801
815
|
decoders.GetBlockedUsersResponse = (input) => {
|
|
802
816
|
const typeMappings = {
|
|
803
817
|
blocks: { type: "BlockedUserResponse", isSingle: false }
|
|
@@ -1146,6 +1160,12 @@ decoders.QueryActivityReactionsResponse = (input) => {
|
|
|
1146
1160
|
};
|
|
1147
1161
|
return decode(typeMappings, input);
|
|
1148
1162
|
};
|
|
1163
|
+
decoders.QueryAppealsResponse = (input) => {
|
|
1164
|
+
const typeMappings = {
|
|
1165
|
+
items: { type: "AppealItemResponse", isSingle: false }
|
|
1166
|
+
};
|
|
1167
|
+
return decode(typeMappings, input);
|
|
1168
|
+
};
|
|
1149
1169
|
decoders.QueryBookmarkFoldersResponse = (input) => {
|
|
1150
1170
|
const typeMappings = {
|
|
1151
1171
|
bookmark_folders: { type: "BookmarkFolderResponse", isSingle: false }
|
|
@@ -1268,6 +1288,7 @@ decoders.ReviewQueueItemResponse = (input) => {
|
|
|
1268
1288
|
flags: { type: "ModerationFlagResponse", isSingle: false },
|
|
1269
1289
|
completed_at: { type: "DatetimeType", isSingle: true },
|
|
1270
1290
|
reviewed_at: { type: "DatetimeType", isSingle: true },
|
|
1291
|
+
appeal: { type: "AppealItemResponse", isSingle: true },
|
|
1271
1292
|
assigned_to: { type: "UserResponse", isSingle: true },
|
|
1272
1293
|
call: { type: "CallResponse", isSingle: true },
|
|
1273
1294
|
entity_creator: { type: "EntityCreatorResponse", isSingle: true },
|
|
@@ -1338,6 +1359,7 @@ decoders.StoriesFeedUpdatedEvent = (input) => {
|
|
|
1338
1359
|
};
|
|
1339
1360
|
decoders.SubmitActionResponse = (input) => {
|
|
1340
1361
|
const typeMappings = {
|
|
1362
|
+
appeal_item: { type: "AppealItemResponse", isSingle: true },
|
|
1341
1363
|
item: { type: "ReviewQueueItemResponse", isSingle: true }
|
|
1342
1364
|
};
|
|
1343
1365
|
return decode(typeMappings, input);
|
|
@@ -1655,12 +1677,14 @@ class FeedsApi {
|
|
|
1655
1677
|
const body = {
|
|
1656
1678
|
type: request?.type,
|
|
1657
1679
|
feeds: request?.feeds,
|
|
1680
|
+
create_notification_activity: request?.create_notification_activity,
|
|
1658
1681
|
expires_at: request?.expires_at,
|
|
1659
1682
|
id: request?.id,
|
|
1660
1683
|
parent_id: request?.parent_id,
|
|
1661
1684
|
poll_id: request?.poll_id,
|
|
1662
1685
|
restrict_replies: request?.restrict_replies,
|
|
1663
1686
|
skip_enrich_url: request?.skip_enrich_url,
|
|
1687
|
+
skip_push: request?.skip_push,
|
|
1664
1688
|
text: request?.text,
|
|
1665
1689
|
visibility: request?.visibility,
|
|
1666
1690
|
visibility_tag: request?.visibility_tag,
|
|
@@ -1893,6 +1917,9 @@ class FeedsApi {
|
|
|
1893
1917
|
return { ...response.body, metadata: response.metadata };
|
|
1894
1918
|
}
|
|
1895
1919
|
async deleteActivityReaction(request) {
|
|
1920
|
+
const queryParams = {
|
|
1921
|
+
delete_notification_activity: request?.delete_notification_activity
|
|
1922
|
+
};
|
|
1896
1923
|
const pathParams = {
|
|
1897
1924
|
activity_id: request?.activity_id,
|
|
1898
1925
|
type: request?.type
|
|
@@ -1901,7 +1928,7 @@ class FeedsApi {
|
|
|
1901
1928
|
"DELETE",
|
|
1902
1929
|
"/api/v2/feeds/activities/{activity_id}/reactions/{type}",
|
|
1903
1930
|
pathParams,
|
|
1904
|
-
|
|
1931
|
+
queryParams
|
|
1905
1932
|
);
|
|
1906
1933
|
decoders.DeleteActivityReactionResponse?.(response.body);
|
|
1907
1934
|
return { ...response.body, metadata: response.metadata };
|
|
@@ -1930,6 +1957,7 @@ class FeedsApi {
|
|
|
1930
1957
|
id: request?.id
|
|
1931
1958
|
};
|
|
1932
1959
|
const body = {
|
|
1960
|
+
handle_mention_notifications: request?.handle_mention_notifications,
|
|
1933
1961
|
unset: request?.unset,
|
|
1934
1962
|
set: request?.set
|
|
1935
1963
|
};
|
|
@@ -1950,11 +1978,13 @@ class FeedsApi {
|
|
|
1950
1978
|
};
|
|
1951
1979
|
const body = {
|
|
1952
1980
|
expires_at: request?.expires_at,
|
|
1981
|
+
handle_mention_notifications: request?.handle_mention_notifications,
|
|
1953
1982
|
poll_id: request?.poll_id,
|
|
1954
1983
|
restrict_replies: request?.restrict_replies,
|
|
1955
1984
|
skip_enrich_url: request?.skip_enrich_url,
|
|
1956
1985
|
text: request?.text,
|
|
1957
1986
|
visibility: request?.visibility,
|
|
1987
|
+
visibility_tag: request?.visibility_tag,
|
|
1958
1988
|
attachments: request?.attachments,
|
|
1959
1989
|
collection_refs: request?.collection_refs,
|
|
1960
1990
|
feeds: request?.feeds,
|
|
@@ -2167,7 +2197,8 @@ class FeedsApi {
|
|
|
2167
2197
|
}
|
|
2168
2198
|
async deleteComment(request) {
|
|
2169
2199
|
const queryParams = {
|
|
2170
|
-
hard_delete: request?.hard_delete
|
|
2200
|
+
hard_delete: request?.hard_delete,
|
|
2201
|
+
delete_notification_activity: request?.delete_notification_activity
|
|
2171
2202
|
};
|
|
2172
2203
|
const pathParams = {
|
|
2173
2204
|
id: request?.id
|
|
@@ -2190,9 +2221,11 @@ class FeedsApi {
|
|
|
2190
2221
|
};
|
|
2191
2222
|
const body = {
|
|
2192
2223
|
comment: request?.comment,
|
|
2224
|
+
handle_mention_notifications: request?.handle_mention_notifications,
|
|
2193
2225
|
skip_enrich_url: request?.skip_enrich_url,
|
|
2194
2226
|
skip_push: request?.skip_push,
|
|
2195
2227
|
attachments: request?.attachments,
|
|
2228
|
+
mentioned_user_ids: request?.mentioned_user_ids,
|
|
2196
2229
|
custom: request?.custom
|
|
2197
2230
|
};
|
|
2198
2231
|
const response = await this.apiClient.sendRequest(
|
|
@@ -2251,6 +2284,9 @@ class FeedsApi {
|
|
|
2251
2284
|
return { ...response.body, metadata: response.metadata };
|
|
2252
2285
|
}
|
|
2253
2286
|
async deleteCommentReaction(request) {
|
|
2287
|
+
const queryParams = {
|
|
2288
|
+
delete_notification_activity: request?.delete_notification_activity
|
|
2289
|
+
};
|
|
2254
2290
|
const pathParams = {
|
|
2255
2291
|
id: request?.id,
|
|
2256
2292
|
type: request?.type
|
|
@@ -2259,7 +2295,7 @@ class FeedsApi {
|
|
|
2259
2295
|
"DELETE",
|
|
2260
2296
|
"/api/v2/feeds/comments/{id}/reactions/{type}",
|
|
2261
2297
|
pathParams,
|
|
2262
|
-
|
|
2298
|
+
queryParams
|
|
2263
2299
|
);
|
|
2264
2300
|
decoders.DeleteCommentReactionResponse?.(response.body);
|
|
2265
2301
|
return { ...response.body, metadata: response.metadata };
|
|
@@ -2704,6 +2740,9 @@ class FeedsApi {
|
|
|
2704
2740
|
return { ...response.body, metadata: response.metadata };
|
|
2705
2741
|
}
|
|
2706
2742
|
async unfollow(request) {
|
|
2743
|
+
const queryParams = {
|
|
2744
|
+
delete_notification_activity: request?.delete_notification_activity
|
|
2745
|
+
};
|
|
2707
2746
|
const pathParams = {
|
|
2708
2747
|
source: request?.source,
|
|
2709
2748
|
target: request?.target
|
|
@@ -2712,14 +2751,15 @@ class FeedsApi {
|
|
|
2712
2751
|
"DELETE",
|
|
2713
2752
|
"/api/v2/feeds/follows/{source}/{target}",
|
|
2714
2753
|
pathParams,
|
|
2715
|
-
|
|
2754
|
+
queryParams
|
|
2716
2755
|
);
|
|
2717
2756
|
decoders.UnfollowResponse?.(response.body);
|
|
2718
2757
|
return { ...response.body, metadata: response.metadata };
|
|
2719
2758
|
}
|
|
2720
2759
|
async getOrCreateUnfollows(request) {
|
|
2721
2760
|
const body = {
|
|
2722
|
-
follows: request?.follows
|
|
2761
|
+
follows: request?.follows,
|
|
2762
|
+
delete_notification_activity: request?.delete_notification_activity
|
|
2723
2763
|
};
|
|
2724
2764
|
const response = await this.apiClient.sendRequest(
|
|
2725
2765
|
"POST",
|
|
@@ -3923,7 +3963,7 @@ const getRateLimitFromResponseHeader = (response_headers) => {
|
|
|
3923
3963
|
};
|
|
3924
3964
|
return result;
|
|
3925
3965
|
};
|
|
3926
|
-
const version = "0.3.
|
|
3966
|
+
const version = "0.3.36";
|
|
3927
3967
|
const axios = axiosImport.default ?? axiosImport;
|
|
3928
3968
|
class ApiClient {
|
|
3929
3969
|
constructor(apiKey, tokenManager, connectionIdManager, options) {
|
|
@@ -4160,6 +4200,51 @@ class ModerationApi {
|
|
|
4160
4200
|
constructor(apiClient) {
|
|
4161
4201
|
this.apiClient = apiClient;
|
|
4162
4202
|
}
|
|
4203
|
+
async appeal(request) {
|
|
4204
|
+
const body = {
|
|
4205
|
+
appeal_reason: request?.appeal_reason,
|
|
4206
|
+
entity_id: request?.entity_id,
|
|
4207
|
+
entity_type: request?.entity_type,
|
|
4208
|
+
attachments: request?.attachments
|
|
4209
|
+
};
|
|
4210
|
+
const response = await this.apiClient.sendRequest(
|
|
4211
|
+
"POST",
|
|
4212
|
+
"/api/v2/moderation/appeal",
|
|
4213
|
+
void 0,
|
|
4214
|
+
void 0,
|
|
4215
|
+
body,
|
|
4216
|
+
"application/json"
|
|
4217
|
+
);
|
|
4218
|
+
decoders.AppealResponse?.(response.body);
|
|
4219
|
+
return { ...response.body, metadata: response.metadata };
|
|
4220
|
+
}
|
|
4221
|
+
async getAppeal(request) {
|
|
4222
|
+
const pathParams = {
|
|
4223
|
+
id: request?.id
|
|
4224
|
+
};
|
|
4225
|
+
const response = await this.apiClient.sendRequest("GET", "/api/v2/moderation/appeal/{id}", pathParams, void 0);
|
|
4226
|
+
decoders.GetAppealResponse?.(response.body);
|
|
4227
|
+
return { ...response.body, metadata: response.metadata };
|
|
4228
|
+
}
|
|
4229
|
+
async queryAppeals(request) {
|
|
4230
|
+
const body = {
|
|
4231
|
+
limit: request?.limit,
|
|
4232
|
+
next: request?.next,
|
|
4233
|
+
prev: request?.prev,
|
|
4234
|
+
sort: request?.sort,
|
|
4235
|
+
filter: request?.filter
|
|
4236
|
+
};
|
|
4237
|
+
const response = await this.apiClient.sendRequest(
|
|
4238
|
+
"POST",
|
|
4239
|
+
"/api/v2/moderation/appeals",
|
|
4240
|
+
void 0,
|
|
4241
|
+
void 0,
|
|
4242
|
+
body,
|
|
4243
|
+
"application/json"
|
|
4244
|
+
);
|
|
4245
|
+
decoders.QueryAppealsResponse?.(response.body);
|
|
4246
|
+
return { ...response.body, metadata: response.metadata };
|
|
4247
|
+
}
|
|
4163
4248
|
async ban(request) {
|
|
4164
4249
|
const body = {
|
|
4165
4250
|
target_user_id: request?.target_user_id,
|
|
@@ -4317,6 +4402,7 @@ class ModerationApi {
|
|
|
4317
4402
|
async submitAction(request) {
|
|
4318
4403
|
const body = {
|
|
4319
4404
|
action_type: request?.action_type,
|
|
4405
|
+
appeal_id: request?.appeal_id,
|
|
4320
4406
|
item_id: request?.item_id,
|
|
4321
4407
|
ban: request?.ban,
|
|
4322
4408
|
block: request?.block,
|
|
@@ -4327,8 +4413,11 @@ class ModerationApi {
|
|
|
4327
4413
|
delete_reaction: request?.delete_reaction,
|
|
4328
4414
|
delete_user: request?.delete_user,
|
|
4329
4415
|
mark_reviewed: request?.mark_reviewed,
|
|
4416
|
+
reject_appeal: request?.reject_appeal,
|
|
4417
|
+
restore: request?.restore,
|
|
4330
4418
|
shadow_block: request?.shadow_block,
|
|
4331
|
-
unban: request?.unban
|
|
4419
|
+
unban: request?.unban,
|
|
4420
|
+
unblock: request?.unblock
|
|
4332
4421
|
};
|
|
4333
4422
|
const response = await this.apiClient.sendRequest(
|
|
4334
4423
|
"POST",
|
|
@@ -7879,4 +7968,4 @@ export {
|
|
|
7879
7968
|
shouldUpdateState as s,
|
|
7880
7969
|
uniqueArrayMerge as u
|
|
7881
7970
|
};
|
|
7882
|
-
//# sourceMappingURL=feeds-client-
|
|
7971
|
+
//# sourceMappingURL=feeds-client-BAM-n--9.mjs.map
|