@stream-io/feeds-client 0.2.2 → 0.2.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 +8 -0
- package/dist/@react-bindings/contexts/StreamSearchContext.d.ts +1 -1
- package/dist/@react-bindings/contexts/StreamSearchResultsContext.d.ts +1 -1
- package/dist/@react-bindings/hooks/search-state-hooks/useSearchQuery.d.ts +1 -1
- package/dist/@react-bindings/hooks/search-state-hooks/useSearchResult.d.ts +1 -1
- package/dist/@react-bindings/hooks/search-state-hooks/useSearchSources.d.ts +2 -2
- package/dist/@react-bindings/wrappers/StreamSearch.d.ts +1 -1
- package/dist/@react-bindings/wrappers/StreamSearchResults.d.ts +1 -1
- package/dist/index-react-bindings.browser.cjs +26 -8
- package/dist/index-react-bindings.browser.cjs.map +1 -1
- package/dist/index-react-bindings.browser.js +26 -8
- package/dist/index-react-bindings.browser.js.map +1 -1
- package/dist/index-react-bindings.node.cjs +26 -8
- package/dist/index-react-bindings.node.cjs.map +1 -1
- package/dist/index-react-bindings.node.js +26 -8
- package/dist/index-react-bindings.node.js.map +1 -1
- package/dist/index.browser.cjs +242 -170
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +242 -171
- package/dist/index.browser.js.map +1 -1
- package/dist/index.d.ts +1 -5
- package/dist/index.node.cjs +242 -170
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.js +242 -171
- package/dist/index.node.js.map +1 -1
- package/dist/src/common/{ActivitySearchSource.d.ts → search/ActivitySearchSource.d.ts} +3 -3
- package/dist/src/common/{BaseSearchSource.d.ts → search/BaseSearchSource.d.ts} +41 -35
- package/dist/src/common/{FeedSearchSource.d.ts → search/FeedSearchSource.d.ts} +3 -3
- package/dist/src/common/{SearchController.d.ts → search/SearchController.d.ts} +1 -3
- package/dist/src/common/{UserSearchSource.d.ts → search/UserSearchSource.d.ts} +4 -4
- package/dist/src/common/search/index.d.ts +6 -0
- package/dist/src/common/search/types.d.ts +22 -0
- package/dist/src/common/types.d.ts +1 -0
- package/dist/src/feed/event-handlers/activity/handle-activity-deleted.d.ts +5 -12
- package/dist/src/gen/models/index.d.ts +58 -26
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/index.ts +1 -5
- package/package.json +1 -1
- package/src/common/{ActivitySearchSource.ts → search/ActivitySearchSource.ts} +3 -3
- package/src/common/{BaseSearchSource.ts → search/BaseSearchSource.ts} +137 -69
- package/src/common/{FeedSearchSource.ts → search/FeedSearchSource.ts} +3 -3
- package/src/common/{SearchController.ts → search/SearchController.ts} +2 -7
- package/src/common/{UserSearchSource.ts → search/UserSearchSource.ts} +3 -3
- package/src/common/search/index.ts +6 -0
- package/src/common/search/types.ts +21 -0
- package/src/common/types.ts +2 -0
- package/src/feed/event-handlers/activity/activity-utils.test.ts +2 -2
- package/src/feed/event-handlers/activity/handle-activity-added.test.ts +86 -0
- package/src/feed/event-handlers/activity/handle-activity-deleted.test.ts +117 -0
- package/src/feed/event-handlers/activity/handle-activity-deleted.ts +8 -4
- package/src/feed/event-handlers/feed-member/handle-feed-member-added.test.ts +75 -0
- package/src/feed/event-handlers/feed-member/handle-feed-member-removed.test.ts +82 -0
- package/src/feed/event-handlers/feed-member/handle-feed-member-removed.ts +19 -9
- package/src/feed/event-handlers/feed-member/handle-feed-member-updated.test.ts +84 -0
- package/src/gen/feeds/FeedsApi.ts +6 -0
- package/src/gen/model-decoders/decoders.ts +13 -1
- package/src/gen/models/index.ts +90 -34
- package/src/test-utils/response-generators.ts +107 -0
- package/dist/src/test-utils/index.d.ts +0 -1
- package/dist/src/test-utils/response-generators.d.ts +0 -74
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseSearchSource } from './BaseSearchSource';
|
|
2
|
-
import type { SearchSourceOptions } from './
|
|
3
|
-
import { FeedsClient } from '
|
|
4
|
-
import { ActivityResponse } from '
|
|
2
|
+
import type { SearchSourceOptions } from './types';
|
|
3
|
+
import { FeedsClient } from '../../feeds-client';
|
|
4
|
+
import { ActivityResponse } from '../../gen/models';
|
|
5
5
|
export declare class ActivitySearchSource extends BaseSearchSource<ActivityResponse> {
|
|
6
6
|
readonly type: "activity";
|
|
7
7
|
private readonly client;
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
import { StateStore } from '
|
|
2
|
-
import { type DebouncedFunc } from '
|
|
3
|
-
|
|
4
|
-
export type QueryReturnValue<T> = {
|
|
5
|
-
items: T[];
|
|
6
|
-
next?: string | null;
|
|
7
|
-
};
|
|
1
|
+
import { StateStore } from '../StateStore';
|
|
2
|
+
import { type DebouncedFunc } from '../utils';
|
|
3
|
+
import type { QueryReturnValue, SearchSourceOptions, SearchSourceState, SearchSourceType } from './types';
|
|
8
4
|
export type DebounceOptions = {
|
|
9
5
|
debounceMs: number;
|
|
10
6
|
};
|
|
11
7
|
type DebouncedExecQueryFunction = DebouncedFunc<(searchString?: string) => Promise<void>>;
|
|
12
|
-
|
|
8
|
+
interface ISearchSource<T = any> {
|
|
13
9
|
activate(): void;
|
|
14
|
-
cancelScheduledQuery(): void;
|
|
15
10
|
canExecuteQuery(newSearchString?: string): boolean;
|
|
16
11
|
deactivate(): void;
|
|
17
12
|
readonly hasNext: boolean;
|
|
@@ -24,34 +19,26 @@ export interface SearchSource<T = any> {
|
|
|
24
19
|
readonly next: string | undefined | null;
|
|
25
20
|
readonly offset: number | undefined;
|
|
26
21
|
resetState(): void;
|
|
27
|
-
search(text?: string): Promise<void> | undefined;
|
|
28
22
|
readonly searchQuery: string;
|
|
29
|
-
setDebounceOptions(options: DebounceOptions): void;
|
|
30
23
|
readonly state: StateStore<SearchSourceState<T>>;
|
|
31
24
|
readonly type: SearchSourceType;
|
|
32
25
|
}
|
|
33
|
-
export
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/** The number of milliseconds to debounce the search query. The default interval is 300ms. */
|
|
45
|
-
debounceMs?: number;
|
|
46
|
-
pageSize?: number;
|
|
47
|
-
allowEmptySearchString?: boolean;
|
|
48
|
-
};
|
|
49
|
-
export declare abstract class BaseSearchSource<T> implements SearchSource<T> {
|
|
26
|
+
export interface SearchSource<T = any> extends ISearchSource<T> {
|
|
27
|
+
cancelScheduledQuery(): void;
|
|
28
|
+
setDebounceOptions(options: DebounceOptions): void;
|
|
29
|
+
search(text?: string): Promise<void> | undefined;
|
|
30
|
+
}
|
|
31
|
+
export interface SearchSourceSync<T = any> extends ISearchSource<T> {
|
|
32
|
+
cancelScheduledQuery(): void;
|
|
33
|
+
setDebounceOptions(options: DebounceOptions): void;
|
|
34
|
+
search(text?: string): void;
|
|
35
|
+
}
|
|
36
|
+
declare abstract class BaseSearchSourceBase<T> implements ISearchSource<T> {
|
|
50
37
|
state: StateStore<SearchSourceState<T>>;
|
|
51
|
-
|
|
38
|
+
pageSize: number;
|
|
52
39
|
protected allowEmptySearchString: boolean;
|
|
40
|
+
protected resetOnNewSearchQuery: boolean;
|
|
53
41
|
abstract readonly type: SearchSourceType;
|
|
54
|
-
protected searchDebounced: DebouncedExecQueryFunction;
|
|
55
42
|
protected constructor(options?: SearchSourceOptions);
|
|
56
43
|
get lastQueryError(): Error | undefined;
|
|
57
44
|
get hasNext(): boolean;
|
|
@@ -72,18 +59,37 @@ export declare abstract class BaseSearchSource<T> implements SearchSource<T> {
|
|
|
72
59
|
get next(): string | null | undefined;
|
|
73
60
|
get offset(): number | undefined;
|
|
74
61
|
get searchQuery(): string;
|
|
75
|
-
protected abstract query(searchQuery: string): Promise<QueryReturnValue<T>>;
|
|
76
|
-
protected abstract filterQueryResults(items: T[]): T[] | Promise<T[]>;
|
|
77
|
-
setDebounceOptions: ({ debounceMs }: DebounceOptions) => void;
|
|
78
62
|
activate: () => void;
|
|
79
63
|
deactivate: () => void;
|
|
80
64
|
canExecuteQuery: (newSearchString?: string) => boolean;
|
|
81
65
|
protected getStateBeforeFirstQuery(newSearchString: string): SearchSourceState<T>;
|
|
82
66
|
protected getStateAfterQuery(stateUpdate: Partial<SearchSourceState<T>>, isFirstPage: boolean): SearchSourceState<T>;
|
|
67
|
+
protected prepareStateForQuery(newSearchString?: string): {
|
|
68
|
+
searchString: string;
|
|
69
|
+
hasNewSearchQuery: boolean;
|
|
70
|
+
};
|
|
71
|
+
protected updatePaginationStateFromQuery(result: QueryReturnValue<T>): Partial<SearchSourceState<T>>;
|
|
72
|
+
resetState(): void;
|
|
73
|
+
resetStateAndActivate(): void;
|
|
74
|
+
}
|
|
75
|
+
export declare abstract class BaseSearchSource<T> extends BaseSearchSourceBase<T> implements SearchSource<T> {
|
|
76
|
+
protected searchDebounced: DebouncedExecQueryFunction;
|
|
77
|
+
constructor(options?: SearchSourceOptions);
|
|
78
|
+
protected abstract query(searchQuery: string): Promise<QueryReturnValue<T>>;
|
|
79
|
+
protected abstract filterQueryResults(items: T[]): T[] | Promise<T[]>;
|
|
80
|
+
setDebounceOptions: ({ debounceMs }: DebounceOptions) => void;
|
|
83
81
|
executeQuery(newSearchString?: string): Promise<void>;
|
|
84
82
|
search: (searchQuery?: string) => Promise<void> | undefined;
|
|
85
83
|
cancelScheduledQuery(): void;
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
}
|
|
85
|
+
export declare abstract class BaseSearchSourceSync<T> extends BaseSearchSourceBase<T> implements SearchSourceSync<T> {
|
|
86
|
+
protected searchDebounced: DebouncedExecQueryFunction;
|
|
87
|
+
constructor(options?: SearchSourceOptions);
|
|
88
|
+
protected abstract query(searchQuery: string): QueryReturnValue<T>;
|
|
89
|
+
protected abstract filterQueryResults(items: T[]): T[];
|
|
90
|
+
setDebounceOptions: ({ debounceMs }: DebounceOptions) => void;
|
|
91
|
+
executeQuery(newSearchString?: string): void;
|
|
92
|
+
search: (searchQuery?: string) => Promise<void> | undefined;
|
|
93
|
+
cancelScheduledQuery(): void;
|
|
88
94
|
}
|
|
89
95
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseSearchSource } from './BaseSearchSource';
|
|
2
|
-
import type { SearchSourceOptions } from './
|
|
3
|
-
import { FeedsClient } from '
|
|
4
|
-
import { Feed } from '
|
|
2
|
+
import type { SearchSourceOptions } from './types';
|
|
3
|
+
import { FeedsClient } from '../../feeds-client';
|
|
4
|
+
import { Feed } from '../../feed';
|
|
5
5
|
export type FeedSearchSourceOptions = SearchSourceOptions & {
|
|
6
6
|
groupId?: string;
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StateStore } from '
|
|
1
|
+
import { StateStore } from '../StateStore';
|
|
2
2
|
import type { SearchSource } from './BaseSearchSource';
|
|
3
3
|
export type SearchControllerState = {
|
|
4
4
|
isActive: boolean;
|
|
@@ -17,8 +17,6 @@ export declare class SearchController {
|
|
|
17
17
|
/**
|
|
18
18
|
* Not intended for direct use by integrators, might be removed without notice resulting in
|
|
19
19
|
* broken integrations.
|
|
20
|
-
*
|
|
21
|
-
* @internal
|
|
22
20
|
*/
|
|
23
21
|
_internalState: StateStore<InternalSearchControllerState>;
|
|
24
22
|
state: StateStore<SearchControllerState>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseSearchSource } from './BaseSearchSource';
|
|
2
|
-
import type { SearchSourceOptions } from './
|
|
3
|
-
import { FeedsClient } from '
|
|
4
|
-
import { UserResponse } from '
|
|
2
|
+
import type { SearchSourceOptions } from './types';
|
|
3
|
+
import { FeedsClient } from '../../feeds-client';
|
|
4
|
+
import { UserResponse } from '../../gen/models';
|
|
5
5
|
export declare class UserSearchSource extends BaseSearchSource<UserResponse> {
|
|
6
6
|
readonly type: "user";
|
|
7
7
|
private readonly client;
|
|
@@ -10,7 +10,7 @@ export declare class UserSearchSource extends BaseSearchSource<UserResponse> {
|
|
|
10
10
|
items: never[];
|
|
11
11
|
next?: undefined;
|
|
12
12
|
} | {
|
|
13
|
-
items: import("
|
|
13
|
+
items: import("../../gen/models").FullUserResponse[];
|
|
14
14
|
next: undefined;
|
|
15
15
|
}>;
|
|
16
16
|
protected filterQueryResults(items: UserResponse[]): UserResponse[];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type SearchSourceState<T = any> = {
|
|
2
|
+
hasNext: boolean;
|
|
3
|
+
isActive: boolean;
|
|
4
|
+
isLoading: boolean;
|
|
5
|
+
items: T[] | undefined;
|
|
6
|
+
searchQuery: string;
|
|
7
|
+
lastQueryError?: Error;
|
|
8
|
+
next?: string | null;
|
|
9
|
+
offset?: number;
|
|
10
|
+
};
|
|
11
|
+
export type SearchSourceOptions = {
|
|
12
|
+
/** The number of milliseconds to debounce the search query. The default interval is 300ms. */
|
|
13
|
+
debounceMs?: number;
|
|
14
|
+
pageSize?: number;
|
|
15
|
+
allowEmptySearchString?: boolean;
|
|
16
|
+
resetOnNewSearchQuery?: boolean;
|
|
17
|
+
};
|
|
18
|
+
export type SearchSourceType = 'activity' | 'user' | 'feed' | (string & {});
|
|
19
|
+
export type QueryReturnValue<T> = {
|
|
20
|
+
items: T[];
|
|
21
|
+
next?: string | null;
|
|
22
|
+
};
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
import type { Feed } from '../../../feed';
|
|
2
2
|
import type { ActivityPinResponse, ActivityResponse } from '../../../gen/models';
|
|
3
|
-
import type { EventPayload } from '../../../types-internal';
|
|
4
|
-
export declare const removeActivityFromState: (activityResponse: ActivityResponse, activities: ActivityResponse[] | undefined) => {
|
|
5
|
-
changed: boolean;
|
|
3
|
+
import type { EventPayload, UpdateStateResult } from '../../../types-internal';
|
|
4
|
+
export declare const removeActivityFromState: (activityResponse: ActivityResponse, activities: ActivityResponse[] | undefined) => UpdateStateResult<{
|
|
6
5
|
activities: ActivityResponse[] | undefined;
|
|
7
|
-
}
|
|
8
|
-
export declare const removePinnedActivityFromState: (activityResponse: ActivityResponse, pinnedActivities: ActivityPinResponse[] | undefined) => {
|
|
9
|
-
changed: boolean;
|
|
10
|
-
activities: ActivityPinResponse[];
|
|
11
|
-
pinned_activities?: undefined;
|
|
12
|
-
} | {
|
|
13
|
-
changed: boolean;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const removePinnedActivityFromState: (activityResponse: ActivityResponse, pinnedActivities: ActivityPinResponse[] | undefined) => UpdateStateResult<{
|
|
14
8
|
pinned_activities: ActivityPinResponse[] | undefined;
|
|
15
|
-
|
|
16
|
-
};
|
|
9
|
+
}>;
|
|
17
10
|
export declare function handleActivityDeleted(this: Feed, event: EventPayload<'feeds.activity.deleted'>): void;
|
|
@@ -326,6 +326,7 @@ export interface AddBookmarkResponse {
|
|
|
326
326
|
export interface AddCommentReactionRequest {
|
|
327
327
|
type: string;
|
|
328
328
|
create_notification_activity?: boolean;
|
|
329
|
+
skip_push?: boolean;
|
|
329
330
|
custom?: Record<string, any>;
|
|
330
331
|
}
|
|
331
332
|
export interface AddCommentReactionResponse {
|
|
@@ -339,6 +340,7 @@ export interface AddCommentRequest {
|
|
|
339
340
|
object_type: string;
|
|
340
341
|
create_notification_activity?: boolean;
|
|
341
342
|
parent_id?: string;
|
|
343
|
+
skip_push?: boolean;
|
|
342
344
|
attachments?: Attachment[];
|
|
343
345
|
mentioned_user_ids?: string[];
|
|
344
346
|
custom?: Record<string, any>;
|
|
@@ -361,6 +363,7 @@ export interface AddFolderRequest {
|
|
|
361
363
|
export interface AddReactionRequest {
|
|
362
364
|
type: string;
|
|
363
365
|
create_notification_activity?: boolean;
|
|
366
|
+
skip_push?: boolean;
|
|
364
367
|
custom?: Record<string, any>;
|
|
365
368
|
}
|
|
366
369
|
export interface AddReactionResponse {
|
|
@@ -495,10 +498,10 @@ export interface BanActionRequest {
|
|
|
495
498
|
timeout?: number;
|
|
496
499
|
}
|
|
497
500
|
export interface BanOptions {
|
|
498
|
-
duration
|
|
499
|
-
ip_ban
|
|
500
|
-
reason
|
|
501
|
-
shadow_ban
|
|
501
|
+
duration?: number;
|
|
502
|
+
ip_ban?: boolean;
|
|
503
|
+
reason?: string;
|
|
504
|
+
shadow_ban?: boolean;
|
|
502
505
|
}
|
|
503
506
|
export interface BanRequest {
|
|
504
507
|
target_user_id: string;
|
|
@@ -515,7 +518,7 @@ export interface BanResponse {
|
|
|
515
518
|
duration: string;
|
|
516
519
|
}
|
|
517
520
|
export interface BlockContentOptions {
|
|
518
|
-
reason
|
|
521
|
+
reason?: string;
|
|
519
522
|
}
|
|
520
523
|
export interface BlockListConfig {
|
|
521
524
|
enabled: boolean;
|
|
@@ -944,6 +947,9 @@ export interface ChannelMember {
|
|
|
944
947
|
deleted_messages?: string[];
|
|
945
948
|
user?: UserResponse;
|
|
946
949
|
}
|
|
950
|
+
export interface ChannelMemberResponse {
|
|
951
|
+
channel_role: string;
|
|
952
|
+
}
|
|
947
953
|
export interface ChannelMute {
|
|
948
954
|
created_at: Date;
|
|
949
955
|
updated_at: Date;
|
|
@@ -1030,6 +1036,7 @@ export interface Command {
|
|
|
1030
1036
|
export interface CommentAddedEvent {
|
|
1031
1037
|
created_at: Date;
|
|
1032
1038
|
fid: string;
|
|
1039
|
+
activity: ActivityResponse;
|
|
1033
1040
|
comment: CommentResponse;
|
|
1034
1041
|
custom: Record<string, any>;
|
|
1035
1042
|
type: string;
|
|
@@ -1050,6 +1057,7 @@ export interface CommentDeletedEvent {
|
|
|
1050
1057
|
export interface CommentReactionAddedEvent {
|
|
1051
1058
|
created_at: Date;
|
|
1052
1059
|
fid: string;
|
|
1060
|
+
activity: ActivityResponse;
|
|
1053
1061
|
comment: CommentResponse;
|
|
1054
1062
|
custom: Record<string, any>;
|
|
1055
1063
|
reaction: FeedsReactionResponse;
|
|
@@ -1071,6 +1079,7 @@ export interface CommentReactionDeletedEvent {
|
|
|
1071
1079
|
export interface CommentReactionUpdatedEvent {
|
|
1072
1080
|
created_at: Date;
|
|
1073
1081
|
fid: string;
|
|
1082
|
+
activity: ActivityResponse;
|
|
1074
1083
|
comment: CommentResponse;
|
|
1075
1084
|
custom: Record<string, any>;
|
|
1076
1085
|
reaction: FeedsReactionResponse;
|
|
@@ -1149,7 +1158,6 @@ export interface ConfigResponse {
|
|
|
1149
1158
|
automod_toxicity_config?: AutomodToxicityConfig;
|
|
1150
1159
|
block_list_config?: BlockListConfig;
|
|
1151
1160
|
llm_config?: LLMConfig;
|
|
1152
|
-
rule_builder_config?: RuleBuilderConfig;
|
|
1153
1161
|
velocity_filter_config?: VelocityFilterConfig;
|
|
1154
1162
|
video_call_rule_config?: VideoCallRuleConfig;
|
|
1155
1163
|
}
|
|
@@ -1163,8 +1171,8 @@ export interface ConnectUserDetailsRequest {
|
|
|
1163
1171
|
privacy_settings?: PrivacySettingsResponse;
|
|
1164
1172
|
}
|
|
1165
1173
|
export interface ContentCountRuleParameters {
|
|
1166
|
-
threshold
|
|
1167
|
-
time_window
|
|
1174
|
+
threshold?: number;
|
|
1175
|
+
time_window?: string;
|
|
1168
1176
|
}
|
|
1169
1177
|
export interface CreateBlockListRequest {
|
|
1170
1178
|
name: string;
|
|
@@ -1484,6 +1492,7 @@ export interface FeedGroup {
|
|
|
1484
1492
|
last_feed_get_at?: Date;
|
|
1485
1493
|
aggregation?: AggregationConfig;
|
|
1486
1494
|
notification?: NotificationConfig;
|
|
1495
|
+
push_notification?: PushNotificationConfig;
|
|
1487
1496
|
ranking?: RankingConfig;
|
|
1488
1497
|
stories?: StoriesConfig;
|
|
1489
1498
|
}
|
|
@@ -1635,6 +1644,12 @@ export interface FeedUpdatedEvent {
|
|
|
1635
1644
|
received_at?: Date;
|
|
1636
1645
|
user?: UserResponseCommonFields;
|
|
1637
1646
|
}
|
|
1647
|
+
export interface FeedsEventPreferences {
|
|
1648
|
+
comments?: string;
|
|
1649
|
+
mentions?: string;
|
|
1650
|
+
new_followers?: string;
|
|
1651
|
+
reactions?: string;
|
|
1652
|
+
}
|
|
1638
1653
|
export interface FeedsReactionResponse {
|
|
1639
1654
|
activity_id: string;
|
|
1640
1655
|
created_at: Date;
|
|
@@ -1684,7 +1699,7 @@ export interface Flag {
|
|
|
1684
1699
|
user?: User;
|
|
1685
1700
|
}
|
|
1686
1701
|
export interface FlagContentOptions {
|
|
1687
|
-
reason
|
|
1702
|
+
reason?: string;
|
|
1688
1703
|
}
|
|
1689
1704
|
export interface FlagRequest {
|
|
1690
1705
|
entity_id: string;
|
|
@@ -1699,7 +1714,7 @@ export interface FlagResponse {
|
|
|
1699
1714
|
item_id: string;
|
|
1700
1715
|
}
|
|
1701
1716
|
export interface FlagUserOptions {
|
|
1702
|
-
reason
|
|
1717
|
+
reason?: string;
|
|
1703
1718
|
}
|
|
1704
1719
|
export interface FollowBatchRequest {
|
|
1705
1720
|
follows: FollowRequest[];
|
|
@@ -1731,6 +1746,7 @@ export interface FollowRequest {
|
|
|
1731
1746
|
target: string;
|
|
1732
1747
|
create_notification_activity?: boolean;
|
|
1733
1748
|
push_preference?: 'all' | 'none';
|
|
1749
|
+
skip_push?: boolean;
|
|
1734
1750
|
custom?: Record<string, any>;
|
|
1735
1751
|
}
|
|
1736
1752
|
export interface FollowResponse {
|
|
@@ -1951,8 +1967,8 @@ export interface ImageData {
|
|
|
1951
1967
|
width: string;
|
|
1952
1968
|
}
|
|
1953
1969
|
export interface ImageRuleParameters {
|
|
1954
|
-
threshold
|
|
1955
|
-
time_window
|
|
1970
|
+
threshold?: number;
|
|
1971
|
+
time_window?: string;
|
|
1956
1972
|
harm_labels?: string[];
|
|
1957
1973
|
}
|
|
1958
1974
|
export interface ImageSize {
|
|
@@ -2024,6 +2040,7 @@ export interface IngressVideoLayerResponse {
|
|
|
2024
2040
|
export interface LLMConfig {
|
|
2025
2041
|
enabled: boolean;
|
|
2026
2042
|
rules: LLMRule[];
|
|
2043
|
+
app_context?: string;
|
|
2027
2044
|
async?: boolean;
|
|
2028
2045
|
severity_descriptions?: Record<string, string>;
|
|
2029
2046
|
}
|
|
@@ -2125,6 +2142,7 @@ export interface Message {
|
|
|
2125
2142
|
thread_participants?: User[];
|
|
2126
2143
|
i18n?: Record<string, string>;
|
|
2127
2144
|
image_labels?: Record<string, string[]>;
|
|
2145
|
+
member?: ChannelMember;
|
|
2128
2146
|
moderation?: ModerationV2Response;
|
|
2129
2147
|
pinned_by?: User;
|
|
2130
2148
|
poll?: Poll;
|
|
@@ -2182,6 +2200,7 @@ export interface MessageResponse {
|
|
|
2182
2200
|
draft?: DraftResponse;
|
|
2183
2201
|
i18n?: Record<string, string>;
|
|
2184
2202
|
image_labels?: Record<string, string[]>;
|
|
2203
|
+
member?: ChannelMemberResponse;
|
|
2185
2204
|
moderation?: ModerationV2Response;
|
|
2186
2205
|
pinned_by?: UserResponse;
|
|
2187
2206
|
poll?: PollResponseData;
|
|
@@ -2206,11 +2225,11 @@ export interface ModerationCustomActionEvent {
|
|
|
2206
2225
|
user?: User;
|
|
2207
2226
|
}
|
|
2208
2227
|
export interface ModerationFlagResponse {
|
|
2209
|
-
created_at:
|
|
2228
|
+
created_at: Date;
|
|
2210
2229
|
entity_id: string;
|
|
2211
2230
|
entity_type: string;
|
|
2212
2231
|
type: string;
|
|
2213
|
-
updated_at:
|
|
2232
|
+
updated_at: Date;
|
|
2214
2233
|
user_id: string;
|
|
2215
2234
|
result: Array<Record<string, any>>;
|
|
2216
2235
|
entity_creator_id?: string;
|
|
@@ -2554,10 +2573,16 @@ export interface PrivacySettingsResponse {
|
|
|
2554
2573
|
read_receipts?: ReadReceiptsResponse;
|
|
2555
2574
|
typing_indicators?: TypingIndicatorsResponse;
|
|
2556
2575
|
}
|
|
2576
|
+
export interface PushNotificationConfig {
|
|
2577
|
+
enabled?: boolean;
|
|
2578
|
+
activity_types?: string[];
|
|
2579
|
+
}
|
|
2557
2580
|
export interface PushPreferences {
|
|
2558
2581
|
call_level?: string;
|
|
2559
2582
|
chat_level?: string;
|
|
2560
2583
|
disabled_until?: Date;
|
|
2584
|
+
feeds_level?: string;
|
|
2585
|
+
feeds_events?: FeedsEventPreferences;
|
|
2561
2586
|
}
|
|
2562
2587
|
export interface Quality {
|
|
2563
2588
|
bitdepth?: number;
|
|
@@ -2947,40 +2972,39 @@ export interface RingSettingsResponse {
|
|
|
2947
2972
|
missed_call_timeout_ms: number;
|
|
2948
2973
|
}
|
|
2949
2974
|
export interface RuleBuilderAction {
|
|
2950
|
-
type
|
|
2975
|
+
type?: string;
|
|
2951
2976
|
ban_options?: BanOptions;
|
|
2952
2977
|
flag_content_options?: FlagContentOptions;
|
|
2953
2978
|
flag_user_options?: FlagUserOptions;
|
|
2954
2979
|
remove_content_options?: BlockContentOptions;
|
|
2955
2980
|
}
|
|
2956
2981
|
export interface RuleBuilderCondition {
|
|
2957
|
-
type: string;
|
|
2958
2982
|
confidence?: number;
|
|
2983
|
+
type?: string;
|
|
2959
2984
|
content_count_rule_params?: ContentCountRuleParameters;
|
|
2960
2985
|
image_content_params?: ImageContentParameters;
|
|
2961
2986
|
image_rule_params?: ImageRuleParameters;
|
|
2962
2987
|
text_content_params?: TextContentParameters;
|
|
2963
2988
|
text_rule_params?: TextRuleParameters;
|
|
2964
2989
|
user_created_within_params?: UserCreatedWithinParameters;
|
|
2990
|
+
user_custom_property_params?: UserCustomPropertyParameters;
|
|
2965
2991
|
user_rule_params?: UserRuleParameters;
|
|
2966
2992
|
video_content_params?: VideoContentParameters;
|
|
2967
2993
|
video_rule_params?: VideoRuleParameters;
|
|
2968
2994
|
}
|
|
2969
2995
|
export interface RuleBuilderConditionGroup {
|
|
2970
|
-
logic
|
|
2971
|
-
conditions
|
|
2996
|
+
logic?: string;
|
|
2997
|
+
conditions?: RuleBuilderCondition[];
|
|
2972
2998
|
}
|
|
2973
2999
|
export interface RuleBuilderConfig {
|
|
2974
|
-
rules: RuleBuilderRule[];
|
|
2975
3000
|
async?: boolean;
|
|
3001
|
+
rules?: RuleBuilderRule[];
|
|
2976
3002
|
}
|
|
2977
3003
|
export interface RuleBuilderRule {
|
|
2978
|
-
enabled: boolean;
|
|
2979
|
-
id: string;
|
|
2980
|
-
name: string;
|
|
2981
3004
|
rule_type: string;
|
|
2982
3005
|
action: RuleBuilderAction;
|
|
2983
3006
|
cooldown_period?: string;
|
|
3007
|
+
id?: string;
|
|
2984
3008
|
logic?: string;
|
|
2985
3009
|
conditions?: RuleBuilderCondition[];
|
|
2986
3010
|
groups?: RuleBuilderConditionGroup[];
|
|
@@ -3104,14 +3128,16 @@ export interface TextContentParameters {
|
|
|
3104
3128
|
severity?: string;
|
|
3105
3129
|
blocklist_match?: string[];
|
|
3106
3130
|
harm_labels?: string[];
|
|
3131
|
+
llm_harm_labels?: Record<string, string>;
|
|
3107
3132
|
}
|
|
3108
3133
|
export interface TextRuleParameters {
|
|
3109
|
-
threshold: number;
|
|
3110
|
-
time_window: string;
|
|
3111
3134
|
contains_url?: boolean;
|
|
3112
3135
|
severity?: string;
|
|
3136
|
+
threshold?: number;
|
|
3137
|
+
time_window?: string;
|
|
3113
3138
|
blocklist_match?: string[];
|
|
3114
3139
|
harm_labels?: string[];
|
|
3140
|
+
llm_harm_labels?: Record<string, string>;
|
|
3115
3141
|
}
|
|
3116
3142
|
export interface ThreadedCommentResponse {
|
|
3117
3143
|
confidence_score: number;
|
|
@@ -3244,6 +3270,7 @@ export interface UpdateBookmarkResponse {
|
|
|
3244
3270
|
}
|
|
3245
3271
|
export interface UpdateCommentRequest {
|
|
3246
3272
|
comment?: string;
|
|
3273
|
+
skip_push?: boolean;
|
|
3247
3274
|
custom?: Record<string, any>;
|
|
3248
3275
|
}
|
|
3249
3276
|
export interface UpdateCommentResponse {
|
|
@@ -3276,6 +3303,7 @@ export interface UpdateFollowRequest {
|
|
|
3276
3303
|
create_notification_activity?: boolean;
|
|
3277
3304
|
follower_role?: string;
|
|
3278
3305
|
push_preference?: 'all' | 'none';
|
|
3306
|
+
skip_push?: boolean;
|
|
3279
3307
|
custom?: Record<string, any>;
|
|
3280
3308
|
}
|
|
3281
3309
|
export interface UpdateFollowResponse {
|
|
@@ -3393,6 +3421,10 @@ export interface UserBannedEvent {
|
|
|
3393
3421
|
export interface UserCreatedWithinParameters {
|
|
3394
3422
|
max_age?: string;
|
|
3395
3423
|
}
|
|
3424
|
+
export interface UserCustomPropertyParameters {
|
|
3425
|
+
operator?: string;
|
|
3426
|
+
property_key?: string;
|
|
3427
|
+
}
|
|
3396
3428
|
export interface UserDeactivatedEvent {
|
|
3397
3429
|
created_at: Date;
|
|
3398
3430
|
created_by: User;
|
|
@@ -3545,8 +3577,8 @@ export interface VideoOrientation {
|
|
|
3545
3577
|
orientation?: number;
|
|
3546
3578
|
}
|
|
3547
3579
|
export interface VideoRuleParameters {
|
|
3548
|
-
threshold
|
|
3549
|
-
time_window
|
|
3580
|
+
threshold?: number;
|
|
3581
|
+
time_window?: string;
|
|
3550
3582
|
harm_labels?: string[];
|
|
3551
3583
|
}
|
|
3552
3584
|
export interface VideoSettings {
|