From ef3a69967ec068398efffb62e3cc57b9e842710c Mon Sep 17 00:00:00 2001 From: subash pradhan Date: Fri, 7 Nov 2025 10:43:10 +0100 Subject: [PATCH 1/2] feat: add app_banned types to ChannelFilters --- src/types.ts | 1 + test/unit/utils.test.ts | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/types.ts b/src/types.ts index a999bea76..cdaed659f 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1753,6 +1753,7 @@ export type ReactionFilters = QueryFilters< export type ChannelFilters = QueryFilters< ContainsOperator> & { + app_banned?: 'only' | 'excluded'; archived?: boolean; 'member.user.name'?: | RequireOnlyOne<{ diff --git a/test/unit/utils.test.ts b/test/unit/utils.test.ts index cbe9ed07b..aa4ff2aa7 100644 --- a/test/unit/utils.test.ts +++ b/test/unit/utils.test.ts @@ -690,6 +690,35 @@ describe('Channel pinning and archiving utils', () => { expect(shouldConsiderArchivedChannels(mockFilters)).to.be.true; }); }); + + describe('app_banned filter', () => { + it('should accept "only" as a valid value', () => { + const mockFilters: ChannelFilters = { app_banned: 'only' }; + expect(mockFilters.app_banned).to.equal('only'); + }); + + it('should accept "excluded" as a valid value', () => { + const mockFilters: ChannelFilters = { app_banned: 'excluded' }; + expect(mockFilters.app_banned).to.equal('excluded'); + }); + + it('should allow app_banned to be combined with other filters', () => { + const mockFilters: ChannelFilters = { + type: 'messaging', + app_banned: 'excluded', + archived: false, + members: { $in: ['user-1'] }, + }; + expect(mockFilters.app_banned).to.equal('excluded'); + expect(mockFilters.type).to.equal('messaging'); + expect(mockFilters.archived).to.be.false; + }); + + it('should allow app_banned to be undefined', () => { + const mockFilters: ChannelFilters = { type: 'messaging' }; + expect(mockFilters.app_banned).to.be.undefined; + }); + }); }); describe('promoteChannel', () => { From 8849346a0768730e474aa4d757946f562e26fca9 Mon Sep 17 00:00:00 2001 From: subash pradhan Date: Fri, 7 Nov 2025 12:19:13 +0100 Subject: [PATCH 2/2] feat: add app_banned and has_unread properties --- src/types.ts | 1 + test/unit/utils.test.ts | 29 ----------------------------- 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/src/types.ts b/src/types.ts index cdaed659f..5dd390464 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1754,6 +1754,7 @@ export type ReactionFilters = QueryFilters< export type ChannelFilters = QueryFilters< ContainsOperator> & { app_banned?: 'only' | 'excluded'; + has_unread?: boolean; archived?: boolean; 'member.user.name'?: | RequireOnlyOne<{ diff --git a/test/unit/utils.test.ts b/test/unit/utils.test.ts index aa4ff2aa7..cbe9ed07b 100644 --- a/test/unit/utils.test.ts +++ b/test/unit/utils.test.ts @@ -690,35 +690,6 @@ describe('Channel pinning and archiving utils', () => { expect(shouldConsiderArchivedChannels(mockFilters)).to.be.true; }); }); - - describe('app_banned filter', () => { - it('should accept "only" as a valid value', () => { - const mockFilters: ChannelFilters = { app_banned: 'only' }; - expect(mockFilters.app_banned).to.equal('only'); - }); - - it('should accept "excluded" as a valid value', () => { - const mockFilters: ChannelFilters = { app_banned: 'excluded' }; - expect(mockFilters.app_banned).to.equal('excluded'); - }); - - it('should allow app_banned to be combined with other filters', () => { - const mockFilters: ChannelFilters = { - type: 'messaging', - app_banned: 'excluded', - archived: false, - members: { $in: ['user-1'] }, - }; - expect(mockFilters.app_banned).to.equal('excluded'); - expect(mockFilters.type).to.equal('messaging'); - expect(mockFilters.archived).to.be.false; - }); - - it('should allow app_banned to be undefined', () => { - const mockFilters: ChannelFilters = { type: 'messaging' }; - expect(mockFilters.app_banned).to.be.undefined; - }); - }); }); describe('promoteChannel', () => {