From cd17df2151fc0cccf61b8330188d4d7bb415165e Mon Sep 17 00:00:00 2001 From: Jimmy Pettersson Date: Tue, 29 Sep 2026 11:11:36 +0200 Subject: [PATCH 1/3] chore: regenerate from the current chat OpenAPI spec Picks up API changes already on chat master before adding FEEDS-1965 fields in the next commit. No hand edits. Co-Authored-By: Claude Opus 5.5 --- src/gen/chat/ChatApi.ts | 2 + src/gen/feeds/FeedsApi.ts | 95 ++++++++- src/gen/model-decoders/decoders.ts | 29 +++ src/gen/models/index.ts | 289 +++++++++++++++++++++++++++- src/gen/moderation/ModerationApi.ts | 1 + 5 files changed, 407 insertions(+), 9 deletions(-) diff --git a/src/gen/chat/ChatApi.ts b/src/gen/chat/ChatApi.ts index c7b0dee..b05c63d 100644 --- a/src/gen/chat/ChatApi.ts +++ b/src/gen/chat/ChatApi.ts @@ -2013,6 +2013,7 @@ export class ChatApi { message_id: request?.message_id, }; const body = { + expires_at: request?.expires_at, remind_at: request?.remind_at, user_id: request?.user_id, user: request?.user, @@ -2041,6 +2042,7 @@ export class ChatApi { message_id: request?.message_id, }; const body = { + expires_at: request?.expires_at, remind_at: request?.remind_at, user_id: request?.user_id, user: request?.user, diff --git a/src/gen/feeds/FeedsApi.ts b/src/gen/feeds/FeedsApi.ts index 1ed2c37..f31f1bb 100644 --- a/src/gen/feeds/FeedsApi.ts +++ b/src/gen/feeds/FeedsApi.ts @@ -54,6 +54,8 @@ import { DeleteFeedViewResponse, DeleteFeedsBatchRequest, DeleteFeedsBatchResponse, + DeleteFeedsRetentionPolicyRequest, + DeleteFeedsRetentionPolicyResponse, DeleteUserInterestsResponse, ExportFeedUserDataResponse, FollowBatchRequest, @@ -68,6 +70,9 @@ import { GetFeedViewResponse, GetFeedVisibilityResponse, GetFeedsRateLimitsResponse, + GetFeedsRetentionPolicyResponse, + GetFeedsRetentionPolicyRunsRequest, + GetFeedsRetentionPolicyRunsResponse, GetFollowSuggestionsResponse, GetOrCreateFeedGroupRequest, GetOrCreateFeedGroupResponse, @@ -128,6 +133,8 @@ import { RestoreCommentRequest, RestoreCommentResponse, RestoreFeedGroupResponse, + SetFeedsRetentionPolicyRequest, + SetFeedsRetentionPolicyResponse, SingleFollowResponse, TrackActivityMetricsRequest, TrackActivityMetricsResponse, @@ -1257,7 +1264,6 @@ export class FeedsApi { const body = { filter: request?.filter, id_around: request?.id_around, - include_soft_deleted_comments: request?.include_soft_deleted_comments, limit: request?.limit, next: request?.next, prev: request?.prev, @@ -3027,6 +3033,93 @@ export class FeedsApi { return { ...response.body, metadata: response.metadata }; } + async feedsGetRetentionPolicy(): Promise< + StreamResponse + > { + const response = await this.apiClient.sendRequest< + StreamResponse + >('GET', '/api/v2/feeds/retention_policy', undefined, undefined); + + decoders['GetFeedsRetentionPolicyResponse']?.(response.body); + + return { ...response.body, metadata: response.metadata }; + } + + async feedsSetRetentionPolicy( + request: SetFeedsRetentionPolicyRequest, + ): Promise> { + const body = { + max_age_hours: request?.max_age_hours, + policy: request?.policy, + enabled: request?.enabled, + }; + + const response = await this.apiClient.sendRequest< + StreamResponse + >( + 'POST', + '/api/v2/feeds/retention_policy', + undefined, + undefined, + body, + 'application/json', + ); + + decoders['SetFeedsRetentionPolicyResponse']?.(response.body); + + return { ...response.body, metadata: response.metadata }; + } + + async feedsDeleteRetentionPolicy( + request: DeleteFeedsRetentionPolicyRequest, + ): Promise> { + const body = { + policy: request?.policy, + }; + + const response = await this.apiClient.sendRequest< + StreamResponse + >( + 'POST', + '/api/v2/feeds/retention_policy/delete', + undefined, + undefined, + body, + 'application/json', + ); + + decoders['DeleteFeedsRetentionPolicyResponse']?.(response.body); + + return { ...response.body, metadata: response.metadata }; + } + + async feedsGetRetentionPolicyRuns( + request?: GetFeedsRetentionPolicyRunsRequest, + ): Promise> { + const body = { + limit: request?.limit, + next: request?.next, + prev: request?.prev, + sort: request?.sort, + filter_conditions: request?.filter_conditions, + }; + + const response = await this.apiClient.sendRequest< + StreamResponse + >( + 'POST', + '/api/v2/feeds/retention_policy/runs', + undefined, + undefined, + body, + 'application/json', + ); + + decoders['GetFeedsRetentionPolicyRunsResponse']?.(response.body); + + return { ...response.body, metadata: response.metadata }; + } + async queryRevisionHistory( request: QueryRevisionHistoryRequest, ): Promise> { diff --git a/src/gen/model-decoders/decoders.ts b/src/gen/model-decoders/decoders.ts index 706046b..77a356c 100644 --- a/src/gen/model-decoders/decoders.ts +++ b/src/gen/model-decoders/decoders.ts @@ -3023,6 +3023,15 @@ decoders['GetFeedViewResponse'] = (input?: { [key: string]: any }) => { return decode(typeMappings, input); }; +decoders['GetFeedsRetentionPolicyResponse'] = (input?: { + [key: string]: any; +}) => { + const typeMappings: TypeMapping = { + policies: { type: 'RetentionPolicy', isSingle: false }, + }; + return decode(typeMappings, input); +}; + decoders['GetFollowSuggestionsResponse'] = (input?: { [key: string]: any }) => { const typeMappings: TypeMapping = { suggestions: { type: 'FeedSuggestionResponse', isSingle: false }, @@ -3283,6 +3292,15 @@ decoders['IngressStoppedEvent'] = (input?: { [key: string]: any }) => { return decode(typeMappings, input); }; +decoders['IntentDetectedEvent'] = (input?: { [key: string]: any }) => { + const typeMappings: TypeMapping = { + created_at: { type: 'DatetimeType', isSingle: true }, + + received_at: { type: 'DatetimeType', isSingle: true }, + }; + return decode(typeMappings, input); +}; + decoders['KickedUserEvent'] = (input?: { [key: string]: any }) => { const typeMappings: TypeMapping = { created_at: { type: 'DatetimeType', isSingle: true }, @@ -4879,6 +4897,8 @@ decoders['ReminderResponseData'] = (input?: { [key: string]: any }) => { updated_at: { type: 'DatetimeType', isSingle: true }, + expires_at: { type: 'DatetimeType', isSingle: true }, + remind_at: { type: 'DatetimeType', isSingle: true }, channel: { type: 'ChannelResponse', isSingle: true }, @@ -5190,6 +5210,15 @@ decoders['SessionWarningResponse'] = (input?: { [key: string]: any }) => { return decode(typeMappings, input); }; +decoders['SetFeedsRetentionPolicyResponse'] = (input?: { + [key: string]: any; +}) => { + const typeMappings: TypeMapping = { + policy: { type: 'RetentionPolicy', isSingle: true }, + }; + return decode(typeMappings, input); +}; + decoders['SetRetentionPolicyResponse'] = (input?: { [key: string]: any }) => { const typeMappings: TypeMapping = { policy: { type: 'RetentionPolicy', isSingle: true }, diff --git a/src/gen/models/index.ts b/src/gen/models/index.ts index 9ce501d..6f0d1f0 100644 --- a/src/gen/models/index.ts +++ b/src/gen/models/index.ts @@ -882,6 +882,10 @@ export interface ActivitySelectorConfig { * Minimum popularity threshold. For the 'popular' selector, omit to use the default (5); values below 1 are rejected */ min_popularity?: number; + /** + * Maximum number of candidate activities this selector contributes to a ranked feed (1-1000). Omit to use the default ranking buffer. Only supported on the popular, proximity, interest and query selectors, and ignored on feeds without ranking + */ + ranking_candidate_limit?: number; /** * Sort parameters for activity selection */ @@ -918,6 +922,10 @@ export interface ActivitySelectorConfigResponse { * Minimum popularity threshold. For the 'popular' selector, values below 1 are normalized to the default (5) at read time. */ min_popularity?: number; + /** + * Maximum number of candidate activities this selector contributes to a ranked feed + */ + ranking_candidate_limit?: number; /** * Sort parameters for activity selection */ @@ -2646,7 +2654,8 @@ export interface BulkActionAppealsRequest { */ unban?: UnbanActionRequestPayload; /** - * Deprecated: use restore instead — it now also reverses a block or shadow block. Configuration for unblock action. + * @deprecated + * Deprecated: Use restore instead, which now also reverses a block or shadow block. Configuration for unblock action. */ unblock?: UnblockActionRequestPayload; /** @@ -4234,6 +4243,9 @@ export interface ChannelConfig { blocklist_behavior?: 'flag' | 'block' | 'shadow_block'; partition_size?: number; partition_ttl?: string; + /** + * Sets the push notification level for a channel type + */ push_level?: 'all' | 'all_mentions' | 'mentions' | 'direct_mentions' | 'none'; allowed_flag_reasons?: Array; blocklists?: Array; @@ -4332,6 +4344,9 @@ export interface ChannelConfigWithInfo { blocklist_behavior?: 'flag' | 'block' | 'shadow_block'; partition_size?: number; partition_ttl?: string; + /** + * Sets the push notification level for a channel type + */ push_level?: 'all' | 'all_mentions' | 'mentions' | 'direct_mentions' | 'none'; allowed_flag_reasons?: Array; blocklists?: Array; @@ -5095,6 +5110,9 @@ export interface ChannelTypeConfig { blocklist_behavior?: 'flag' | 'block' | 'shadow_block'; partition_size?: number; partition_ttl?: string; + /** + * Sets the push notification level for a channel type + */ push_level?: 'all' | 'all_mentions' | 'mentions' | 'direct_mentions' | 'none'; allowed_flag_reasons?: Array; blocklists?: Array; @@ -5553,6 +5571,22 @@ export interface CheckResponse { * Status of the moderation check (completed or pending) */ status: string; + /** + * Intent topic label matched by this request's text (test mode only; omitted when no topic matched) + */ + intent_matched_topic?: string; + /** + * Stage 2 conversation score (0-100) computed synchronously against this request's texts (test mode only). Omitted -- not zero -- when intent_matched_topic is set but scoring could not be completed (matched topic disabled/removed, or the scoring call itself failed); only present when a real score was computed + */ + intent_score?: number; + /** + * The matched topic's configured score_threshold, for comparison against intent_score (test mode only). Same omitted-not-zero rule as intent_score + */ + intent_score_threshold?: number; + /** + * Whether intent_score clears intent_score_threshold, i.e. whether this would fire moderation.intent_detected in production (test mode only). Same omitted-not-zero rule as intent_score + */ + intent_would_fire?: boolean; /** * ID of the running moderation task */ @@ -5562,6 +5596,9 @@ export interface CheckResponse { */ triggered_rules?: Array; item?: ReviewQueueItemResponse; + /** + * @deprecated + */ triggered_rule?: TriggeredRuleResponse; } @@ -6142,6 +6179,9 @@ export interface ConfigOverridesRequest { * Maximum message length */ max_message_length?: number; + /** + * Overrides the push notification level for this channel + */ push_level?: 'all' | 'all_mentions' | 'mentions' | 'direct_mentions' | 'none'; /** * Enable/disable quotes @@ -6229,6 +6269,7 @@ export interface ConfigResponse { automod_toxicity_config?: AutomodToxicityConfig; block_list_config?: BlockListConfig; flood_config?: FloodConfig; + intent_config?: IntentConfigResponse; llm_config?: LLMConfig; velocity_filter_config?: VelocityFilterConfig; video_call_rule_config?: VideoCallRuleConfig; @@ -6545,6 +6586,9 @@ export interface CreateChannelTypeResponse { created_at: Date; custom_events: boolean; delivery_events: boolean; + /** + * Duration of the request in milliseconds + */ duration: string; mark_messages_pending: boolean; max_message_length: number; @@ -6573,6 +6617,9 @@ export interface CreateChannelTypeResponse { blocklist_behavior?: 'flag' | 'block' | 'shadow_block'; partition_size?: number; partition_ttl?: string; + /** + * Sets the push notification level for a channel type + */ push_level?: 'all' | 'all_mentions' | 'mentions' | 'direct_mentions' | 'none'; allowed_flag_reasons?: Array; blocklists?: Array; @@ -7037,6 +7084,7 @@ export interface CreateQueueRequest { } export interface CreateReminderRequest { + expires_at?: Date; remind_at?: Date; user_id?: string; /** @@ -7665,6 +7713,17 @@ export interface DeleteFeedsBatchResponse { task_id: string; } +export interface DeleteFeedsRetentionPolicyRequest { + policy: 'old-activities'; +} + +export interface DeleteFeedsRetentionPolicyResponse { + /** + * Duration of the request in milliseconds + */ + duration: string; +} + export interface DeleteImportV2TaskResponse { /** * Duration of the request in milliseconds @@ -9301,6 +9360,13 @@ export interface FeedsReactionResponse { custom?: Record; } +export interface FeedsRetentionRunResponse { + app_pk: number; + date: string; + policy: string; + stats: RunStats; +} + export interface FeedsShareResponse { activity_id: string; created_at: Date; @@ -9629,6 +9695,7 @@ export interface FloodSimilarConfig { } export interface FloodSimilarRuleParameters { + min_text_length?: number; similarity_distance?: number; threshold?: number; time_window?: string; @@ -9843,6 +9910,10 @@ export interface FullUserResponse { shadow_banned: boolean; total_unread_count: number; unread_channels: number; + /** + * @deprecated + * Deprecated: Use total_unread_count instead. + */ unread_count: number; unread_threads: number; updated_at: Date; @@ -10072,6 +10143,9 @@ export interface GetChannelTypeResponse { blocklist_behavior?: 'flag' | 'block' | 'shadow_block'; partition_size?: number; partition_ttl?: string; + /** + * Sets the push notification level for a channel type + */ push_level?: 'all' | 'all_mentions' | 'mentions' | 'direct_mentions' | 'none'; allowed_flag_reasons?: Array; blocklists?: Array; @@ -10259,6 +10333,39 @@ export interface GetFeedsRateLimitsResponse { web?: Record; } +export interface GetFeedsRetentionPolicyResponse { + /** + * Duration of the request in milliseconds + */ + duration: string; + enabled: boolean; + policies: Array; +} + +export interface GetFeedsRetentionPolicyRunsRequest { + limit?: number; + next?: string; + prev?: string; + /** + * Array of sort parameters + */ + sort?: Array; + /** + * Filter conditions to apply to the query + */ + filter_conditions?: Record; +} + +export interface GetFeedsRetentionPolicyRunsResponse { + /** + * Duration of the request in milliseconds + */ + duration: string; + runs: Array; + next?: string; + prev?: string; +} + export interface GetFlagCountRequest { /** * ID of the user whose content was flagged @@ -11271,6 +11378,136 @@ export interface InsertActionLogResponse { duration: string; } +export interface IntentBufferedItem { + /** + * The ID of the user who authored the buffered message or comment + */ + author_user_id: string; + /** + * When the buffered message or comment was created + */ + created_at: Date; + /** + * The ID of the buffered message or comment + */ + id: string; + /** + * The text of the buffered message or comment + */ + text: string; +} + +export interface IntentConfigRequest { + /** + * Topics to classify conversation text against (max 20, labels must be unique) + */ + topics?: Array; +} + +export interface IntentConfigResponse { + /** + * Topics conversation text is classified against + */ + topics: Array; +} + +export interface IntentDetectedEvent { + /** + * The channel CID (chat) or feed ID (feeds) the buffered conversation belongs to + */ + conversation_id: string; + created_at: Date; + /** + * The ID of the most recently buffered entity + */ + entity_id: string; + /** + * The type of the most recently buffered entity (chat message or feed comment) + */ + entity_type: string; + /** + * The configured intent topic label that started the buffer + */ + matched_topic: string; + /** + * The Stage 2 conversation score (0-100) that cleared score_threshold + */ + score: number; + /** + * The ID of the user whose conversation was scored + */ + user_id: string; + /** + * The buffered items that were scored, in the order they were captured + */ + items: Array; + custom: Record; + type: string; + received_at?: Date; +} + +export interface IntentTopicRequest { + /** + * Unique topic label (e.g. purchase_intent) + */ + label: string; + /** + * How long the buffer collects items before scoring runs + */ + analysis_cooldown_seconds?: number; + /** + * Optional description used in the classification prompt; the label alone is used when empty + */ + description?: string; + /** + * Whether this topic is evaluated + */ + enabled?: boolean; + /** + * Items buffered per conversation before scoring runs early + */ + max_captured_items?: number; + /** + * Suppresses this topic for a user and conversation after it fires; 0 uses the default + */ + refire_cooldown_seconds?: number; + /** + * Conversation score (0-100) required to fire moderation.intent_detected + */ + score_threshold?: number; +} + +export interface IntentTopicResponse { + /** + * How long the buffer collects items before scoring runs + */ + analysis_cooldown_seconds: number; + /** + * Whether this topic is evaluated + */ + enabled: boolean; + /** + * Unique topic label (e.g. purchase_intent) + */ + label: string; + /** + * Items buffered per conversation before scoring runs early + */ + max_captured_items: number; + /** + * Conversation score (0-100) required to fire moderation.intent_detected + */ + score_threshold: number; + /** + * Optional description used in the classification prompt; the label alone is used when empty + */ + description?: string; + /** + * Suppresses this topic for a user and conversation after it fires; 0 uses the default + */ + refire_cooldown_seconds?: number; +} + export interface InterestTagResponse { /** * Lifetime number of distinct reacted-to activities tagged with this value, without decay; 0 for manually set tags @@ -14089,6 +14326,10 @@ export interface OwnUserResponse { role: string; total_unread_count: number; unread_channels: number; + /** + * @deprecated + * Deprecated: Use total_unread_count instead. + */ unread_count: number; unread_threads: number; updated_at: Date; @@ -15600,10 +15841,6 @@ export interface QueryCommentsRequest { * Returns the comment with the specified ID along with surrounding comments for context */ id_around?: string; - /** - * When true, include soft-deleted comments in the result. Server-side only, and requires an object_id filter. Returns comments deleted by any path, including user-data deletion. Moderation-actioned comments (removed, hidden) remain excluded, and comments whose parent activity is itself deleted are not returned. - */ - include_soft_deleted_comments?: boolean; /** * Maximum number of comments to return */ @@ -16316,7 +16553,7 @@ export interface QueryReviewQueueRequest { */ sort?: Array; /** - * Filter conditions for review queue items. Accepts built-in fields (e.g. status, channel_cid, severity, recommended_action) and customer-supplied moderation_payload.custom keys: any key that is not a built-in field is matched against the item's custom moderation data (e.g. {"location_id": "loc-42"}). Use filter_config.filterable_custom_keys to discover which custom keys the app exposes as chips. + * Filter conditions for review queue items. Accepts built-in fields (e.g. status, channel_cid, severity, recommended_action) and customer-supplied moderation_payload.custom keys: any key that is not a built-in field is matched against the item's custom moderation data (e.g. {"location_id": "loc-42"}). Use filter_config.filterable_custom_keys to discover which custom keys the app exposes as chips. content_text searches the moderated text: "$q" is a keyword search (terms ANDed, no adjacency) over the indexed tsvector, while "$eq" (or "$in" for several wordings) matches the text exactly. The exact form is unindexed, so scope it with date_range rather than running it across the whole queue. */ filter?: Record; /** @@ -17214,6 +17451,7 @@ export interface ReminderResponseData { message_id: string; updated_at: Date; user_id: string; + expires_at?: Date; remind_at?: Date; /** * Represents channel in chat @@ -17748,6 +17986,7 @@ export interface RuleBuilderCondition { ocr_content_params?: OCRContentParameters; text_content_params?: TextContentParameters; text_rule_params?: TextRuleParameters; + user_channel_count_params?: UserChannelCountRuleParameters; user_created_within_params?: UserCreatedWithinParameters; user_custom_property_params?: UserCustomPropertyParameters; user_flag_count_rule_params?: FlagCountRuleParameters; @@ -18539,6 +18778,21 @@ export interface SessionWarningResponse { time?: Date; } +export interface SetFeedsRetentionPolicyRequest { + max_age_hours: number; + policy: 'old-activities'; + enabled?: boolean; +} + +export interface SetFeedsRetentionPolicyResponse { + /** + * Duration of the request in milliseconds + */ + duration: string; + enabled: boolean; + policy: RetentionPolicy; +} + export interface SetRetentionPolicyRequest { max_age_hours: number; policy: 'old-messages' | 'inactive-channels'; @@ -19161,7 +19415,8 @@ export interface SubmitActionRequest { */ unban?: UnbanActionRequestPayload; /** - * Deprecated: use restore instead — it now also reverses a block or shadow block. Configuration for unblock action. + * @deprecated + * Deprecated: Use restore instead, which now also reverses a block or shadow block. Configuration for unblock action. */ unblock?: UnblockActionRequestPayload; /** @@ -20019,6 +20274,7 @@ export interface UnbanRequest { */ unbanned_by_id?: string; /** + * @deprecated * User request object */ unbanned_by?: UserRequest; @@ -20804,6 +21060,9 @@ export interface UpdateChannelTypeRequest { partition_size?: number; partition_ttl?: string; polls?: boolean; + /** + * Sets the push notification level for a channel type + */ push_level?: 'all' | 'all_mentions' | 'mentions' | 'direct_mentions' | 'none'; push_notifications?: boolean; quotes?: boolean; @@ -20841,6 +21100,9 @@ export interface UpdateChannelTypeResponse { created_at: Date; custom_events: boolean; delivery_events: boolean; + /** + * Duration of the request in milliseconds + */ duration: string; mark_messages_pending: boolean; max_message_length: number; @@ -20869,6 +21131,9 @@ export interface UpdateChannelTypeResponse { blocklist_behavior?: 'flag' | 'block' | 'shadow_block'; partition_size?: number; partition_ttl?: string; + /** + * Sets the push notification level for a channel type + */ push_level?: 'all' | 'all_mentions' | 'mentions' | 'direct_mentions' | 'none'; allowed_flag_reasons?: Array; blocklists?: Array; @@ -21513,6 +21778,7 @@ export interface UpdateQueueRequest { } export interface UpdateReminderRequest { + expires_at?: Date; remind_at?: Date; user_id?: string; /** @@ -21707,7 +21973,7 @@ export interface UpdateUsersResponse { duration: string; /** * @deprecated - * Deprecated: always empty. Removing a user from a team no longer deletes their memberships in that team's channels, so there is no task to poll + * Deprecated: Always empty. Removing a user from a team no longer deletes their memberships in that team's channels, so there is no task to poll. */ membership_deletion_task_id: string; /** @@ -21917,6 +22183,7 @@ export interface UpsertConfigRequest { bodyguard_config?: AITextConfig; flood_config?: FloodConfig; google_vision_config?: GoogleVisionConfig; + intent_config?: IntentConfigRequest; llm_config?: LLMConfig; rule_builder_config?: RuleBuilderConfig; /** @@ -22222,6 +22489,11 @@ export interface UserBannedEvent { created_by?: UserResponseCommonFields; } +export interface UserChannelCountRuleParameters { + threshold?: number; + time_window?: string; +} + export interface UserCreatedWithinParameters { max_age?: string; } @@ -23099,6 +23371,7 @@ export type WHEvent = | ({ type: 'moderation.image_analysis.complete'; } & ModerationImageAnalysisCompleteEvent) + | ({ type: 'moderation.intent_detected' } & IntentDetectedEvent) | ({ type: 'moderation.mark_reviewed' } & ModerationMarkReviewedEvent) | ({ type: 'moderation.text_analysis.complete'; diff --git a/src/gen/moderation/ModerationApi.ts b/src/gen/moderation/ModerationApi.ts index 84f20d2..6abf5f6 100644 --- a/src/gen/moderation/ModerationApi.ts +++ b/src/gen/moderation/ModerationApi.ts @@ -547,6 +547,7 @@ export class ModerationApi { bodyguard_config: request?.bodyguard_config, flood_config: request?.flood_config, google_vision_config: request?.google_vision_config, + intent_config: request?.intent_config, llm_config: request?.llm_config, rule_builder_config: request?.rule_builder_config, user: request?.user, From 68a04e510422b34dbc6679f67d02bdc4c42a8e2c Mon Sep 17 00:00:00 2001 From: Jimmy Pettersson Date: Tue, 29 Sep 2026 11:12:18 +0200 Subject: [PATCH 2/3] feat: add top_level_comment_count to feeds GetActivity and GetComments Regenerated for FEEDS-1965: include_top_level_comment_count on getActivity/getComments, top_level_comment_count on both responses, and the always-present comment_count on GetCommentsResponse. Co-Authored-By: Claude Opus 5.5 --- src/gen/feeds/FeedsApi.ts | 4 ++++ src/gen/models/index.ts | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/gen/feeds/FeedsApi.ts b/src/gen/feeds/FeedsApi.ts index f31f1bb..7090fbd 100644 --- a/src/gen/feeds/FeedsApi.ts +++ b/src/gen/feeds/FeedsApi.ts @@ -740,6 +740,7 @@ export class FeedsApi { user_id?: string; language?: string; translate_text?: boolean; + include_top_level_comment_count?: boolean; }): Promise> { const queryParams = { comment_sort: request?.comment_sort, @@ -748,6 +749,7 @@ export class FeedsApi { user_id: request?.user_id, language: request?.language, translate_text: request?.translate_text, + include_top_level_comment_count: request?.include_top_level_comment_count, }; const pathParams = { id: request?.id, @@ -1166,6 +1168,7 @@ export class FeedsApi { limit?: number; prev?: string; next?: string; + include_top_level_comment_count?: boolean; }): Promise> { const queryParams = { object_id: request?.object_id, @@ -1180,6 +1183,7 @@ export class FeedsApi { limit: request?.limit, prev: request?.prev, next: request?.next, + include_top_level_comment_count: request?.include_top_level_comment_count, }; const response = await this.apiClient.sendRequest< diff --git a/src/gen/models/index.ts b/src/gen/models/index.ts index 6f0d1f0..d90b687 100644 --- a/src/gen/models/index.ts +++ b/src/gen/models/index.ts @@ -815,6 +815,10 @@ export interface ActivityResponse { * Text content of the activity */ text?: string; + /** + * Number of top-level comments (comments directly on the activity, excluding replies). Only returned by GetActivity when include_top_level_comment_count=true; never set on feed reads or events. Same status/deletion rules as comment_count; not adjusted per viewer. + */ + top_level_comment_count?: number; /** * If visibility is 'tag', this is the tag name */ @@ -10186,6 +10190,10 @@ export interface GetCommentResponse { } export interface GetCommentsResponse { + /** + * Total number of comments on the object, including replies at every depth + */ + comment_count: number; duration: string; /** * Sort order used for the comments (first, last, top, best, controversial) @@ -10197,6 +10205,10 @@ export interface GetCommentsResponse { comments: Array; next?: string; prev?: string; + /** + * Number of comments directly on the object, excluding replies. Independent of depth, replies_limit and id_around, and not adjusted per viewer. Only present when include_top_level_comment_count is set + */ + top_level_comment_count?: number; } export interface GetConfigResponse { From 9cb93f935a85e4d1bf7da5fe91f4442db27c4ffb Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Tue, 29 Sep 2026 07:48:21 -0500 Subject: [PATCH 3/3] fix: merge remove duplicate methods --- src/gen/feeds/FeedsApi.ts | 87 --------------------------------------- 1 file changed, 87 deletions(-) diff --git a/src/gen/feeds/FeedsApi.ts b/src/gen/feeds/FeedsApi.ts index 708851c..58c591b 100644 --- a/src/gen/feeds/FeedsApi.ts +++ b/src/gen/feeds/FeedsApi.ts @@ -2985,93 +2985,6 @@ export class FeedsApi { return response; } - async feedsGetRetentionPolicy(): Promise< - StreamResponse - > { - const response = await this.apiClient.sendRequest< - StreamResponse - >('GET', '/api/v2/feeds/retention_policy', undefined, undefined); - - decoders['GetFeedsRetentionPolicyResponse']?.(response.body); - - return { ...response.body, metadata: response.metadata }; - } - - async feedsSetRetentionPolicy( - request: SetFeedsRetentionPolicyRequest, - ): Promise> { - const body = { - max_age_hours: request?.max_age_hours, - policy: request?.policy, - enabled: request?.enabled, - }; - - const response = await this.apiClient.sendRequest< - StreamResponse - >( - 'POST', - '/api/v2/feeds/retention_policy', - undefined, - undefined, - body, - 'application/json', - ); - - decoders['SetFeedsRetentionPolicyResponse']?.(response.body); - - return { ...response.body, metadata: response.metadata }; - } - - async feedsDeleteRetentionPolicy( - request: DeleteFeedsRetentionPolicyRequest, - ): Promise> { - const body = { - policy: request?.policy, - }; - - const response = await this.apiClient.sendRequest< - StreamResponse - >( - 'POST', - '/api/v2/feeds/retention_policy/delete', - undefined, - undefined, - body, - 'application/json', - ); - - decoders['DeleteFeedsRetentionPolicyResponse']?.(response.body); - - return { ...response.body, metadata: response.metadata }; - } - - async feedsGetRetentionPolicyRuns( - request?: GetFeedsRetentionPolicyRunsRequest, - ): Promise> { - const body = { - limit: request?.limit, - next: request?.next, - prev: request?.prev, - sort: request?.sort, - filter_conditions: request?.filter_conditions, - }; - - const response = await this.apiClient.sendRequest< - StreamResponse - >( - 'POST', - '/api/v2/feeds/retention_policy/runs', - undefined, - undefined, - body, - 'application/json', - ); - - decoders['GetFeedsRetentionPolicyRunsResponse']?.(response.body); - - return { ...response.body, metadata: response.metadata }; - } - async queryRevisionHistory( request: QueryRevisionHistoryRequest, ): Promise> {