@stream-io/feeds-client 0.1.2 → 0.1.4
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 +18 -0
- package/dist/index-react-bindings.browser.cjs +33 -5
- package/dist/index-react-bindings.browser.cjs.map +1 -1
- package/dist/index-react-bindings.browser.js +33 -5
- package/dist/index-react-bindings.browser.js.map +1 -1
- package/dist/index-react-bindings.node.cjs +33 -5
- package/dist/index-react-bindings.node.cjs.map +1 -1
- package/dist/index-react-bindings.node.js +33 -5
- package/dist/index-react-bindings.node.js.map +1 -1
- package/dist/index.browser.cjs +33 -5
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +33 -5
- package/dist/index.browser.js.map +1 -1
- package/dist/index.node.cjs +33 -5
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.js +33 -5
- package/dist/index.node.js.map +1 -1
- package/dist/src/Feed.d.ts +2 -0
- package/dist/src/FeedsClient.d.ts +1 -0
- package/dist/src/common/ApiClient.d.ts +1 -0
- package/dist/src/gen/models/index.d.ts +92 -15
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/Feed.ts +14 -3
- package/src/FeedsClient.ts +13 -0
- package/src/common/ApiClient.ts +10 -3
- package/src/gen/feeds/FeedsApi.ts +5 -0
- package/src/gen/models/index.ts +143 -17
package/dist/src/Feed.d.ts
CHANGED
|
@@ -60,6 +60,7 @@ export type FeedState = Omit<Partial<GetOrCreateFeedResponse & FeedResponse>, 'f
|
|
|
60
60
|
following_pagination?: LoadingStates & {
|
|
61
61
|
sort?: string;
|
|
62
62
|
};
|
|
63
|
+
last_get_or_create_request_config?: GetOrCreateFeedRequest;
|
|
63
64
|
};
|
|
64
65
|
export declare class Feed extends FeedApi {
|
|
65
66
|
readonly state: StateStore<FeedState>;
|
|
@@ -71,6 +72,7 @@ export declare class Feed extends FeedApi {
|
|
|
71
72
|
get fid(): string;
|
|
72
73
|
get currentState(): FeedState;
|
|
73
74
|
private handleCommentReactionEvent;
|
|
75
|
+
synchronize(): Promise<void>;
|
|
74
76
|
getOrCreate(request?: GetOrCreateFeedRequest): Promise<StreamResponse<GetOrCreateFeedResponse>>;
|
|
75
77
|
private handleBookmarkAdded;
|
|
76
78
|
private handleBookmarkDeleted;
|
|
@@ -19,6 +19,7 @@ export declare class FeedsClient extends FeedsApi {
|
|
|
19
19
|
private readonly eventDispatcher;
|
|
20
20
|
private readonly polls_by_id;
|
|
21
21
|
private activeFeeds;
|
|
22
|
+
private healthyConnectionChangedEventCount;
|
|
22
23
|
constructor(apiKey: string, options?: FeedsClientOptions);
|
|
23
24
|
pollFromState: (id: string) => StreamPoll | undefined;
|
|
24
25
|
hydratePollCache(activities: ActivityResponse[]): void;
|
|
@@ -7,6 +7,7 @@ export declare class ApiClient {
|
|
|
7
7
|
private readonly connectionIdManager;
|
|
8
8
|
readonly baseUrl: string;
|
|
9
9
|
private readonly axiosInstance;
|
|
10
|
+
private timeout;
|
|
10
11
|
constructor(apiKey: string, tokenManager: TokenManager, connectionIdManager: ConnectionIdManager, options?: FeedsClientOptions);
|
|
11
12
|
sendRequest: <T>(method: string, url: string, pathParams?: Record<string, string>, queryParams?: Record<string, any>, body?: any, requestContentType?: string) => Promise<{
|
|
12
13
|
body: T;
|
|
@@ -237,6 +237,7 @@ export interface ActivityResponse {
|
|
|
237
237
|
moderation?: ModerationV2Response;
|
|
238
238
|
parent?: ActivityResponse;
|
|
239
239
|
poll?: PollResponseData;
|
|
240
|
+
target?: Record<string, any>;
|
|
240
241
|
}
|
|
241
242
|
export interface ActivityUnpinnedEvent {
|
|
242
243
|
created_at: Date;
|
|
@@ -289,6 +290,7 @@ export interface AddBookmarkResponse {
|
|
|
289
290
|
}
|
|
290
291
|
export interface AddCommentReactionRequest {
|
|
291
292
|
type: string;
|
|
293
|
+
create_notification_activity?: boolean;
|
|
292
294
|
custom?: Record<string, any>;
|
|
293
295
|
}
|
|
294
296
|
export interface AddCommentReactionResponse {
|
|
@@ -300,6 +302,7 @@ export interface AddCommentRequest {
|
|
|
300
302
|
comment: string;
|
|
301
303
|
object_id: string;
|
|
302
304
|
object_type: string;
|
|
305
|
+
create_notification_activity?: boolean;
|
|
303
306
|
parent_id?: string;
|
|
304
307
|
attachments?: Attachment[];
|
|
305
308
|
mentioned_user_ids?: string[];
|
|
@@ -322,6 +325,7 @@ export interface AddFolderRequest {
|
|
|
322
325
|
}
|
|
323
326
|
export interface AddReactionRequest {
|
|
324
327
|
type: string;
|
|
328
|
+
create_notification_activity?: boolean;
|
|
325
329
|
custom?: Record<string, any>;
|
|
326
330
|
}
|
|
327
331
|
export interface AddReactionResponse {
|
|
@@ -451,6 +455,12 @@ export interface BanActionRequest {
|
|
|
451
455
|
shadow?: boolean;
|
|
452
456
|
timeout?: number;
|
|
453
457
|
}
|
|
458
|
+
export interface BanOptions {
|
|
459
|
+
duration: number;
|
|
460
|
+
ip_ban: boolean;
|
|
461
|
+
reason: string;
|
|
462
|
+
shadow_ban: boolean;
|
|
463
|
+
}
|
|
454
464
|
export interface BanRequest {
|
|
455
465
|
target_user_id: string;
|
|
456
466
|
banned_by_id?: string;
|
|
@@ -465,6 +475,9 @@ export interface BanRequest {
|
|
|
465
475
|
export interface BanResponse {
|
|
466
476
|
duration: string;
|
|
467
477
|
}
|
|
478
|
+
export interface BlockContentOptions {
|
|
479
|
+
reason: string;
|
|
480
|
+
}
|
|
468
481
|
export interface BlockListConfig {
|
|
469
482
|
enabled: boolean;
|
|
470
483
|
rules: BlockListRule[];
|
|
@@ -1080,6 +1093,7 @@ export interface ConfigResponse {
|
|
|
1080
1093
|
automod_semantic_filters_config?: AutomodSemanticFiltersConfig;
|
|
1081
1094
|
automod_toxicity_config?: AutomodToxicityConfig;
|
|
1082
1095
|
block_list_config?: BlockListConfig;
|
|
1096
|
+
rule_builder_config?: RuleBuilderConfig;
|
|
1083
1097
|
velocity_filter_config?: VelocityFilterConfig;
|
|
1084
1098
|
video_call_rule_config?: VideoCallRuleConfig;
|
|
1085
1099
|
}
|
|
@@ -1092,6 +1106,10 @@ export interface ConnectUserDetailsRequest {
|
|
|
1092
1106
|
custom?: Record<string, any>;
|
|
1093
1107
|
privacy_settings?: PrivacySettingsResponse;
|
|
1094
1108
|
}
|
|
1109
|
+
export interface ContentCountRuleParameters {
|
|
1110
|
+
threshold: number;
|
|
1111
|
+
time_window: string;
|
|
1112
|
+
}
|
|
1095
1113
|
export interface CreateBlockListRequest {
|
|
1096
1114
|
name: string;
|
|
1097
1115
|
words: string[];
|
|
@@ -1584,6 +1602,9 @@ export interface Flag {
|
|
|
1584
1602
|
review_queue_item?: ReviewQueueItem;
|
|
1585
1603
|
user?: User;
|
|
1586
1604
|
}
|
|
1605
|
+
export interface FlagContentOptions {
|
|
1606
|
+
reason: string;
|
|
1607
|
+
}
|
|
1587
1608
|
export interface FlagRequest {
|
|
1588
1609
|
entity_id: string;
|
|
1589
1610
|
entity_type: string;
|
|
@@ -1596,6 +1617,9 @@ export interface FlagResponse {
|
|
|
1596
1617
|
duration: string;
|
|
1597
1618
|
item_id: string;
|
|
1598
1619
|
}
|
|
1620
|
+
export interface FlagUserOptions {
|
|
1621
|
+
reason: string;
|
|
1622
|
+
}
|
|
1599
1623
|
export interface FollowBatchRequest {
|
|
1600
1624
|
follows: FollowRequest[];
|
|
1601
1625
|
}
|
|
@@ -1622,6 +1646,7 @@ export interface FollowDeletedEvent {
|
|
|
1622
1646
|
export interface FollowRequest {
|
|
1623
1647
|
source: string;
|
|
1624
1648
|
target: string;
|
|
1649
|
+
create_notification_activity?: boolean;
|
|
1625
1650
|
push_preference?: 'all' | 'none';
|
|
1626
1651
|
custom?: Record<string, any>;
|
|
1627
1652
|
}
|
|
@@ -1830,6 +1855,9 @@ export interface HealthCheckEvent {
|
|
|
1830
1855
|
received_at?: Date;
|
|
1831
1856
|
me?: OwnUserResponse;
|
|
1832
1857
|
}
|
|
1858
|
+
export interface ImageContentParameters {
|
|
1859
|
+
harm_labels?: string[];
|
|
1860
|
+
}
|
|
1833
1861
|
export interface ImageData {
|
|
1834
1862
|
frames: string;
|
|
1835
1863
|
height: string;
|
|
@@ -1837,6 +1865,11 @@ export interface ImageData {
|
|
|
1837
1865
|
url: string;
|
|
1838
1866
|
width: string;
|
|
1839
1867
|
}
|
|
1868
|
+
export interface ImageRuleParameters {
|
|
1869
|
+
threshold: number;
|
|
1870
|
+
time_window: string;
|
|
1871
|
+
harm_labels?: string[];
|
|
1872
|
+
}
|
|
1840
1873
|
export interface ImageSize {
|
|
1841
1874
|
crop?: 'top' | 'bottom' | 'left' | 'right' | 'center';
|
|
1842
1875
|
height?: number;
|
|
@@ -2716,29 +2749,43 @@ export interface RingSettingsResponse {
|
|
|
2716
2749
|
missed_call_timeout_ms: number;
|
|
2717
2750
|
}
|
|
2718
2751
|
export interface RuleBuilderAction {
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2752
|
+
type: string;
|
|
2753
|
+
ban_options?: BanOptions;
|
|
2754
|
+
flag_content_options?: FlagContentOptions;
|
|
2755
|
+
flag_user_options?: FlagUserOptions;
|
|
2756
|
+
remove_content_options?: BlockContentOptions;
|
|
2724
2757
|
}
|
|
2725
2758
|
export interface RuleBuilderCondition {
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2759
|
+
type: string;
|
|
2760
|
+
confidence?: number;
|
|
2761
|
+
content_count_rule_params?: ContentCountRuleParameters;
|
|
2762
|
+
image_content_params?: ImageContentParameters;
|
|
2763
|
+
image_rule_params?: ImageRuleParameters;
|
|
2764
|
+
text_content_params?: TextContentParameters;
|
|
2765
|
+
text_rule_params?: TextRuleParameters;
|
|
2766
|
+
user_created_within_params?: UserCreatedWithinParameters;
|
|
2767
|
+
user_rule_params?: UserRuleParameters;
|
|
2768
|
+
video_content_params?: VideoContentParameters;
|
|
2769
|
+
video_rule_params?: VideoRuleParameters;
|
|
2770
|
+
}
|
|
2771
|
+
export interface RuleBuilderConditionGroup {
|
|
2772
|
+
logic: string;
|
|
2773
|
+
conditions: RuleBuilderCondition[];
|
|
2730
2774
|
}
|
|
2731
2775
|
export interface RuleBuilderConfig {
|
|
2776
|
+
rules: RuleBuilderRule[];
|
|
2732
2777
|
async?: boolean;
|
|
2733
|
-
enabled?: boolean;
|
|
2734
|
-
rules?: RuleBuilderRule[];
|
|
2735
2778
|
}
|
|
2736
2779
|
export interface RuleBuilderRule {
|
|
2737
|
-
enabled
|
|
2738
|
-
id
|
|
2739
|
-
name
|
|
2780
|
+
enabled: boolean;
|
|
2781
|
+
id: string;
|
|
2782
|
+
name: string;
|
|
2783
|
+
rule_type: string;
|
|
2784
|
+
action: RuleBuilderAction;
|
|
2785
|
+
cooldown_period?: string;
|
|
2786
|
+
logic?: string;
|
|
2740
2787
|
conditions?: RuleBuilderCondition[];
|
|
2741
|
-
|
|
2788
|
+
groups?: RuleBuilderConditionGroup[];
|
|
2742
2789
|
}
|
|
2743
2790
|
export interface SFUIDLastSeen {
|
|
2744
2791
|
id: string;
|
|
@@ -2820,6 +2867,7 @@ export interface SharedLocationsResponse {
|
|
|
2820
2867
|
export interface SingleFollowRequest {
|
|
2821
2868
|
source: string;
|
|
2822
2869
|
target: string;
|
|
2870
|
+
create_notification_activity?: boolean;
|
|
2823
2871
|
push_preference?: 'all' | 'none';
|
|
2824
2872
|
custom?: Record<string, any>;
|
|
2825
2873
|
}
|
|
@@ -2856,6 +2904,20 @@ export interface TargetResolution {
|
|
|
2856
2904
|
height: number;
|
|
2857
2905
|
width: number;
|
|
2858
2906
|
}
|
|
2907
|
+
export interface TextContentParameters {
|
|
2908
|
+
contains_url?: boolean;
|
|
2909
|
+
severity?: string;
|
|
2910
|
+
blocklist_match?: string[];
|
|
2911
|
+
harm_labels?: string[];
|
|
2912
|
+
}
|
|
2913
|
+
export interface TextRuleParameters {
|
|
2914
|
+
threshold: number;
|
|
2915
|
+
time_window: string;
|
|
2916
|
+
contains_url?: boolean;
|
|
2917
|
+
severity?: string;
|
|
2918
|
+
blocklist_match?: string[];
|
|
2919
|
+
harm_labels?: string[];
|
|
2920
|
+
}
|
|
2859
2921
|
export interface ThreadedCommentResponse {
|
|
2860
2922
|
confidence_score: number;
|
|
2861
2923
|
created_at: Date;
|
|
@@ -3016,6 +3078,7 @@ export interface UpdateFeedResponse {
|
|
|
3016
3078
|
export interface UpdateFollowRequest {
|
|
3017
3079
|
source: string;
|
|
3018
3080
|
target: string;
|
|
3081
|
+
create_notification_activity?: boolean;
|
|
3019
3082
|
follower_role?: string;
|
|
3020
3083
|
push_preference?: 'all' | 'none';
|
|
3021
3084
|
custom?: Record<string, any>;
|
|
@@ -3131,6 +3194,9 @@ export interface UserBannedEvent {
|
|
|
3131
3194
|
team?: string;
|
|
3132
3195
|
user?: User;
|
|
3133
3196
|
}
|
|
3197
|
+
export interface UserCreatedWithinParameters {
|
|
3198
|
+
max_age?: string;
|
|
3199
|
+
}
|
|
3134
3200
|
export interface UserDeactivatedEvent {
|
|
3135
3201
|
created_at: Date;
|
|
3136
3202
|
created_by: User;
|
|
@@ -3231,6 +3297,9 @@ export interface UserResponsePrivacyFields {
|
|
|
3231
3297
|
privacy_settings?: PrivacySettingsResponse;
|
|
3232
3298
|
teams_role?: Record<string, string>;
|
|
3233
3299
|
}
|
|
3300
|
+
export interface UserRuleParameters {
|
|
3301
|
+
max_age?: string;
|
|
3302
|
+
}
|
|
3234
3303
|
export interface UserUpdatedEvent {
|
|
3235
3304
|
created_at: Date;
|
|
3236
3305
|
custom: Record<string, any>;
|
|
@@ -3266,6 +3335,9 @@ export interface VelocityFilterConfigRule {
|
|
|
3266
3335
|
export interface VideoCallRuleConfig {
|
|
3267
3336
|
rules: Record<string, HarmConfig>;
|
|
3268
3337
|
}
|
|
3338
|
+
export interface VideoContentParameters {
|
|
3339
|
+
harm_labels?: string[];
|
|
3340
|
+
}
|
|
3269
3341
|
export interface VideoEndCallRequest {
|
|
3270
3342
|
}
|
|
3271
3343
|
export interface VideoKickUserRequest {
|
|
@@ -3273,6 +3345,11 @@ export interface VideoKickUserRequest {
|
|
|
3273
3345
|
export interface VideoOrientation {
|
|
3274
3346
|
orientation?: number;
|
|
3275
3347
|
}
|
|
3348
|
+
export interface VideoRuleParameters {
|
|
3349
|
+
threshold: number;
|
|
3350
|
+
time_window: string;
|
|
3351
|
+
harm_labels?: string[];
|
|
3352
|
+
}
|
|
3276
3353
|
export interface VideoSettings {
|
|
3277
3354
|
access_request_enabled: boolean;
|
|
3278
3355
|
camera_default_on: boolean;
|