diff --git a/__tests__/agent.test.ts b/__tests__/agent.test.ts index d725f1f..7ce8ede 100644 --- a/__tests__/agent.test.ts +++ b/__tests__/agent.test.ts @@ -67,7 +67,7 @@ describe.skip('AI agent integration', () => { const [, agent] = await createTestStreamAndRealtimeClients(); let errorEvent: any = null; - agent.on('realtime.event', ({ event }) => { + agent.on('realtime.event', ({ event }: { event: any }) => { if (event.type === 'error') { errorEvent = event; } @@ -147,7 +147,7 @@ describe.skip('AI agent integration', () => { required: ['lat', 'lng', 'location'], }, }, - async ({ lat, lng }) => { + async ({ lat, lng }: { lat: number; lng: number }) => { const result = await fetch( `https://api.open-meteo.com/v1/forecast?latitude=${lat}&longitude=${lng}¤t=temperature_2m,wind_speed_10m`, ); diff --git a/__tests__/date-transform.test.ts b/__tests__/date-transform.test.ts index 526f46a..727a5dd 100644 --- a/__tests__/date-transform.test.ts +++ b/__tests__/date-transform.test.ts @@ -3,8 +3,9 @@ import { randomUUID } from 'crypto'; import { createTestClient } from './create-test-client'; import { StreamClient } from '../src/StreamClient'; import { UserRequest } from '../src/gen/models'; +import { nsToDate, nsToMs } from '../src/utils/time'; -describe('Date conversion', () => { +describe('dates on responses', () => { let client: StreamClient; const user = { id: 'stream-node-test-user', @@ -36,18 +37,18 @@ describe('Date conversion', () => { const createdAt = response.call.created_at; - expect(createdAt instanceof Date).toBe(true); - expect(now - createdAt.getTime()).toBeLessThan(oneMin); + expect(typeof createdAt).toBe('number'); + expect(now - nsToMs(createdAt)).toBeLessThan(oneMin); - expect(response.call.starts_at instanceof Date).toBe(true); - expect(startsAt.getTime()).toEqual(response.call.starts_at?.getTime()); + expect(typeof response.call.starts_at).toBe('number'); + expect(startsAt.getTime()).toEqual(nsToMs(response.call.starts_at!)); expect(response.call.ended_at).toBeNull(); expect(response.members.length).toBeGreaterThan(0); response.members.forEach((m) => { - expect(m.created_at instanceof Date).toBe(true); + expect(typeof m.created_at).toBe('number'); }); const queryResult = await client.video.queryCalls({ @@ -75,28 +76,26 @@ describe('Date conversion', () => { const createdAt = response.channel!.created_at; - expect(createdAt instanceof Date).toBe(true); - expect(now - createdAt.getTime()).toBeLessThan(oneMin); + expect(typeof createdAt).toBe('number'); + expect(now - nsToMs(createdAt)).toBeLessThan(oneMin); expect(response.channel!.deleted_at).toBeUndefined(); expect(response.members.length).toBeGreaterThan(0); response.members.forEach((m) => { - expect(m.created_at instanceof Date).toBe(true); + expect(typeof m.created_at).toBe('number'); }); const queryResult = await client.chat.queryChannels({ filter_conditions: { - created_at: { $lte: createdAt.toISOString() }, + created_at: { $lte: nsToDate(createdAt).toISOString() }, }, limit: 10, }); queryResult.channels.forEach((c) => { - expect(c.channel!.created_at.getTime()).toBeLessThanOrEqual( - createdAt.getTime(), - ); + expect(c.channel!.created_at).toBeLessThanOrEqual(createdAt); }); await channel.delete(); @@ -113,7 +112,7 @@ describe('Date conversion', () => { const response = await client.upsertUsers([newUser]); - expect(response.users[newUser.id].created_at instanceof Date).toBe(true); + expect(typeof response.users[newUser.id].created_at).toBe('number'); expect( typeof response.users[newUser.id].custom.created_at === 'string', diff --git a/__tests__/devices-push.test.ts b/__tests__/devices-push.test.ts index c043821..6232256 100644 --- a/__tests__/devices-push.test.ts +++ b/__tests__/devices-push.test.ts @@ -2,7 +2,7 @@ import { beforeAll, describe, expect, it } from 'vitest'; import { randomUUID } from 'crypto'; import { createTestClient } from './create-test-client'; import { StreamClient } from '../src/StreamClient'; -import { CreateDeviceRequest, PushProvider } from '../src/gen/models'; +import { CreateDeviceRequest, PushProviderRequest } from '../src/gen/models'; describe('devices and push', () => { let client: StreamClient; @@ -16,7 +16,7 @@ describe('devices and push', () => { push_provider_name: 'firebase', user_id: user.id, }; - const pushProvider: PushProvider = { + const pushProvider: PushProviderRequest = { name: 'test-push-provider', type: 'xiaomi', xiaomi_app_secret: '', diff --git a/__tests__/messages.test.ts b/__tests__/messages.test.ts index 2fe689f..5d4bd54 100644 --- a/__tests__/messages.test.ts +++ b/__tests__/messages.test.ts @@ -57,7 +57,6 @@ describe('messages API', () => { }); it('thread replies', async () => { - const now = new Date(); const response = await channel.sendMessage({ message: { text: 'Hello from Stream Node SDK', @@ -77,7 +76,6 @@ describe('messages API', () => { const getResponse = await client.chat.getReplies({ parent_id: response.message.id, - created_at_after: now, }); expect( diff --git a/__tests__/rate-limit.test.ts b/__tests__/rate-limit.test.ts index 935f18a..546a9ce 100644 --- a/__tests__/rate-limit.test.ts +++ b/__tests__/rate-limit.test.ts @@ -1,6 +1,7 @@ import { beforeAll, describe, expect, it } from 'vitest'; import { createTestClient } from './create-test-client'; import { StreamClient } from '../src/StreamClient'; +import { StreamError } from '../src/types'; describe('rate limit', () => { let client: StreamClient; @@ -61,12 +62,14 @@ describe('rate limit', () => { try { await call.startTranscription(); throw new Error(`Method didn't throw`); - } catch (error) { + } catch (err) { + const error = err as StreamError; + expect(error.code).toBeDefined(); expect(error.metadata).toBeDefined(); expect(error.metadata.responseCode).toBe(404); - const rateLimit = error.metadata.rateLimit; + const rateLimit = error.metadata.rateLimit!; expect(rateLimit.rateLimit).toBeDefined(); } diff --git a/generate-openapi.sh b/generate-openapi.sh index 7f360b1..0fbc4d2 100755 --- a/generate-openapi.sh +++ b/generate-openapi.sh @@ -6,6 +6,6 @@ CHAT_DIR="../chat" rm -rf $OUTPUT_DIR -( cd $CHAT_DIR ; make openapi ; make -C tools/openapi build ; ./build/openapi generate-client --language ts --spec ./releases/v2/serverside-api.yaml --output $OUTPUT_DIR ) +( cd $CHAT_DIR ; make openapi ; make -C tools/openapi build ; ./build/openapi generate-client --language ts --spec ./releases/v2/serverside-api.yaml --opt response_dates_as_number=true --output $OUTPUT_DIR ) yarn lint:gen diff --git a/index.ts b/index.ts index 71c9a50..da6b658 100644 --- a/index.ts +++ b/index.ts @@ -10,3 +10,13 @@ export { InvalidWebhookError, InvalidWebhookErrorMessages, } from './src/utils/webhook'; +export { + convertTimestampToDate, + dateToNs, + msToNs, + nowNs, + NS_PER_MS, + nsToDate, + nsToMs, + nsToRfc3339, +} from './src/utils/time'; diff --git a/src/gen/chat/ChannelApi.ts b/src/gen/chat/ChannelApi.ts index 8d793e3..1c4f16c 100644 --- a/src/gen/chat/ChannelApi.ts +++ b/src/gen/chat/ChannelApi.ts @@ -12,6 +12,8 @@ import { MarkReadRequest, MarkReadResponse, MarkUnreadRequest, + QueryChannelBansRequest, + QueryChannelBansResponse, Response, SendEventRequest, SendMessageRequest, @@ -114,6 +116,22 @@ export class ChannelApi { }); } + queryChannelBans( + request?: QueryChannelBansRequest, + ): Promise> { + if (!this.id) { + throw new Error( + `Channel isn't yet created, call getOrCreateDistinctChannel() before this operation`, + ); + } + + return this.chatApi.queryChannelBans({ + id: this.id, + type: this.type, + ...request, + }); + } + deleteDraft(request?: { parent_id?: string; user_id?: string; diff --git a/src/gen/chat/ChatApi.ts b/src/gen/chat/ChatApi.ts index 0e4388d..ab18a13 100644 --- a/src/gen/chat/ChatApi.ts +++ b/src/gen/chat/ChatApi.ts @@ -71,6 +71,8 @@ import { QueryBannedUsersResponse, QueryCampaignsRequest, QueryCampaignsResponse, + QueryChannelBansRequest, + QueryChannelBansResponse, QueryChannelsRequest, QueryChannelsResponse, QueryDraftsRequest, @@ -452,6 +454,7 @@ export class ChatApi { const body = { limit: request?.limit, user_id: request?.user_id, + sort: request?.sort, groups: request?.groups, user: request?.user, }; @@ -661,6 +664,37 @@ export class ChatApi { return response; } + async queryChannelBans( + request: QueryChannelBansRequest & { type: string; id: string }, + ): Promise> { + const pathParams = { + type: request?.type, + id: request?.id, + }; + const body = { + exclude_expired_bans: request?.exclude_expired_bans, + include_total: request?.include_total, + limit: request?.limit, + next: request?.next, + prev: request?.prev, + user_id: request?.user_id, + filter_conditions: request?.filter_conditions, + user: request?.user, + }; + + const response = await this.apiClient.sendRequest( + 'POST', + '/api/v2/chat/channels/{type}/{id}/bans/query', + pathParams, + undefined, + body, + ); + + decoders['QueryChannelBansResponse']?.(response); + + return response; + } + async deleteDraft(request: { type: string; id: string; @@ -1854,6 +1888,8 @@ export class ChatApi { poll_id: request?.poll_id, }; const body = { + config_key: request?.config_key, + config_team: request?.config_team, user_id: request?.user_id, user: request?.user, vote: request?.vote, diff --git a/src/gen/common/CommonApi.ts b/src/gen/common/CommonApi.ts index 0c9b712..557da90 100644 --- a/src/gen/common/CommonApi.ts +++ b/src/gen/common/CommonApi.ts @@ -1071,6 +1071,8 @@ export class CommonApi { name: request?.name, allow_answers: request?.allow_answers, allow_user_suggested_options: request?.allow_user_suggested_options, + config_key: request?.config_key, + config_team: request?.config_team, description: request?.description, enforce_unique_vote: request?.enforce_unique_vote, id: request?.id, @@ -1105,6 +1107,8 @@ export class CommonApi { name: request?.name, allow_answers: request?.allow_answers, allow_user_suggested_options: request?.allow_user_suggested_options, + config_key: request?.config_key, + config_team: request?.config_team, description: request?.description, enforce_unique_vote: request?.enforce_unique_vote, is_closed: request?.is_closed, @@ -1209,6 +1213,8 @@ export class CommonApi { poll_id: request?.poll_id, }; const body = { + config_key: request?.config_key, + config_team: request?.config_team, user_id: request?.user_id, unset: request?.unset, set: request?.set, @@ -1236,6 +1242,8 @@ export class CommonApi { }; const body = { text: request?.text, + config_key: request?.config_key, + config_team: request?.config_team, user_id: request?.user_id, custom: request?.custom, user: request?.user, @@ -1263,6 +1271,8 @@ export class CommonApi { const body = { id: request?.id, text: request?.text, + config_key: request?.config_key, + config_team: request?.config_team, user_id: request?.user_id, custom: request?.custom, user: request?.user, diff --git a/src/gen/feeds/FeedsApi.ts b/src/gen/feeds/FeedsApi.ts index 6331934..2ba2263 100644 --- a/src/gen/feeds/FeedsApi.ts +++ b/src/gen/feeds/FeedsApi.ts @@ -209,6 +209,7 @@ export class FeedsApi { poll_id: request?.poll_id, restrict_replies: request?.restrict_replies, skip_enrich_url: request?.skip_enrich_url, + skip_existing: request?.skip_existing, skip_push: request?.skip_push, text: request?.text, user_id: request?.user_id, @@ -246,6 +247,7 @@ export class FeedsApi { create_users: request?.create_users, enrich_own_fields: request?.enrich_own_fields, force_moderation: request?.force_moderation, + skip_existing: request?.skip_existing, }; const response = await this.apiClient.sendRequest( @@ -511,6 +513,8 @@ export class FeedsApi { poll_id: request?.poll_id, }; const body = { + config_key: request?.config_key, + config_team: request?.config_team, user_id: request?.user_id, user: request?.user, vote: request?.vote, @@ -975,9 +979,11 @@ export class FeedsApi { async deleteCollections(request: { collection_refs: Array; + hard_delete?: boolean; }): Promise> { const queryParams = { collection_refs: request?.collection_refs, + hard_delete: request?.hard_delete, }; const response = @@ -2697,6 +2703,7 @@ export class FeedsApi { ): Promise> { const body = { follows: request?.follows, + async: request?.async, create_users: request?.create_users, enrich_own_fields: request?.enrich_own_fields, }; @@ -2719,6 +2726,7 @@ export class FeedsApi { ): Promise> { const body = { follows: request?.follows, + async: request?.async, create_users: request?.create_users, enrich_own_fields: request?.enrich_own_fields, }; @@ -3077,6 +3085,7 @@ export class FeedsApi { ): Promise> { const body = { follows: request?.follows, + async: request?.async, delete_notification_activity: request?.delete_notification_activity, enrich_own_fields: request?.enrich_own_fields, }; @@ -3099,6 +3108,7 @@ export class FeedsApi { ): Promise> { const body = { follows: request?.follows, + async: request?.async, delete_notification_activity: request?.delete_notification_activity, enrich_own_fields: request?.enrich_own_fields, }; diff --git a/src/gen/model-decoders/decoders.ts b/src/gen/model-decoders/decoders.ts index 4272d08..a43d0fb 100644 --- a/src/gen/model-decoders/decoders.ts +++ b/src/gen/model-decoders/decoders.ts @@ -34,6283 +34,25 @@ const decode = (typeMappings: TypeMapping, input?: Record) => { return input; }; -decoders['AcceptFeedMemberInviteResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - member: { type: 'FeedMemberResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['AcceptFollowResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - follow: { type: 'FollowResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ActionLogResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - review_queue_item: { type: 'ReviewQueueItemResponse', isSingle: true }, - - target_user: { type: 'UserResponse', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ActivityAddedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - activity: { type: 'ActivityResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ActivityDeletedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - activity: { type: 'ActivityResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ActivityFeedbackEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ActivityMarkEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ActivityPinResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - activity: { type: 'ActivityResponse', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ActivityPinnedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - pinned_activity: { type: 'PinActivityResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ActivityReactionAddedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - activity: { type: 'ActivityResponse', isSingle: true }, - - reaction: { type: 'FeedsReactionResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ActivityReactionDeletedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - activity: { type: 'ActivityResponse', isSingle: true }, - - reaction: { type: 'FeedsReactionResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ActivityReactionUpdatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - activity: { type: 'ActivityResponse', isSingle: true }, - - reaction: { type: 'FeedsReactionResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ActivityRemovedFromFeedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - activity: { type: 'ActivityResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ActivityResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - comments: { type: 'CommentResponse', isSingle: false }, - - latest_reactions: { type: 'FeedsReactionResponse', isSingle: false }, - - mentioned_users: { type: 'UserResponse', isSingle: false }, - - own_bookmarks: { type: 'BookmarkResponse', isSingle: false }, - - own_reactions: { type: 'FeedsReactionResponse', isSingle: false }, - - collections: { type: 'EnrichedCollectionResponse', isSingle: false }, - - reaction_groups: { type: 'FeedsReactionGroupResponse', isSingle: false }, - - user: { type: 'UserResponse', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - edited_at: { type: 'DatetimeType', isSingle: true }, - - expires_at: { type: 'DatetimeType', isSingle: true }, - - friend_reactions: { type: 'FeedsReactionResponse', isSingle: false }, - - latest_shares: { type: 'ShareResponse', isSingle: false }, - - current_feed: { type: 'FeedResponse', isSingle: true }, - - parent: { type: 'ActivityResponse', isSingle: true }, - - poll: { type: 'PollResponseData', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ActivityRestoredEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - activity: { type: 'ActivityResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ActivitySelectorConfigResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - cutoff_time: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ActivityUnpinnedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - pinned_activity: { type: 'PinActivityResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ActivityUpdatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - activity: { type: 'ActivityResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['AddActivityResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - activity: { type: 'ActivityResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['AddBookmarkResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - bookmark: { type: 'BookmarkResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['AddCommentBookmarkResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - bookmark: { type: 'BookmarkResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['AddCommentReactionResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - comment: { type: 'CommentResponse', isSingle: true }, - - reaction: { type: 'FeedsReactionResponse', isSingle: true }, - - reference_activity: { type: 'ActivityResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['AddCommentResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - comment: { type: 'CommentResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['AddCommentsBatchResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - comments: { type: 'CommentResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['AddReactionResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - activity: { type: 'ActivityResponse', isSingle: true }, - - reaction: { type: 'FeedsReactionResponse', isSingle: true }, - - reference_activity: { type: 'ActivityResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['AddUserGroupMembersResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - user_group: { type: 'UserGroupResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['AggregatedActivityResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - activities: { type: 'ActivityResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - decoders['AppResponseFields'] = (input?: { [key: string]: any }) => { const typeMappings: TypeMapping = { event_hooks: { type: 'EventHook', isSingle: false }, - - call_types: { type: 'CallType', isSingle: false }, - - channel_configs: { type: 'ChannelConfig', isSingle: false }, - - push_notifications: { type: 'PushNotificationFields', isSingle: true }, - - revoke_tokens_issued_before: { type: 'DatetimeType', isSingle: true }, }; return decode(typeMappings, input); }; -decoders['AppealAcceptedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - appeal: { type: 'AppealItemResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['AppealCreatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - appeal: { type: 'AppealItemResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['AppealItemResponse'] = (input?: { [key: string]: any }) => { +decoders['EventHook'] = (input?: { [key: string]: any }) => { const typeMappings: TypeMapping = { created_at: { type: 'DatetimeType', isSingle: true }, updated_at: { type: 'DatetimeType', isSingle: true }, - - actions: { type: 'ActionLogResponse', isSingle: false }, - - flags: { type: 'ModerationFlagResponse', isSingle: false }, - - moderation_action: { type: 'ActionLogResponse', isSingle: true }, - - original_moderation_action: { type: 'ActionLogResponse', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['AppealRejectedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - appeal: { type: 'AppealItemResponse', isSingle: true }, }; return decode(typeMappings, input); }; -decoders['AsyncBulkImageModerationEvent'] = (input?: { - [key: string]: any; -}) => { +decoders['GetApplicationResponse'] = (input?: { [key: string]: any }) => { const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - finished_at: { type: 'DatetimeType', isSingle: true }, - - started_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['AsyncExportChannelsEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - finished_at: { type: 'DatetimeType', isSingle: true }, - - started_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['AsyncExportErrorEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - finished_at: { type: 'DatetimeType', isSingle: true }, - - started_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['AsyncExportLabelResultsEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - finished_at: { type: 'DatetimeType', isSingle: true }, - - started_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['AsyncExportModerationLogsEvent'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - finished_at: { type: 'DatetimeType', isSingle: true }, - - started_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['AsyncExportReviewQueueEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - finished_at: { type: 'DatetimeType', isSingle: true }, - - started_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['AsyncExportUsersEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - finished_at: { type: 'DatetimeType', isSingle: true }, - - started_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['AsyncImportErrorEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - finished_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - started_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['AsyncImportSuccessEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - finished_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - started_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['AutomodDetailsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - result: { type: 'MessageModerationResult', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['BanInfoResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - expires: { type: 'DatetimeType', isSingle: true }, - - channel: { type: 'ChannelMetadata', isSingle: true }, - - created_by: { type: 'UserResponse', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['BanResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - expires: { type: 'DatetimeType', isSingle: true }, - - banned_by: { type: 'UserResponse', isSingle: true }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['BatchQueryActivityReactionsResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - reactions: { type: 'FeedsReactionResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['BatchQueryCommentReactionsResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - reactions: { type: 'FeedsReactionResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['BlockListResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['BlockUsersResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['BlockedUserEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - - blocked_by_user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['BlockedUserResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - blocked_user: { type: 'UserResponse', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['BookmarkAddedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - bookmark: { type: 'BookmarkResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['BookmarkDeletedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - bookmark: { type: 'BookmarkResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['BookmarkFolderDeletedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - bookmark_folder: { type: 'BookmarkFolderResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['BookmarkFolderResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['BookmarkFolderUpdatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - bookmark_folder: { type: 'BookmarkFolderResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['BookmarkResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - activity: { type: 'ActivityResponse', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - - comment: { type: 'CommentResponse', isSingle: true }, - - folder: { type: 'BookmarkFolderResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['BookmarkUpdatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - bookmark: { type: 'BookmarkResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['BulkActionAppealsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - results: { type: 'BulkAppealResult', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['BulkAppealResult'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - appeal_item: { type: 'AppealItemResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallAcceptedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - call: { type: 'CallResponse', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallClosedCaptionsFailedEvent'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallClosedCaptionsStartedEvent'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallClosedCaptionsStoppedEvent'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallCreatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - members: { type: 'MemberResponse', isSingle: false }, - - call: { type: 'CallResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallDTMFEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - timestamp: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallDeletedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - call: { type: 'CallResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallEndedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - call: { type: 'CallResponse', isSingle: true }, - - members: { type: 'MemberResponse', isSingle: false }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallFrameRecordingFailedEvent'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - call: { type: 'CallResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallFrameRecordingFrameReadyEvent'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - captured_at: { type: 'DatetimeType', isSingle: true }, - - created_at: { type: 'DatetimeType', isSingle: true }, - - users: { type: 'UserResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['CallFrameRecordingStartedEvent'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - call: { type: 'CallResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallFrameRecordingStoppedEvent'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - call: { type: 'CallResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallHLSBroadcastingFailedEvent'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallHLSBroadcastingStartedEvent'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - call: { type: 'CallResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallHLSBroadcastingStoppedEvent'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallLiveStartedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - call: { type: 'CallResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallMemberAddedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - members: { type: 'MemberResponse', isSingle: false }, - - call: { type: 'CallResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallMemberRemovedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - call: { type: 'CallResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallMemberUpdatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - members: { type: 'MemberResponse', isSingle: false }, - - call: { type: 'CallResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallMemberUpdatedPermissionEvent'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - members: { type: 'MemberResponse', isSingle: false }, - - call: { type: 'CallResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallMissedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - members: { type: 'MemberResponse', isSingle: false }, - - call: { type: 'CallResponse', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallModerationBlurEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallModerationWarningEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallNotificationEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - members: { type: 'MemberResponse', isSingle: false }, - - call: { type: 'CallResponse', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallParticipantResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - joined_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallParticipantTimeline'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - timestamp: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallReactionEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallRecording'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - end_time: { type: 'DatetimeType', isSingle: true }, - - start_time: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallRecordingFailedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallRecordingReadyEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - call_recording: { type: 'CallRecording', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallRecordingStartedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallRecordingStoppedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallRejectedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - call: { type: 'CallResponse', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallReportResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - ended_at: { type: 'DatetimeType', isSingle: true }, - - started_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - created_by: { type: 'UserResponse', isSingle: true }, - - egress: { type: 'EgressResponse', isSingle: true }, - - ended_at: { type: 'DatetimeType', isSingle: true }, - - starts_at: { type: 'DatetimeType', isSingle: true }, - - session: { type: 'CallSessionResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallRingEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - members: { type: 'MemberResponse', isSingle: false }, - - call: { type: 'CallResponse', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallRingSettledEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - rang_at: { type: 'DatetimeType', isSingle: true }, - - settled_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallRtmpBroadcastFailedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallRtmpBroadcastStartedEvent'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallRtmpBroadcastStoppedEvent'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallSessionEndedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - call: { type: 'CallResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallSessionParticipantCountsUpdatedEvent'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallSessionParticipantJoinedEvent'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - participant: { type: 'CallParticipantResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallSessionParticipantLeftEvent'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - participant: { type: 'CallParticipantResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallSessionResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - participants: { type: 'CallParticipantResponse', isSingle: false }, - - accepted_by: { type: 'DatetimeType', isSingle: false }, - - missed_by: { type: 'DatetimeType', isSingle: false }, - - rejected_by: { type: 'DatetimeType', isSingle: false }, - - ended_at: { type: 'DatetimeType', isSingle: true }, - - live_ended_at: { type: 'DatetimeType', isSingle: true }, - - live_started_at: { type: 'DatetimeType', isSingle: true }, - - started_at: { type: 'DatetimeType', isSingle: true }, - - timer_ends_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallSessionStartedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - call: { type: 'CallResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallStateResponseFields'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - members: { type: 'MemberResponse', isSingle: false }, - - call: { type: 'CallResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallStatsParticipant'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - sessions: { type: 'CallStatsParticipantSession', isSingle: false }, - - latest_activity_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallStatsParticipantSession'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - ended_at: { type: 'DatetimeType', isSingle: true }, - - started_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallStatsReportReadyEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - participants_overview: { type: 'CallStatsParticipant', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['CallStatsReportSummaryResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - first_stats_time: { type: 'DatetimeType', isSingle: true }, - - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallStatsSessionResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - generated_at: { type: 'DatetimeType', isSingle: true }, - - call_ended_at: { type: 'DatetimeType', isSingle: true }, - - call_started_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallTranscription'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - end_time: { type: 'DatetimeType', isSingle: true }, - - start_time: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallTranscriptionFailedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallTranscriptionReadyEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - call_transcription: { type: 'CallTranscription', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallTranscriptionStartedEvent'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallTranscriptionStoppedEvent'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallType'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallTypeResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallUpdatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - call: { type: 'CallResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallUserFeedbackSubmittedEvent'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CallUserMutedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CampaignCompletedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - campaign: { type: 'CampaignResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CampaignResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - segments: { type: 'Segment', isSingle: false }, - - users: { type: 'UserResponse', isSingle: false }, - - stats: { type: 'CampaignStatsResponse', isSingle: true }, - - scheduled_for: { type: 'DatetimeType', isSingle: true }, - - stop_at: { type: 'DatetimeType', isSingle: true }, - - sender: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CampaignStartedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - campaign: { type: 'CampaignResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CampaignStatsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - stats_completed_at: { type: 'DatetimeType', isSingle: true }, - - stats_started_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ChangeFeedVisibilityResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - feed: { type: 'FeedResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ChannelBatchCompletedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - batch_created_at: { type: 'DatetimeType', isSingle: true }, - - created_at: { type: 'DatetimeType', isSingle: true }, - - finished_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ChannelBatchStartedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - batch_created_at: { type: 'DatetimeType', isSingle: true }, - - created_at: { type: 'DatetimeType', isSingle: true }, - - finished_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ChannelConfig'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ChannelConfigWithInfo'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - commands: { type: 'Command', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['ChannelContextResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_by: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ChannelCreatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ChannelDeletedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ChannelFrozenEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ChannelHiddenEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ChannelMemberResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - archived_at: { type: 'DatetimeType', isSingle: true }, - - ban_expires: { type: 'DatetimeType', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - future_channel_ban_expires: { type: 'DatetimeType', isSingle: true }, - - invite_accepted_at: { type: 'DatetimeType', isSingle: true }, - - invite_rejected_at: { type: 'DatetimeType', isSingle: true }, - - pinned_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ChannelMetadata'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - last_message_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ChannelMute'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - expires: { type: 'DatetimeType', isSingle: true }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ChannelMutedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - mutes: { type: 'ChannelMute', isSingle: false }, - - mute: { type: 'ChannelMute', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ChannelPushPreferencesResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - disabled_until: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ChannelResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - hide_messages_before: { type: 'DatetimeType', isSingle: true }, - - last_message_at: { type: 'DatetimeType', isSingle: true }, - - mute_expires_at: { type: 'DatetimeType', isSingle: true }, - - truncated_at: { type: 'DatetimeType', isSingle: true }, - - members: { type: 'ChannelMemberResponse', isSingle: false }, - - config: { type: 'ChannelConfigWithInfo', isSingle: true }, - - created_by: { type: 'UserResponse', isSingle: true }, - - truncated_by: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ChannelStateResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - members: { type: 'ChannelMemberResponse', isSingle: false }, - - messages: { type: 'MessageResponse', isSingle: false }, - - pinned_messages: { type: 'MessageResponse', isSingle: false }, - - threads: { type: 'ThreadStateResponse', isSingle: false }, - - hide_messages_before: { type: 'DatetimeType', isSingle: true }, - - active_live_locations: { - type: 'SharedLocationResponseData', - isSingle: false, - }, - - pending_messages: { type: 'PendingMessageResponse', isSingle: false }, - - read: { type: 'ReadStateResponse', isSingle: false }, - - watchers: { type: 'UserResponse', isSingle: false }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - draft: { type: 'DraftResponse', isSingle: true }, - - membership: { type: 'ChannelMemberResponse', isSingle: true }, - - push_preferences: { - type: 'ChannelPushPreferencesResponse', - isSingle: true, - }, - }; - return decode(typeMappings, input); -}; - -decoders['ChannelStateResponseFields'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - members: { type: 'ChannelMemberResponse', isSingle: false }, - - messages: { type: 'MessageResponse', isSingle: false }, - - pinned_messages: { type: 'MessageResponse', isSingle: false }, - - threads: { type: 'ThreadStateResponse', isSingle: false }, - - hide_messages_before: { type: 'DatetimeType', isSingle: true }, - - active_live_locations: { - type: 'SharedLocationResponseData', - isSingle: false, - }, - - pending_messages: { type: 'PendingMessageResponse', isSingle: false }, - - read: { type: 'ReadStateResponse', isSingle: false }, - - watchers: { type: 'UserResponse', isSingle: false }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - draft: { type: 'DraftResponse', isSingle: true }, - - membership: { type: 'ChannelMemberResponse', isSingle: true }, - - push_preferences: { - type: 'ChannelPushPreferencesResponse', - isSingle: true, - }, - }; - return decode(typeMappings, input); -}; - -decoders['ChannelTruncatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - message: { type: 'MessageResponse', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ChannelTypeConfig'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - commands: { type: 'Command', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['ChannelUnFrozenEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ChannelUnmutedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - mutes: { type: 'ChannelMute', isSingle: false }, - - mute: { type: 'ChannelMute', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ChannelUpdatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - message: { type: 'MessageResponse', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ChannelVisibleEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ChatActivityStatsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - messages: { type: 'MessageStatsResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ChatDraftPayloadResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - mentioned_users: { type: 'UserResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['ChatDraftResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - message: { type: 'ChatDraftPayloadResponse', isSingle: true }, - - parent_message: { type: 'ChatMessageResponse', isSingle: true }, - - quoted_message: { type: 'ChatMessageResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ChatMessageResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - latest_reactions: { type: 'ChatReactionResponse', isSingle: false }, - - mentioned_users: { type: 'UserResponse', isSingle: false }, - - own_reactions: { type: 'ChatReactionResponse', isSingle: false }, - - user: { type: 'UserResponse', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - message_text_updated_at: { type: 'DatetimeType', isSingle: true }, - - pin_expires: { type: 'DatetimeType', isSingle: true }, - - pinned_at: { type: 'DatetimeType', isSingle: true }, - - mentioned_groups: { type: 'UserGroupResponse', isSingle: false }, - - thread_participants: { type: 'UserResponse', isSingle: false }, - - draft: { type: 'ChatDraftResponse', isSingle: true }, - - pinned_by: { type: 'UserResponse', isSingle: true }, - - poll: { type: 'PollResponseData', isSingle: true }, - - quoted_message: { type: 'ChatMessageResponse', isSingle: true }, - - reaction_groups: { type: 'ChatReactionGroupResponse', isSingle: false }, - - reminder: { type: 'ChatReminderResponseData', isSingle: true }, - - shared_location: { type: 'ChatSharedLocationResponseData', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ChatReactionGroupResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - first_reaction_at: { type: 'DatetimeType', isSingle: true }, - - last_reaction_at: { type: 'DatetimeType', isSingle: true }, - - latest_reactions_by: { - type: 'ChatReactionGroupUserResponse', - isSingle: false, - }, - }; - return decode(typeMappings, input); -}; - -decoders['ChatReactionGroupUserResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ChatReactionResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ChatReminderResponseData'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - remind_at: { type: 'DatetimeType', isSingle: true }, - - message: { type: 'ChatMessageResponse', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ChatSharedLocationResponseData'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - end_at: { type: 'DatetimeType', isSingle: true }, - - message: { type: 'ChatMessageResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CheckResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - item: { type: 'ReviewQueueItemResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ClosedCaptionEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CollectionResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['Command'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CommentAddedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - activity: { type: 'ActivityResponse', isSingle: true }, - - comment: { type: 'CommentResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CommentDeletedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - comment: { type: 'CommentResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CommentFeedbackEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CommentReactionAddedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - activity: { type: 'ActivityResponse', isSingle: true }, - - comment: { type: 'CommentResponse', isSingle: true }, - - reaction: { type: 'FeedsReactionResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CommentReactionDeletedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - comment: { type: 'CommentResponse', isSingle: true }, - - reaction: { type: 'FeedsReactionResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CommentReactionUpdatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - activity: { type: 'ActivityResponse', isSingle: true }, - - comment: { type: 'CommentResponse', isSingle: true }, - - reaction: { type: 'FeedsReactionResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CommentResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - mentioned_users: { type: 'UserResponse', isSingle: false }, - - own_reactions: { type: 'FeedsReactionResponse', isSingle: false }, - - user: { type: 'UserResponse', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - edited_at: { type: 'DatetimeType', isSingle: true }, - - latest_reactions: { type: 'FeedsReactionResponse', isSingle: false }, - - reaction_groups: { type: 'FeedsReactionGroupResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['CommentRestoredEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - comment: { type: 'CommentResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CommentUpdatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - comment: { type: 'CommentResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ConfigResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CountByMinuteResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - start_ts: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CreateBlockListResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - blocklist: { type: 'BlockListResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CreateCallTypeResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CreateCampaignResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - campaign: { type: 'CampaignResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CreateChannelTypeResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CreateCollectionsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - collections: { type: 'CollectionResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['CreateCommandResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - command: { type: 'Command', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CreateFeedGroupResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - feed_group: { type: 'FeedGroupResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CreateFeedViewResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - feed_view: { type: 'FeedViewResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CreateFeedsBatchResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - feeds: { type: 'FeedResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['CreateGuestResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CreateImportResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - import_task: { type: 'ImportTask', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CreateImportV2TaskResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CreateMembershipLevelResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - membership_level: { type: 'MembershipLevelResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CreatePredefinedFilterResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - predefined_filter: { type: 'PredefinedFilterResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CreateReminderResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - reminder: { type: 'ReminderResponseData', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CreateRoleResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - role: { type: 'Role', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CreateSIPTrunkResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - sip_trunk: { type: 'SIPTrunkResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CreateSegmentResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - segment: { type: 'SegmentResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CreateUserGroupResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - user_group: { type: 'UserGroupResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CustomCheckResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - item: { type: 'ReviewQueueItemResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CustomEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['CustomVideoEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['DeactivateUserResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['DeleteActivityReactionResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - activity: { type: 'ActivityResponse', isSingle: true }, - - reaction: { type: 'FeedsReactionResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['DeleteBookmarkResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - bookmark: { type: 'BookmarkResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['DeleteCallResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - call: { type: 'CallResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['DeleteChannelResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - channel: { type: 'ChannelResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['DeleteCommentBookmarkResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - bookmark: { type: 'BookmarkResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['DeleteCommentReactionResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - comment: { type: 'CommentResponse', isSingle: true }, - - reaction: { type: 'FeedsReactionResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['DeleteCommentResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - activity: { type: 'ActivityResponse', isSingle: true }, - - comment: { type: 'CommentResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['DeleteMessageResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - message: { type: 'MessageResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['DeleteReactionResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - message: { type: 'MessageResponse', isSingle: true }, - - reaction: { type: 'ReactionResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['DeviceResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['DraftPayloadResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - mentioned_users: { type: 'UserResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['DraftResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - message: { type: 'DraftPayloadResponse', isSingle: true }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - parent_message: { type: 'MessageResponse', isSingle: true }, - - quoted_message: { type: 'MessageResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['EgressRTMPResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - started_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['EgressResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - rtmps: { type: 'EgressRTMPResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['EnrichedCollectionResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['EntityCreatorResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - ban_expires: { type: 'DatetimeType', isSingle: true }, - - deactivated_at: { type: 'DatetimeType', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - last_active: { type: 'DatetimeType', isSingle: true }, - - revoke_tokens_issued_before: { type: 'DatetimeType', isSingle: true }, - - devices: { type: 'DeviceResponse', isSingle: false }, - - push_notifications: { - type: 'PushNotificationSettingsResponse', - isSingle: true, - }, - }; - return decode(typeMappings, input); -}; - -decoders['EventHook'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['EventResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - event: { type: 'WSEvent', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ExportUserResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - messages: { type: 'MessageResponse', isSingle: false }, - - reactions: { type: 'ReactionResponse', isSingle: false }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FeedCreatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - members: { type: 'FeedMemberResponse', isSingle: false }, - - feed: { type: 'FeedResponse', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FeedDeletedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FeedGroupChangedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FeedGroupDeletedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FeedGroupResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - activity_selectors: { - type: 'ActivitySelectorConfigResponse', - isSingle: false, - }, - }; - return decode(typeMappings, input); -}; - -decoders['FeedGroupRestoredEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FeedMemberAddedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - member: { type: 'FeedMemberResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FeedMemberRemovedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FeedMemberResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - - invite_accepted_at: { type: 'DatetimeType', isSingle: true }, - - invite_rejected_at: { type: 'DatetimeType', isSingle: true }, - - membership_level: { type: 'MembershipLevelResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FeedMemberUpdatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - member: { type: 'FeedMemberResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FeedOwnData'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - own_followings: { type: 'FollowResponse', isSingle: false }, - - own_follows: { type: 'FollowResponse', isSingle: false }, - - own_membership: { type: 'FeedMemberResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FeedResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - created_by: { type: 'UserResponse', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - own_followings: { type: 'FollowResponse', isSingle: false }, - - own_follows: { type: 'FollowResponse', isSingle: false }, - - own_membership: { type: 'FeedMemberResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FeedSuggestionResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - created_by: { type: 'UserResponse', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - own_followings: { type: 'FollowResponse', isSingle: false }, - - own_follows: { type: 'FollowResponse', isSingle: false }, - - own_membership: { type: 'FeedMemberResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FeedUpdatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - feed: { type: 'FeedResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FeedViewResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - last_used_at: { type: 'DatetimeType', isSingle: true }, - - activity_selectors: { - type: 'ActivitySelectorConfigResponse', - isSingle: false, - }, - }; - return decode(typeMappings, input); -}; - -decoders['FeedsBookmarkResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FeedsEnrichedCollectionResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FeedsFeedResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - created_by: { type: 'UserResponse', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FeedsReactionGroupResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - first_reaction_at: { type: 'DatetimeType', isSingle: true }, - - last_reaction_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FeedsReactionResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FeedsRetentionPolicy'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - enabled_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FeedsShareResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FeedsV3ActivityResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - comments: { type: 'FeedsV3CommentResponse', isSingle: false }, - - latest_reactions: { type: 'FeedsReactionResponse', isSingle: false }, - - mentioned_users: { type: 'UserResponse', isSingle: false }, - - own_bookmarks: { type: 'FeedsBookmarkResponse', isSingle: false }, - - own_reactions: { type: 'FeedsReactionResponse', isSingle: false }, - - collections: { type: 'FeedsEnrichedCollectionResponse', isSingle: false }, - - reaction_groups: { type: 'FeedsReactionGroupResponse', isSingle: false }, - - user: { type: 'UserResponse', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - edited_at: { type: 'DatetimeType', isSingle: true }, - - expires_at: { type: 'DatetimeType', isSingle: true }, - - friend_reactions: { type: 'FeedsReactionResponse', isSingle: false }, - - latest_shares: { type: 'FeedsShareResponse', isSingle: false }, - - current_feed: { type: 'FeedsFeedResponse', isSingle: true }, - - parent: { type: 'FeedsV3ActivityResponse', isSingle: true }, - - poll: { type: 'PollResponseData', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FeedsV3CommentResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - mentioned_users: { type: 'UserResponse', isSingle: false }, - - own_reactions: { type: 'FeedsReactionResponse', isSingle: false }, - - user: { type: 'UserResponse', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - edited_at: { type: 'DatetimeType', isSingle: true }, - - latest_reactions: { type: 'FeedsReactionResponse', isSingle: false }, - - reaction_groups: { type: 'FeedsReactionGroupResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['FlagDetailsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - automod: { type: 'AutomodDetailsResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FlagFeedbackResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FlagUpdatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - created_by: { type: 'UserResponse', isSingle: true }, - - message: { type: 'MessageResponse', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FollowBatchResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created: { type: 'FollowResponse', isSingle: false }, - - follows: { type: 'FollowResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['FollowCreatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - follow: { type: 'FollowResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FollowDeletedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - follow: { type: 'FollowResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FollowResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - source_feed: { type: 'FeedResponse', isSingle: true }, - - target_feed: { type: 'FeedResponse', isSingle: true }, - - request_accepted_at: { type: 'DatetimeType', isSingle: true }, - - request_rejected_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FollowUpdatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - follow: { type: 'FollowResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FullUserResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - channel_mutes: { type: 'ChannelMute', isSingle: false }, - - devices: { type: 'DeviceResponse', isSingle: false }, - - mutes: { type: 'UserMuteResponse', isSingle: false }, - - ban_expires: { type: 'DatetimeType', isSingle: true }, - - deactivated_at: { type: 'DatetimeType', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - last_active: { type: 'DatetimeType', isSingle: true }, - - revoke_tokens_issued_before: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['FutureChannelBanResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - expires: { type: 'DatetimeType', isSingle: true }, - - banned_by: { type: 'UserResponse', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetActiveCallsStatusResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - end_time: { type: 'DatetimeType', isSingle: true }, - - start_time: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetActivityResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - activity: { type: 'ActivityResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetAppealResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - item: { type: 'AppealItemResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetApplicationResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - app: { type: 'AppResponseFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetBlockListResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - blocklist: { type: 'BlockListResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetBlockedUsersResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - blocks: { type: 'BlockedUserResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['GetCallParticipantSessionMetricsResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - joined_at: { type: 'DatetimeType', isSingle: true }, - - published_tracks: { type: 'PublishedTrackMetrics', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['GetCallReportResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - report: { type: 'ReportResponse', isSingle: true }, - - video_reactions: { type: 'VideoReactionsResponse', isSingle: false }, - - chat_activity: { type: 'ChatActivityStatsResponse', isSingle: true }, - - session: { type: 'CallSessionResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetCallResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - members: { type: 'MemberResponse', isSingle: false }, - - call: { type: 'CallResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetCallSessionParticipantStatsDetailsResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - timeframe: { type: 'ParticipantSeriesTimeframe', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetCallTypeResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetCampaignResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - campaign: { type: 'CampaignResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetChannelTypeResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - commands: { type: 'Command', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['GetCommandResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetCommentRepliesResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - comments: { type: 'ThreadedCommentResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['GetCommentResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - comment: { type: 'CommentResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetCommentsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - comments: { type: 'ThreadedCommentResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['GetConfigResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - config: { type: 'ConfigResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetDraftResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - draft: { type: 'DraftResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetExternalStorageResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetFeedGroupResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - feed_group: { type: 'FeedGroupResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetFeedViewResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - feed_view: { type: 'FeedViewResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetFeedsRetentionPolicyResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - policies: { type: 'FeedsRetentionPolicy', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['GetFollowSuggestionsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - suggestions: { type: 'FeedSuggestionResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['GetImportResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - import_task: { type: 'ImportTask', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetImportV2TaskResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetManyMessagesResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - messages: { type: 'MessageResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['GetMessageResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - message: { type: 'MessageWithChannelResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetModerationRuleResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - rule: { type: 'ModerationRuleV2Response', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetOrCreateCallResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - members: { type: 'MemberResponse', isSingle: false }, - - call: { type: 'CallResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetOrCreateFeedGroupResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - feed_group: { type: 'FeedGroupResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetOrCreateFeedResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - activities: { type: 'ActivityResponse', isSingle: false }, - - aggregated_activities: { - type: 'AggregatedActivityResponse', - isSingle: false, - }, - - followers: { type: 'FollowResponse', isSingle: false }, - - following: { type: 'FollowResponse', isSingle: false }, - - members: { type: 'FeedMemberResponse', isSingle: false }, - - pinned_activities: { type: 'ActivityPinResponse', isSingle: false }, - - feed: { type: 'FeedResponse', isSingle: true }, - - notification_status: { type: 'NotificationStatusResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetOrCreateFeedViewResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - feed_view: { type: 'FeedViewResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetOrCreateFollowResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - follow: { type: 'FollowResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetOrCreateUnfollowResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - follow: { type: 'FollowResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetPinnedMessagesResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - messages: { type: 'MessageResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['GetPredefinedFilterResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - predefined_filter: { type: 'PredefinedFilterResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetPushTemplatesResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - templates: { type: 'PushTemplateResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['GetReactionsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - reactions: { type: 'ReactionResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['GetRepliesResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - messages: { type: 'MessageResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['GetRetentionPolicyResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - policies: { type: 'RetentionPolicy', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['GetReviewQueueItemResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - item: { type: 'ReviewQueueItemResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetSegmentResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - segment: { type: 'SegmentResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetSetupSessionResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - setup_session: { type: 'SetupSession', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetTaskResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetThreadResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - thread: { type: 'ThreadStateResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GetUserGroupResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - user_group: { type: 'UserGroupResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GoLiveResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - call: { type: 'CallResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['GroupedChannelsBucket'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - channels: { type: 'ChannelStateResponseFields', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['GroupedQueryChannelsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - groups: { type: 'GroupedChannelsBucket', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['ImportTask'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - history: { type: 'ImportTaskHistory', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['ImportTaskHistory'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ImportV2TaskItem'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['IngressErrorEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['IngressStartedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['IngressStoppedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - 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 }, - - user: { type: 'UserResponse', isSingle: true }, - - kicked_by_user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['LabelResultResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ListBlockListResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - blocklists: { type: 'BlockListResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['ListCallTypeResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - call_types: { type: 'CallTypeResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['ListChannelTypesResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - channel_types: { type: 'ChannelTypeConfig', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['ListCommandsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - commands: { type: 'Command', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['ListDevicesResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - devices: { type: 'DeviceResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['ListFeedGroupsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - groups: { type: 'FeedGroupResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['ListFeedViewsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - views: { type: 'FeedViewResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['ListImportV2TasksResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - import_tasks: { type: 'ImportV2TaskItem', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['ListImportsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - import_tasks: { type: 'ImportTask', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['ListPushProvidersResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - push_providers: { type: 'PushProviderResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['ListQueuesResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - queues: { type: 'ModerationQueueResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['ListRecordingsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - recordings: { type: 'CallRecording', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['ListRolesResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - roles: { type: 'Role', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['ListSIPInboundRoutingRuleResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - sip_inbound_routing_rules: { - type: 'SIPInboundRoutingRuleResponse', - isSingle: false, - }, - }; - return decode(typeMappings, input); -}; - -decoders['ListSIPTrunksResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - sip_trunks: { type: 'SIPTrunkResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['ListTranscriptionsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - transcriptions: { type: 'CallTranscription', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['ListUserGroupsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - user_groups: { type: 'UserGroupResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['MarkReadResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - event: { type: 'MarkReadResponseEvent', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['MarkReadResponseEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - channel_last_message_at: { type: 'DatetimeType', isSingle: true }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - thread: { type: 'ThreadResponse', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['MaxStreakChangedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['MemberAddedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - member: { type: 'ChannelMemberResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['MemberRemovedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - member: { type: 'ChannelMemberResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['MemberResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['MemberUpdatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - member: { type: 'ChannelMemberResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['MembersResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - members: { type: 'ChannelMemberResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['MembershipLevelResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['MessageActionResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - message: { type: 'MessageResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['MessageDeletedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - message: { type: 'MessageResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['MessageFlagResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - approved_at: { type: 'DatetimeType', isSingle: true }, - - rejected_at: { type: 'DatetimeType', isSingle: true }, - - reviewed_at: { type: 'DatetimeType', isSingle: true }, - - details: { type: 'FlagDetailsResponse', isSingle: true }, - - message: { type: 'MessageResponse', isSingle: true }, - - moderation_feedback: { type: 'FlagFeedbackResponse', isSingle: true }, - - moderation_result: { type: 'MessageModerationResult', isSingle: true }, - - reviewed_by: { type: 'UserResponse', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['MessageFlaggedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - message: { type: 'MessageResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - details: { type: 'MessageModerationResult', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['MessageHistoryEntryResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - message_updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['MessageModerationResult'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['MessageNewEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - message: { type: 'MessageResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - thread_participants: { type: 'UserResponseCommonFields', isSingle: false }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['MessageReadEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - thread: { type: 'ThreadResponse', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['MessageResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - latest_reactions: { type: 'ReactionResponse', isSingle: false }, - - mentioned_users: { type: 'UserResponse', isSingle: false }, - - own_reactions: { type: 'ReactionResponse', isSingle: false }, - - user: { type: 'UserResponse', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - message_text_updated_at: { type: 'DatetimeType', isSingle: true }, - - pin_expires: { type: 'DatetimeType', isSingle: true }, - - pinned_at: { type: 'DatetimeType', isSingle: true }, - - mentioned_groups: { type: 'UserGroupResponse', isSingle: false }, - - thread_participants: { type: 'UserResponse', isSingle: false }, - - draft: { type: 'DraftResponse', isSingle: true }, - - pinned_by: { type: 'UserResponse', isSingle: true }, - - poll: { type: 'PollResponseData', isSingle: true }, - - quoted_message: { type: 'MessageResponse', isSingle: true }, - - reaction_groups: { type: 'ReactionGroupResponse', isSingle: false }, - - reminder: { type: 'ReminderResponseData', isSingle: true }, - - shared_location: { type: 'SharedLocationResponseData', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['MessageStatsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - count_over_time: { type: 'CountByMinuteResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['MessageUnblockedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - message: { type: 'MessageResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['MessageUndeletedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - message: { type: 'MessageResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['MessageUpdatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - message: { type: 'MessageResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['MessageWithChannelResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - latest_reactions: { type: 'ReactionResponse', isSingle: false }, - - mentioned_users: { type: 'UserResponse', isSingle: false }, - - own_reactions: { type: 'ReactionResponse', isSingle: false }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - message_text_updated_at: { type: 'DatetimeType', isSingle: true }, - - pin_expires: { type: 'DatetimeType', isSingle: true }, - - pinned_at: { type: 'DatetimeType', isSingle: true }, - - mentioned_groups: { type: 'UserGroupResponse', isSingle: false }, - - thread_participants: { type: 'UserResponse', isSingle: false }, - - draft: { type: 'DraftResponse', isSingle: true }, - - pinned_by: { type: 'UserResponse', isSingle: true }, - - poll: { type: 'PollResponseData', isSingle: true }, - - quoted_message: { type: 'MessageResponse', isSingle: true }, - - reaction_groups: { type: 'ReactionGroupResponse', isSingle: false }, - - reminder: { type: 'ReminderResponseData', isSingle: true }, - - shared_location: { type: 'SharedLocationResponseData', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ModerationAnalysisFailedEvent'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ModerationCallResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - ended_at: { type: 'DatetimeType', isSingle: true }, - - starts_at: { type: 'DatetimeType', isSingle: true }, - - created_by: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ModerationCheckCompletedEvent'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ModerationCustomActionEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - review_queue_item: { type: 'ReviewQueueItemResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - message: { type: 'MessageResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ModerationFlagResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - content_published_at: { type: 'DatetimeType', isSingle: true }, - - review_queue_item: { type: 'ReviewQueueItemResponse', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ModerationFlaggedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ModerationImageAnalysisCompleteEvent'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ModerationMarkReviewedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - item: { type: 'ReviewQueueItemResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - message: { type: 'MessageResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ModerationQueueResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ModerationRuleV2Response'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ModerationRulesTriggeredEvent'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ModerationTextAnalysisCompleteEvent'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['MuteChannelResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - channel_mutes: { type: 'ChannelMute', isSingle: false }, - - channel_mute: { type: 'ChannelMute', isSingle: true }, - - own_user: { type: 'OwnUserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['MuteResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - mutes: { type: 'UserMuteResponse', isSingle: false }, - - own_user: { type: 'OwnUserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['NotificationFeedUpdatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - aggregated_activities: { - type: 'AggregatedActivityResponse', - isSingle: false, - }, - - notification_status: { type: 'NotificationStatusResponse', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['NotificationMarkUnreadEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - last_read_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['NotificationStatusResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - last_read_at: { type: 'DatetimeType', isSingle: true }, - - last_seen_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['NotificationThreadMessageNewEvent'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - message: { type: 'MessageResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - thread_participants: { type: 'UserResponseCommonFields', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['OwnBatchResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - data: { type: 'FeedOwnData', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['OwnUserResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - channel_mutes: { type: 'ChannelMute', isSingle: false }, - - devices: { type: 'DeviceResponse', isSingle: false }, - - mutes: { type: 'UserMuteResponse', isSingle: false }, - - deactivated_at: { type: 'DatetimeType', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - last_active: { type: 'DatetimeType', isSingle: true }, - - revoke_tokens_issued_before: { type: 'DatetimeType', isSingle: true }, - - push_preferences: { type: 'PushPreferencesResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ParticipantCountByMinuteResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - start_ts: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ParticipantCountOverTimeResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - by_minute: { type: 'ParticipantCountByMinuteResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['ParticipantReportResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - count_over_time: { - type: 'ParticipantCountOverTimeResponse', - isSingle: true, - }, - }; - return decode(typeMappings, input); -}; - -decoders['ParticipantSeriesTimeframe'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - since: { type: 'DatetimeType', isSingle: true }, - - until: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ParticipantSessionDetails'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - joined_at: { type: 'DatetimeType', isSingle: true }, - - left_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['PendingMessageEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - message: { type: 'MessageResponse', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['PendingMessageResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - channel: { type: 'ChannelResponse', isSingle: true }, - - message: { type: 'MessageResponse', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['PerformanceAnalysisResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - last_analyzed: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['PermissionRequestEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['PinActivityResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - activity: { type: 'ActivityResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['PolicyTestResult'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['PolicyTestRun'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - completed_at: { type: 'DatetimeType', isSingle: true }, - - config_updated_at: { type: 'DatetimeType', isSingle: true }, - - started_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['PolicyTestRunResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - results: { type: 'PolicyTestResult', isSingle: false }, - - run: { type: 'PolicyTestRun', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['PolicyTestSet'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - last_run: { type: 'PolicyTestRun', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['PolicyTestSetListResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - sets: { type: 'PolicyTestSet', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['PolicyTestSetResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - recent_runs: { type: 'PolicyTestRun', isSingle: false }, - - set: { type: 'PolicyTestSet', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['PollResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - poll: { type: 'PollResponseData', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['PollResponseData'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - latest_answers: { type: 'PollVoteResponseData', isSingle: false }, - - own_votes: { type: 'PollVoteResponseData', isSingle: false }, - - created_by: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['PollVoteResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - poll: { type: 'PollResponseData', isSingle: true }, - - vote: { type: 'PollVoteResponseData', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['PollVoteResponseData'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['PollVotesResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - votes: { type: 'PollVoteResponseData', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['PredefinedFilterResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - performance: { type: 'PerformanceAnalysisResponse', isSingle: true }, - - stats: { type: 'PredefinedFilterStatsResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['PredefinedFilterStatsResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - last_seen: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['PublishedTrackMetrics'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - warnings: { type: 'SessionWarningResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['PushNotificationFields'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - providers: { type: 'PushProvider', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['PushNotificationSettingsResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - disabled_until: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['PushPreferencesResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - disabled_until: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['PushProvider'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - disabled_at: { type: 'DatetimeType', isSingle: true }, - - push_templates: { type: 'PushTemplate', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['PushProviderResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - disabled_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['PushTemplate'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['PushTemplateResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryActivitiesResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - activities: { type: 'ActivityResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryActivityReactionsResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - reactions: { type: 'FeedsReactionResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryActivitySharesResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - shares: { type: 'ShareResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryAppealsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - items: { type: 'AppealItemResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryBannedUsersResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - bans: { type: 'BanResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryBookmarkFoldersResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - bookmark_folders: { type: 'BookmarkFolderResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryBookmarksResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - bookmarks: { type: 'BookmarkResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryCallMembersResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - members: { type: 'MemberResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryCallParticipantSessionsResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - participants_sessions: { - type: 'ParticipantSessionDetails', - isSingle: false, - }, - - session: { type: 'CallSessionResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryCallParticipantsResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - members: { type: 'MemberResponse', isSingle: false }, - - participants: { type: 'CallParticipantResponse', isSingle: false }, - - call: { type: 'CallResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryCallRingAttemptsResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - ring_attempts: { type: 'RingAttemptResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryCallSessionParticipantStatsResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - participants: { type: 'CallStatsParticipant', isSingle: false }, - - call_ended_at: { type: 'DatetimeType', isSingle: true }, - - call_started_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryCallSessionParticipantStatsTimelineResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - events: { type: 'CallParticipantTimeline', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryCallSessionStatsResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - call_stats: { type: 'CallStatsSessionResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryCallStatsMapResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - call_ended_at: { type: 'DatetimeType', isSingle: true }, - - call_started_at: { type: 'DatetimeType', isSingle: true }, - - end_time: { type: 'DatetimeType', isSingle: true }, - - generated_at: { type: 'DatetimeType', isSingle: true }, - - start_time: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryCallStatsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - reports: { type: 'CallStatsReportSummaryResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryCallsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - calls: { type: 'CallStateResponseFields', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryCampaignsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - campaigns: { type: 'CampaignResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryChannelsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - channels: { type: 'ChannelStateResponseFields', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryCollectionsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - collections: { type: 'CollectionResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryCommentReactionsResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - reactions: { type: 'FeedsReactionResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryCommentsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - comments: { type: 'CommentResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryDraftsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - drafts: { type: 'DraftResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryFeedMembersResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - members: { type: 'FeedMemberResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryFeedModerationTemplate'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryFeedModerationTemplatesResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - templates: { type: 'QueryFeedModerationTemplate', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryFeedsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - feeds: { type: 'FeedResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryFollowsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - follows: { type: 'FollowResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryFutureChannelBansResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - bans: { type: 'FutureChannelBanResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryLabelResultsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - label_results: { type: 'LabelResultResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryMembershipLevelsResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - membership_levels: { type: 'MembershipLevelResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryMessageFlagsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - flags: { type: 'MessageFlagResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryMessageHistoryResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - message_history: { type: 'MessageHistoryEntryResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryModerationConfigsResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - configs: { type: 'ConfigResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryModerationFlagsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - flags: { type: 'ModerationFlagResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryModerationLogsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - logs: { type: 'ActionLogResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryModerationRulesResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - rules: { type: 'ModerationRuleV2Response', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryPinnedActivitiesResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - pinned_activities: { type: 'ActivityPinResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryPollsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - polls: { type: 'PollResponseData', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryPredefinedFiltersResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - predefined_filters: { type: 'PredefinedFilterResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryReactionsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - reactions: { type: 'ReactionResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryRemindersResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - reminders: { type: 'ReminderResponseData', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryReviewQueueResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - items: { type: 'ReviewQueueItemResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryRevisionHistoryResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - revisions: { type: 'RevisionHistoryResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QuerySegmentTargetsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - targets: { type: 'SegmentTargetResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QuerySegmentsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - segments: { type: 'SegmentResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryThreadsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - threads: { type: 'ThreadStateResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueryUsersResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - users: { type: 'FullUserResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['QueueResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - queue: { type: 'ModerationQueueResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['Reaction'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ReactionDeletedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - thread_participants: { type: 'UserResponseCommonFields', isSingle: false }, - - message: { type: 'MessageResponse', isSingle: true }, - - reaction: { type: 'ReactionResponse', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ReactionGroupResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - first_reaction_at: { type: 'DatetimeType', isSingle: true }, - - last_reaction_at: { type: 'DatetimeType', isSingle: true }, - - latest_reactions_by: { type: 'ReactionGroupUserResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['ReactionGroupUserResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ReactionNewEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - thread_participants: { type: 'UserResponseCommonFields', isSingle: false }, - - message: { type: 'MessageResponse', isSingle: true }, - - reaction: { type: 'ReactionResponse', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ReactionResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ReactionUpdatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - message: { type: 'MessageResponse', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - reaction: { type: 'ReactionResponse', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ReactivateUserResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ReadCollectionsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - collections: { type: 'CollectionResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['ReadStateResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - last_read: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - - last_delivered_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['RejectFeedMemberInviteResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - member: { type: 'FeedMemberResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['RejectFollowResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - follow: { type: 'FollowResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ReminderCreatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - reminder: { type: 'ReminderResponseData', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ReminderDeletedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - reminder: { type: 'ReminderResponseData', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ReminderNotificationEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - reminder: { type: 'ReminderResponseData', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ReminderResponseData'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - expires_at: { type: 'DatetimeType', isSingle: true }, - - remind_at: { type: 'DatetimeType', isSingle: true }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - message: { type: 'MessageResponse', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ReminderUpdatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - reminder: { type: 'ReminderResponseData', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['RemoveUserGroupMembersResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - user_group: { type: 'UserGroupResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ReportResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - call: { type: 'CallReportResponse', isSingle: true }, - - participants: { type: 'ParticipantReportResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ResolveSipInboundResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - sip_routing_rule: { type: 'SIPInboundRoutingRuleResponse', isSingle: true }, - - sip_trunk: { type: 'SIPTrunkResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['RestoreActivityResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - activity: { type: 'ActivityResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['RestoreCommentResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - activity: { type: 'ActivityResponse', isSingle: true }, - - comment: { type: 'CommentResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['RestoreFeedGroupResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - feed_group: { type: 'FeedGroupResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['RetentionPolicy'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - enabled_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ReviewQueueItemNewEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - flags: { type: 'ModerationFlagResponse', isSingle: false }, - - action: { type: 'ActionLogResponse', isSingle: true }, - - review_queue_item: { type: 'ReviewQueueItemResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ReviewQueueItemResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - actions: { type: 'ActionLogResponse', isSingle: false }, - - bans: { type: 'BanInfoResponse', isSingle: false }, - - flags: { type: 'ModerationFlagResponse', isSingle: false }, - - completed_at: { type: 'DatetimeType', isSingle: true }, - - escalated_at: { type: 'DatetimeType', isSingle: true }, - - reviewed_at: { type: 'DatetimeType', isSingle: true }, - - appeal: { type: 'AppealItemResponse', isSingle: true }, - - assigned_to: { type: 'UserResponse', isSingle: true }, - - call: { type: 'ModerationCallResponse', isSingle: true }, - - entity_creator: { type: 'EntityCreatorResponse', isSingle: true }, - - feeds_v2_reaction: { type: 'Reaction', isSingle: true }, - - feeds_v3_activity: { type: 'FeedsV3ActivityResponse', isSingle: true }, - - feeds_v3_comment: { type: 'FeedsV3CommentResponse', isSingle: true }, - - message: { type: 'ChatMessageResponse', isSingle: true }, - - reaction: { type: 'Reaction', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ReviewQueueItemUpdatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - flags: { type: 'ModerationFlagResponse', isSingle: false }, - - action: { type: 'ActionLogResponse', isSingle: true }, - - review_queue_item: { type: 'ReviewQueueItemResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['RevisionHistoryResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['RingAttemptResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - expires_at: { type: 'DatetimeType', isSingle: true }, - - targets: { type: 'RingTargetResponse', isSingle: false }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - settled_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['RingDeliveryResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - sent_at: { type: 'DatetimeType', isSingle: true }, - - acked_at: { type: 'DatetimeType', isSingle: true }, - - displayed_at: { type: 'DatetimeType', isSingle: true }, - - fetched_at: { type: 'DatetimeType', isSingle: true }, - - provider_accepted_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['RingTargetResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - state_at: { type: 'DatetimeType', isSingle: true }, - - deliveries: { type: 'RingDeliveryResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['Role'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['SIPInboundRoutingRuleResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['SIPTrunkResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['SearchResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - results: { type: 'SearchResult', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['SearchResult'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - message: { type: 'SearchResultMessage', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['SearchResultMessage'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - latest_reactions: { type: 'ReactionResponse', isSingle: false }, - - mentioned_users: { type: 'UserResponse', isSingle: false }, - - own_reactions: { type: 'ReactionResponse', isSingle: false }, - - user: { type: 'UserResponse', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - message_text_updated_at: { type: 'DatetimeType', isSingle: true }, - - pin_expires: { type: 'DatetimeType', isSingle: true }, - - pinned_at: { type: 'DatetimeType', isSingle: true }, - - mentioned_groups: { type: 'UserGroupResponse', isSingle: false }, - - thread_participants: { type: 'UserResponse', isSingle: false }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - draft: { type: 'DraftResponse', isSingle: true }, - - pinned_by: { type: 'UserResponse', isSingle: true }, - - poll: { type: 'PollResponseData', isSingle: true }, - - quoted_message: { type: 'MessageResponse', isSingle: true }, - - reaction_groups: { type: 'ReactionGroupResponse', isSingle: false }, - - reminder: { type: 'ReminderResponseData', isSingle: true }, - - shared_location: { type: 'SharedLocationResponseData', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['SearchRolesResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - roles: { type: 'Role', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['SearchUserGroupsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - user_groups: { type: 'UserGroupResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['Segment'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['SegmentResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['SegmentTargetResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['SendMessageResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - message: { type: 'MessageResponse', isSingle: true }, - - channel_context: { type: 'ChannelContextResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['SendReactionResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - message: { type: 'MessageResponse', isSingle: true }, - - reaction: { type: 'ReactionResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['SessionWarningResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - time: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['SetFeedsRetentionPolicyResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - policy: { type: 'FeedsRetentionPolicy', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['SetRetentionPolicyResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - policy: { type: 'RetentionPolicy', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['SetupSession'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - completed_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ShareResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['SharedLocationResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - end_at: { type: 'DatetimeType', isSingle: true }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - message: { type: 'MessageResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['SharedLocationResponseData'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - end_at: { type: 'DatetimeType', isSingle: true }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - message: { type: 'MessageResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['SharedLocationsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - active_live_locations: { - type: 'SharedLocationResponseData', - isSingle: false, - }, - }; - return decode(typeMappings, input); -}; - -decoders['SingleFollowResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - follow: { type: 'FollowResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['StartCampaignResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - campaign: { type: 'CampaignResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['StopLiveResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - call: { type: 'CallResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['StoriesFeedUpdatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - activities: { type: 'ActivityResponse', isSingle: false }, - - aggregated_activities: { - type: 'AggregatedActivityResponse', - isSingle: false, - }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['SubmitActionResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - appeal_item: { type: 'AppealItemResponse', isSingle: true }, - - item: { type: 'ReviewQueueItemResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ThreadParticipant'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - last_read_at: { type: 'DatetimeType', isSingle: true }, - - last_thread_message_at: { type: 'DatetimeType', isSingle: true }, - - left_thread_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ThreadResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - last_message_at: { type: 'DatetimeType', isSingle: true }, - - thread_participants: { type: 'ThreadParticipant', isSingle: false }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - created_by: { type: 'UserResponse', isSingle: true }, - - parent_message: { type: 'MessageResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ThreadStateResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - latest_replies: { type: 'MessageResponse', isSingle: false }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - last_message_at: { type: 'DatetimeType', isSingle: true }, - - read: { type: 'ReadStateResponse', isSingle: false }, - - thread_participants: { type: 'ThreadParticipant', isSingle: false }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - created_by: { type: 'UserResponse', isSingle: true }, - - draft: { type: 'DraftResponse', isSingle: true }, - - parent_message: { type: 'MessageResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ThreadUpdatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - thread: { type: 'ThreadResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['ThreadedCommentResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - mentioned_users: { type: 'UserResponse', isSingle: false }, - - own_reactions: { type: 'FeedsReactionResponse', isSingle: false }, - - user: { type: 'UserResponse', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - edited_at: { type: 'DatetimeType', isSingle: true }, - - latest_reactions: { type: 'FeedsReactionResponse', isSingle: false }, - - replies: { type: 'ThreadedCommentResponse', isSingle: false }, - - reaction_groups: { type: 'FeedsReactionGroupResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['TranslateActivityResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - activity: { type: 'ActivityResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['TranslateCommentResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - comment: { type: 'CommentResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['TranslateMessageResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - message: { type: 'MessageResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['TruncateChannelResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - channel: { type: 'ChannelResponse', isSingle: true }, - - message: { type: 'MessageResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UnblockedUserEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UndeleteMessageResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - message: { type: 'MessageResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UnfollowBatchResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - follows: { type: 'FollowResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['UnfollowResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - follow: { type: 'FollowResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UnpinActivityResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - activity: { type: 'ActivityResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UnreadCountsBatchResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - counts_by_user: { type: 'UnreadCountsResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['UnreadCountsChannel'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - last_read: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UnreadCountsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - channels: { type: 'UnreadCountsChannel', isSingle: false }, - - threads: { type: 'UnreadCountsThread', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['UnreadCountsThread'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - last_read: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateActivitiesPartialBatchResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - activities: { type: 'ActivityResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateActivityPartialResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - activity: { type: 'ActivityResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateActivityResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - activity: { type: 'ActivityResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateBlockListResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - blocklist: { type: 'BlockListResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateBookmarkFolderResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - bookmark_folder: { type: 'BookmarkFolderResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateBookmarkResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - bookmark: { type: 'BookmarkResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateCallMembersResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - members: { type: 'MemberResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateCallResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - members: { type: 'MemberResponse', isSingle: false }, - - call: { type: 'CallResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateCallTypeResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateChannelPartialResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - members: { type: 'ChannelMemberResponse', isSingle: false }, - - channel: { type: 'ChannelResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateChannelResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - members: { type: 'ChannelMemberResponse', isSingle: false }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - message: { type: 'MessageResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateChannelTypeResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateCollectionsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - collections: { type: 'CollectionResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateCommandResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - command: { type: 'Command', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateCommentBookmarkResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - bookmark: { type: 'BookmarkResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateCommentPartialResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - comment: { type: 'CommentResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateCommentResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - comment: { type: 'CommentResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateFeedGroupResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - feed_group: { type: 'FeedGroupResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateFeedMembersResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - added: { type: 'FeedMemberResponse', isSingle: false }, - - updated: { type: 'FeedMemberResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateFeedResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - feed: { type: 'FeedResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateFeedViewResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - feed_view: { type: 'FeedViewResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateFollowResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - follow: { type: 'FollowResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateMemberPartialResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - channel_member: { type: 'ChannelMemberResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateMembershipLevelResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - membership_level: { type: 'MembershipLevelResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateMessagePartialResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - message: { type: 'MessageResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateMessageResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - message: { type: 'MessageResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdatePredefinedFilterResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - predefined_filter: { type: 'PredefinedFilterResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateReminderResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - reminder: { type: 'ReminderResponseData', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateSIPInboundRoutingRuleResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - sip_inbound_routing_rule: { - type: 'SIPInboundRoutingRuleResponse', - isSingle: true, - }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateSIPTrunkResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - sip_trunk: { type: 'SIPTrunkResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateSegmentResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - segment: { type: 'SegmentResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateThreadPartialResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - thread: { type: 'ThreadResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateUserGroupResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - user_group: { type: 'UserGroupResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdateUsersResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - users: { type: 'FullUserResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['UpdatedCallPermissionsEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpsertActivitiesResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - activities: { type: 'ActivityResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['UpsertCollectionsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - collections: { type: 'CollectionResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['UpsertConfigResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - config: { type: 'ConfigResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpsertModerationRuleResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - rule: { type: 'ModerationRuleV2Response', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpsertModerationTemplateResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpsertPushPreferencesResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - user_preferences: { type: 'PushPreferencesResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['UpsertPushProviderResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - push_provider: { type: 'PushProviderResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpsertPushTemplateResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - template: { type: 'PushTemplateResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UpsertSetupSessionResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - setup_session: { type: 'SetupSession', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UserBannedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - - expiration: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - created_by: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UserDeactivatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - created_by: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UserDeletedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UserFlaggedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - target_user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UserGroupCreatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UserGroupDeletedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UserGroupMember'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UserGroupMemberAddedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UserGroupMemberRemovedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UserGroupResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - members: { type: 'UserGroupMember', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['UserGroupUpdatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UserMessagesDeletedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UserMuteResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - expires: { type: 'DatetimeType', isSingle: true }, - - target: { type: 'UserResponse', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UserMutedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - target_users: { type: 'UserResponseCommonFields', isSingle: false }, - - target_user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UserReactivatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - created_by: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UserResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - ban_expires: { type: 'DatetimeType', isSingle: true }, - - deactivated_at: { type: 'DatetimeType', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - last_active: { type: 'DatetimeType', isSingle: true }, - - revoke_tokens_issued_before: { type: 'DatetimeType', isSingle: true }, - - devices: { type: 'DeviceResponse', isSingle: false }, - - push_notifications: { - type: 'PushNotificationSettingsResponse', - isSingle: true, - }, - }; - return decode(typeMappings, input); -}; - -decoders['UserResponseCommonFields'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - deactivated_at: { type: 'DatetimeType', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - last_active: { type: 'DatetimeType', isSingle: true }, - - revoke_tokens_issued_before: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UserUnbannedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - created_by: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UserUnmutedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - - target_users: { type: 'UserResponseCommonFields', isSingle: false }, - - target_user: { type: 'UserResponseCommonFields', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UserUnreadReminderEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'UserResponseCommonFields', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['UserUpdatedEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - received_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['VideoReactionOverTimeResponse'] = (input?: { - [key: string]: any; -}) => { - const typeMappings: TypeMapping = { - by_minute: { type: 'CountByMinuteResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders['VideoReactionsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - count_over_time: { type: 'VideoReactionOverTimeResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['WSEvent'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - channel_last_message_at: { type: 'DatetimeType', isSingle: true }, - - channel: { type: 'ChannelResponse', isSingle: true }, - - created_by: { type: 'UserResponse', isSingle: true }, - - me: { type: 'OwnUserResponse', isSingle: true }, - - member: { type: 'ChannelMemberResponse', isSingle: true }, - - message: { type: 'MessageResponse', isSingle: true }, - - poll: { type: 'PollResponseData', isSingle: true }, - - poll_vote: { type: 'PollVoteResponseData', isSingle: true }, - - reaction: { type: 'ReactionResponse', isSingle: true }, - - thread: { type: 'ThreadResponse', isSingle: true }, - - user: { type: 'UserResponse', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders['WrappedUnreadCountsResponse'] = (input?: { [key: string]: any }) => { - const typeMappings: TypeMapping = { - channels: { type: 'UnreadCountsChannel', isSingle: false }, - - threads: { type: 'UnreadCountsThread', isSingle: false }, + app: { type: 'AppResponseFields', isSingle: true }, }; return decode(typeMappings, input); }; diff --git a/src/gen/models/index.ts b/src/gen/models/index.ts index 1beb5f3..4475e6d 100644 --- a/src/gen/models/index.ts +++ b/src/gen/models/index.ts @@ -1,3 +1,29 @@ +declare const timestampNsBrand: unique symbol; + +/** + * A unix-nanosecond timestamp, exactly as the server sends it. + * + * NOT milliseconds. `new Date(t)` is out of range and yields an Invalid Date, whose + * `.toISOString()` then throws; `models/timestamp-guard.ts` turns that into a + * compile error. Comparing or sorting two timestamps is fine -- same unit, plain + * numbers. Everything else should go through this SDK's time helpers: + * + * nsToDate(t) a Date + * convertTimestampToDate(t) a Date, or undefined when the value is absent or NaN + * nsToMs(t) epoch ms, for arithmetic against Date.now() + * nsToRfc3339(t) an RFC3339 string keeping sub-millisecond precision + * dateToNs(d), msToNs(ms) back to a wire timestamp + * nowNs() the local clock, wire-comparable + * asTimestampNS(n) brand a number already in ns (DB rows, fixtures) -- no conversion + * + * A request date field is typed `Date`, not this -- pass `nsToDate(t)` when handing a + * server-sent timestamp back to the API, or `nsToRfc3339(t)` where precision matters. + * + * Values above `Number.MAX_SAFE_INTEGER` are quantised to ~256ns, so ordering holds + * but exact equality after a JSON round-trip does not. + */ +export type TimestampNS = number & { readonly [timestampNsBrand]: true }; + export interface AIAudioConfigRequest { /** * Bodyguard credentials profile to classify transcripts with. Applies to the NLP engine only; ignored when LLM configurability is enabled. Empty falls back to the app-pinned profile, then the organization's top-level credentials @@ -93,6 +119,10 @@ export interface APIError { * Additional error-specific information */ details: Array; + /** + * Milliseconds until the user's slow mode cool down period ends. Only set on code 60 (cool down) errors + */ + cooldown_remaining_ms?: number; /** * Flag that indicates if the error is unrecoverable, requests that return unrecoverable errors should not be retried, this error only applies to the request that caused it */ @@ -205,7 +235,7 @@ export interface ActionLogResponse { /** * Timestamp when the action was taken */ - created_at: Date; + created_at: TimestampNS; /** * Unique identifier of the action log */ @@ -295,7 +325,7 @@ export interface ActivityAddedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; fid: string; activity: ActivityResponse; custom: Record; @@ -304,7 +334,7 @@ export interface ActivityAddedEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; } @@ -312,7 +342,7 @@ export interface ActivityDeletedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; fid: string; activity: ActivityResponse; custom: Record; @@ -321,7 +351,7 @@ export interface ActivityDeletedEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; } @@ -329,14 +359,14 @@ export interface ActivityFeedbackEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; activity_feedback: ActivityFeedbackEventPayload; custom: Record; /** * The type of event: "feeds.activity.feedback" in this case */ type: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; } @@ -352,11 +382,11 @@ export interface ActivityFeedbackEventPayload { /** * When the feedback was created */ - created_at: Date; + created_at: TimestampNS; /** * When the feedback was last updated */ - updated_at: Date; + updated_at: TimestampNS; /** * The feedback value (true/false) */ @@ -406,7 +436,7 @@ export interface ActivityMarkEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; fid: string; custom: Record; /** @@ -422,7 +452,7 @@ export interface ActivityMarkEvent { * Whether all activities were marked as seen */ mark_all_seen?: boolean; - received_at?: Date; + received_at?: TimestampNS; /** * The IDs of activities marked as read */ @@ -453,7 +483,7 @@ export interface ActivityPinResponse { /** * When the pin was created */ - created_at: Date; + created_at: TimestampNS; /** * ID of the feed where activity is pinned */ @@ -461,7 +491,7 @@ export interface ActivityPinResponse { /** * When the pin was last updated */ - updated_at: Date; + updated_at: TimestampNS; activity: ActivityResponse; /** * User response object @@ -473,7 +503,7 @@ export interface ActivityPinnedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * The ID of the feed */ @@ -485,7 +515,7 @@ export interface ActivityPinnedEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; } @@ -523,7 +553,7 @@ export interface ActivityReactionAddedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; fid: string; activity: ActivityResponse; custom: Record; @@ -533,7 +563,7 @@ export interface ActivityReactionAddedEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; } @@ -541,7 +571,7 @@ export interface ActivityReactionDeletedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; fid: string; activity: ActivityResponse; custom: Record; @@ -551,7 +581,7 @@ export interface ActivityReactionDeletedEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; } @@ -559,7 +589,7 @@ export interface ActivityReactionUpdatedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; fid: string; activity: ActivityResponse; custom: Record; @@ -569,7 +599,7 @@ export interface ActivityReactionUpdatedEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; } @@ -577,7 +607,7 @@ export interface ActivityRemovedFromFeedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; fid: string; activity: ActivityResponse; custom: Record; @@ -586,7 +616,7 @@ export interface ActivityRemovedFromFeedEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; } @@ -699,7 +729,7 @@ export interface ActivityResponse { /** * When the activity was created */ - created_at: Date; + created_at: TimestampNS; /** * If this activity is hidden by this user (using activity feedback) */ @@ -739,7 +769,7 @@ export interface ActivityResponse { /** * When the activity was last updated */ - updated_at: Date; + updated_at: TimestampNS; /** * Visibility setting for the activity. One of: public, private, tag */ @@ -803,15 +833,15 @@ export interface ActivityResponse { /** * When the activity was deleted */ - deleted_at?: Date; + deleted_at?: TimestampNS; /** * When the activity was last edited */ - edited_at?: Date; + edited_at?: TimestampNS; /** * When the activity will expire */ - expires_at?: Date; + expires_at?: TimestampNS; /** * Total count of reactions from friends on this activity */ @@ -868,7 +898,7 @@ export interface ActivityRestoredEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; fid: string; activity: ActivityResponse; custom: Record; @@ -877,7 +907,7 @@ export interface ActivityRestoredEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; } @@ -940,7 +970,7 @@ export interface ActivitySelectorConfigResponse { /** * Time threshold for activity selection (timestamp) */ - cutoff_time?: Date; + cutoff_time?: TimestampNS; /** * Flexible relative time window for activity selection (e.g., '1h', '3d', '1y') */ @@ -976,7 +1006,7 @@ export interface ActivityUnpinnedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * The ID of the feed */ @@ -988,7 +1018,7 @@ export interface ActivityUnpinnedEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; } @@ -996,7 +1026,7 @@ export interface ActivityUpdatedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; fid: string; activity: ActivityResponse; custom: Record; @@ -1005,7 +1035,7 @@ export interface ActivityUpdatedEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; } @@ -1054,6 +1084,7 @@ export interface AddActivityRequest { * Whether to skip URL enrichment for the activity */ skip_enrich_url?: boolean; + skip_existing?: boolean; /** * Whether to skip push notifications */ @@ -1116,6 +1147,10 @@ export interface AddActivityResponse { * Number of mention notification activities created for mentioned users */ mention_notifications_created?: number; + /** + * Contains the activity ID when skip_existing is true and the activity already existed, so it was left unchanged. + */ + skipped_existing?: Array; } export interface AddBookmarkRequest { @@ -1430,7 +1465,7 @@ export interface AggregatedActivityResponse { /** * When the aggregation was created */ - created_at: Date; + created_at: TimestampNS; /** * Grouping identifier */ @@ -1442,7 +1477,7 @@ export interface AggregatedActivityResponse { /** * When the aggregation was last updated */ - updated_at: Date; + updated_at: TimestampNS; /** * Number of unique users in this aggregation */ @@ -1566,6 +1601,14 @@ export interface AnalyzeResponse { * `complete` (all fields screened), `partial` (mix of verdicts and per-field errors), or `pending` (async). */ status: string; + /** + * ID of the LLM model that scored the content (e.g. gpt-4o-mini). Omitted when no LLM verdict was used (e.g. Bodyguard-only, or `pending`). + */ + llm_model?: string; + /** + * reasoning_effort sent with the LLM request. Omitted when the request did not send one. + */ + llm_reasoning_effort?: string; /** * Per-image moderation verdicts keyed by caller label. */ @@ -1603,6 +1646,17 @@ export interface AnalyzeTextField { classifications?: Array; } +export interface AppDefaults { + /** + * Defaults applied by the get-or-create channel endpoint. + */ + get_or_create_channel: GetOrCreateChannelDefaults; + /** + * Defaults applied by the query channels endpoint. + */ + query_channels: QueryChannelsDefaults; +} + export interface AppResponseFields { allow_multi_user_devices: boolean; /** @@ -1660,6 +1714,10 @@ export interface AppResponseFields { webhook_events: Array; call_types: Record; channel_configs: Record; + /** + * Request limit defaults applied by the server when the corresponding field is omitted. + */ + defaults: AppDefaults; file_upload_config: FileUploadConfig; grants: Record>; image_upload_config: FileUploadConfig; @@ -1670,7 +1728,7 @@ export interface AppResponseFields { chat_primary_use_case?: string; moderation_onboarding_complete?: boolean; moderation_s3_image_access_role_arn?: string; - revoke_tokens_issued_before?: Date; + revoke_tokens_issued_before?: TimestampNS; video_primary_use_case?: string; allowed_flag_reasons?: Array; geofences?: Array; @@ -1681,18 +1739,18 @@ export interface AppResponseFields { } export interface AppealAcceptedEvent { - created_at: Date; + created_at: TimestampNS; custom: Record; type: string; - received_at?: Date; + received_at?: TimestampNS; appeal?: AppealItemResponse; } export interface AppealCreatedEvent { - created_at: Date; + created_at: TimestampNS; custom: Record; type: string; - received_at?: Date; + received_at?: TimestampNS; appeal?: AppealItemResponse; } @@ -1704,7 +1762,7 @@ export interface AppealItemResponse { /** * When the flag was created */ - created_at: Date; + created_at: TimestampNS; /** * ID of the entity */ @@ -1721,7 +1779,7 @@ export interface AppealItemResponse { /** * When the flag was last updated */ - updated_at: Date; + updated_at: TimestampNS; /** * Text severity level assigned by the AI provider */ @@ -1788,10 +1846,10 @@ export interface AppealItemResponse { } export interface AppealRejectedEvent { - created_at: Date; + created_at: TimestampNS; custom: Record; type: string; - received_at?: Date; + received_at?: TimestampNS; appeal?: AppealItemResponse; } @@ -1836,105 +1894,105 @@ export interface AppealResponse { } export interface AsyncBulkImageModerationEvent { - created_at: Date; - finished_at: Date; - started_at: Date; + created_at: TimestampNS; + finished_at: TimestampNS; + started_at: TimestampNS; task_id: string; url: string; custom: Record; type: string; - received_at?: Date; + received_at?: TimestampNS; } export interface AsyncExportChannelsEvent { - created_at: Date; - finished_at: Date; - started_at: Date; + created_at: TimestampNS; + finished_at: TimestampNS; + started_at: TimestampNS; task_id: string; url: string; custom: Record; type: string; - received_at?: Date; + received_at?: TimestampNS; } export interface AsyncExportErrorEvent { - created_at: Date; + created_at: TimestampNS; error: string; - finished_at: Date; - started_at: Date; + finished_at: TimestampNS; + started_at: TimestampNS; task_id: string; custom: Record; type: string; - received_at?: Date; + received_at?: TimestampNS; } export interface AsyncExportLabelResultsEvent { - created_at: Date; - finished_at: Date; - started_at: Date; + created_at: TimestampNS; + finished_at: TimestampNS; + started_at: TimestampNS; task_id: string; url: string; custom: Record; type: string; - received_at?: Date; + received_at?: TimestampNS; } export interface AsyncExportModerationLogsEvent { - created_at: Date; - finished_at: Date; - started_at: Date; + created_at: TimestampNS; + finished_at: TimestampNS; + started_at: TimestampNS; task_id: string; url: string; custom: Record; type: string; - received_at?: Date; + received_at?: TimestampNS; } export interface AsyncExportReviewQueueEvent { - created_at: Date; - finished_at: Date; - started_at: Date; + created_at: TimestampNS; + finished_at: TimestampNS; + started_at: TimestampNS; task_id: string; url: string; custom: Record; type: string; - received_at?: Date; + received_at?: TimestampNS; } export interface AsyncExportUsersEvent { - created_at: Date; - finished_at: Date; - started_at: Date; + created_at: TimestampNS; + finished_at: TimestampNS; + started_at: TimestampNS; task_id: string; url: string; custom: Record; type: string; - received_at?: Date; + received_at?: TimestampNS; } export interface AsyncImportErrorEvent { - created_at: Date; + created_at: TimestampNS; error: string; - finished_at: Date; + finished_at: TimestampNS; product: string; state: string; task_id: string; custom: Record; type: string; - received_at?: Date; - started_at?: Date; + received_at?: TimestampNS; + started_at?: TimestampNS; } export interface AsyncImportSuccessEvent { - created_at: Date; - finished_at: Date; + created_at: TimestampNS; + finished_at: TimestampNS; product: string; state: string; task_id: string; custom: Record; type: string; - received_at?: Date; - started_at?: Date; + received_at?: TimestampNS; + started_at?: TimestampNS; } export interface AsyncModerationCallbackConfig { @@ -2139,7 +2197,7 @@ export interface BanInfoResponse { /** * When the ban was created */ - created_at: Date; + created_at: TimestampNS; /** * The channel this ban applies to. Empty if this is an app-wide (global) ban rather than a per-channel ban. */ @@ -2147,7 +2205,7 @@ export interface BanInfoResponse { /** * When the ban expires */ - expires?: Date; + expires?: TimestampNS; /** * Reason for the ban */ @@ -2220,8 +2278,8 @@ export interface BanRequest { } export interface BanResponse { - created_at: Date; - expires?: Date; + created_at: TimestampNS; + expires?: TimestampNS; reason?: string; shadow?: boolean; /** @@ -2349,14 +2407,14 @@ export interface BlockListResponse { /** * Date/time of creation */ - created_at?: Date; + created_at?: TimestampNS; id?: string; owner_user_id?: string; team?: string; /** * Date/time of the last update */ - updated_at?: Date; + updated_at?: TimestampNS; } export interface BlockListRule { @@ -2411,7 +2469,7 @@ export interface BlockUsersResponse { /** * Timestamp when the user was blocked */ - created_at: Date; + created_at: TimestampNS; /** * Duration of the request in milliseconds */ @@ -2420,7 +2478,7 @@ export interface BlockUsersResponse { export interface BlockedUserEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * User response object */ @@ -2440,7 +2498,7 @@ export interface BlockedUserResponse { * ID of the user who got blocked */ blocked_user_id: string; - created_at: Date; + created_at: TimestampNS; /** * ID of the user who blocked another user */ @@ -2497,14 +2555,14 @@ export interface BookmarkAddedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; bookmark: BookmarkResponse; custom: Record; /** * The type of event: "feeds.bookmark.added" in this case */ type: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; } @@ -2512,14 +2570,14 @@ export interface BookmarkDeletedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; bookmark: BookmarkResponse; custom: Record; /** * The type of event: "feeds.bookmark.deleted" in this case */ type: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; } @@ -2527,14 +2585,14 @@ export interface BookmarkFolderDeletedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; bookmark_folder: BookmarkFolderResponse; custom: Record; /** * The type of event: "feeds.bookmark_folder.deleted" in this case */ type: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; } @@ -2542,7 +2600,7 @@ export interface BookmarkFolderResponse { /** * When the folder was created */ - created_at: Date; + created_at: TimestampNS; /** * Unique identifier for the folder */ @@ -2554,7 +2612,7 @@ export interface BookmarkFolderResponse { /** * When the folder was last updated */ - updated_at: Date; + updated_at: TimestampNS; /** * User response object */ @@ -2569,14 +2627,14 @@ export interface BookmarkFolderUpdatedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; bookmark_folder: BookmarkFolderResponse; custom: Record; /** * The type of event: "feeds.bookmark_folder.updated" in this case */ type: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; } @@ -2584,7 +2642,7 @@ export interface BookmarkResponse { /** * When the bookmark was created */ - created_at: Date; + created_at: TimestampNS; /** * ID of the bookmarked object */ @@ -2596,7 +2654,7 @@ export interface BookmarkResponse { /** * When the bookmark was last updated */ - updated_at: Date; + updated_at: TimestampNS; activity: ActivityResponse; /** * User response object @@ -2615,14 +2673,14 @@ export interface BookmarkUpdatedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; bookmark: BookmarkResponse; custom: Record; /** * The type of event: "feeds.bookmark.updated" in this case */ type: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; } @@ -2846,7 +2904,7 @@ export interface BypassResponse { export interface CallAcceptedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * Represents a call */ @@ -2872,11 +2930,11 @@ export interface CallActionOptions { } export interface CallClosedCaption { - end_time: Date; + end_time: TimestampNS; id: string; language: string; speaker_id: string; - start_time: Date; + start_time: TimestampNS; text: string; translated: boolean; /** @@ -2888,7 +2946,7 @@ export interface CallClosedCaption { export interface CallClosedCaptionsFailedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * The type of event: "call.closed_captions_failed" in this case */ @@ -2897,7 +2955,7 @@ export interface CallClosedCaptionsFailedEvent { export interface CallClosedCaptionsStartedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * The type of event: "call.closed_captions_started" in this case */ @@ -2906,7 +2964,7 @@ export interface CallClosedCaptionsStartedEvent { export interface CallClosedCaptionsStoppedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * The type of event: "call.transcription_stopped" in this case */ @@ -2915,7 +2973,7 @@ export interface CallClosedCaptionsStoppedEvent { export interface CallCreatedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * the members added to this call */ @@ -2937,7 +2995,7 @@ export interface CallCustomPropertyParameters { export interface CallDTMFEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * The DTMF digit (0-9, *, #, A-D) */ @@ -2953,7 +3011,7 @@ export interface CallDTMFEvent { /** * When the digit press ended and was detected */ - timestamp: Date; + timestamp: TimestampNS; /** * User response object */ @@ -2966,7 +3024,7 @@ export interface CallDTMFEvent { export interface CallDeletedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * Represents a call */ @@ -2987,7 +3045,7 @@ export interface CallDurationReportResponse { export interface CallEndedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * Represents a call */ @@ -3012,7 +3070,7 @@ export interface CallEndedEvent { export interface CallFrameRecordingFailedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; egress_id: string; /** * Represents a call @@ -3029,8 +3087,8 @@ export interface CallFrameRecordingFrameReadyEvent { /** * The time the frame was captured */ - captured_at: Date; - created_at: Date; + captured_at: TimestampNS; + created_at: TimestampNS; egress_id: string; /** * Call session ID @@ -3056,7 +3114,7 @@ export interface CallFrameRecordingFrameReadyEvent { export interface CallFrameRecordingStartedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; egress_id: string; /** * Represents a call @@ -3070,7 +3128,7 @@ export interface CallFrameRecordingStartedEvent { export interface CallFrameRecordingStoppedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; egress_id: string; /** * Represents a call @@ -3084,7 +3142,7 @@ export interface CallFrameRecordingStoppedEvent { export interface CallHLSBroadcastingFailedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * The type of event: "call.hls_broadcasting_failed" in this case */ @@ -3093,7 +3151,7 @@ export interface CallHLSBroadcastingFailedEvent { export interface CallHLSBroadcastingStartedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; hls_playlist_url: string; /** * Represents a call @@ -3107,7 +3165,7 @@ export interface CallHLSBroadcastingStartedEvent { export interface CallHLSBroadcastingStoppedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * The type of event: "call.hls_broadcasting_stopped" in this case */ @@ -3132,7 +3190,7 @@ export interface CallLevelEventPayload { export interface CallLiveStartedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * Represents a call */ @@ -3145,7 +3203,7 @@ export interface CallLiveStartedEvent { export interface CallMemberAddedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * the members added to this call */ @@ -3162,7 +3220,7 @@ export interface CallMemberAddedEvent { export interface CallMemberRemovedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * the list of member IDs removed from the call */ @@ -3179,7 +3237,7 @@ export interface CallMemberRemovedEvent { export interface CallMemberUpdatedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * The list of members that were updated */ @@ -3196,7 +3254,7 @@ export interface CallMemberUpdatedEvent { export interface CallMemberUpdatedPermissionEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * The list of members that were updated */ @@ -3217,7 +3275,7 @@ export interface CallMemberUpdatedPermissionEvent { export interface CallMissedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; notify_user: boolean; /** * Call session ID @@ -3243,7 +3301,7 @@ export interface CallMissedEvent { export interface CallModerationBlurEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * The user ID whose video stream is being blurred */ @@ -3260,7 +3318,7 @@ export interface CallModerationBlurEvent { export interface CallModerationWarningEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * The warning message */ @@ -3281,7 +3339,7 @@ export interface CallModerationWarningEvent { export interface CallNotificationEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * Call session ID */ @@ -3313,7 +3371,7 @@ export interface CallParticipantCountReportResponse { } export interface CallParticipantResponse { - joined_at: Date; + joined_at: TimestampNS; role: string; user_session_id: string; /** @@ -3324,14 +3382,14 @@ export interface CallParticipantResponse { export interface CallParticipantTimeline { severity: string; - timestamp: Date; + timestamp: TimestampNS; type: string; data: Record; } export interface CallReactionEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; reaction: VideoReactionResponse; /** * The type of event: "call.reaction_new" in this case @@ -3340,17 +3398,17 @@ export interface CallReactionEvent { } export interface CallRecording { - end_time: Date; + end_time: TimestampNS; filename: string; recording_type: string; session_id: string; - start_time: Date; + start_time: TimestampNS; url: string; } export interface CallRecordingFailedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; egress_id: string; /** * The type of recording @@ -3364,7 +3422,7 @@ export interface CallRecordingFailedEvent { export interface CallRecordingReadyEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; egress_id: string; /** * The type of recording @@ -3382,7 +3440,7 @@ export interface CallRecordingReadyEvent { export interface CallRecordingStartedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; egress_id: string; /** * The type of recording @@ -3396,7 +3454,7 @@ export interface CallRecordingStartedEvent { export interface CallRecordingStoppedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; egress_id: string; /** * The type of recording @@ -3410,7 +3468,7 @@ export interface CallRecordingStoppedEvent { export interface CallRejectedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * Represents a call */ @@ -3431,8 +3489,8 @@ export interface CallRejectedEvent { export interface CallReportResponse { score: number; - ended_at?: Date; - started_at?: Date; + ended_at?: TimestampNS; + started_at?: TimestampNS; } export interface CallRequest { @@ -3460,7 +3518,7 @@ export interface CallResponse { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; current_session_id: string; /** * Call ID @@ -3476,7 +3534,7 @@ export interface CallResponse { /** * Date/time of the last update */ - updated_at: Date; + updated_at: TimestampNS; blocked_user_ids: Array; /** * User response object @@ -3496,7 +3554,7 @@ export interface CallResponse { /** * Date/time when the call ended */ - ended_at?: Date; + ended_at?: TimestampNS; join_ahead_time_seconds?: number; /** * 10-digit routing number for SIP routing @@ -3505,7 +3563,7 @@ export interface CallResponse { /** * Date/time when the call will start */ - starts_at?: Date; + starts_at?: TimestampNS; team?: string; session?: CallSessionResponse; thumbnails?: ThumbnailResponse; @@ -3513,7 +3571,7 @@ export interface CallResponse { export interface CallRingEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * Call session ID */ @@ -3543,7 +3601,7 @@ export interface CallRingEvent { export interface CallRingSettledEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * ID of the user who rang */ @@ -3555,7 +3613,7 @@ export interface CallRingSettledEvent { /** * When the ring was sent */ - rang_at: Date; + rang_at: TimestampNS; /** * Identifies this ring of the call session, as carried on call.ring */ @@ -3571,7 +3629,7 @@ export interface CallRingSettledEvent { /** * When the outcome left ringing */ - settled_at: Date; + settled_at: TimestampNS; /** * ID of the user whose action closed the ring, or 'server' for the missed-call deadline and automatic ends */ @@ -3594,7 +3652,7 @@ export interface CallRtmpBroadcastFailedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * Name of the given RTMP broadcast */ @@ -3613,7 +3671,7 @@ export interface CallRtmpBroadcastStartedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * Name of the given RTMP broadcast */ @@ -3632,7 +3690,7 @@ export interface CallRtmpBroadcastStoppedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * Name of the given RTMP broadcast */ @@ -3651,7 +3709,7 @@ export interface CallRuleActionSequence { export interface CallSessionEndedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * Call session ID */ @@ -3669,7 +3727,7 @@ export interface CallSessionEndedEvent { export interface CallSessionParticipantCountsUpdatedEvent { anonymous_participant_count: number; call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * Call session ID */ @@ -3683,7 +3741,7 @@ export interface CallSessionParticipantCountsUpdatedEvent { export interface CallSessionParticipantJoinedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * Call session ID */ @@ -3697,7 +3755,7 @@ export interface CallSessionParticipantJoinedEvent { export interface CallSessionParticipantLeftEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * The duration participant was in the session in seconds */ @@ -3721,20 +3779,20 @@ export interface CallSessionResponse { anonymous_participant_count: number; id: string; participants: Array; - accepted_by: Record; - missed_by: Record; + accepted_by: Record; + missed_by: Record; participants_count_by_role: Record; - rejected_by: Record; - ended_at?: Date; - live_ended_at?: Date; - live_started_at?: Date; - started_at?: Date; - timer_ends_at?: Date; + rejected_by: Record; + ended_at?: TimestampNS; + live_ended_at?: TimestampNS; + live_started_at?: TimestampNS; + started_at?: TimestampNS; + timer_ends_at?: TimestampNS; } export interface CallSessionStartedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * Call session ID */ @@ -3777,6 +3835,7 @@ export interface CallSettingsRequest { geofencing?: GeofenceSettingsRequest; individual_recording?: IndividualRecordingSettingsRequest; ingress?: IngressSettingsRequest; + lifecycle?: LifecycleSettingsRequest; limits?: LimitsSettingsRequest; raw_recording?: RawRecordingSettingsRequest; recording?: RecordSettingsRequest; @@ -3802,6 +3861,10 @@ export interface CallSettingsResponse { frame_recording: FrameRecordingSettingsResponse; geofencing: GeofenceSettingsResponse; individual_recording: IndividualRecordingSettingsResponse; + /** + * LifecycleSettings is the payload for call lifecycle settings + */ + lifecycle: LifecycleSettingsResponse; limits: LimitsSettingsResponse; raw_recording: RawRecordingSettingsResponse; /** @@ -3880,7 +3943,7 @@ export interface CallStatsMapSubscribers { export interface CallStatsParticipant { user_id: string; sessions: Array; - latest_activity_at?: Date; + latest_activity_at?: TimestampNS; name?: string; roles?: Array; } @@ -3913,7 +3976,7 @@ export interface CallStatsParticipantSession { current_ip?: string; current_sfu?: string; distance_to_sfu_kilometers?: number; - ended_at?: Date; + ended_at?: TimestampNS; freezes_duration_ms?: number; ingress?: string; jitter_ms?: number; @@ -3922,7 +3985,7 @@ export interface CallStatsParticipantSession { publisher_type?: string; sdk?: string; sdk_version?: string; - started_at?: Date; + started_at?: TimestampNS; unified_session_id?: string; webrtc_version?: string; location?: CallStatsLocation; @@ -3930,7 +3993,7 @@ export interface CallStatsParticipantSession { export interface CallStatsReportReadyEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * Call session ID */ @@ -3955,8 +4018,8 @@ export interface CallStatsReportSummaryResponse { call_duration_seconds: number; call_session_id: string; call_status: string; - first_stats_time: Date; - created_at?: Date; + first_stats_time: TimestampNS; + created_at?: TimestampNS; min_user_rating?: number; quality_score?: number; } @@ -3965,23 +4028,23 @@ export interface CallStatsSessionResponse { call_id: string; call_session_id: string; call_type: string; - generated_at: Date; + generated_at: TimestampNS; counts: CallStatsParticipantCounts; - call_ended_at?: Date; - call_started_at?: Date; + call_ended_at?: TimestampNS; + call_started_at?: TimestampNS; } export interface CallTranscription { - end_time: Date; + end_time: TimestampNS; filename: string; session_id: string; - start_time: Date; + start_time: TimestampNS; url: string; } export interface CallTranscriptionFailedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; egress_id: string; /** * The type of event: "call.transcription_failed" in this case @@ -3995,7 +4058,7 @@ export interface CallTranscriptionFailedEvent { export interface CallTranscriptionReadyEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; egress_id: string; /** * CallTranscription represents a transcription of a call. @@ -4009,7 +4072,7 @@ export interface CallTranscriptionReadyEvent { export interface CallTranscriptionStartedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; egress_id: string; /** * The type of event: "call.transcription_started" in this case @@ -4019,7 +4082,7 @@ export interface CallTranscriptionStartedEvent { export interface CallTranscriptionStoppedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; egress_id: string; /** * The type of event: "call.transcription_stopped" in this case @@ -4029,11 +4092,11 @@ export interface CallTranscriptionStoppedEvent { export interface CallType { app: number; - created_at: Date; + created_at: TimestampNS; id: number; name: string; recording_external_storage: string; - updated_at: Date; + updated_at: TimestampNS; notification_settings?: NotificationSettings; settings?: CallSettings; } @@ -4042,7 +4105,7 @@ export interface CallTypeResponse { /** * the time the call type was created */ - created_at: Date; + created_at: TimestampNS; /** * the name of the call type */ @@ -4050,7 +4113,7 @@ export interface CallTypeResponse { /** * the time the call type was last updated */ - updated_at: Date; + updated_at: TimestampNS; /** * the permissions granted to each role */ @@ -4069,7 +4132,7 @@ export interface CallTypeRuleParameters { export interface CallUpdatedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * Represents a call */ @@ -4086,7 +4149,7 @@ export interface CallUpdatedEvent { export interface CallUserFeedbackSubmittedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * The rating given by the user (1-5) */ @@ -4117,7 +4180,7 @@ export interface CallUserFeedbackSubmittedEvent { export interface CallUserMutedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; from_user_id: string; reason: string; muted_user_ids: Array; @@ -4156,10 +4219,10 @@ export interface CampaignChannelTemplate { } export interface CampaignCompletedEvent { - created_at: Date; + created_at: TimestampNS; custom: Record; type: string; - received_at?: Date; + received_at?: TimestampNS; campaign?: CampaignResponse; } @@ -4173,7 +4236,7 @@ export interface CampaignMessageTemplate { export interface CampaignResponse { create_channels: boolean; - created_at: Date; + created_at: TimestampNS; description: string; id: string; name: string; @@ -4184,14 +4247,14 @@ export interface CampaignResponse { skip_push: boolean; skip_webhook: boolean; status: string; - updated_at: Date; + updated_at: TimestampNS; segment_ids: Array; segments: Array; user_ids: Array; users: Array; stats: CampaignStatsResponse; - scheduled_for?: Date; - stop_at?: Date; + scheduled_for?: TimestampNS; + stop_at?: TimestampNS; channel_template?: CampaignChannelTemplate; message_template?: CampaignMessageTemplate; /** @@ -4201,19 +4264,19 @@ export interface CampaignResponse { } export interface CampaignStartedEvent { - created_at: Date; + created_at: TimestampNS; custom: Record; type: string; - received_at?: Date; + received_at?: TimestampNS; campaign?: CampaignResponse; } export interface CampaignStatsResponse { progress: number; stats_channels_created: number; - stats_completed_at: Date; + stats_completed_at: TimestampNS; stats_messages_sent: number; - stats_started_at: Date; + stats_started_at: TimestampNS; stats_users_read: number; stats_users_sent: number; } @@ -4228,6 +4291,14 @@ export interface CancelImportV2TaskResponse { } export interface CastPollVoteRequest { + /** + * Key of the moderation configuration to use. Server-side only. + */ + config_key?: string; + /** + * Team associated with the configuration. Server-side only. + */ + config_team?: string; user_id?: string; /** * User request object @@ -4252,10 +4323,37 @@ export interface ChangeFeedVisibilityResponse { feed: FeedResponse; } +export interface ChannelBanResponse { + created_at: TimestampNS; + scopes: Array; + channel_ban?: ChannelBanScopeResponse; + future_channel_ban?: ChannelBanScopeResponse; + /** + * User response object + */ + user?: UserResponse; +} + +export interface ChannelBanScopeResponse { + created_at: TimestampNS; + shadow: boolean; + expires?: TimestampNS; + reason?: string; + /** + * User response object + */ + banned_by?: UserResponse; +} + +export interface ChannelBansScopeTotals { + channel: number; + future_channel: number; +} + export interface ChannelBatchCompletedEvent { - batch_created_at: Date; - created_at: Date; - finished_at: Date; + batch_created_at: TimestampNS; + created_at: TimestampNS; + finished_at: TimestampNS; operation: string; status: string; success_channels_count: number; @@ -4263,7 +4361,7 @@ export interface ChannelBatchCompletedEvent { failed_channels: Array; custom: Record; type: string; - received_at?: Date; + received_at?: TimestampNS; } export interface ChannelBatchMemberRequest { @@ -4272,9 +4370,9 @@ export interface ChannelBatchMemberRequest { } export interface ChannelBatchStartedEvent { - batch_created_at: Date; - created_at: Date; - finished_at: Date; + batch_created_at: TimestampNS; + created_at: TimestampNS; + finished_at: TimestampNS; operation: string; status: string; success_channels_count: number; @@ -4282,7 +4380,7 @@ export interface ChannelBatchStartedEvent { failed_channels: Array; custom: Record; type: string; - received_at?: Date; + received_at?: TimestampNS; } export interface ChannelBatchUpdateRequest { @@ -4341,7 +4439,7 @@ export interface ChannelConfig { automod_behavior: 'flag' | 'block' | 'shadow_block'; connect_events: boolean; count_messages: boolean; - created_at: Date; + created_at: TimestampNS; custom_events: boolean; delivery_events: boolean; mark_messages_pending: boolean; @@ -4360,7 +4458,7 @@ export interface ChannelConfig { shared_locations: boolean; skip_last_msg_update_for_system_msgs: boolean; typing_events: boolean; - updated_at: Date; + updated_at: TimestampNS; uploads: boolean; url_enrichment: boolean; user_message_reminders: boolean; @@ -4445,7 +4543,7 @@ export interface ChannelConfigWithInfo { automod_behavior: 'flag' | 'block' | 'shadow_block'; connect_events: boolean; count_messages: boolean; - created_at: Date; + created_at: TimestampNS; custom_events: boolean; delivery_events: boolean; mark_messages_pending: boolean; @@ -4464,7 +4562,7 @@ export interface ChannelConfigWithInfo { shared_locations: boolean; skip_last_msg_update_for_system_msgs: boolean; typing_events: boolean; - updated_at: Date; + updated_at: TimestampNS; uploads: boolean; url_enrichment: boolean; user_message_reminders: boolean; @@ -4510,7 +4608,7 @@ export interface ChannelCreatedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * Represents channel in chat */ @@ -4537,7 +4635,7 @@ export interface ChannelCreatedEvent { * The CID of the channel which was created */ cid?: string; - received_at?: Date; + received_at?: TimestampNS; /** * The team ID */ @@ -4563,7 +4661,7 @@ export interface ChannelDeletedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * Represents channel in chat */ @@ -4590,7 +4688,7 @@ export interface ChannelDeletedEvent { * The CID of the channel which was deleted */ cid?: string; - received_at?: Date; + received_at?: TimestampNS; /** * The team ID */ @@ -4623,7 +4721,7 @@ export interface ChannelFrozenEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; custom: Record; /** * The type of event: "channel.frozen" in this case @@ -4641,7 +4739,7 @@ export interface ChannelFrozenEvent { * The CID of the channel which was frozen */ cid?: string; - received_at?: Date; + received_at?: TimestampNS; } export interface ChannelGetOrCreateRequest { @@ -4672,7 +4770,7 @@ export interface ChannelHiddenEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * Represents channel in chat */ @@ -4699,7 +4797,7 @@ export interface ChannelHiddenEvent { * The CID of the channel which was hidden */ cid?: string; - received_at?: Date; + received_at?: TimestampNS; /** * The team ID */ @@ -4798,7 +4896,7 @@ export interface ChannelMemberResponse { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; notifications_muted: boolean; /** * Whether member is shadow banned in this channel or not @@ -4807,30 +4905,31 @@ export interface ChannelMemberResponse { /** * Date/time of the last update */ - updated_at: Date; + updated_at: TimestampNS; + user_id: string; custom: Record; - archived_at?: Date; + archived_at?: TimestampNS; /** * Expiration date of the ban */ - ban_expires?: Date; + ban_expires?: TimestampNS; /** * Whether the member's ban also applies to channels the channel's creator will create in the future (an active future channel ban by the creator targets this member) */ ban_from_future_channels?: boolean; - deleted_at?: Date; + deleted_at?: TimestampNS; /** * Expiration date of the future channel ban; absent when the future channel ban is permanent */ - future_channel_ban_expires?: Date; + future_channel_ban_expires?: TimestampNS; /** * Date when invite was accepted */ - invite_accepted_at?: Date; + invite_accepted_at?: TimestampNS; /** * Date when invite was rejected */ - invite_rejected_at?: Date; + invite_rejected_at?: TimestampNS; /** * Whether member was invited or not */ @@ -4839,13 +4938,12 @@ export interface ChannelMemberResponse { * Whether member is channel moderator or not */ is_moderator?: boolean; - pinned_at?: Date; + pinned_at?: TimestampNS; /** * Permission level of the member in the channel (DEPRECATED: use channel_role instead). One of: member, moderator, admin, owner */ role?: string; status?: string; - user_id?: string; deleted_messages?: Array; /** * User response object @@ -4874,7 +4972,7 @@ export interface ChannelMetadata { id: string; type: string; custom: Record; - last_message_at?: Date; + last_message_at?: TimestampNS; member_count?: number; message_count?: number; push_level?: string; @@ -4885,15 +4983,15 @@ export interface ChannelMute { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * Date/time of the last update */ - updated_at: Date; + updated_at: TimestampNS; /** * Date/time of mute expiration */ - expires?: Date; + expires?: TimestampNS; /** * Represents channel in chat */ @@ -4908,13 +5006,13 @@ export interface ChannelMutedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; custom: Record; /** * The type of event: "channel.muted" in this case */ type: string; - received_at?: Date; + received_at?: TimestampNS; /** * The mute objects */ @@ -4946,6 +5044,7 @@ export const ChannelOwnCapability = { QUERY_POLL_VOTES: 'query-poll-votes', QUOTE_MESSAGE: 'quote-message', READ_EVENTS: 'read-events', + SCHEDULE_MESSAGE: 'schedule-message', SEARCH_MESSAGES: 'search-messages', SEND_CUSTOM_EVENTS: 'send-custom-events', SEND_LINKS: 'send-links', @@ -4979,7 +5078,7 @@ export interface ChannelPushPreferencesResponse { /** * If provided the notifications will be disabled until the set date. */ - disabled_until?: Date; + disabled_until?: TimestampNS; chat_preferences?: ChatPreferencesResponse; } @@ -4991,7 +5090,7 @@ export interface ChannelResponse { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; disabled: boolean; /** * Whether channel is frozen or not @@ -5008,7 +5107,7 @@ export interface ChannelResponse { /** * Date/time of the last update */ - updated_at: Date; + updated_at: TimestampNS; /** * Custom data for this object */ @@ -5032,7 +5131,7 @@ export interface ChannelResponse { /** * Date/time of deletion */ - deleted_at?: Date; + deleted_at?: TimestampNS; /** * Whether this channel is hidden by current user or not */ @@ -5040,11 +5139,11 @@ export interface ChannelResponse { /** * Date since when the message history is accessible */ - hide_messages_before?: Date; + hide_messages_before?: TimestampNS; /** * Date of the last message sent */ - last_message_at?: Date; + last_message_at?: TimestampNS; /** * Number of members in the channel */ @@ -5056,7 +5155,7 @@ export interface ChannelResponse { /** * Date of mute expiration */ - mute_expires_at?: Date; + mute_expires_at?: TimestampNS; /** * Whether this channel is muted or not */ @@ -5068,7 +5167,7 @@ export interface ChannelResponse { /** * Date of the latest truncation of the channel */ - truncated_at?: Date; + truncated_at?: TimestampNS; /** * List of filter tags associated with the channel */ @@ -5098,8 +5197,9 @@ export interface ChannelStateResponse { messages: Array; pinned_messages: Array; threads: Array; + cooldown_remaining_ms?: number; hidden?: boolean; - hide_messages_before?: Date; + hide_messages_before?: TimestampNS; watcher_count?: number; active_live_locations?: Array; pending_messages?: Array; @@ -5131,6 +5231,10 @@ export interface ChannelStateResponseFields { */ pinned_messages: Array; threads: Array; + /** + * Milliseconds until the current user's slow mode cool down period ends. Only set on client-side get or create channel and get channel requests while the user is under cool down + */ + cooldown_remaining_ms?: number; /** * Whether this channel is hidden or not */ @@ -5138,7 +5242,7 @@ export interface ChannelStateResponseFields { /** * Messages before this date are hidden from the user */ - hide_messages_before?: Date; + hide_messages_before?: TimestampNS; /** * Number of channel watchers */ @@ -5175,7 +5279,7 @@ export interface ChannelTruncatedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * Represents channel in chat */ @@ -5203,7 +5307,7 @@ export interface ChannelTruncatedEvent { */ cid?: string; message_id?: string; - received_at?: Date; + received_at?: TimestampNS; /** * The team ID */ @@ -5221,7 +5325,7 @@ export interface ChannelTypeConfig { automod_behavior: 'flag' | 'block' | 'shadow_block'; connect_events: boolean; count_messages: boolean; - created_at: Date; + created_at: TimestampNS; custom_events: boolean; delivery_events: boolean; mark_messages_pending: boolean; @@ -5240,7 +5344,7 @@ export interface ChannelTypeConfig { shared_locations: boolean; skip_last_msg_update_for_system_msgs: boolean; typing_events: boolean; - updated_at: Date; + updated_at: TimestampNS; uploads: boolean; url_enrichment: boolean; user_message_reminders: boolean; @@ -5268,7 +5372,7 @@ export interface ChannelUnFrozenEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; custom: Record; /** * The type of event: "channel.unfrozen" in this case @@ -5286,20 +5390,20 @@ export interface ChannelUnFrozenEvent { * The CID of the channel which was unfrozen */ cid?: string; - received_at?: Date; + received_at?: TimestampNS; } export interface ChannelUnmutedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; custom: Record; /** * The type of event: "channel.unmuted" in this case */ type: string; - received_at?: Date; + received_at?: TimestampNS; /** * The mute objects */ @@ -5312,7 +5416,7 @@ export interface ChannelUpdatedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * Represents channel in chat */ @@ -5340,7 +5444,7 @@ export interface ChannelUpdatedEvent { */ cid?: string; message_id?: string; - received_at?: Date; + received_at?: TimestampNS; /** * The team ID */ @@ -5357,7 +5461,7 @@ export interface ChannelVisibleEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * Represents channel in chat */ @@ -5384,7 +5488,7 @@ export interface ChannelVisibleEvent { * The CID of the channel which was shown */ cid?: string; - received_at?: Date; + received_at?: TimestampNS; /** * The team ID */ @@ -5415,7 +5519,7 @@ export interface ChatDraftPayloadResponse { export interface ChatDraftResponse { channel_cid: string; - created_at: Date; + created_at: TimestampNS; message: ChatDraftPayloadResponse; parent_id?: string; parent_message?: ChatMessageResponse; @@ -5424,7 +5528,7 @@ export interface ChatDraftResponse { export interface ChatMessageResponse { cid: string; - created_at: Date; + created_at: TimestampNS; deleted_reply_count: number; html: string; id: string; @@ -5436,7 +5540,7 @@ export interface ChatMessageResponse { silent: boolean; text: string; type: string; - updated_at: Date; + updated_at: TimestampNS; attachments: Array; latest_reactions: Array; mentioned_users: Array; @@ -5450,13 +5554,13 @@ export interface ChatMessageResponse { */ user: UserResponse; command?: string; - deleted_at?: Date; + deleted_at?: TimestampNS; deleted_for_me?: boolean; - message_text_updated_at?: Date; + message_text_updated_at?: TimestampNS; mml?: string; parent_id?: string; - pin_expires?: Date; - pinned_at?: Date; + pin_expires?: TimestampNS; + pinned_at?: TimestampNS; poll_id?: string; quoted_message_id?: string; show_in_channel?: boolean; @@ -5524,14 +5628,14 @@ export interface ChatPreferencesResponse { export interface ChatReactionGroupResponse { count: number; - first_reaction_at: Date; - last_reaction_at: Date; + first_reaction_at: TimestampNS; + last_reaction_at: TimestampNS; sum_scores: number; latest_reactions_by: Array; } export interface ChatReactionGroupUserResponse { - created_at: Date; + created_at: TimestampNS; user_id: string; /** * User response object @@ -5540,11 +5644,11 @@ export interface ChatReactionGroupUserResponse { } export interface ChatReactionResponse { - created_at: Date; + created_at: TimestampNS; message_id: string; score: number; type: string; - updated_at: Date; + updated_at: TimestampNS; user_id: string; custom: Record; /** @@ -5555,11 +5659,11 @@ export interface ChatReactionResponse { export interface ChatReminderResponseData { channel_cid: string; - created_at: Date; + created_at: TimestampNS; message_id: string; - updated_at: Date; + updated_at: TimestampNS; user_id: string; - remind_at?: Date; + remind_at?: TimestampNS; message?: ChatMessageResponse; /** * User response object @@ -5569,14 +5673,14 @@ export interface ChatReminderResponseData { export interface ChatSharedLocationResponseData { channel_cid: string; - created_at: Date; + created_at: TimestampNS; created_by_device_id: string; latitude: number; longitude: number; message_id: string; - updated_at: Date; + updated_at: TimestampNS; user_id: string; - end_at?: Date; + end_at?: TimestampNS; message?: ChatMessageResponse; } @@ -5744,25 +5848,21 @@ export interface CheckResponse { */ 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 + * ID of the LLM model that produced the verdict (e.g. gpt-4o-mini). Omitted when no LLM ran synchronously (e.g. Bodyguard-only checks or async moderation) */ - intent_score_threshold?: number; + llm_model?: string; /** - * 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 + * reasoning_effort sent with the LLM request that produced the verdict. Omitted when the request did not send one */ - intent_would_fire?: boolean; + llm_reasoning_effort?: string; /** * ID of the running moderation task */ task_id?: string; + /** + * Score (0-100) of each policy intent topic against this request's text, in policy order (test mode only; omitted when the policy has no topics or scoring failed) + */ + intent_scores?: Array; /** * All moderation rules triggered by this check (content, user, and call rules), with their resolved actions */ @@ -5900,6 +6000,14 @@ export interface ClientEvent { * Reason the client initiated the join. Optional on CoordinatorJoin events; empty when not provided. */ join_reason?: string; + /** + * Source of the leave that aborted a join: user, app, callkit, remote_event, sdk_error, or unknown. Not validated against this set, so SDKs may report new values. Optional; sent on failure events. Maximum 32 characters. + */ + leave_initiator?: string; + /** + * Internal reason or triggering event for the leave that aborted a join. Optional; sent on failure events. Maximum 200 characters. + */ + leave_reason?: string; /** * Microphone permission status: INITIATED, FAILED, GRANTED, or NOT_INITIATED. Required on every MediaDevicePermission event. */ @@ -5986,7 +6094,7 @@ export interface ClientOSDataResponse { export interface ClosedCaptionEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * CallClosedCaption represents a closed caption of a call. */ @@ -6052,11 +6160,11 @@ export interface CollectionResponse { /** * When the collection was created */ - created_at?: Date; + created_at?: TimestampNS; /** * When the collection was last updated */ - updated_at?: Date; + updated_at?: TimestampNS; /** * ID of the user who owns this collection */ @@ -6087,18 +6195,18 @@ export interface Command { /** * Date/time of creation */ - created_at?: Date; + created_at?: TimestampNS; /** * Date/time of the last update */ - updated_at?: Date; + updated_at?: TimestampNS; } export interface CommentAddedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; fid: string; activity: ActivityResponse; comment: CommentResponse; @@ -6108,7 +6216,7 @@ export interface CommentAddedEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; } @@ -6116,7 +6224,7 @@ export interface CommentDeletedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; fid: string; comment: CommentResponse; custom: Record; @@ -6125,7 +6233,7 @@ export interface CommentDeletedEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; } @@ -6133,14 +6241,14 @@ export interface CommentFeedbackEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; comment_feedback: CommentFeedbackEventPayload; custom: Record; /** * The type of event: "feeds.comment.feedback" in this case */ type: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; } @@ -6152,7 +6260,7 @@ export interface CommentFeedbackEventPayload { /** * When the feedback was created */ - created_at: Date; + created_at: TimestampNS; /** * Whether the comment is hidden for the user */ @@ -6160,7 +6268,7 @@ export interface CommentFeedbackEventPayload { /** * When the feedback was last updated */ - updated_at: Date; + updated_at: TimestampNS; /** * User response object */ @@ -6195,7 +6303,7 @@ export interface CommentReactionAddedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; fid: string; activity: ActivityResponse; comment: CommentResponse; @@ -6206,7 +6314,7 @@ export interface CommentReactionAddedEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; } @@ -6214,7 +6322,7 @@ export interface CommentReactionDeletedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; fid: string; comment: CommentResponse; custom: Record; @@ -6224,14 +6332,14 @@ export interface CommentReactionDeletedEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; } export interface CommentReactionUpdatedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; fid: string; activity: ActivityResponse; comment: CommentResponse; @@ -6242,7 +6350,7 @@ export interface CommentReactionUpdatedEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; } @@ -6255,7 +6363,7 @@ export interface CommentResponse { /** * When the comment was created */ - created_at: Date; + created_at: TimestampNS; /** * Number of downvotes for this comment */ @@ -6295,7 +6403,7 @@ export interface CommentResponse { /** * When the comment was last updated */ - updated_at: Date; + updated_at: TimestampNS; /** * Number of upvotes for this comment */ @@ -6319,11 +6427,11 @@ export interface CommentResponse { /** * When the comment was deleted */ - deleted_at?: Date; + deleted_at?: TimestampNS; /** * When the comment was last edited */ - edited_at?: Date; + edited_at?: TimestampNS; /** * ID of parent comment for nested replies */ @@ -6356,7 +6464,7 @@ export interface CommentRestoredEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; fid: string; comment: CommentResponse; custom: Record; @@ -6365,7 +6473,7 @@ export interface CommentRestoredEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; } @@ -6373,7 +6481,7 @@ export interface CommentUpdatedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; fid: string; comment: CommentResponse; custom: Record; @@ -6382,7 +6490,7 @@ export interface CommentUpdatedEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; } @@ -6472,7 +6580,7 @@ export interface ConfigResponse { /** * When the configuration was created */ - created_at: Date; + created_at: TimestampNS; /** * Unique identifier for the moderation configuration */ @@ -6484,7 +6592,7 @@ export interface ConfigResponse { /** * When the configuration was last updated */ - updated_at: Date; + updated_at: TimestampNS; supported_video_call_harm_types: Array; /** * Configurable image moderation label definitions for dashboard rendering @@ -6548,7 +6656,7 @@ export interface CoordinatesResponse { export interface CountByMinuteResponse { count: number; - start_ts: Date; + start_ts: TimestampNS; } export interface Coverage { @@ -6618,7 +6726,7 @@ export interface CreateCallTypeResponse { /** * the time the call type was created */ - created_at: Date; + created_at: TimestampNS; duration: string; /** * the name of the call type @@ -6627,7 +6735,7 @@ export interface CreateCallTypeResponse { /** * the time the call type was last updated */ - updated_at: Date; + updated_at: TimestampNS; /** * the permissions granted to each role */ @@ -6827,7 +6935,7 @@ export interface CreateChannelTypeResponse { automod_behavior: 'flag' | 'block' | 'shadow_block'; connect_events: boolean; count_messages: boolean; - created_at: Date; + created_at: TimestampNS; custom_events: boolean; delivery_events: boolean; /** @@ -6850,7 +6958,7 @@ export interface CreateChannelTypeResponse { shared_locations: boolean; skip_last_msg_update_for_system_msgs: boolean; typing_events: boolean; - updated_at: Date; + updated_at: TimestampNS; uploads: boolean; url_enrichment: boolean; user_message_reminders: boolean; @@ -7130,7 +7238,7 @@ export interface CreateImportV2TaskRequest { export interface CreateImportV2TaskResponse { app_pk: number; - created_at: Date; + created_at: TimestampNS; /** * Duration of the request in milliseconds */ @@ -7138,7 +7246,7 @@ export interface CreateImportV2TaskResponse { id: string; product: string; state: number; - updated_at: Date; + updated_at: TimestampNS; settings: ImportV2TaskSettings; } @@ -7234,6 +7342,14 @@ export interface CreatePollOptionRequest { * Option text */ text: string; + /** + * Key of the moderation configuration to use. Server-side only. + */ + config_key?: string; + /** + * Team associated with the configuration. Server-side only. + */ + config_team?: string; user_id?: string; /** * Custom data for this object @@ -7255,6 +7371,14 @@ export interface CreatePollRequest { */ allow_answers?: boolean; allow_user_suggested_options?: boolean; + /** + * Key of the moderation configuration to use. Server-side only. + */ + config_key?: string; + /** + * Team associated with the configuration. Server-side only. + */ + config_team?: string; /** * A description of the poll */ @@ -7529,15 +7653,15 @@ export interface CustomCheckResponse { } export interface CustomEvent { - created_at: Date; + created_at: TimestampNS; custom: Record; type: string; - received_at?: Date; + received_at?: TimestampNS; } export interface CustomVideoEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * Custom data for this object */ @@ -8023,6 +8147,31 @@ export interface DeleteModerationTemplateResponse { duration: string; } +export interface DeletePollAnswerRequestPayload { + /** + * Reason for deletion + */ + reason?: string; +} + +export interface DeletePollOptionRequestPayload { + /** + * Option to delete. Required on an item for a whole poll (create or edit); defaults to the option an add_option / update_option item was raised for + */ + option_id?: string; + /** + * Reason for deletion + */ + reason?: string; +} + +export interface DeletePollRequestPayload { + /** + * Reason for deletion + */ + reason?: string; +} + export interface DeleteQueueRequest { user_id?: string; /** @@ -8267,7 +8416,7 @@ export interface DeviceResponse { /** * The date when the device was created. */ - created_at: Date; + created_at: TimestampNS; /** * The device identifier. */ @@ -8353,7 +8502,7 @@ export interface DraftPayloadResponse { export interface DraftResponse { channel_cid: string; - created_at: Date; + created_at: TimestampNS; /** * Contains the draft message content */ @@ -8408,7 +8557,7 @@ export interface EgressHLSResponse { export interface EgressRTMPResponse { name: string; - started_at: Date; + started_at: TimestampNS; stream_key?: string; stream_url?: string; } @@ -8495,11 +8644,11 @@ export interface EnrichedCollectionResponse { /** * When the collection was created */ - created_at?: Date; + created_at?: TimestampNS; /** * When the collection was last updated */ - updated_at?: Date; + updated_at?: TimestampNS; /** * ID of the user who owns this collection */ @@ -8535,6 +8684,10 @@ export interface EnrichmentOptions { * Controls the top-level flat 'activities' array for aggregated feeds. For new apps, defaults to false (excluded); set to true to include. For older apps, defaults to true (included) for backward compatibility; set to false to exclude. */ include_flat_activities?: boolean; + /** + * Default: false. Server-side only. When true, the response includes ranking_config: the ranking configuration (from the feed view, or the feed group as fallback) used to rank this read. + */ + include_ranking_config?: boolean; /** * Default: false. When true, includes score_vars in activity responses containing variable values used at ranking time. */ @@ -8615,7 +8768,7 @@ export interface EntityCreatorResponse { */ ban_count: number; banned: boolean; - created_at: Date; + created_at: TimestampNS; /** * Number of major actions performed on the user */ @@ -8630,19 +8783,19 @@ export interface EntityCreatorResponse { online: boolean; role: string; shadow_banned: boolean; - updated_at: Date; + updated_at: TimestampNS; blocked_user_ids: Array; teams: Array; custom: Record; avg_response_time?: number; - ban_expires?: Date; + ban_expires?: TimestampNS; bypass_moderation?: boolean; - deactivated_at?: Date; - deleted_at?: Date; + deactivated_at?: TimestampNS; + deleted_at?: TimestampNS; image?: string; - last_active?: Date; + last_active?: TimestampNS; name?: string; - revoke_tokens_issued_before?: Date; + revoke_tokens_issued_before?: TimestampNS; devices?: Array; /** * The privacy settings of the user. @@ -8861,7 +9014,7 @@ export interface FeedCreatedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; fid: string; members: Array; custom: Record; @@ -8872,14 +9025,14 @@ export interface FeedCreatedEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; } export interface FeedDeletedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; fid: string; custom: Record; /** @@ -8887,23 +9040,23 @@ export interface FeedDeletedEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; } export interface FeedGroup { aggregation_version: number; app_pk: number; - created_at: Date; + created_at: TimestampNS; default_follower_role: string; default_visibility: string; group_id: string; - updated_at: Date; + updated_at: TimestampNS; activity_processors: Array; activity_selectors: Array; custom: Record; - deleted_at?: Date; - last_feed_get_at?: Date; + deleted_at?: TimestampNS; + last_feed_get_at?: TimestampNS; activity_filter?: ActivityFilterConfig; aggregation?: AggregationConfig; notification?: NotificationConfig; @@ -8916,7 +9069,7 @@ export interface FeedGroupChangedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; fid: string; custom: Record; /** @@ -8924,7 +9077,7 @@ export interface FeedGroupChangedEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; feed_group?: FeedGroup; user?: UserResponseCommonFields; } @@ -8933,7 +9086,7 @@ export interface FeedGroupDeletedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; fid: string; /** * The ID of the feed group that was deleted @@ -8945,14 +9098,14 @@ export interface FeedGroupDeletedEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; } export interface FeedGroupResponse { /** * When the feed group was created */ - created_at: Date; + created_at: TimestampNS; /** * Identifier within the group */ @@ -8960,7 +9113,7 @@ export interface FeedGroupResponse { /** * When the feed group was last updated */ - updated_at: Date; + updated_at: TimestampNS; /** * Role new followers of feeds in this group are given. Either a built-in (feed_follower, feed_member_viewer) or any role your app has defined. Empty means feed_follower. Applied when the follow is accepted, so a follow that starts pending picks it up on approval */ @@ -8970,7 +9123,7 @@ export interface FeedGroupResponse { */ default_visibility?: 'public' | 'visible' | 'followers' | 'members' | 'private'; - deleted_at?: Date; + deleted_at?: TimestampNS; /** * Configuration for activity processors */ @@ -8997,7 +9150,7 @@ export interface FeedGroupRestoredEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; fid: string; /** * The ID of the feed group that was restored @@ -9009,7 +9162,7 @@ export interface FeedGroupRestoredEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; } export interface FeedGroupScope { @@ -9037,7 +9190,7 @@ export interface FeedMemberAddedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; fid: string; custom: Record; member: FeedMemberResponse; @@ -9046,7 +9199,7 @@ export interface FeedMemberAddedEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; } @@ -9054,7 +9207,7 @@ export interface FeedMemberRemovedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; fid: string; member_id: string; custom: Record; @@ -9063,7 +9216,7 @@ export interface FeedMemberRemovedEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; } @@ -9094,7 +9247,7 @@ export interface FeedMemberResponse { /** * When the membership was created */ - created_at: Date; + created_at: TimestampNS; /** * Role of the member in the feed */ @@ -9106,7 +9259,7 @@ export interface FeedMemberResponse { /** * When the membership was last updated */ - updated_at: Date; + updated_at: TimestampNS; /** * User response object */ @@ -9114,11 +9267,11 @@ export interface FeedMemberResponse { /** * When the invite was accepted */ - invite_accepted_at?: Date; + invite_accepted_at?: TimestampNS; /** * When the invite was rejected */ - invite_rejected_at?: Date; + invite_rejected_at?: TimestampNS; /** * Custom data for the membership */ @@ -9130,7 +9283,7 @@ export interface FeedMemberUpdatedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; fid: string; custom: Record; member: FeedMemberResponse; @@ -9139,7 +9292,7 @@ export interface FeedMemberUpdatedEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; } @@ -9239,7 +9392,7 @@ export interface FeedResponse { /** * When the feed was created */ - created_at: Date; + created_at: TimestampNS; /** * Description of the feed */ @@ -9279,7 +9432,7 @@ export interface FeedResponse { /** * When the feed was last updated */ - updated_at: Date; + updated_at: TimestampNS; /** * User response object */ @@ -9287,7 +9440,7 @@ export interface FeedResponse { /** * When the feed was deleted */ - deleted_at?: Date; + deleted_at?: TimestampNS; /** * Visibility setting for the feed */ @@ -9321,7 +9474,7 @@ export interface FeedSuggestionResponse { /** * When the feed was created */ - created_at: Date; + created_at: TimestampNS; /** * Description of the feed */ @@ -9361,7 +9514,7 @@ export interface FeedSuggestionResponse { /** * When the feed was last updated */ - updated_at: Date; + updated_at: TimestampNS; /** * User response object */ @@ -9369,7 +9522,7 @@ export interface FeedSuggestionResponse { /** * When the feed was deleted */ - deleted_at?: Date; + deleted_at?: TimestampNS; reason?: string; recommendation_score?: number; /** @@ -9402,7 +9555,7 @@ export interface FeedSuggestionResponse { } export interface FeedUpdatedEvent { - created_at: Date; + created_at: TimestampNS; fid: string; custom: Record; feed: FeedResponse; @@ -9411,7 +9564,7 @@ export interface FeedUpdatedEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; } @@ -9423,7 +9576,7 @@ export interface FeedViewResponse { /** * When the feed view was last used */ - last_used_at?: Date; + last_used_at?: TimestampNS; /** * Configured activity selectors */ @@ -9453,10 +9606,10 @@ export interface FeedsActivityLocation { } export interface FeedsBookmarkResponse { - created_at: Date; + created_at: TimestampNS; object_id: string; object_type: string; - updated_at: Date; + updated_at: TimestampNS; /** * User response object */ @@ -9466,18 +9619,18 @@ export interface FeedsBookmarkResponse { } export interface FeedsEnrichedCollectionResponse { - created_at: Date; + created_at: TimestampNS; id: string; name: string; status: string; - updated_at: Date; + updated_at: TimestampNS; user_id: string; custom: Record; } export interface FeedsFeedResponse { activity_count: number; - created_at: Date; + created_at: TimestampNS; description: string; feed: string; follower_count: number; @@ -9487,12 +9640,12 @@ export interface FeedsFeedResponse { member_count: number; name: string; pin_count: number; - updated_at: Date; + updated_at: TimestampNS; /** * User response object */ created_by: UserResponse; - deleted_at?: Date; + deleted_at?: TimestampNS; visibility?: string; filter_tags?: Array; custom?: Record; @@ -9514,6 +9667,7 @@ export interface FeedsNotificationComment { comment: string; id: string; user_id: string; + parent_id?: string; attachments?: Array; } @@ -9602,15 +9756,15 @@ export interface FeedsPreferencesResponse { export interface FeedsReactionGroupResponse { count: number; - first_reaction_at: Date; - last_reaction_at: Date; + first_reaction_at: TimestampNS; + last_reaction_at: TimestampNS; } export interface FeedsReactionResponse { activity_id: string; - created_at: Date; + created_at: TimestampNS; type: string; - updated_at: Date; + updated_at: TimestampNS; /** * User response object */ @@ -9621,7 +9775,7 @@ export interface FeedsReactionResponse { export interface FeedsRetentionPolicy { app_pk: number; - enabled_at: Date; + enabled_at: TimestampNS; policy: string; config: FeedsPolicyConfig; } @@ -9635,7 +9789,7 @@ export interface FeedsRetentionRunResponse { export interface FeedsShareResponse { activity_id: string; - created_at: Date; + created_at: TimestampNS; /** * User response object */ @@ -9645,7 +9799,7 @@ export interface FeedsShareResponse { export interface FeedsV3ActivityResponse { bookmark_count: number; comment_count: number; - created_at: Date; + created_at: TimestampNS; hidden: boolean; id: string; popularity: number; @@ -9655,7 +9809,7 @@ export interface FeedsV3ActivityResponse { score: number; share_count: number; type: string; - updated_at: Date; + updated_at: TimestampNS; visibility: string; attachments: Array; comments: Array; @@ -9674,9 +9828,9 @@ export interface FeedsV3ActivityResponse { * User response object */ user: UserResponse; - deleted_at?: Date; - edited_at?: Date; - expires_at?: Date; + deleted_at?: TimestampNS; + edited_at?: TimestampNS; + expires_at?: TimestampNS; friend_reaction_count?: number; is_read?: boolean; is_seen?: boolean; @@ -9701,7 +9855,7 @@ export interface FeedsV3ActivityResponse { export interface FeedsV3CommentResponse { bookmark_count: number; confidence_score: number; - created_at: Date; + created_at: TimestampNS; downvote_count: number; hidden: boolean; id: string; @@ -9711,7 +9865,7 @@ export interface FeedsV3CommentResponse { reply_count: number; score: number; status: string; - updated_at: Date; + updated_at: TimestampNS; upvote_count: number; mentioned_users: Array; own_reactions: Array; @@ -9720,8 +9874,8 @@ export interface FeedsV3CommentResponse { */ user: UserResponse; controversy_score?: number; - deleted_at?: Date; - edited_at?: Date; + deleted_at?: TimestampNS; + edited_at?: TimestampNS; parent_id?: string; text?: string; attachments?: Array; @@ -9838,7 +9992,7 @@ export interface FlagDetailsResponse { } export interface FlagFeedbackResponse { - created_at: Date; + created_at: TimestampNS; message_id: string; labels: Array; } @@ -9888,13 +10042,13 @@ export interface FlagRequest { } export interface FlagResponse { - created_at: Date; + created_at: TimestampNS; created_by_automod: boolean; - updated_at: Date; - approved_at?: Date; + updated_at: TimestampNS; + approved_at?: TimestampNS; reason?: string; - rejected_at?: Date; - reviewed_at?: Date; + rejected_at?: TimestampNS; + reviewed_at?: TimestampNS; reviewed_by?: string; target_message_id?: string; custom?: Record; @@ -9914,10 +10068,10 @@ export interface FlagResponse { } export interface FlagUpdatedEvent { - created_at: Date; + created_at: TimestampNS; custom: Record; type: string; - received_at?: Date; + received_at?: TimestampNS; /** * User response object */ @@ -9978,6 +10132,10 @@ export interface FollowBatchRequest { * List of follow relationships to create */ follows: Array; + /** + * If true, the batch is queued as a background task, paced per app, and the response has empty follows and a task_id. Server-side only. Supported by the get-or-create endpoint (GetOrCreateFollows); FollowBatch rejects it. Async batches can apply out of order with other follow writes. Defaults to false. + */ + async?: boolean; /** * If true, auto-creates users referenced by source/target FIDs in the batch when they don't already exist. Server-side only. Defaults to false. This top-level field is the only supported batch/upsert create_users control. */ @@ -9998,13 +10156,17 @@ export interface FollowBatchResponse { * List of current follow relationships */ follows: Array; + /** + * ID of the background task when the request was sent with async: true + */ + task_id?: string; } export interface FollowCreatedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; fid: string; custom: Record; follow: FollowResponse; @@ -10013,14 +10175,14 @@ export interface FollowCreatedEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; } export interface FollowDeletedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; fid: string; custom: Record; follow: FollowResponse; @@ -10029,7 +10191,7 @@ export interface FollowDeletedEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; } export interface FollowRequest { @@ -10084,7 +10246,7 @@ export interface FollowResponse { /** * When the follow relationship was created */ - created_at: Date; + created_at: TimestampNS; /** * Role of the follower (source user) in the follow relationship, as stored. A reserved name, or a role your app no longer defines, is reported as stored but evaluated as 'feed_follower'. */ @@ -10100,17 +10262,17 @@ export interface FollowResponse { /** * When the follow relationship was last updated */ - updated_at: Date; + updated_at: TimestampNS; source_feed: FeedResponse; target_feed: FeedResponse; /** * When the follow request was accepted */ - request_accepted_at?: Date; + request_accepted_at?: TimestampNS; /** * When the follow request was rejected */ - request_rejected_at?: Date; + request_rejected_at?: TimestampNS; /** * Custom data for the follow relationship */ @@ -10121,7 +10283,7 @@ export interface FollowUpdatedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; fid: string; custom: Record; follow: FollowResponse; @@ -10130,7 +10292,7 @@ export interface FollowUpdatedEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; } export interface FrameRecordSettings { @@ -10172,7 +10334,7 @@ export interface FriendReactionsOptions { export interface FullUserResponse { banned: boolean; - created_at: Date; + created_at: TimestampNS; id: string; invisible: boolean; language: string; @@ -10187,7 +10349,7 @@ export interface FullUserResponse { */ unread_count: number; unread_threads: number; - updated_at: Date; + updated_at: TimestampNS; blocked_user_ids: Array; channel_mutes: Array; devices: Array; @@ -10195,14 +10357,14 @@ export interface FullUserResponse { teams: Array; custom: Record; avg_response_time?: number; - ban_expires?: Date; + ban_expires?: TimestampNS; bypass_moderation?: boolean; - deactivated_at?: Date; - deleted_at?: Date; + deactivated_at?: TimestampNS; + deleted_at?: TimestampNS; image?: string; - last_active?: Date; + last_active?: TimestampNS; name?: string; - revoke_tokens_issued_before?: Date; + revoke_tokens_issued_before?: TimestampNS; latest_hidden_channels?: Array; /** * The privacy settings of the user. @@ -10212,8 +10374,8 @@ export interface FullUserResponse { } export interface FutureChannelBanResponse { - created_at: Date; - expires?: Date; + created_at: TimestampNS; + expires?: TimestampNS; reason?: string; shadow?: boolean; /** @@ -10258,11 +10420,11 @@ export interface GetActiveCallsStatusResponse { /** * End time of the status period */ - end_time: Date; + end_time: TimestampNS; /** * Start time of the status period */ - start_time: Date; + start_time: TimestampNS; metrics?: ActiveCallsMetrics; summary?: ActiveCallsSummary; } @@ -10314,7 +10476,7 @@ export interface GetCallParticipantSessionMetricsResponse { duration: string; is_publisher?: boolean; is_subscriber?: boolean; - joined_at?: Date; + joined_at?: TimestampNS; publisher_type?: string; user_id?: string; user_session_id?: string; @@ -10362,10 +10524,10 @@ export interface GetCallSessionParticipantStatsDetailsResponse { } export interface GetCallTypeResponse { - created_at: Date; + created_at: TimestampNS; duration: string; name: string; - updated_at: Date; + updated_at: TimestampNS; grants: Record>; notification_settings: NotificationSettingsResponse; settings: CallSettingsResponse; @@ -10386,7 +10548,7 @@ export interface GetChannelTypeResponse { automod_behavior: 'flag' | 'block' | 'shadow_block'; connect_events: boolean; count_messages: boolean; - created_at: Date; + created_at: TimestampNS; custom_events: boolean; delivery_events: boolean; /** @@ -10409,7 +10571,7 @@ export interface GetChannelTypeResponse { shared_locations: boolean; skip_last_msg_update_for_system_msgs: boolean; typing_events: boolean; - updated_at: Date; + updated_at: TimestampNS; uploads: boolean; url_enrichment: boolean; user_message_reminders: boolean; @@ -10439,8 +10601,8 @@ export interface GetCommandResponse { duration: string; name: string; set: string; - created_at?: Date; - updated_at?: Date; + created_at?: TimestampNS; + updated_at?: TimestampNS; } export interface GetCommentRepliesResponse { @@ -10544,13 +10706,13 @@ export interface GetExternalStorageGCSResponse { } export interface GetExternalStorageResponse { - created_at: Date; + created_at: TimestampNS; /** * Duration of the request in milliseconds */ duration: string; type: string; - updated_at: Date; + updated_at: TimestampNS; aws_s3?: GetExternalStorageAWSS3Response; gcs?: GetExternalStorageGCSResponse; } @@ -10689,7 +10851,7 @@ export interface GetImportResponse { export interface GetImportV2TaskResponse { app_pk: number; - created_at: Date; + created_at: TimestampNS; /** * Duration of the request in milliseconds */ @@ -10697,7 +10859,7 @@ export interface GetImportV2TaskResponse { id: string; product: string; state: number; - updated_at: Date; + updated_at: TimestampNS; settings: ImportV2TaskSettings; result?: Record; } @@ -10814,6 +10976,17 @@ export interface GetOrCreateCallResponse { call: CallResponse; } +export interface GetOrCreateChannelDefaults { + /** + * Resolved defaults for a nested pagination object. + */ + members: PagerDefaults; + /** + * Resolved defaults for a nested pagination object. + */ + messages: PagerDefaults; +} + export interface GetOrCreateFeedGroupRequest { /** * Role new followers of feeds in this group are given. Either a built-in (feed_follower, feed_member_viewer) or any role your app has defined. Empty means feed_follower. Applied when the follow is accepted, so a follow that starts pending picks it up on approval @@ -10912,6 +11085,7 @@ export interface GetOrCreateFeedResponse { following_pagination?: PagerResponse; member_pagination?: PagerResponse; notification_status?: NotificationStatusResponse; + ranking_config?: RankingConfig; } export interface GetOrCreateFeedViewRequest { @@ -11103,7 +11277,7 @@ export interface GetSetupSessionResponse { } export interface GetTaskResponse { - created_at: Date; + created_at: TimestampNS; duration: string; /** * Current status of task @@ -11113,7 +11287,7 @@ export interface GetTaskResponse { * ID of task */ task_id: string; - updated_at: Date; + updated_at: TimestampNS; error?: ErrorResult; /** * Result produced by task after completion @@ -11180,15 +11354,28 @@ export interface GroupedChannelsBucket { */ prev?: string; /** - * Unread channels currently classified into this bucket + * Total unread channels matching this bucket and its filters, independent of page size */ unread_channels?: number; } export interface GroupedChannelsGroupRequest { + /** + * Max channels for this group; omitted or zero uses the request limit + */ limit?: number; + /** + * Cursor for the next page; only allowed when requesting one group + */ next?: string; + /** + * Cursor for the previous page; only allowed when requesting one group + */ prev?: string; + /** + * Optional query_timestamp $gte bound for a stored group, requiring query_timestamp sort; do not repeat its group name. For all, combine group equality/$in and date bounds with $or, or use one standalone group $ne exclusion. An empty object matches a stored group; omitted or null preserves legacy grouping. + */ + filter_conditions?: Record; } export interface GroupedQueryChannelsRequest { @@ -11198,7 +11385,11 @@ export interface GroupedQueryChannelsRequest { limit?: number; user_id?: string; /** - * Groups to return, keyed by group name. Each group can define limit, next, or prev. 'next' and 'prev' cursors are only allowed when the request contains exactly one group; multi-group pagination is rejected. + * Optional query_timestamp descending with NULLS LAST when enabled. Omitted sort preserves existing last_updated ordering and cursor formats + */ + sort?: Array; + /** + * Groups to return, keyed by stored group name. Each entry can define limit, next, prev, and optional filter_conditions: date bounds for stored groups; all supports combined group/date branches or one group $ne exclusion. Cursors are only allowed when requesting exactly one group. Omitted or null filters preserve legacy grouping, including all. */ groups?: Record; /** @@ -11213,7 +11404,7 @@ export interface GroupedQueryChannelsResponse { */ duration: string; /** - * Predefined channel groups keyed by group name + * Groups keyed by the requested stored group name */ groups: Record; } @@ -11390,29 +11581,29 @@ export interface ImportBlockListResponse { } export interface ImportTask { - created_at: Date; + created_at: TimestampNS; id: string; mode: string; path: string; state: string; - updated_at: Date; + updated_at: TimestampNS; history: Array; size?: number; } export interface ImportTaskHistory { - created_at: Date; + created_at: TimestampNS; next_state: string; prev_state: string; } export interface ImportV2TaskItem { app_pk: number; - created_at: Date; + created_at: TimestampNS; id: string; product: string; state: number; - updated_at: Date; + updated_at: TimestampNS; settings: ImportV2TaskSettings; result?: Record; } @@ -11484,7 +11675,7 @@ export interface IngressAudioEncodingResponse { export interface IngressErrorEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * Human-readable error message */ @@ -11545,7 +11736,7 @@ export interface IngressSourceResponse { export interface IngressStartedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * Unique identifier for this stream */ @@ -11578,7 +11769,7 @@ export interface IngressStartedEvent { export interface IngressStoppedEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * Unique identifier for the stream */ @@ -11671,23 +11862,23 @@ export interface InsertActionLogResponse { duration: string; } -export interface IntentBufferedItem { +export interface IntentConditionInfo { /** - * The ID of the user who authored the buffered message or comment + * Whether the score reached the threshold. */ - author_user_id: string; + passed: boolean; /** - * When the buffered message or comment was created + * Final (damped) score of the topic in this analysis; 0 when the topic is not defined in the policy. */ - created_at: Date; + score: number; /** - * The ID of the buffered message or comment + * Minimum score (1-100) the condition requires. */ - id: string; + threshold: number; /** - * The text of the buffered message or comment + * Policy intent topic label the condition references. */ - text: string; + topic: string; } export interface IntentConfigRequest { @@ -11704,39 +11895,37 @@ export interface IntentConfigResponse { topics: Array; } -export interface IntentDetectedEvent { +export interface IntentEvaluationInfo { /** - * The channel CID (chat) or feed ID (feeds) the buffered conversation belongs to + * The analyzed conversation: the channel CID for chat, the object ID for feeds. */ conversation_id: string; - created_at: Date; /** - * The ID of the most recently buffered entity + * Number of conversation messages sent to the model. */ - entity_id: string; + message_count: number; /** - * The type of the most recently buffered entity (chat message or feed comment) + * One entry per `intent_rule` condition of the rule, flat conditions first, then group conditions. */ - entity_type: string; + conditions: Array; /** - * The configured intent topic label that started the buffer + * Score (0-100) the model gave every topic in the analysis call, keyed by topic label, before message-count damping. */ - matched_topic: string; + raw_scores: Record; /** - * The Stage 2 conversation score (0-100) that cleared score_threshold + * Final score (0-100) of every topic after message-count damping, keyed by topic label. Conditions compare against these. */ + scores: Record; +} + +export interface IntentRuleParameters { + topic: string; + threshold?: number; +} + +export interface IntentScoreResponse { 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; + topic: string; } export interface IntentTopicRequest { @@ -11744,61 +11933,21 @@ 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 { @@ -11875,7 +12024,7 @@ export interface KickUserResponse { export interface KickedUserEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * User response object */ @@ -11931,7 +12080,7 @@ export interface LabelResultResponse { /** * Timestamp */ - created_at: Date; + created_at: TimestampNS; /** * High-level harm category */ @@ -12085,6 +12234,20 @@ export interface LayoutSettingsResponse { options?: Record; } +export interface LifecycleSettingsRequest { + /** + * Call lifecycle mode. One of: reusable, single_use. A single_use call cannot be reused once it has ended; the server ends it when its ring settles without an answer (currently: when the caller cancels the ring). Fixed at call creation + */ + mode?: 'reusable' | 'single_use'; +} + +export interface LifecycleSettingsResponse { + /** + * Call lifecycle mode. One of: reusable, single_use. A single_use call cannot be reused once it has ended; the server ends it when its ring settles without an answer (currently: when the caller cancels the ring). Fixed at call creation + */ + mode: 'reusable' | 'single_use'; +} + export interface LimitInfoResponse { /** * The maximum number of API calls allowed per time window @@ -12383,9 +12546,9 @@ export interface MarkReadResponseEvent { channel_id: string; channel_type: string; cid: string; - created_at: Date; + created_at: TimestampNS; type: string; - channel_last_message_at?: Date; + channel_last_message_at?: TimestampNS; last_read_message_id?: string; team?: string; /** @@ -12439,7 +12602,7 @@ export interface MatchedContent { /** * `content_published_at` from the contributing `/analyze` request, or server receive time when that field was omitted. */ - published_at: Date; + published_at: TimestampNS; /** * Content type that contributed this entry: `image` or `text`. */ @@ -12464,17 +12627,17 @@ export interface MatchedContent { } export interface MaxStreakChangedEvent { - created_at: Date; + created_at: TimestampNS; custom: Record; type: string; - received_at?: Date; + received_at?: TimestampNS; } export interface MemberAddedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * Represents channel in chat */ @@ -12505,7 +12668,7 @@ export interface MemberAddedEvent { * The CID of the channel to which the member was added */ cid?: string; - received_at?: Date; + received_at?: TimestampNS; /** * The team ID */ @@ -12518,7 +12681,7 @@ export interface MemberRemovedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * Represents channel in chat */ @@ -12549,7 +12712,7 @@ export interface MemberRemovedEvent { * The CID of the channel from which the member was removed */ cid?: string; - received_at?: Date; + received_at?: TimestampNS; /** * The team ID */ @@ -12571,11 +12734,11 @@ export interface MemberResponse { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * Date/time of the last update */ - updated_at: Date; + updated_at: TimestampNS; user_id: string; /** * Custom member response data @@ -12588,7 +12751,7 @@ export interface MemberResponse { /** * Date/time of deletion */ - deleted_at?: Date; + deleted_at?: TimestampNS; role?: string; } @@ -12596,7 +12759,7 @@ export interface MemberUpdatedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * Represents channel in chat */ @@ -12627,7 +12790,7 @@ export interface MemberUpdatedEvent { * The CID of the channel in which the member was updated */ cid?: string; - received_at?: Date; + received_at?: TimestampNS; /** * The team ID */ @@ -12667,7 +12830,7 @@ export interface MembershipLevelResponse { /** * When the membership level was created */ - created_at: Date; + created_at: TimestampNS; /** * Unique identifier for the membership level */ @@ -12683,7 +12846,7 @@ export interface MembershipLevelResponse { /** * When the membership level was last updated */ - updated_at: Date; + updated_at: TimestampNS; /** * Activity tags this membership level gives access to */ @@ -12737,7 +12900,7 @@ export interface MessageDeletedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * Whether the message was hard deleted */ @@ -12776,7 +12939,7 @@ export interface MessageDeletedEvent { * Whether the message was deleted only for the current user */ deleted_for_me?: boolean; - received_at?: Date; + received_at?: TimestampNS; /** * The team ID */ @@ -12786,13 +12949,13 @@ export interface MessageDeletedEvent { } export interface MessageFlagResponse { - created_at: Date; + created_at: TimestampNS; created_by_automod: boolean; - updated_at: Date; - approved_at?: Date; + updated_at: TimestampNS; + approved_at?: TimestampNS; reason?: string; - rejected_at?: Date; - reviewed_at?: Date; + rejected_at?: TimestampNS; + reviewed_at?: TimestampNS; custom?: Record; details?: FlagDetailsResponse; /** @@ -12818,7 +12981,7 @@ export interface MessageFlaggedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; message_id: string; /** * Represents any chat message @@ -12852,7 +13015,7 @@ export interface MessageFlaggedEvent { * The reason for the flag */ reason?: string; - received_at?: Date; + received_at?: TimestampNS; /** * The team ID */ @@ -12877,7 +13040,7 @@ export interface MessageFlaggedEvent { export interface MessageHistoryEntryResponse { is_deleted: boolean; message_id: string; - message_updated_at: Date; + message_updated_at: TimestampNS; message_updated_by_id: string; text: string; attachments: Array; @@ -12892,7 +13055,7 @@ export interface MessageModerationResult { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * ID of the message */ @@ -12900,7 +13063,7 @@ export interface MessageModerationResult { /** * Date/time of the last update */ - updated_at: Date; + updated_at: TimestampNS; /** * Whether user has bad karma */ @@ -12935,7 +13098,7 @@ export interface MessageNewEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; message_id: string; /** * The number of watchers @@ -12974,7 +13137,7 @@ export interface MessageNewEvent { * The author of the parent message */ parent_author?: string; - received_at?: Date; + received_at?: TimestampNS; /** * The team ID */ @@ -13054,7 +13217,7 @@ export interface MessageReadEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; custom: Record; /** * The type of event: "message.read" in this case @@ -13084,7 +13247,7 @@ export interface MessageReadEvent { * The ID of the last read message */ last_read_message_id?: string; - received_at?: Date; + received_at?: TimestampNS; /** * The team ID */ @@ -13184,7 +13347,7 @@ export interface MessageResponse { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; deleted_reply_count: number; /** * Contains HTML markup of the message. Can only be set when using server-side API @@ -13229,7 +13392,7 @@ export interface MessageResponse { /** * Date/time of the last update */ - updated_at: Date; + updated_at: TimestampNS; /** * Array of message attachments */ @@ -13270,9 +13433,9 @@ export interface MessageResponse { /** * Date/time of deletion */ - deleted_at?: Date; + deleted_at?: TimestampNS; deleted_for_me?: boolean; - message_text_updated_at?: Date; + message_text_updated_at?: TimestampNS; /** * Should be empty if `text` is provided. Can only be set when using server-side API */ @@ -13284,11 +13447,11 @@ export interface MessageResponse { /** * Date when pinned message expires */ - pin_expires?: Date; + pin_expires?: TimestampNS; /** * Date when message got pinned */ - pinned_at?: Date; + pinned_at?: TimestampNS; /** * Identifier of the poll to include in the message */ @@ -13351,7 +13514,7 @@ export interface MessageUnblockedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; message_id: string; custom: Record; /** @@ -13366,7 +13529,7 @@ export interface MessageUnblockedEvent { * The CID of the channel where the message was unblocked */ cid?: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; } @@ -13374,7 +13537,7 @@ export interface MessageUndeletedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; message_id: string; custom: Record; /** @@ -13405,7 +13568,7 @@ export interface MessageUndeletedEvent { * The CID of the channel where the message was sent */ cid?: string; - received_at?: Date; + received_at?: TimestampNS; /** * The team ID */ @@ -13422,7 +13585,7 @@ export interface MessageUpdatedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; message_id: string; custom: Record; /** @@ -13453,7 +13616,7 @@ export interface MessageUpdatedEvent { * The CID of the channel where the message was sent */ cid?: string; - received_at?: Date; + received_at?: TimestampNS; /** * The team ID */ @@ -13471,7 +13634,7 @@ export interface MessageWithChannelResponse { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; deleted_reply_count: number; /** * Contains HTML markup of the message. Can only be set when using server-side API @@ -13516,7 +13679,7 @@ export interface MessageWithChannelResponse { /** * Date/time of the last update */ - updated_at: Date; + updated_at: TimestampNS; /** * Array of message attachments */ @@ -13561,9 +13724,9 @@ export interface MessageWithChannelResponse { /** * Date/time of deletion */ - deleted_at?: Date; + deleted_at?: TimestampNS; deleted_for_me?: boolean; - message_text_updated_at?: Date; + message_text_updated_at?: TimestampNS; /** * Should be empty if `text` is provided. Can only be set when using server-side API */ @@ -13575,11 +13738,11 @@ export interface MessageWithChannelResponse { /** * Date when pinned message expires */ - pin_expires?: Date; + pin_expires?: TimestampNS; /** * Date when message got pinned */ - pinned_at?: Date; + pinned_at?: TimestampNS; /** * Identifier of the poll to include in the message */ @@ -13704,7 +13867,7 @@ export interface ModerationActionConfigResponse { } export interface ModerationAnalysisFailedEvent { - created_at: Date; + created_at: TimestampNS; type: string; /** * The moderation policy key the request targeted. @@ -13722,7 +13885,7 @@ export interface ModerationAnalysisFailedEvent { * Echo of the `entity_type` on the /analyze request. */ entity_type?: string; - received_at?: Date; + received_at?: TimestampNS; /** * Echo of the request's `content_ids`, keyed by text/image label. On keyframe and caption streams every request repeats the same entity_type/entity_id/entity_creator_id, so this is what identifies the specific submission that went unscreened. */ @@ -13741,21 +13904,21 @@ export interface ModerationCallResponse { backstage: boolean; captioning: boolean; cid: string; - created_at: Date; + created_at: TimestampNS; current_session_id: string; id: string; recording: boolean; transcribing: boolean; translating: boolean; type: string; - updated_at: Date; + updated_at: TimestampNS; blocked_user_ids: Array; custom: Record; channel_cid?: string; - ended_at?: Date; + ended_at?: TimestampNS; join_ahead_time_seconds?: number; routing_number?: string; - starts_at?: Date; + starts_at?: TimestampNS; team?: string; /** * User response object @@ -13764,7 +13927,7 @@ export interface ModerationCallResponse { } export interface ModerationCheckCompletedEvent { - created_at: Date; + created_at: TimestampNS; /** * The ID of entity which was moderated */ @@ -13783,7 +13946,7 @@ export interface ModerationCheckCompletedEvent { review_queue_item_id: string; custom: Record; type: string; - received_at?: Date; + received_at?: TimestampNS; } export interface ModerationConfig { @@ -13813,11 +13976,11 @@ export interface ModerationCustomActionEvent { * The ID of the custom action that was executed */ action_id: string; - created_at: Date; + created_at: TimestampNS; custom: Record; review_queue_item: ReviewQueueItemResponse; type: string; - received_at?: Date; + received_at?: TimestampNS; /** * Additional options passed to the custom action */ @@ -13848,14 +14011,14 @@ export interface ModerationDashboardPreferences { } export interface ModerationFlagResponse { - created_at: Date; + created_at: TimestampNS; entity_id: string; entity_type: string; type: string; - updated_at: Date; + updated_at: TimestampNS; user_id: string; result: Array>; - content_published_at?: Date; + content_published_at?: TimestampNS; entity_creator_id?: string; reason?: string; review_queue_item_id?: string; @@ -13877,18 +14040,18 @@ export interface ModerationFlaggedEvent { * The type of content that was flagged */ content_type: string; - created_at: Date; + created_at: TimestampNS; /** * The ID of the flagged content */ object_id: string; custom: Record; type: string; - received_at?: Date; + received_at?: TimestampNS; } export interface ModerationImageAnalysisCompleteEvent { - created_at: Date; + created_at: TimestampNS; type: string; /** * The moderation policy key that was applied. @@ -13906,7 +14069,7 @@ export interface ModerationImageAnalysisCompleteEvent { * Echo of the `entity_type` on the /analyze request. */ entity_type?: string; - received_at?: Date; + received_at?: TimestampNS; /** * Review queue row ID for deep-linking into the dashboard. */ @@ -13926,11 +14089,11 @@ export interface ModerationImageAnalysisCompleteEvent { } export interface ModerationMarkReviewedEvent { - created_at: Date; + created_at: TimestampNS; custom: Record; item: ReviewQueueItemResponse; type: string; - received_at?: Date; + received_at?: TimestampNS; /** * Represents any chat message */ @@ -14018,14 +14181,14 @@ export interface ModerationPayloadResponse { } export interface ModerationQueueResponse { - created_at: Date; + created_at: TimestampNS; created_by: string; description: string; id: string; item_count: number; name: string; type: string; - updated_at: Date; + updated_at: TimestampNS; sort: Array>; filters: Record; } @@ -14057,14 +14220,14 @@ export interface ModerationRuleInfo { } export interface ModerationRuleV2Response { - created_at: Date; + created_at: TimestampNS; description: string; enabled: boolean; id: string; name: string; rule_type: string; team: string; - updated_at: Date; + updated_at: TimestampNS; config_keys: Array; cooldown_period?: string; logic?: string; @@ -14075,7 +14238,7 @@ export interface ModerationRuleV2Response { } export interface ModerationRulesTriggeredEvent { - created_at: Date; + created_at: TimestampNS; /** * The ID of the entity that triggered the rule */ @@ -14095,7 +14258,7 @@ export interface ModerationRulesTriggeredEvent { custom: Record; rule: ModerationRuleInfo; type: string; - received_at?: Date; + received_at?: TimestampNS; /** * The review queue item ID if applicable */ @@ -14108,10 +14271,11 @@ export interface ModerationRulesTriggeredEvent { * Ordered list of contents whose verdicts contributed to an aggregation rule's threshold. Populated only for aggregation rules when callers supplied `content_ids`. */ matched_contents?: Array; + intent?: IntentEvaluationInfo; } export interface ModerationTextAnalysisCompleteEvent { - created_at: Date; + created_at: TimestampNS; type: string; /** * The moderation policy key that was applied. @@ -14129,7 +14293,7 @@ export interface ModerationTextAnalysisCompleteEvent { * Echo of the `entity_type` on the /analyze request. */ entity_type?: string; - received_at?: Date; + received_at?: TimestampNS; /** * Review queue row ID for deep-linking into the dashboard. */ @@ -14243,9 +14407,25 @@ export interface NoiseCancellationSettings { } export interface NotificationComment { + /** + * The text of the comment + */ comment: string; + /** + * The ID of the comment + */ id: string; + /** + * The ID of the user who wrote the comment + */ user_id: string; + /** + * The ID of the parent comment when this comment is a reply; omitted for top-level comments + */ + parent_id?: string; + /** + * Attachments on the comment + */ attachments?: Array; } @@ -14273,7 +14453,7 @@ export interface NotificationFeedUpdatedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * The ID of the feed */ @@ -14284,7 +14464,7 @@ export interface NotificationFeedUpdatedEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; /** * Aggregated activities for notification feeds */ @@ -14297,7 +14477,7 @@ export interface NotificationMarkUnreadEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; custom: Record; /** * The type of event: "notification.mark_unread" in this case @@ -14327,12 +14507,12 @@ export interface NotificationMarkUnreadEvent { /** * The time when the channel/thread was marked as unread */ - last_read_at?: Date; + last_read_at?: TimestampNS; /** * The ID of the last read message */ last_read_message_id?: string; - received_at?: Date; + received_at?: TimestampNS; /** * The team ID */ @@ -14421,11 +14601,11 @@ export interface NotificationStatusResponse { /** * When notifications were last read */ - last_read_at?: Date; + last_read_at?: TimestampNS; /** * When notifications were last seen */ - last_seen_at?: Date; + last_seen_at?: TimestampNS; /** * Deprecated: use is_read on each activity/group instead. IDs of activities that have been read. Capped at ~101 entries for aggregated feeds. */ @@ -14473,7 +14653,7 @@ export interface NotificationThreadMessageNewEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; message_id: string; /** * The ID of the thread @@ -14511,7 +14691,7 @@ export interface NotificationThreadMessageNewEvent { */ cid?: string; parent_author?: string; - received_at?: Date; + received_at?: TimestampNS; /** * The team ID */ @@ -14629,7 +14809,7 @@ export type OwnCapability = (typeof OwnCapability)[keyof typeof OwnCapability]; export interface OwnUserResponse { banned: boolean; - created_at: Date; + created_at: TimestampNS; id: string; invisible: boolean; language: string; @@ -14643,20 +14823,20 @@ export interface OwnUserResponse { */ unread_count: number; unread_threads: number; - updated_at: Date; + updated_at: TimestampNS; + blocked_user_ids: Array; channel_mutes: Array; devices: Array; mutes: Array; teams: Array; custom: Record; avg_response_time?: number; - deactivated_at?: Date; - deleted_at?: Date; + deactivated_at?: TimestampNS; + deleted_at?: TimestampNS; image?: string; - last_active?: Date; + last_active?: TimestampNS; name?: string; - revoke_tokens_issued_before?: Date; - blocked_user_ids?: Array; + revoke_tokens_issued_before?: TimestampNS; latest_hidden_channels?: Array; /** * The privacy settings of the user. @@ -14670,6 +14850,13 @@ export interface OwnUserResponse { total_unread_count_by_team?: Record; } +export interface PagerDefaults { + /** + * Number of records returned when `limit` is omitted. + */ + limit: number; +} + export interface PagerRequest { limit?: number; next?: string; @@ -14701,7 +14888,7 @@ export interface ParticipantCountByMinuteResponse { last: number; max: number; min: number; - start_ts: Date; + start_ts: TimestampNS; } export interface ParticipantCountOverTimeResponse { @@ -14746,9 +14933,9 @@ export interface ParticipantSeriesSubscriptionTrackMetrics { export interface ParticipantSeriesTimeframe { max_points: number; - since: Date; + since: TimestampNS; step_seconds: number; - until: Date; + until: TimestampNS; } export interface ParticipantSeriesTrackMetrics { @@ -14776,15 +14963,15 @@ export interface ParticipantSessionDetails { user_session_id: string; roles: Array; duration_in_seconds?: number; - joined_at?: Date; - left_at?: Date; + joined_at?: TimestampNS; + left_at?: TimestampNS; } export interface PendingMessageEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * The method used for the pending message */ @@ -14794,7 +14981,7 @@ export interface PendingMessageEvent { * The type of event: "message.pending" in this case */ type: string; - received_at?: Date; + received_at?: TimestampNS; /** * Represents channel in chat */ @@ -14847,7 +15034,7 @@ export interface PerformanceAnalysisResponse { unindexed_fields: Array; unindexed_sort_fields: Array; warnings: Array; - last_analyzed?: Date; + last_analyzed?: TimestampNS; scan_type?: string; } @@ -14927,7 +15114,7 @@ export interface PermissionRequest { export interface PermissionRequestEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * The list of permissions requested by the user */ @@ -14958,7 +15145,7 @@ export interface PinActivityResponse { /** * When the activity was pinned */ - created_at: Date; + created_at: TimestampNS; duration: string; /** * Fully qualified ID of the feed the activity was pinned to @@ -14997,11 +15184,11 @@ export interface PlatformDataResponse { export interface Policy { action: number; - created_at: Date; + created_at: TimestampNS; name: string; owner: boolean; priority: number; - updated_at: Date; + updated_at: TimestampNS; resources: Array; roles: Array; } @@ -15040,7 +15227,7 @@ export interface PolicyTestLabelDrift { } export interface PolicyTestResult { - created_at: Date; + created_at: TimestampNS; id: number; message_text: string; row_index: number; @@ -15066,7 +15253,7 @@ export interface PolicyTestRow { export interface PolicyTestRun { config_key: string; - created_at: Date; + created_at: TimestampNS; id: string; rows_completed: number; rows_total: number; @@ -15074,10 +15261,10 @@ export interface PolicyTestRun { status: string; task_id: string; triggered_by: string; - completed_at?: Date; - config_updated_at?: Date; + completed_at?: TimestampNS; + config_updated_at?: TimestampNS; error_message?: string; - started_at?: Date; + started_at?: TimestampNS; metrics?: PolicyTestRunMetrics; } @@ -15109,13 +15296,13 @@ export interface PolicyTestSeedSpec { export interface PolicyTestSet { config_key: string; - created_at: Date; + created_at: TimestampNS; created_by: string; id: string; mode: string; name: string; row_count: number; - updated_at: Date; + updated_at: TimestampNS; team?: string; rows?: Array; last_run?: PolicyTestRun; @@ -15188,13 +15375,13 @@ export interface PollResponseData { allow_answers: boolean; allow_user_suggested_options: boolean; answers_count: number; - created_at: Date; + created_at: TimestampNS; created_by_id: string; description: string; enforce_unique_vote: boolean; id: string; name: string; - updated_at: Date; + updated_at: TimestampNS; vote_count: number; /** * Voting visibility of the poll @@ -15226,11 +15413,11 @@ export interface PollVoteResponse { } export interface PollVoteResponseData { - created_at: Date; + created_at: TimestampNS; id: string; option_id: string; poll_id: string; - updated_at: Date; + updated_at: TimestampNS; answer_text?: string; is_answer?: boolean; user_id?: string; @@ -15272,10 +15459,10 @@ export interface PoorTail { } export interface PredefinedFilterResponse { - created_at: Date; + created_at: TimestampNS; name: string; operation: string; - updated_at: Date; + updated_at: TimestampNS; filter: Record; description?: string; query_id?: number; @@ -15287,7 +15474,7 @@ export interface PredefinedFilterResponse { export interface PredefinedFilterStatsResponse { calls: number; max_latency_ms: number; - last_seen?: Date; + last_seen?: TimestampNS; } export interface PrivacySettingsResponse { @@ -15393,7 +15580,7 @@ export interface PushNotificationFields { export interface PushNotificationSettingsResponse { disabled?: boolean; - disabled_until?: Date; + disabled_until?: TimestampNS; } export interface PushPreferenceInput { @@ -15444,17 +15631,17 @@ export interface PushPreferencesResponse { /** * If provided the notifications will be disabled until the set date. */ - disabled_until?: Date; + disabled_until?: TimestampNS; feeds_level?: string; chat_preferences?: ChatPreferencesResponse; feeds_preferences?: FeedsPreferencesResponse; } export interface PushProvider { - created_at: Date; + created_at: TimestampNS; name: string; type: string; - updated_at: Date; + updated_at: TimestampNS; apn_auth_key?: string; apn_auth_type?: string; apn_development?: boolean; @@ -15465,7 +15652,7 @@ export interface PushProvider { apn_team_id?: string; apn_topic?: string; description?: string; - disabled_at?: Date; + disabled_at?: TimestampNS; disabled_reason?: string; firebase_apn_template?: string; firebase_credentials?: string; @@ -15509,10 +15696,10 @@ export interface PushProviderRequest { } export interface PushProviderResponse { - created_at: Date; + created_at: TimestampNS; name: string; type: string; - updated_at: Date; + updated_at: TimestampNS; apn_auth_key?: string; apn_auth_type?: string; apn_development?: boolean; @@ -15525,7 +15712,7 @@ export interface PushProviderResponse { apn_team_id?: string; apn_topic?: string; description?: string; - disabled_at?: Date; + disabled_at?: TimestampNS; disabled_reason?: string; firebase_apn_template?: string; firebase_credentials?: string; @@ -15540,7 +15727,7 @@ export interface PushProviderResponse { } export interface PushTemplate { - created_at: Date; + created_at: TimestampNS; enable_push: boolean; event_type: | 'message.new' @@ -15553,7 +15740,7 @@ export interface PushTemplate { | 'feeds.comment.reaction.added' | 'feeds.follow.created' | 'feeds.notification_feed.updated'; - updated_at: Date; + updated_at: TimestampNS; template?: string; } @@ -15561,7 +15748,7 @@ export interface PushTemplateResponse { /** * Time when the template was created */ - created_at: Date; + created_at: TimestampNS; /** * Whether push notification is enabled for this event */ @@ -15577,7 +15764,7 @@ export interface PushTemplateResponse { /** * Time when the template was last updated */ - updated_at: Date; + updated_at: TimestampNS; /** * The push notification template */ @@ -15738,10 +15925,10 @@ export interface QueryBannedUsersPayload { * Filter conditions to apply to the query */ filter_conditions: Record; - created_at_after?: Date; - created_at_after_or_equal?: Date; - created_at_before?: Date; - created_at_before_or_equal?: Date; + created_at_after?: TimestampNS; + created_at_after_or_equal?: TimestampNS; + created_at_before?: TimestampNS; + created_at_before_or_equal?: TimestampNS; /** * Whether to exclude expired bans or not */ @@ -15958,8 +16145,8 @@ export interface QueryCallSessionParticipantStatsResponse { duration: string; participants: Array; counts: CallStatsParticipantCounts; - call_ended_at?: Date; - call_started_at?: Date; + call_ended_at?: TimestampNS; + call_started_at?: TimestampNS; next?: string; prev?: string; tmp_data_source?: string; @@ -16012,12 +16199,12 @@ export interface QueryCallStatsMapResponse { */ duration: string; counts: CallStatsParticipantCounts; - call_ended_at?: Date; - call_started_at?: Date; + call_ended_at?: TimestampNS; + call_started_at?: TimestampNS; data_source?: string; - end_time?: Date; - generated_at?: Date; - start_time?: Date; + end_time?: TimestampNS; + generated_at?: TimestampNS; + start_time?: TimestampNS; publishers?: CallStatsMapPublishers; sfus?: CallStatsMapSFUs; subscribers?: CallStatsMapSubscribers; @@ -16093,6 +16280,66 @@ export interface QueryCampaignsResponse { prev?: string; } +export interface QueryChannelBansRequest { + /** + * Whether to exclude expired bans or not + */ + exclude_expired_bans?: boolean; + /** + * When true, the response includes total and total_by_scope: the number of banned users overall and per scope, independent of paging + */ + include_total?: boolean; + limit?: number; + next?: string; + prev?: string; + user_id?: string; + /** + * Filter conditions to apply to the query + */ + filter_conditions?: Record; + /** + * User request object + */ + user?: UserRequest; +} + +export interface QueryChannelBansResponse { + /** + * Duration of the request in milliseconds + */ + duration: string; + /** + * Users banned from the channel, one entry per user, newest ban first + */ + bans: Array; + next?: string; + prev?: string; + /** + * Number of banned users, each counted once, ignoring paging. Counted per scope with a cap of 100000 each, so it can reach 200000. Only present when include_total is set on the request; omitted when counting timed out + */ + total?: number; + total_by_scope?: ChannelBansScopeTotals; +} + +export interface QueryChannelsDefaults { + /** + * Number of channels returned when `limit` is omitted. + */ + limit: number; + /** + * Largest number of channels returned for one request. A bigger `limit` is silently clamped to this value rather than rejected. An app with no per-app override gets a higher ceiling for the narrow case of a request asking for at most one message and one member per channel. + */ + max_limit: number; + /** + * Number of members returned per channel when `member_limit` is omitted. + */ + member_limit: number; + /** + * Number of messages returned per channel when `message_limit` is omitted. + */ + message_limit: number; +} + export interface QueryChannelsRequest { /** * Number of channels to limit @@ -16322,7 +16569,7 @@ export interface QueryFeedModerationTemplate { /** * When the template was created */ - created_at: Date; + created_at: TimestampNS; /** * Name of the moderation template */ @@ -16330,7 +16577,7 @@ export interface QueryFeedModerationTemplate { /** * When the template was last updated */ - updated_at: Date; + updated_at: TimestampNS; /** * Configuration for a feeds moderation template */ @@ -16431,10 +16678,10 @@ export interface QueryFollowsResponse { } export interface QueryFutureChannelBansPayload { - created_at_after?: Date; - created_at_after_or_equal?: Date; - created_at_before?: Date; - created_at_before_or_equal?: Date; + created_at_after?: TimestampNS; + created_at_after_or_equal?: TimestampNS; + created_at_before?: TimestampNS; + created_at_before_or_equal?: TimestampNS; /** * Whether to exclude expired bans or not */ @@ -16508,10 +16755,10 @@ export interface QueryLabelResultsResponse { export interface QueryMembersPayload { type: string; - created_at_after?: Date; - created_at_after_or_equal?: Date; - created_at_before?: Date; - created_at_before_or_equal?: Date; + created_at_after?: TimestampNS; + created_at_after_or_equal?: TimestampNS; + created_at_before?: TimestampNS; + created_at_before_or_equal?: TimestampNS; id?: string; limit?: number; offset?: number; @@ -17340,11 +17587,11 @@ export interface RawRecordingSettingsResponse { export interface Reaction { activity_id: string; - created_at: Date; + created_at: TimestampNS; kind: string; - updated_at: Date; + updated_at: TimestampNS; user_id: string; - deleted_at?: Date; + deleted_at?: TimestampNS; id?: string; parent?: string; score?: number; @@ -17362,7 +17609,7 @@ export interface ReactionDeletedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * Represents channel in chat */ @@ -17393,7 +17640,7 @@ export interface ReactionDeletedEvent { */ cid?: string; message_id?: string; - received_at?: Date; + received_at?: TimestampNS; /** * The team ID */ @@ -17419,11 +17666,11 @@ export interface ReactionGroupResponse { /** * FirstReactionAt is the time of the first reaction of this type. This is the same also if all reaction of this type are deleted, because if someone will react again with the same type, will be preserved the sorting. */ - first_reaction_at: Date; + first_reaction_at: TimestampNS; /** * LastReactionAt is the time of the last reaction of this type. */ - last_reaction_at: Date; + last_reaction_at: TimestampNS; /** * SumScores is the sum of all scores of reactions of this type. Medium allows you to clap articles more than once and shows the sum of all claps from all users. For example, you can send `clap` x5 using `score: 5`. */ @@ -17438,7 +17685,7 @@ export interface ReactionGroupUserResponse { /** * The time when the user reacted. */ - created_at: Date; + created_at: TimestampNS; /** * The ID of the user who reacted. */ @@ -17453,7 +17700,7 @@ export interface ReactionNewEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * Represents channel in chat */ @@ -17484,7 +17731,7 @@ export interface ReactionNewEvent { */ cid?: string; message_id?: string; - received_at?: Date; + received_at?: TimestampNS; /** * The team ID */ @@ -17531,7 +17778,7 @@ export interface ReactionResponse { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * Message ID */ @@ -17547,7 +17794,7 @@ export interface ReactionResponse { /** * Date/time of the last update */ - updated_at: Date; + updated_at: TimestampNS; /** * User ID */ @@ -17566,7 +17813,7 @@ export interface ReactionUpdatedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; message_id: string; /** * Represents channel in chat @@ -17601,7 +17848,7 @@ export interface ReactionUpdatedEvent { * The CID of the channel containing the message */ cid?: string; - received_at?: Date; + received_at?: TimestampNS; /** * The team ID */ @@ -17674,13 +17921,13 @@ export interface ReadReceiptsResponse { } export interface ReadStateResponse { - last_read: Date; + last_read: TimestampNS; unread_messages: number; /** * User response object */ user: UserResponse; - last_delivered_at?: Date; + last_delivered_at?: TimestampNS; last_delivered_message_id?: string; last_read_message_id?: string; } @@ -17769,7 +18016,7 @@ export interface ReminderCreatedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * The ID of the message for which the reminder was created */ @@ -17788,7 +18035,7 @@ export interface ReminderCreatedEvent { * The ID of the parent message, if the reminder is for a thread message */ parent_id?: string; - received_at?: Date; + received_at?: TimestampNS; } export interface ReminderDeletedEvent { @@ -17799,7 +18046,7 @@ export interface ReminderDeletedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * The ID of the message for which the reminder was created */ @@ -17818,7 +18065,7 @@ export interface ReminderDeletedEvent { * The ID of the parent message, if the reminder is for a thread message */ parent_id?: string; - received_at?: Date; + received_at?: TimestampNS; } export interface ReminderNotificationEvent { @@ -17829,7 +18076,7 @@ export interface ReminderNotificationEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * The ID of the message for which the reminder was created */ @@ -17845,17 +18092,17 @@ export interface ReminderNotificationEvent { */ type: string; parent_id?: string; - received_at?: Date; + received_at?: TimestampNS; } export interface ReminderResponseData { channel_cid: string; - created_at: Date; + created_at: TimestampNS; message_id: string; - updated_at: Date; + updated_at: TimestampNS; user_id: string; - expires_at?: Date; - remind_at?: Date; + expires_at?: TimestampNS; + remind_at?: TimestampNS; /** * Represents channel in chat */ @@ -17878,7 +18125,7 @@ export interface ReminderUpdatedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * The ID of the message for which the reminder was created */ @@ -17897,7 +18144,7 @@ export interface ReminderUpdatedEvent { * The ID of the parent message, if the reminder is for a thread message */ parent_id?: string; - received_at?: Date; + received_at?: TimestampNS; } export interface RemoveUserGroupMembersRequest { @@ -18101,7 +18348,7 @@ export interface RestoreUsersRequest { export interface RetentionPolicy { app_pk: number; - enabled_at: Date; + enabled_at: TimestampNS; policy: string; config: PolicyConfig; } @@ -18114,10 +18361,10 @@ export interface RetentionRunResponse { } export interface ReviewQueueItemNewEvent { - created_at: Date; + created_at: TimestampNS; custom: Record; type: string; - received_at?: Date; + received_at?: TimestampNS; /** * The flags associated with this review queue item */ @@ -18134,7 +18381,7 @@ export interface ReviewQueueItemResponse { /** * When the item was created */ - created_at: Date; + created_at: TimestampNS; /** * ID of the entity being reviewed */ @@ -18172,7 +18419,7 @@ export interface ReviewQueueItemResponse { /** * When the item was last updated */ - updated_at: Date; + updated_at: TimestampNS; /** * Moderation actions taken */ @@ -18192,7 +18439,7 @@ export interface ReviewQueueItemResponse { /** * When the review was completed */ - completed_at?: Date; + completed_at?: TimestampNS; /** * Highest per-label confidence (0-1) any provider reported across the item's flags; absent when no flag carried one */ @@ -18206,7 +18453,7 @@ export interface ReviewQueueItemResponse { /** * When the item was escalated */ - escalated_at?: Date; + escalated_at?: TimestampNS; /** * ID of the moderator who escalated the item */ @@ -18214,7 +18461,7 @@ export interface ReviewQueueItemResponse { /** * When the item was reviewed */ - reviewed_at?: Date; + reviewed_at?: TimestampNS; /** * Teams associated with this item */ @@ -18237,14 +18484,15 @@ export interface ReviewQueueItemResponse { * Content payload for moderation */ moderation_payload?: ModerationPayloadResponse; + poll?: PollResponseData; reaction?: Reaction; } export interface ReviewQueueItemUpdatedEvent { - created_at: Date; + created_at: TimestampNS; custom: Record; type: string; - received_at?: Date; + received_at?: TimestampNS; /** * The flags associated with this review queue item */ @@ -18256,7 +18504,7 @@ export interface ReviewQueueItemUpdatedEvent { export interface RevisionHistoryResponse { action_type: string; actor_type: string; - created_at: Date; + created_at: TimestampNS; object_id: string; object_type: string; user_id: string; @@ -18280,11 +18528,11 @@ export interface RingAttemptResponse { /** * When the ring went out */ - created_at: Date; + created_at: TimestampNS; /** * When the ring expires, i.e. when the missed call deadline fires */ - expires_at: Date; + expires_at: TimestampNS; /** * The user that started the ring */ @@ -18320,11 +18568,11 @@ export interface RingAttemptResponse { /** * When the ring was deleted */ - deleted_at?: Date; + deleted_at?: TimestampNS; /** * When the outcome left ringing */ - settled_at?: Date; + settled_at?: TimestampNS; } export interface RingCallRequest { @@ -18362,11 +18610,11 @@ export interface RingDeliveryResponse { /** * When the ring was dispatched */ - sent_at: Date; + sent_at: TimestampNS; /** * When the device acknowledged the ring; not populated yet */ - acked_at?: Date; + acked_at?: TimestampNS; /** * The device the ring was dispatched to, empty for websocket deliveries which fan out to every connection */ @@ -18374,15 +18622,15 @@ export interface RingDeliveryResponse { /** * When the device displayed the ring; not populated yet */ - displayed_at?: Date; + displayed_at?: TimestampNS; /** * When the device fetched the call; not populated yet */ - fetched_at?: Date; + fetched_at?: TimestampNS; /** * When the push provider accepted the dispatch; not populated yet */ - provider_accepted_at?: Date; + provider_accepted_at?: TimestampNS; } export interface RingSettings { @@ -18414,7 +18662,7 @@ export interface RingSettingsResponse { export interface RingSettledTarget { state: string; - state_at: Date; + state_at: TimestampNS; reason?: string; } @@ -18430,7 +18678,7 @@ export interface RingTargetResponse { /** * When the target last changed state */ - state_at: Date; + state_at: TimestampNS; /** * The dispatches of this ring to the target's devices */ @@ -18441,7 +18689,7 @@ export interface Role { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * Whether this is a custom role or built-in */ @@ -18453,7 +18701,7 @@ export interface Role { /** * Date/time of the last update */ - updated_at: Date; + updated_at: TimestampNS; /** * List of scopes where this role is currently present. `.app` means that role is present in app-level grants */ @@ -18503,6 +18751,10 @@ export interface RuleBuilderCondition { flood_similar_params?: FloodSimilarRuleParameters; image_content_params?: ImageContentParameters; image_rule_params?: ImageRuleParameters; + /** + * intent_rule params: policy intent topic label and the minimum final score (1-100) that fires the condition + */ + intent_rule_params?: IntentRuleParameters; ip_content_count_rule_params?: IPContentCountRuleParameters; ip_flag_count_rule_params?: IPFlagCountRuleParameters; keyframe_ocr_rule_params?: KeyframeOCRRuleParameters; @@ -18510,6 +18762,7 @@ export interface RuleBuilderCondition { ocr_content_params?: OCRContentParameters; text_content_params?: TextContentParameters; text_rule_params?: TextRuleParameters; + user_channel_ban_count_params?: UserChannelBanCountRuleParameters; user_channel_count_params?: UserChannelCountRuleParameters; user_created_within_params?: UserCreatedWithinParameters; user_custom_property_params?: UserCustomPropertyParameters; @@ -18805,7 +19058,7 @@ export interface SIPInboundRoutingRuleResponse { /** * Creation timestamp */ - created_at: Date; + created_at: TimestampNS; duration: string; /** * Unique identifier of the SIP Inbound Routing Rule @@ -18818,7 +19071,7 @@ export interface SIPInboundRoutingRuleResponse { /** * Last update timestamp */ - updated_at: Date; + updated_at: TimestampNS; /** * List of called numbers */ @@ -18895,7 +19148,7 @@ export interface SIPTrunkResponse { /** * Creation timestamp */ - created_at: Date; + created_at: TimestampNS; /** * Unique identifier for the SIP trunk */ @@ -18911,7 +19164,7 @@ export interface SIPTrunkResponse { /** * Last update timestamp */ - updated_at: Date; + updated_at: TimestampNS; /** * The URI for the SIP trunk */ @@ -18934,6 +19187,190 @@ export interface SRTIngress { address: string; } +export interface ScheduledMessageContentResponse { + /** + * Text of the message + */ + text: string; + custom: Record; + /** + * Contains HTML markup of the message + */ + html?: string; + /** + * Whether the message mentions the whole channel + */ + mentioned_channel?: boolean; + /** + * Whether the message mentions the online channel members + */ + mentioned_here?: boolean; + /** + * MML content of the message + */ + mml?: string; + /** + * ID of parent message (thread) + */ + parent_id?: string; + /** + * Date/time the pin expires + */ + pin_expires?: TimestampNS; + /** + * Whether the message will be pinned when sent + */ + pinned?: boolean; + /** + * Identifier of the poll to include in the message + */ + poll_id?: string; + quoted_message_id?: string; + /** + * Whether thread reply should be shown in the channel as well + */ + show_in_channel?: boolean; + /** + * Whether message is silent or not + */ + silent?: boolean; + /** + * Contains type of the message. One of: regular, system + */ + type?: string; + /** + * Array of message attachments + */ + attachments?: Array; + /** + * IDs of the user groups mentioned in the message + */ + mentioned_group_ids?: Array; + /** + * Roles mentioned in the message + */ + mentioned_roles?: Array; + /** + * IDs of the users mentioned in the message + */ + mentioned_users?: Array; + /** + * IDs of the users the message will be visible to + */ + restricted_visibility?: Array; + /** + * The location a scheduled message will share + */ + shared_location?: ScheduledMessageLocation; +} + +export interface ScheduledMessageFailedEvent { + /** + * Date/time of creation + */ + created_at: TimestampNS; + custom: Record; + user: UserResponseCommonFields; + /** + * The type of event: "scheduled_message.failed" in this case + */ + type: string; + /** + * The CID of the channel the message is scheduled in + */ + cid?: string; + received_at?: TimestampNS; + /** + * A message scheduled to be sent later + */ + scheduled_message?: ScheduledMessageResponse; +} + +export interface ScheduledMessageLocation { + /** + * The ID of the device that created the location. + */ + created_by_device_id: string; + /** + * The date when the location sharing ends. + * If it's empty, it means the location sharing is static instead of live. + */ + end_at?: TimestampNS; + /** + * The latitude of the location. + */ + latitude?: number; + /** + * The longitude of the location. + */ + longitude?: number; +} + +export interface ScheduledMessageResponse { + /** + * The CID of the channel the message will be sent to + */ + cid: string; + /** + * Date/time of creation + */ + created_at: TimestampNS; + /** + * Unique identifier of the scheduled message + */ + id: string; + /** + * Date/time the message is scheduled to be sent + */ + scheduled_at: TimestampNS; + /** + * Status of the scheduled message. One of: scheduled, sending, failed, canceled, sent + */ + status: string; + /** + * Date/time of the last update + */ + updated_at: TimestampNS; + /** + * The message a scheduled message will send + */ + message: ScheduledMessageContentResponse; + /** + * User response object + */ + user: UserResponse; + /** + * Why sending the message failed. Only set when status is failed. One of: banned, no_permission, channel_frozen, channel_deleted, user_deleted, moderation_blocked, hook_rejected, expired, internal_error, invalid_message + */ + failure_reason?: string; +} + +export interface ScheduledMessageSentEvent { + /** + * Date/time of creation + */ + created_at: TimestampNS; + /** + * The ID of the message that was sent + */ + message_id: string; + custom: Record; + user: UserResponseCommonFields; + /** + * The type of event: "scheduled_message.sent" in this case + */ + type: string; + /** + * The CID of the channel the message was sent to + */ + cid?: string; + received_at?: TimestampNS; + /** + * A message scheduled to be sent later + */ + scheduled_message?: ScheduledMessageResponse; +} + export interface ScoreBands { good?: number; ok?: number; @@ -19018,7 +19455,7 @@ export interface SearchResult { export interface SearchResultMessage { cid: string; - created_at: Date; + created_at: TimestampNS; deleted_reply_count: number; html: string; id: string; @@ -19030,7 +19467,7 @@ export interface SearchResultMessage { silent: boolean; text: string; type: string; - updated_at: Date; + updated_at: TimestampNS; attachments: Array; latest_reactions: Array; mentioned_users: Array; @@ -19044,13 +19481,13 @@ export interface SearchResultMessage { */ user: UserResponse; command?: string; - deleted_at?: Date; + deleted_at?: TimestampNS; deleted_for_me?: boolean; - message_text_updated_at?: Date; + message_text_updated_at?: TimestampNS; mml?: string; parent_id?: string; - pin_expires?: Date; - pinned_at?: Date; + pin_expires?: TimestampNS; + pinned_at?: TimestampNS; poll_id?: string; quoted_message_id?: string; show_in_channel?: boolean; @@ -19120,13 +19557,13 @@ export interface SearchWarning { export interface Segment { all_sender_channels: boolean; all_users: boolean; - created_at: Date; + created_at: TimestampNS; id: string; name: string; size: number; type: string; - updated_at: Date; - deleted_at?: Date; + updated_at: TimestampNS; + deleted_at?: TimestampNS; description?: string; task_id?: string; filter?: Record; @@ -19135,20 +19572,20 @@ export interface Segment { export interface SegmentResponse { all_sender_channels: boolean; all_users: boolean; - created_at: Date; - deleted_at: Date; + created_at: TimestampNS; + deleted_at: TimestampNS; description: string; id: string; name: string; size: number; type: string; - updated_at: Date; + updated_at: TimestampNS; filter: Record; } export interface SegmentTargetResponse { app_pk: number; - created_at: Date; + created_at: TimestampNS; segment_id: string; target_id: string; } @@ -19299,7 +19736,7 @@ export interface SessionSettingsResponse { export interface SessionWarningResponse { code: string; warning: string; - time?: Date; + time?: TimestampNS; } export interface SetFeedsRetentionPolicyRequest { @@ -19332,12 +19769,12 @@ export interface SetRetentionPolicyResponse { } export interface SetupSession { - created_at: Date; + created_at: TimestampNS; current_step: string; status: string; - updated_at: Date; + updated_at: TimestampNS; setup_data: Record; - completed_at?: Date; + completed_at?: TimestampNS; } export interface ShadowBlockActionRequestPayload { @@ -19355,7 +19792,7 @@ export interface ShareResponse { /** * When the share occurred */ - created_at: Date; + created_at: TimestampNS; /** * User response object */ @@ -19377,7 +19814,7 @@ export interface SharedLocationResponse { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * Device ID that created the live location */ @@ -19398,7 +19835,7 @@ export interface SharedLocationResponse { /** * Date/time of the last update */ - updated_at: Date; + updated_at: TimestampNS; /** * User ID */ @@ -19406,7 +19843,7 @@ export interface SharedLocationResponse { /** * Time when the live location expires */ - end_at?: Date; + end_at?: TimestampNS; /** * Represents channel in chat */ @@ -19425,7 +19862,7 @@ export interface SharedLocationResponseData { /** * The date when the location was created. */ - created_at: Date; + created_at: TimestampNS; /** * The ID of the device that created the location. */ @@ -19445,7 +19882,7 @@ export interface SharedLocationResponseData { /** * The date when the location was updated. */ - updated_at: Date; + updated_at: TimestampNS; /** * The ID of the user that created the location. */ @@ -19454,7 +19891,7 @@ export interface SharedLocationResponseData { * The date when the location sharing ends. * If it's empty, it means the location sharing is static instead of live. */ - end_at?: Date; + end_at?: TimestampNS; /** * Represents channel in chat */ @@ -19846,7 +20283,7 @@ export interface StoriesFeedUpdatedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * The ID of the feed */ @@ -19857,7 +20294,7 @@ export interface StoriesFeedUpdatedEvent { */ type: string; feed_visibility?: string; - received_at?: Date; + received_at?: TimestampNS; /** * Individual activities for stories feeds */ @@ -19871,7 +20308,7 @@ export interface StoriesFeedUpdatedEvent { export interface SubmitActionRequest { /** - * Type of moderation action to perform. One of: mark_reviewed, delete_message, delete_activity, delete_comment, delete_reaction, ban, custom, unban, restore, delete_user, delete_user_messages, unblock, block, shadow_block, unmask, kick_user, end_call, escalate, de_escalate + * Type of moderation action to perform. One of: mark_reviewed, delete_message, delete_activity, delete_comment, delete_reaction, delete_poll, delete_poll_option, delete_poll_answer, ban, custom, unban, restore, delete_user, delete_user_messages, unblock, block, shadow_block, unmask, kick_user, end_call, escalate, de_escalate */ action_type: | 'flag' @@ -19880,6 +20317,9 @@ export interface SubmitActionRequest { | 'delete_activity' | 'delete_comment' | 'delete_reaction' + | 'delete_poll' + | 'delete_poll_option' + | 'delete_poll_answer' | 'ban' | 'custom' | 'unban' @@ -19930,6 +20370,18 @@ export interface SubmitActionRequest { * Configuration for message deletion action */ delete_message?: DeleteMessageRequestPayload; + /** + * Configuration for poll deletion action. Poll deletion is always permanent. + */ + delete_poll?: DeletePollRequestPayload; + /** + * Configuration for deleting the free-text poll answer a review item was raised for. Chat polls only. Deletion is permanent; the poll and other votes are kept. + */ + delete_poll_answer?: DeletePollAnswerRequestPayload; + /** + * Configuration for deleting the single poll option a review item was raised for. Deletion is permanent; the rest of the poll is kept. + */ + delete_poll_option?: DeletePollOptionRequestPayload; /** * Configuration for reaction deletion action */ @@ -20170,14 +20622,14 @@ export interface ThreadParticipant { /** * Date/time of creation */ - created_at: Date; - last_read_at: Date; + created_at: TimestampNS; + last_read_at: TimestampNS; custom: Record; - last_thread_message_at?: Date; + last_thread_message_at?: TimestampNS; /** * Left Thread At is the time when the user left the thread */ - left_thread_at?: Date; + left_thread_at?: TimestampNS; /** * Thead ID is unique string identifier of the thread */ @@ -20204,7 +20656,7 @@ export interface ThreadResponse { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * Created By User ID */ @@ -20228,7 +20680,7 @@ export interface ThreadResponse { /** * Date/time of the last update */ - updated_at: Date; + updated_at: TimestampNS; /** * Custom data for this object */ @@ -20236,11 +20688,11 @@ export interface ThreadResponse { /** * Deleted At */ - deleted_at?: Date; + deleted_at?: TimestampNS; /** * Last Message At */ - last_message_at?: Date; + last_message_at?: TimestampNS; /** * Thread Participants */ @@ -20271,7 +20723,7 @@ export interface ThreadStateResponse { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * Created By User ID */ @@ -20295,7 +20747,7 @@ export interface ThreadStateResponse { /** * Date/time of the last update */ - updated_at: Date; + updated_at: TimestampNS; latest_replies: Array; /** * Custom data for this object @@ -20304,11 +20756,11 @@ export interface ThreadStateResponse { /** * Deleted At */ - deleted_at?: Date; + deleted_at?: TimestampNS; /** * Last Message At */ - last_message_at?: Date; + last_message_at?: TimestampNS; read?: Array; /** * Thread Participants @@ -20330,20 +20782,20 @@ export interface ThreadStateResponse { } export interface ThreadUpdatedEvent { - created_at: Date; + created_at: TimestampNS; custom: Record; type: string; channel_id?: string; channel_type?: string; cid?: string; - received_at?: Date; + received_at?: TimestampNS; thread?: ThreadResponse; } export interface ThreadedCommentResponse { bookmark_count: number; confidence_score: number; - created_at: Date; + created_at: TimestampNS; downvote_count: number; hidden: boolean; id: string; @@ -20356,7 +20808,7 @@ export interface ThreadedCommentResponse { * Status of the comment. One of: active, deleted, removed, hidden */ status: 'active' | 'deleted' | 'removed' | 'hidden' | 'shadow_blocked'; - updated_at: Date; + updated_at: TimestampNS; upvote_count: number; mentioned_users: Array; own_reactions: Array; @@ -20365,8 +20817,8 @@ export interface ThreadedCommentResponse { */ user: UserResponse; controversy_score?: number; - deleted_at?: Date; - edited_at?: Date; + deleted_at?: TimestampNS; + edited_at?: TimestampNS; parent_id?: string; text?: string; attachments?: Array; @@ -20877,7 +21329,7 @@ export interface UnblockUsersResponse { export interface UnblockedUserEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * User response object */ @@ -20911,6 +21363,10 @@ export interface UnfollowBatchRequest { * List of follow relationships to remove, each with optional keep_history */ follows: Array; + /** + * If true, the batch is queued as a background task, paced per app, and the response has empty follows and a task_id. Server-side only. Supported by the get-or-create endpoint (GetOrCreateUnfollows); UnfollowBatch rejects it. Async batches can apply out of order with other follow writes. Defaults to false. + */ + async?: boolean; /** * Whether to delete the corresponding notification activity (default: false) */ @@ -20927,6 +21383,10 @@ export interface UnfollowBatchResponse { * List of follow relationships that were removed */ follows: Array; + /** + * ID of the background task when the request was sent with async: true + */ + task_id?: string; } export interface UnfollowPair { @@ -21036,7 +21496,7 @@ export interface UnreadCountsChannel { /** * The date which the current user last read the channel. */ - last_read: Date; + last_read: TimestampNS; /** * The number of unread messages inside the channel. */ @@ -21071,7 +21531,7 @@ export interface UnreadCountsThread { /** * The date which the current user last read the thread. */ - last_read: Date; + last_read: TimestampNS; /** * The id of the last reply which the current user read in the thread. */ @@ -21476,7 +21936,7 @@ export interface UpdateCallTypeResponse { /** * the time the call type was created */ - created_at: Date; + created_at: TimestampNS; duration: string; /** * the name of the call type @@ -21485,7 +21945,7 @@ export interface UpdateCallTypeResponse { /** * the time the call type was last updated */ - updated_at: Date; + updated_at: TimestampNS; /** * the permissions granted to each role */ @@ -21681,7 +22141,7 @@ export interface UpdateChannelTypeResponse { automod_behavior: 'flag' | 'block' | 'shadow_block'; connect_events: boolean; count_messages: boolean; - created_at: Date; + created_at: TimestampNS; custom_events: boolean; delivery_events: boolean; /** @@ -21704,7 +22164,7 @@ export interface UpdateChannelTypeResponse { shared_locations: boolean; skip_last_msg_update_for_system_msgs: boolean; typing_events: boolean; - updated_at: Date; + updated_at: TimestampNS; uploads: boolean; url_enrichment: boolean; user_message_reminders: boolean; @@ -22246,6 +22706,14 @@ export interface UpdatePollOptionRequest { * Option text */ text: string; + /** + * Key of the moderation configuration to use. Server-side only. + */ + config_key?: string; + /** + * Team associated with the configuration. Server-side only. + */ + config_team?: string; user_id?: string; /** * Custom data for this object @@ -22258,6 +22726,14 @@ export interface UpdatePollOptionRequest { } export interface UpdatePollPartialRequest { + /** + * Key of the moderation configuration to use. Server-side only. + */ + config_key?: string; + /** + * Team associated with the configuration. Server-side only. + */ + config_team?: string; user_id?: string; /** * Array of field names to unset @@ -22290,6 +22766,14 @@ export interface UpdatePollRequest { * Allow user suggested options */ allow_user_suggested_options?: boolean; + /** + * Key of the moderation configuration to use. Server-side only. + */ + config_key?: string; + /** + * Team associated with the configuration. Server-side only. + */ + config_team?: string; /** * Poll description */ @@ -22568,7 +23052,7 @@ export interface UpdateUsersResponse { export interface UpdatedCallPermissionsEvent { call_cid: string; - created_at: Date; + created_at: TimestampNS; /** * The capabilities of the current user */ @@ -22709,6 +23193,10 @@ export interface UpsertActivitiesRequest { * If true, forces moderation to run for server-side requests. By default, server-side requests skip moderation. Client-side requests always run moderation regardless of this field. */ force_moderation?: boolean; + /** + * Server-side only. If true, activities whose id already exists are left unchanged instead of updated: no write, events or notifications. They are listed in skipped_existing and returned as stored. Soft-deleted activities count as existing and are returned with deleted_at set. Default: false. + */ + skip_existing?: boolean; } export interface UpsertActivitiesResponse { @@ -22721,6 +23209,10 @@ export interface UpsertActivitiesResponse { * Total number of mention notification activities created for mentioned users across all activities */ mention_notifications_created?: number; + /** + * IDs of activities left unchanged because they already existed. Only set when skip_existing is true. + */ + skipped_existing?: Array; } export interface UpsertCollectionsRequest { @@ -22888,7 +23380,7 @@ export interface UpsertModerationTemplateResponse { /** * When the template was created */ - created_at: Date; + created_at: TimestampNS; duration: string; /** * Name of the moderation template @@ -22897,7 +23389,7 @@ export interface UpsertModerationTemplateResponse { /** * When the template was last updated */ - updated_at: Date; + updated_at: TimestampNS; /** * Configuration for a feeds moderation template */ @@ -23026,7 +23518,7 @@ export interface UserBannedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; custom: Record; user: UserResponseCommonFields; /** @@ -23050,12 +23542,12 @@ export interface UserBannedEvent { /** * The expiration date of the ban */ - expiration?: Date; + expiration?: TimestampNS; /** * The reason for the ban */ reason?: string; - received_at?: Date; + received_at?: TimestampNS; /** * ID of the review queue item (flagged message) that triggered the ban, if the ban was applied from the moderation review queue */ @@ -23073,6 +23565,12 @@ export interface UserBannedEvent { created_by?: UserResponseCommonFields; } +export interface UserChannelBanCountRuleParameters { + banned_by?: string; + threshold?: number; + time_window?: string; +} + export interface UserChannelCountRuleParameters { threshold?: number; time_window?: string; @@ -23096,14 +23594,14 @@ export interface UserDeactivatedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; custom: Record; user: UserResponseCommonFields; /** * The type of event: "user.deactivated" in this case */ type: string; - received_at?: Date; + received_at?: TimestampNS; created_by?: UserResponseCommonFields; } @@ -23111,7 +23609,7 @@ export interface UserDeletedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * The type of deletion that was used for the user's conversations. One of: hard, soft, pruning, (empty string) */ @@ -23142,7 +23640,7 @@ export interface UserDeletedEvent { * The type of event: "user.deleted" in this case */ type: string; - received_at?: Date; + received_at?: TimestampNS; } export interface UserFeedbackReport { @@ -23170,7 +23668,7 @@ export interface UserFlaggedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * The reason for the flag */ @@ -23184,7 +23682,7 @@ export interface UserFlaggedEvent { * The type of event: "user.flagged" in this case */ type: string; - received_at?: Date; + received_at?: TimestampNS; /** * Custom data */ @@ -23194,10 +23692,10 @@ export interface UserFlaggedEvent { export interface UserGroup { app_pk: number; - created_at: Date; + created_at: TimestampNS; id: string; name: string; - updated_at: Date; + updated_at: TimestampNS; created_by?: string; description?: string; team_id?: string; @@ -23208,13 +23706,13 @@ export interface UserGroupCreatedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; custom: Record; /** * The type of event: "user_group.created" in this case */ type: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; user_group?: UserGroup; } @@ -23223,20 +23721,20 @@ export interface UserGroupDeletedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; custom: Record; /** * The type of event: "user_group.deleted" in this case */ type: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; user_group?: UserGroup; } export interface UserGroupMember { app_pk: number; - created_at: Date; + created_at: TimestampNS; group_id: string; is_admin: boolean; user_id: string; @@ -23246,7 +23744,7 @@ export interface UserGroupMemberAddedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * The user IDs that were added */ @@ -23256,7 +23754,7 @@ export interface UserGroupMemberAddedEvent { * The type of event: "user_group.member_added" in this case */ type: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; user_group?: UserGroup; } @@ -23265,7 +23763,7 @@ export interface UserGroupMemberRemovedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * The user IDs that were removed */ @@ -23275,16 +23773,16 @@ export interface UserGroupMemberRemovedEvent { * The type of event: "user_group.member_removed" in this case */ type: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; user_group?: UserGroup; } export interface UserGroupResponse { - created_at: Date; + created_at: TimestampNS; id: string; name: string; - updated_at: Date; + updated_at: TimestampNS; created_by?: string; description?: string; team_id?: string; @@ -23295,13 +23793,13 @@ export interface UserGroupUpdatedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; custom: Record; /** * The type of event: "user_group.updated" in this case */ type: string; - received_at?: Date; + received_at?: TimestampNS; user?: UserResponseCommonFields; user_group?: UserGroup; } @@ -23333,7 +23831,7 @@ export interface UserMessagesDeletedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; custom: Record; user: UserResponseCommonFields; /** @@ -23358,7 +23856,7 @@ export interface UserMessagesDeletedEvent { * Whether Messages were hard deleted */ hard_delete?: boolean; - received_at?: Date; + received_at?: TimestampNS; /** * The team of the channel where the target user's messages were deleted */ @@ -23367,9 +23865,9 @@ export interface UserMessagesDeletedEvent { } export interface UserMuteResponse { - created_at: Date; - updated_at: Date; - expires?: Date; + created_at: TimestampNS; + updated_at: TimestampNS; + expires?: TimestampNS; /** * User response object */ @@ -23384,14 +23882,14 @@ export interface UserMutedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; custom: Record; user: UserResponseCommonFields; /** * The type of event: "user.muted" in this case */ type: string; - received_at?: Date; + received_at?: TimestampNS; /** * The target users that were muted */ @@ -23414,14 +23912,14 @@ export interface UserReactivatedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; custom: Record; user: UserResponseCommonFields; /** * The type of event: "user.reactivated" in this case */ type: string; - received_at?: Date; + received_at?: TimestampNS; created_by?: UserResponseCommonFields; } @@ -23470,7 +23968,7 @@ export interface UserResponse { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * Unique user identifier */ @@ -23495,7 +23993,7 @@ export interface UserResponse { /** * Date/time of the last update */ - updated_at: Date; + updated_at: TimestampNS; blocked_user_ids: Array; /** * List of teams user is a part of @@ -23509,21 +24007,21 @@ export interface UserResponse { /** * Date when ban expires */ - ban_expires?: Date; + ban_expires?: TimestampNS; bypass_moderation?: boolean; /** * Date of deactivation */ - deactivated_at?: Date; + deactivated_at?: TimestampNS; /** * Date/time of deletion */ - deleted_at?: Date; + deleted_at?: TimestampNS; image?: string; /** * Date of last activity */ - last_active?: Date; + last_active?: TimestampNS; /** * Optional name of user */ @@ -23531,7 +24029,7 @@ export interface UserResponse { /** * Revocation date for tokens */ - revoke_tokens_issued_before?: Date; + revoke_tokens_issued_before?: TimestampNS; /** * List of devices user is using */ @@ -23546,44 +24044,44 @@ export interface UserResponse { export interface UserResponseCommonFields { banned: boolean; - created_at: Date; + created_at: TimestampNS; id: string; language: string; online: boolean; role: string; - updated_at: Date; + updated_at: TimestampNS; blocked_user_ids: Array; teams: Array; custom: Record; avg_response_time?: number; - deactivated_at?: Date; - deleted_at?: Date; + deactivated_at?: TimestampNS; + deleted_at?: TimestampNS; image?: string; - last_active?: Date; + last_active?: TimestampNS; name?: string; - revoke_tokens_issued_before?: Date; + revoke_tokens_issued_before?: TimestampNS; teams_role?: Record; } export interface UserResponsePrivacyFields { banned: boolean; - created_at: Date; + created_at: TimestampNS; id: string; language: string; online: boolean; role: string; - updated_at: Date; + updated_at: TimestampNS; blocked_user_ids: Array; teams: Array; custom: Record; avg_response_time?: number; - deactivated_at?: Date; - deleted_at?: Date; + deactivated_at?: TimestampNS; + deleted_at?: TimestampNS; image?: string; invisible?: boolean; - last_active?: Date; + last_active?: TimestampNS; name?: string; - revoke_tokens_issued_before?: Date; + revoke_tokens_issued_before?: TimestampNS; /** * The privacy settings of the user. */ @@ -23604,7 +24102,7 @@ export interface UserUnbannedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; custom: Record; user: UserResponseCommonFields; /** @@ -23625,7 +24123,7 @@ export interface UserUnbannedEvent { * The CID of the channel where the target user was unbanned */ cid?: string; - received_at?: Date; + received_at?: TimestampNS; /** * Whether the target user was shadow unbanned */ @@ -23642,14 +24140,14 @@ export interface UserUnmutedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; custom: Record; user: UserResponseCommonFields; /** * The type of event: "user.unmuted" in this case */ type: string; - received_at?: Date; + received_at?: TimestampNS; /** * The target users that were unmuted */ @@ -23661,7 +24159,7 @@ export interface UserUnreadReminderEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; /** * The channels with unread messages */ @@ -23672,21 +24170,21 @@ export interface UserUnreadReminderEvent { * The type of event: "user.unread_message_reminder" in this case */ type: string; - received_at?: Date; + received_at?: TimestampNS; } export interface UserUpdatedEvent { /** * Date/time of creation */ - created_at: Date; + created_at: TimestampNS; custom: Record; user: UserResponsePrivacyFields; /** * The type of event: "user.updated" in this case */ type: string; - received_at?: Date; + received_at?: TimestampNS; } export interface ValidateExternalStorageResponse { @@ -23970,7 +24468,6 @@ export type WHEvent = | ({ type: 'moderation.image_analysis.complete'; } & ModerationImageAnalysisCompleteEvent) - | ({ type: 'moderation.intent_detected' } & IntentDetectedEvent) | ({ type: 'moderation.mark_reviewed' } & ModerationMarkReviewedEvent) | ({ type: 'moderation.text_analysis.complete'; @@ -23990,6 +24487,8 @@ export type WHEvent = | ({ type: 'reminder.updated' } & ReminderUpdatedEvent) | ({ type: 'review_queue_item.new' } & ReviewQueueItemNewEvent) | ({ type: 'review_queue_item.updated' } & ReviewQueueItemUpdatedEvent) + | ({ type: 'scheduled_message.failed' } & ScheduledMessageFailedEvent) + | ({ type: 'scheduled_message.sent' } & ScheduledMessageSentEvent) | ({ type: 'thread.updated' } & ThreadUpdatedEvent) | ({ type: 'user.banned' } & UserBannedEvent) | ({ type: 'user.deactivated' } & UserDeactivatedEvent) @@ -24016,12 +24515,12 @@ export interface WHIPIngress { } export interface WSEvent { - created_at: Date; + created_at: TimestampNS; type: string; custom: Record; automoderation?: boolean; channel_id?: string; - channel_last_message_at?: Date; + channel_last_message_at?: TimestampNS; channel_type?: string; cid?: string; connection_id?: string; diff --git a/src/gen/models/timestamp-guard.ts b/src/gen/models/timestamp-guard.ts new file mode 100644 index 0000000..966c56a --- /dev/null +++ b/src/gen/models/timestamp-guard.ts @@ -0,0 +1,27 @@ +import type { TimestampNS } from './index'; + +/** + * Makes `new Date(ns)` a deprecated constructor, and a compile error for a server-sent nanosecond timestamp. + * + * Any tsconfig whose `include` covers this directory picks this file up; `exclude` it to defer. + * + * The `0 extends 1 & T` guard excludes `any`. Without it this overload would capture + * every `new Date()` in the program -- `any` is assignable to the brand, and a + * merged declaration is tried before lib.es5.d.ts -- breaking each `JSON.parse` path + * and index-signature read on the next regeneration. + */ +declare global { + interface DateConstructor { + /** + * @deprecated Unix nanoseconds, not milliseconds. Use SDK's provided nsToDate(t), or nsToMs(t) for arithmetic. + */ + new ( + t: 0 extends 1 & T ? never : T, + ): { + readonly ERROR_use_SDKs_nsToDate_helper_instead: never; + }; + } +} + +// Keeps this a module, which `declare global` requires, independent of the import above. +export {}; diff --git a/src/gen/moderation/ModerationApi.ts b/src/gen/moderation/ModerationApi.ts index bfb8901..4667a9f 100644 --- a/src/gen/moderation/ModerationApi.ts +++ b/src/gen/moderation/ModerationApi.ts @@ -1313,6 +1313,9 @@ export class ModerationApi { delete_activity: request?.delete_activity, delete_comment: request?.delete_comment, delete_message: request?.delete_message, + delete_poll: request?.delete_poll, + delete_poll_answer: request?.delete_poll_answer, + delete_poll_option: request?.delete_poll_option, delete_reaction: request?.delete_reaction, delete_user: request?.delete_user, delete_user_messages: request?.delete_user_messages, diff --git a/src/utils/time.ts b/src/utils/time.ts new file mode 100644 index 0000000..99d0e9e --- /dev/null +++ b/src/utils/time.ts @@ -0,0 +1,84 @@ +/** + * Unit conversions between the API's timestamps and JavaScript's. + * + * **The invariant this module exists to hold:** a timestamp is a unix-**nanosecond** `number` — + * that is what the API puts on the wire and what every server-sent date field on a generated + * response or event type carries. A duration, interval or delay stays in **milliseconds**, because + * that is what `setTimeout` and `ApiConfig.timeout` speak. + * + * Two consequences make the helpers below mandatory rather than convenient: + * + * - **Every `Date`-based path is out of range.** `Date` tops out around 8.64e15 ms while a current + * nanosecond timestamp is ~1.79e18, so a bare wire number read as milliseconds lands on an + * invalid instance: `new Date(ns).toISOString()` throws `RangeError`, and a date library handed + * the same number formats it as the literal string `'Invalid Date'`. Neither is a type error. + * - **A unit mix-up between two `number`s is the silent one.** Comparing a wire timestamp against + * `Date.now()`, or adding a millisecond duration to one, produces a plausible-looking number and + * no complaint at all. + * + * Outgoing **request** date fields are unaffected: they are still typed `Date`, because + * `JSON.stringify` emits RFC3339 for a `Date` and that is the format the request spec declares. + * Use {@link nsToDate} when handing a server-sent timestamp back to the API. + * + * Precision note: nanosecond epoch values exceed `Number.MAX_SAFE_INTEGER` (~9.01e15), so they are + * quantised to roughly 256 ns steps. Ordering is unaffected; exact equality against a value that + * has round-tripped through JSON is not guaranteed. + */ + +/** Nanoseconds per millisecond — the only magic number in this module. */ +export const NS_PER_MS = 1e6; + +/** A wire timestamp as epoch milliseconds, for arithmetic against `Date.now()` or a `Date`. */ +export const nsToMs = (ns: number): number => Math.floor(ns / NS_PER_MS); + +/** Epoch milliseconds as a wire timestamp. */ +export const msToNs = (ms: number): number => ms * NS_PER_MS; + +/** + * The local clock as a wire-comparable timestamp, for building API-shaped objects. + * + * Millisecond resolution, so two calls within the same millisecond produce equal timestamps. + * Callers that order by timestamp must tie-break on something else. + */ +export const nowNs = (): number => msToNs(Date.now()); + +/** A wire timestamp as a `Date`, for request payloads and date libraries. */ +export const nsToDate = (ns: number): Date => new Date(nsToMs(ns)); + +/** + * A wire timestamp as a nanosecond-precision RFC3339 string, for an outgoing request date field. + * {@link nsToDate} is lossy here — `Date` holds only milliseconds. + */ +export const nsToRfc3339 = (ns: number): string => { + const ms = nsToMs(ns); + const subMs = String(ns - ms * NS_PER_MS).padStart(6, '0'); + return new Date(ms).toISOString().replace(/\.(\d{3})Z$/, `.$1${subMs}Z`); +}; + +/** A `Date` as a wire timestamp. */ +export const dateToNs = (date: Date): number => msToNs(date.getTime()); + +/** + * A server-sent timestamp as a `Date`, or `undefined` when there is none. + * + * The guarded companion to {@link nsToDate}, for the boundary where a wire timestamp becomes + * something a date library or a caller consumes. Use {@link nsToDate} when the value is known to + * be present; use this when it comes straight off a response, an event or persisted state. + * + * The guard is the whole point, and it covers two cases that are silent rather than loud: + * + * - **Absent.** Many timestamps are optional in practice even where the generated type marks them + * required. `nsToDate(undefined as never)` yields an `Invalid Date`, and `.toISOString()` on one + * throws `RangeError: Invalid time value`. + * - **Not finite.** A malformed payload or a hand-built fixture can produce `NaN`, which reaches + * the same `RangeError` by a different route. + * + * Returning `undefined` rather than throwing lets a caller fall back to whatever it already does + * for a missing timestamp. + */ +export const convertTimestampToDate = ( + timestamp?: number | null, +): Date | undefined => { + if (timestamp == null || !Number.isFinite(timestamp)) return undefined; + return nsToDate(timestamp); +}; diff --git a/tsconfig.test.json b/tsconfig.test.json new file mode 100644 index 0000000..e7732a7 --- /dev/null +++ b/tsconfig.test.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": true, + "types": ["node", "vitest/globals"] + }, + "include": ["./src", "index.ts", "./__tests__"] +} diff --git a/vite.config.mts b/vite.config.mts index cf56164..e2ac5b0 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -41,6 +41,11 @@ export default defineConfig({ }, testTimeout: 60000, include: ["__tests__/**/*.test.ts"], + typecheck: { + enabled: true, + tsconfig: "./tsconfig.test.json", + include: ["__tests__/**/*.test.ts"], + }, includeSource: ["src/**/*.ts"], retry: 3, },