This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

semble / src / shared / infrastructure / http / factories / ControllerFactory.ts
19 kB 318 lines
1import { InitiateOAuthSignInController } from '../../../../modules/user/infrastructure/http/controllers/InitiateOAuthSignInController'; 2import { CompleteOAuthSignInController } from '../../../../modules/user/infrastructure/http/controllers/CompleteOAuthSignInController'; 3import { RefreshAccessTokenController } from '../../../../modules/user/infrastructure/http/controllers/RefreshAccessTokenController'; 4import { AddUrlToLibraryController } from '../../../../modules/cards/infrastructure/http/controllers/AddUrlToLibraryController'; 5import { AddCardToLibraryController } from '../../../../modules/cards/infrastructure/http/controllers/AddCardToLibraryController'; 6import { AddCardToCollectionController } from '../../../../modules/cards/infrastructure/http/controllers/AddCardToCollectionController'; 7import { UpdateNoteCardController } from '../../../../modules/cards/infrastructure/http/controllers/UpdateNoteCardController'; 8import { UpdateUrlCardAssociationsController } from '../../../../modules/cards/infrastructure/http/controllers/UpdateUrlCardAssociationsController'; 9import { RemoveCardFromLibraryController } from '../../../../modules/cards/infrastructure/http/controllers/RemoveCardFromLibraryController'; 10import { RemoveCardFromCollectionController } from '../../../../modules/cards/infrastructure/http/controllers/RemoveCardFromCollectionController'; 11import { GetUrlMetadataController } from '../../../../modules/cards/infrastructure/http/controllers/GetUrlMetadataController'; 12import { GetUrlCardViewController } from '../../../../modules/cards/infrastructure/http/controllers/GetUrlCardViewController'; 13import { GetLibrariesForCardController } from '../../../../modules/cards/infrastructure/http/controllers/GetLibrariesForCardController'; 14import { GetMyUrlCardsController } from '../../../../modules/cards/infrastructure/http/controllers/GetMyUrlCardsController'; 15import { GetUserUrlCardsController } from '../../../../modules/cards/infrastructure/http/controllers/GetUserUrlCardsController'; 16import { CreateCollectionController } from '../../../../modules/cards/infrastructure/http/controllers/CreateCollectionController'; 17import { UpdateCollectionController } from '../../../../modules/cards/infrastructure/http/controllers/UpdateCollectionController'; 18import { DeleteCollectionController } from '../../../../modules/cards/infrastructure/http/controllers/DeleteCollectionController'; 19import { GetCollectionPageController } from '../../../../modules/cards/infrastructure/http/controllers/GetCollectionPageController'; 20import { GetMyCollectionsController } from '../../../../modules/cards/infrastructure/http/controllers/GetMyCollectionsController'; 21import { GetGlobalFeedController } from '../../../../modules/feeds/infrastructure/http/controllers/GetGlobalFeedController'; 22import { GetGemActivityFeedController } from '../../../../modules/feeds/infrastructure/http/controllers/GetGemActivityFeedController'; 23import { GetFollowingFeedController } from '../../../../modules/feeds/infrastructure/http/controllers/GetFollowingFeedController'; 24import { GetSimilarUrlsForUrlController } from '../../../../modules/search/infrastructure/http/controllers/GetSimilarUrlsForUrlController'; 25import { SemanticSearchUrlsController } from '../../../../modules/search/infrastructure/http/controllers/SemanticSearchUrlsController'; 26import { SearchBskyPostsForUrlController } from '../../../../modules/search/infrastructure/http/controllers/SearchBskyPostsForUrlController'; 27import { SearchAtProtoAccountsController } from '../../../../modules/search/infrastructure/http/controllers/SearchAtProtoAccountsController'; 28import { SearchLeafletDocsForUrlController } from '../../../../modules/search/infrastructure/http/controllers/SearchLeafletDocsForUrlController'; 29import { UseCases } from './UseCaseFactory'; 30import { GetMyProfileController } from 'src/modules/cards/infrastructure/http/controllers/GetMyProfileController'; 31import { GetUserProfileController } from 'src/modules/cards/infrastructure/http/controllers/GetUserProfileController'; 32import { LoginWithAppPasswordController } from 'src/modules/user/infrastructure/http/controllers/LoginWithAppPasswordController'; 33import { LogoutController } from 'src/modules/user/infrastructure/http/controllers/LogoutController'; 34import { GenerateExtensionTokensController } from 'src/modules/user/infrastructure/http/controllers/GenerateExtensionTokensController'; 35import { GetUserCollectionsController } from 'src/modules/cards/infrastructure/http/controllers/GetUserCollectionsController'; 36import { SearchCollectionsController } from 'src/modules/cards/infrastructure/http/controllers/SearchCollectionsController'; 37import { GetOpenCollectionsWithContributorController } from 'src/modules/cards/infrastructure/http/controllers/GetOpenCollectionsWithContributorController'; 38import { GetCollectionPageByAtUriController } from 'src/modules/cards/infrastructure/http/controllers/GetCollectionPageByAtUriController'; 39import { GetUrlStatusForMyLibraryController } from '../../../../modules/cards/infrastructure/http/controllers/GetUrlStatusForMyLibraryController'; 40import { GetLibrariesForUrlController } from '../../../../modules/cards/infrastructure/http/controllers/GetLibrariesForUrlController'; 41import { GetCollectionsForUrlController } from '../../../../modules/cards/infrastructure/http/controllers/GetCollectionsForUrlController'; 42import { GetNoteCardsForUrlController } from '../../../../modules/cards/infrastructure/http/controllers/GetNoteCardsForUrlController'; 43import { GetMyNotificationsController } from '../../../../modules/notifications/infrastructure/http/controllers/GetMyNotificationsController'; 44import { GetUnreadNotificationCountController } from '../../../../modules/notifications/infrastructure/http/controllers/GetUnreadNotificationCountController'; 45import { MarkNotificationsAsReadController } from '../../../../modules/notifications/infrastructure/http/controllers/MarkNotificationsAsReadController'; 46import { MarkAllNotificationsAsReadController } from '../../../../modules/notifications/infrastructure/http/controllers/MarkAllNotificationsAsReadController'; 47import { FollowTargetController } from '../../../../modules/user/infrastructure/http/controllers/FollowTargetController'; 48import { UnfollowTargetController } from '../../../../modules/user/infrastructure/http/controllers/UnfollowTargetController'; 49import { GetFollowingUsersController } from '../../../../modules/user/infrastructure/http/controllers/GetFollowingUsersController'; 50import { GetFollowersController } from '../../../../modules/user/infrastructure/http/controllers/GetFollowersController'; 51import { GetFollowingCollectionsController } from '../../../../modules/user/infrastructure/http/controllers/GetFollowingCollectionsController'; 52import { GetFollowingCountController } from '../../../../modules/user/infrastructure/http/controllers/GetFollowingCountController'; 53import { GetFollowersCountController } from '../../../../modules/user/infrastructure/http/controllers/GetFollowersCountController'; 54import { GetFollowingCollectionsCountController } from '../../../../modules/user/infrastructure/http/controllers/GetFollowingCollectionsCountController'; 55import { GetCollectionFollowersController } from '../../../../modules/cards/infrastructure/http/controllers/GetCollectionFollowersController'; 56import { GetCollectionFollowersCountController } from '../../../../modules/cards/infrastructure/http/controllers/GetCollectionFollowersCountController'; 57import { GetCollectionContributorsController } from '../../../../modules/cards/infrastructure/http/controllers/GetCollectionContributorsController'; 58import { CookieService } from '../services/CookieService'; 59 60export interface Controllers { 61 // User controllers 62 loginWithAppPasswordController: LoginWithAppPasswordController; 63 logoutController: LogoutController; 64 initiateOAuthSignInController: InitiateOAuthSignInController; 65 completeOAuthSignInController: CompleteOAuthSignInController; 66 getMyProfileController: GetMyProfileController; 67 getUserProfileController: GetUserProfileController; 68 refreshAccessTokenController: RefreshAccessTokenController; 69 generateExtensionTokensController: GenerateExtensionTokensController; 70 followTargetController: FollowTargetController; 71 unfollowTargetController: UnfollowTargetController; 72 getFollowingUsersController: GetFollowingUsersController; 73 getFollowersController: GetFollowersController; 74 getFollowingCollectionsController: GetFollowingCollectionsController; 75 getFollowingCountController: GetFollowingCountController; 76 getFollowersCountController: GetFollowersCountController; 77 getFollowingCollectionsCountController: GetFollowingCollectionsCountController; 78 // Card controllers 79 addUrlToLibraryController: AddUrlToLibraryController; 80 addCardToLibraryController: AddCardToLibraryController; 81 addCardToCollectionController: AddCardToCollectionController; 82 updateNoteCardController: UpdateNoteCardController; 83 updateUrlCardAssociationsController: UpdateUrlCardAssociationsController; 84 removeCardFromLibraryController: RemoveCardFromLibraryController; 85 removeCardFromCollectionController: RemoveCardFromCollectionController; 86 getUrlMetadataController: GetUrlMetadataController; 87 getUrlCardViewController: GetUrlCardViewController; 88 getLibrariesForCardController: GetLibrariesForCardController; 89 getMyUrlCardsController: GetMyUrlCardsController; 90 getUserUrlCardsController: GetUserUrlCardsController; 91 createCollectionController: CreateCollectionController; 92 updateCollectionController: UpdateCollectionController; 93 deleteCollectionController: DeleteCollectionController; 94 getCollectionPageController: GetCollectionPageController; 95 getCollectionPageByAtUriController: GetCollectionPageByAtUriController; 96 getMyCollectionsController: GetMyCollectionsController; 97 getCollectionsController: GetUserCollectionsController; 98 searchCollectionsController: SearchCollectionsController; 99 getOpenCollectionsWithContributorController: GetOpenCollectionsWithContributorController; 100 getUrlStatusForMyLibraryController: GetUrlStatusForMyLibraryController; 101 getLibrariesForUrlController: GetLibrariesForUrlController; 102 getCollectionsForUrlController: GetCollectionsForUrlController; 103 getNoteCardsForUrlController: GetNoteCardsForUrlController; 104 getCollectionFollowersController: GetCollectionFollowersController; 105 getCollectionFollowersCountController: GetCollectionFollowersCountController; 106 getCollectionContributorsController: GetCollectionContributorsController; 107 // Feed controllers 108 getGlobalFeedController: GetGlobalFeedController; 109 getGemActivityFeedController: GetGemActivityFeedController; 110 getFollowingFeedController: GetFollowingFeedController; 111 // Search controllers 112 getSimilarUrlsForUrlController: GetSimilarUrlsForUrlController; 113 semanticSearchUrlsController: SemanticSearchUrlsController; 114 searchBskyPostsForUrlController: SearchBskyPostsForUrlController; 115 searchAtProtoAccountsController: SearchAtProtoAccountsController; 116 searchLeafletDocsForUrlController: SearchLeafletDocsForUrlController; 117 // Notification controllers 118 getMyNotificationsController: GetMyNotificationsController; 119 getUnreadNotificationCountController: GetUnreadNotificationCountController; 120 markNotificationsAsReadController: MarkNotificationsAsReadController; 121 markAllNotificationsAsReadController: MarkAllNotificationsAsReadController; 122} 123 124export class ControllerFactory { 125 static create(useCases: UseCases, cookieService: CookieService): Controllers { 126 return { 127 // User controllers 128 loginWithAppPasswordController: new LoginWithAppPasswordController( 129 useCases.loginWithAppPasswordUseCase, 130 cookieService, 131 ), 132 logoutController: new LogoutController( 133 useCases.logoutUseCase, 134 cookieService, 135 ), 136 initiateOAuthSignInController: new InitiateOAuthSignInController( 137 useCases.initiateOAuthSignInUseCase, 138 ), 139 completeOAuthSignInController: new CompleteOAuthSignInController( 140 useCases.completeOAuthSignInUseCase, 141 cookieService, 142 ), 143 getMyProfileController: new GetMyProfileController( 144 useCases.getProfileUseCase, 145 ), 146 getUserProfileController: new GetUserProfileController( 147 useCases.getProfileUseCase, 148 ), 149 refreshAccessTokenController: new RefreshAccessTokenController( 150 useCases.refreshAccessTokenUseCase, 151 cookieService, 152 ), 153 generateExtensionTokensController: new GenerateExtensionTokensController( 154 useCases.generateExtensionTokensUseCase, 155 ), 156 followTargetController: new FollowTargetController( 157 useCases.followTargetUseCase, 158 ), 159 unfollowTargetController: new UnfollowTargetController( 160 useCases.unfollowTargetUseCase, 161 ), 162 getFollowingUsersController: new GetFollowingUsersController( 163 useCases.getFollowingUsersUseCase, 164 ), 165 getFollowersController: new GetFollowersController( 166 useCases.getFollowersUseCase, 167 ), 168 getFollowingCollectionsController: new GetFollowingCollectionsController( 169 useCases.getFollowingCollectionsUseCase, 170 ), 171 getFollowingCountController: new GetFollowingCountController( 172 useCases.getFollowingCountUseCase, 173 ), 174 getFollowersCountController: new GetFollowersCountController( 175 useCases.getFollowersCountUseCase, 176 ), 177 getFollowingCollectionsCountController: 178 new GetFollowingCollectionsCountController( 179 useCases.getFollowingCollectionsCountUseCase, 180 ), 181 182 // Card controllers 183 addUrlToLibraryController: new AddUrlToLibraryController( 184 useCases.addUrlToLibraryUseCase, 185 ), 186 addCardToLibraryController: new AddCardToLibraryController( 187 useCases.addCardToLibraryUseCase, 188 ), 189 addCardToCollectionController: new AddCardToCollectionController( 190 useCases.addCardToCollectionUseCase, 191 ), 192 updateNoteCardController: new UpdateNoteCardController( 193 useCases.updateNoteCardUseCase, 194 ), 195 updateUrlCardAssociationsController: 196 new UpdateUrlCardAssociationsController( 197 useCases.updateUrlCardAssociationsUseCase, 198 ), 199 removeCardFromLibraryController: new RemoveCardFromLibraryController( 200 useCases.removeCardFromLibraryUseCase, 201 ), 202 removeCardFromCollectionController: 203 new RemoveCardFromCollectionController( 204 useCases.removeCardFromCollectionUseCase, 205 ), 206 getUrlMetadataController: new GetUrlMetadataController( 207 useCases.getUrlMetadataUseCase, 208 ), 209 getUrlCardViewController: new GetUrlCardViewController( 210 useCases.getUrlCardViewUseCase, 211 ), 212 getLibrariesForCardController: new GetLibrariesForCardController( 213 useCases.getLibrariesForCardUseCase, 214 ), 215 getMyUrlCardsController: new GetMyUrlCardsController( 216 useCases.getMyUrlCardsUseCase, 217 ), 218 getUserUrlCardsController: new GetUserUrlCardsController( 219 useCases.getMyUrlCardsUseCase, 220 ), 221 createCollectionController: new CreateCollectionController( 222 useCases.createCollectionUseCase, 223 ), 224 updateCollectionController: new UpdateCollectionController( 225 useCases.updateCollectionUseCase, 226 ), 227 deleteCollectionController: new DeleteCollectionController( 228 useCases.deleteCollectionUseCase, 229 ), 230 getCollectionPageController: new GetCollectionPageController( 231 useCases.getCollectionPageUseCase, 232 ), 233 getCollectionPageByAtUriController: 234 new GetCollectionPageByAtUriController( 235 useCases.getCollectionPageByAtUriUseCase, 236 ), 237 getMyCollectionsController: new GetMyCollectionsController( 238 useCases.getCollectionsUseCase, 239 ), 240 getCollectionsController: new GetUserCollectionsController( 241 useCases.getCollectionsUseCase, 242 ), 243 searchCollectionsController: new SearchCollectionsController( 244 useCases.searchCollectionsUseCase, 245 ), 246 getOpenCollectionsWithContributorController: 247 new GetOpenCollectionsWithContributorController( 248 useCases.getOpenCollectionsWithContributorUseCase, 249 ), 250 getUrlStatusForMyLibraryController: 251 new GetUrlStatusForMyLibraryController( 252 useCases.getUrlStatusForMyLibraryUseCase, 253 ), 254 getLibrariesForUrlController: new GetLibrariesForUrlController( 255 useCases.getLibrariesForUrlUseCase, 256 ), 257 getCollectionsForUrlController: new GetCollectionsForUrlController( 258 useCases.getCollectionsForUrlUseCase, 259 ), 260 getNoteCardsForUrlController: new GetNoteCardsForUrlController( 261 useCases.getNoteCardsForUrlUseCase, 262 ), 263 getCollectionFollowersController: new GetCollectionFollowersController( 264 useCases.getCollectionFollowersUseCase, 265 ), 266 getCollectionFollowersCountController: 267 new GetCollectionFollowersCountController( 268 useCases.getCollectionFollowersCountUseCase, 269 ), 270 getCollectionContributorsController: 271 new GetCollectionContributorsController( 272 useCases.getCollectionContributorsUseCase, 273 ), 274 275 // Feed controllers 276 getGlobalFeedController: new GetGlobalFeedController( 277 useCases.getGlobalFeedUseCase, 278 ), 279 getGemActivityFeedController: new GetGemActivityFeedController( 280 useCases.getGemActivityFeedUseCase, 281 ), 282 getFollowingFeedController: new GetFollowingFeedController( 283 useCases.getFollowingFeedUseCase, 284 ), 285 // Search controllers 286 getSimilarUrlsForUrlController: new GetSimilarUrlsForUrlController( 287 useCases.getSimilarUrlsForUrlUseCase, 288 ), 289 semanticSearchUrlsController: new SemanticSearchUrlsController( 290 useCases.semanticSearchUrlsUseCase, 291 ), 292 searchBskyPostsForUrlController: new SearchBskyPostsForUrlController( 293 useCases.searchBskyPostsForUrlUseCase, 294 ), 295 searchAtProtoAccountsController: new SearchAtProtoAccountsController( 296 useCases.searchAtProtoAccountsUseCase, 297 ), 298 searchLeafletDocsForUrlController: new SearchLeafletDocsForUrlController( 299 useCases.searchLeafletDocsForUrlUseCase, 300 ), 301 // Notification controllers 302 getMyNotificationsController: new GetMyNotificationsController( 303 useCases.getMyNotificationsUseCase, 304 ), 305 getUnreadNotificationCountController: 306 new GetUnreadNotificationCountController( 307 useCases.getUnreadNotificationCountUseCase, 308 ), 309 markNotificationsAsReadController: new MarkNotificationsAsReadController( 310 useCases.markNotificationsAsReadUseCase, 311 ), 312 markAllNotificationsAsReadController: 313 new MarkAllNotificationsAsReadController( 314 useCases.markAllNotificationsAsReadUseCase, 315 ), 316 }; 317 } 318}