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
22 kB 369 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 { CreateConnectionController } from '../../../../modules/cards/infrastructure/http/controllers/CreateConnectionController'; 59import { UpdateConnectionController } from '../../../../modules/cards/infrastructure/http/controllers/UpdateConnectionController'; 60import { DeleteConnectionController } from '../../../../modules/cards/infrastructure/http/controllers/DeleteConnectionController'; 61import { GetConnectionsController } from '../../../../modules/cards/infrastructure/http/controllers/GetConnectionsController'; 62import { GetForwardConnectionsForUrlController } from '../../../../modules/cards/infrastructure/http/controllers/GetForwardConnectionsForUrlController'; 63import { GetBackwardConnectionsForUrlController } from '../../../../modules/cards/infrastructure/http/controllers/GetBackwardConnectionsForUrlController'; 64import { SearchUrlsController } from '../../../../modules/cards/infrastructure/http/controllers/SearchUrlsController'; 65import { GetGraphDataController } from '../../../../modules/cards/infrastructure/http/controllers/GetGraphDataController'; 66import { CookieService } from '../services/CookieService'; 67 68export interface Controllers { 69 // User controllers 70 loginWithAppPasswordController: LoginWithAppPasswordController; 71 logoutController: LogoutController; 72 initiateOAuthSignInController: InitiateOAuthSignInController; 73 completeOAuthSignInController: CompleteOAuthSignInController; 74 getMyProfileController: GetMyProfileController; 75 getUserProfileController: GetUserProfileController; 76 refreshAccessTokenController: RefreshAccessTokenController; 77 generateExtensionTokensController: GenerateExtensionTokensController; 78 followTargetController: FollowTargetController; 79 unfollowTargetController: UnfollowTargetController; 80 getFollowingUsersController: GetFollowingUsersController; 81 getFollowersController: GetFollowersController; 82 getFollowingCollectionsController: GetFollowingCollectionsController; 83 getFollowingCountController: GetFollowingCountController; 84 getFollowersCountController: GetFollowersCountController; 85 getFollowingCollectionsCountController: GetFollowingCollectionsCountController; 86 // Card controllers 87 addUrlToLibraryController: AddUrlToLibraryController; 88 addCardToLibraryController: AddCardToLibraryController; 89 addCardToCollectionController: AddCardToCollectionController; 90 updateNoteCardController: UpdateNoteCardController; 91 updateUrlCardAssociationsController: UpdateUrlCardAssociationsController; 92 removeCardFromLibraryController: RemoveCardFromLibraryController; 93 removeCardFromCollectionController: RemoveCardFromCollectionController; 94 getUrlMetadataController: GetUrlMetadataController; 95 getUrlCardViewController: GetUrlCardViewController; 96 getLibrariesForCardController: GetLibrariesForCardController; 97 getMyUrlCardsController: GetMyUrlCardsController; 98 getUserUrlCardsController: GetUserUrlCardsController; 99 createCollectionController: CreateCollectionController; 100 updateCollectionController: UpdateCollectionController; 101 deleteCollectionController: DeleteCollectionController; 102 getCollectionPageController: GetCollectionPageController; 103 getCollectionPageByAtUriController: GetCollectionPageByAtUriController; 104 getMyCollectionsController: GetMyCollectionsController; 105 getCollectionsController: GetUserCollectionsController; 106 searchCollectionsController: SearchCollectionsController; 107 getOpenCollectionsWithContributorController: GetOpenCollectionsWithContributorController; 108 getUrlStatusForMyLibraryController: GetUrlStatusForMyLibraryController; 109 getLibrariesForUrlController: GetLibrariesForUrlController; 110 getCollectionsForUrlController: GetCollectionsForUrlController; 111 getNoteCardsForUrlController: GetNoteCardsForUrlController; 112 getCollectionFollowersController: GetCollectionFollowersController; 113 getCollectionFollowersCountController: GetCollectionFollowersCountController; 114 getCollectionContributorsController: GetCollectionContributorsController; 115 // Connection controllers 116 getConnectionsController: GetConnectionsController; 117 createConnectionController: CreateConnectionController; 118 updateConnectionController: UpdateConnectionController; 119 deleteConnectionController: DeleteConnectionController; 120 getForwardConnectionsForUrlController: GetForwardConnectionsForUrlController; 121 getBackwardConnectionsForUrlController: GetBackwardConnectionsForUrlController; 122 // Graph controllers 123 getGraphDataController: GetGraphDataController; 124 // Search controllers 125 searchUrlsController: SearchUrlsController; 126 // Feed controllers 127 getGlobalFeedController: GetGlobalFeedController; 128 getGemActivityFeedController: GetGemActivityFeedController; 129 getFollowingFeedController: GetFollowingFeedController; 130 // Search controllers 131 getSimilarUrlsForUrlController: GetSimilarUrlsForUrlController; 132 semanticSearchUrlsController: SemanticSearchUrlsController; 133 searchBskyPostsForUrlController: SearchBskyPostsForUrlController; 134 searchAtProtoAccountsController: SearchAtProtoAccountsController; 135 searchLeafletDocsForUrlController: SearchLeafletDocsForUrlController; 136 // Notification controllers 137 getMyNotificationsController: GetMyNotificationsController; 138 getUnreadNotificationCountController: GetUnreadNotificationCountController; 139 markNotificationsAsReadController: MarkNotificationsAsReadController; 140 markAllNotificationsAsReadController: MarkAllNotificationsAsReadController; 141} 142 143export class ControllerFactory { 144 static create(useCases: UseCases, cookieService: CookieService): Controllers { 145 return { 146 // User controllers 147 loginWithAppPasswordController: new LoginWithAppPasswordController( 148 useCases.loginWithAppPasswordUseCase, 149 cookieService, 150 ), 151 logoutController: new LogoutController( 152 useCases.logoutUseCase, 153 cookieService, 154 ), 155 initiateOAuthSignInController: new InitiateOAuthSignInController( 156 useCases.initiateOAuthSignInUseCase, 157 ), 158 completeOAuthSignInController: new CompleteOAuthSignInController( 159 useCases.completeOAuthSignInUseCase, 160 cookieService, 161 ), 162 getMyProfileController: new GetMyProfileController( 163 useCases.getProfileUseCase, 164 ), 165 getUserProfileController: new GetUserProfileController( 166 useCases.getProfileUseCase, 167 ), 168 refreshAccessTokenController: new RefreshAccessTokenController( 169 useCases.refreshAccessTokenUseCase, 170 cookieService, 171 ), 172 generateExtensionTokensController: new GenerateExtensionTokensController( 173 useCases.generateExtensionTokensUseCase, 174 ), 175 followTargetController: new FollowTargetController( 176 useCases.followTargetUseCase, 177 ), 178 unfollowTargetController: new UnfollowTargetController( 179 useCases.unfollowTargetUseCase, 180 ), 181 getFollowingUsersController: new GetFollowingUsersController( 182 useCases.getFollowingUsersUseCase, 183 ), 184 getFollowersController: new GetFollowersController( 185 useCases.getFollowersUseCase, 186 ), 187 getFollowingCollectionsController: new GetFollowingCollectionsController( 188 useCases.getFollowingCollectionsUseCase, 189 ), 190 getFollowingCountController: new GetFollowingCountController( 191 useCases.getFollowingCountUseCase, 192 ), 193 getFollowersCountController: new GetFollowersCountController( 194 useCases.getFollowersCountUseCase, 195 ), 196 getFollowingCollectionsCountController: 197 new GetFollowingCollectionsCountController( 198 useCases.getFollowingCollectionsCountUseCase, 199 ), 200 201 // Card controllers 202 addUrlToLibraryController: new AddUrlToLibraryController( 203 useCases.addUrlToLibraryUseCase, 204 ), 205 addCardToLibraryController: new AddCardToLibraryController( 206 useCases.addCardToLibraryUseCase, 207 ), 208 addCardToCollectionController: new AddCardToCollectionController( 209 useCases.addCardToCollectionUseCase, 210 ), 211 updateNoteCardController: new UpdateNoteCardController( 212 useCases.updateNoteCardUseCase, 213 ), 214 updateUrlCardAssociationsController: 215 new UpdateUrlCardAssociationsController( 216 useCases.updateUrlCardAssociationsUseCase, 217 ), 218 removeCardFromLibraryController: new RemoveCardFromLibraryController( 219 useCases.removeCardFromLibraryUseCase, 220 ), 221 removeCardFromCollectionController: 222 new RemoveCardFromCollectionController( 223 useCases.removeCardFromCollectionUseCase, 224 ), 225 getUrlMetadataController: new GetUrlMetadataController( 226 useCases.getUrlMetadataUseCase, 227 ), 228 getUrlCardViewController: new GetUrlCardViewController( 229 useCases.getUrlCardViewUseCase, 230 ), 231 getLibrariesForCardController: new GetLibrariesForCardController( 232 useCases.getLibrariesForCardUseCase, 233 ), 234 getMyUrlCardsController: new GetMyUrlCardsController( 235 useCases.getMyUrlCardsUseCase, 236 ), 237 getUserUrlCardsController: new GetUserUrlCardsController( 238 useCases.getMyUrlCardsUseCase, 239 ), 240 createCollectionController: new CreateCollectionController( 241 useCases.createCollectionUseCase, 242 ), 243 updateCollectionController: new UpdateCollectionController( 244 useCases.updateCollectionUseCase, 245 ), 246 deleteCollectionController: new DeleteCollectionController( 247 useCases.deleteCollectionUseCase, 248 ), 249 getCollectionPageController: new GetCollectionPageController( 250 useCases.getCollectionPageUseCase, 251 ), 252 getCollectionPageByAtUriController: 253 new GetCollectionPageByAtUriController( 254 useCases.getCollectionPageByAtUriUseCase, 255 ), 256 getMyCollectionsController: new GetMyCollectionsController( 257 useCases.getCollectionsUseCase, 258 ), 259 getCollectionsController: new GetUserCollectionsController( 260 useCases.getCollectionsUseCase, 261 ), 262 searchCollectionsController: new SearchCollectionsController( 263 useCases.searchCollectionsUseCase, 264 ), 265 getOpenCollectionsWithContributorController: 266 new GetOpenCollectionsWithContributorController( 267 useCases.getOpenCollectionsWithContributorUseCase, 268 ), 269 getUrlStatusForMyLibraryController: 270 new GetUrlStatusForMyLibraryController( 271 useCases.getUrlStatusForMyLibraryUseCase, 272 ), 273 getLibrariesForUrlController: new GetLibrariesForUrlController( 274 useCases.getLibrariesForUrlUseCase, 275 ), 276 getCollectionsForUrlController: new GetCollectionsForUrlController( 277 useCases.getCollectionsForUrlUseCase, 278 ), 279 getNoteCardsForUrlController: new GetNoteCardsForUrlController( 280 useCases.getNoteCardsForUrlUseCase, 281 ), 282 getCollectionFollowersController: new GetCollectionFollowersController( 283 useCases.getCollectionFollowersUseCase, 284 ), 285 getCollectionFollowersCountController: 286 new GetCollectionFollowersCountController( 287 useCases.getCollectionFollowersCountUseCase, 288 ), 289 getCollectionContributorsController: 290 new GetCollectionContributorsController( 291 useCases.getCollectionContributorsUseCase, 292 ), 293 294 // Connection controllers 295 getConnectionsController: new GetConnectionsController( 296 useCases.getConnectionsUseCase, 297 ), 298 createConnectionController: new CreateConnectionController( 299 useCases.createConnectionUseCase, 300 ), 301 updateConnectionController: new UpdateConnectionController( 302 useCases.updateConnectionUseCase, 303 ), 304 deleteConnectionController: new DeleteConnectionController( 305 useCases.deleteConnectionUseCase, 306 ), 307 getForwardConnectionsForUrlController: 308 new GetForwardConnectionsForUrlController( 309 useCases.getForwardConnectionsForUrlUseCase, 310 ), 311 getBackwardConnectionsForUrlController: 312 new GetBackwardConnectionsForUrlController( 313 useCases.getBackwardConnectionsForUrlUseCase, 314 ), 315 316 // Graph controllers 317 getGraphDataController: new GetGraphDataController( 318 useCases.getGraphDataUseCase, 319 ), 320 321 // Search controllers 322 searchUrlsController: new SearchUrlsController( 323 useCases.searchUrlsUseCase, 324 ), 325 326 // Feed controllers 327 getGlobalFeedController: new GetGlobalFeedController( 328 useCases.getGlobalFeedUseCase, 329 ), 330 getGemActivityFeedController: new GetGemActivityFeedController( 331 useCases.getGemActivityFeedUseCase, 332 ), 333 getFollowingFeedController: new GetFollowingFeedController( 334 useCases.getFollowingFeedUseCase, 335 ), 336 // Search controllers 337 getSimilarUrlsForUrlController: new GetSimilarUrlsForUrlController( 338 useCases.getSimilarUrlsForUrlUseCase, 339 ), 340 semanticSearchUrlsController: new SemanticSearchUrlsController( 341 useCases.semanticSearchUrlsUseCase, 342 ), 343 searchBskyPostsForUrlController: new SearchBskyPostsForUrlController( 344 useCases.searchBskyPostsForUrlUseCase, 345 ), 346 searchAtProtoAccountsController: new SearchAtProtoAccountsController( 347 useCases.searchAtProtoAccountsUseCase, 348 ), 349 searchLeafletDocsForUrlController: new SearchLeafletDocsForUrlController( 350 useCases.searchLeafletDocsForUrlUseCase, 351 ), 352 // Notification controllers 353 getMyNotificationsController: new GetMyNotificationsController( 354 useCases.getMyNotificationsUseCase, 355 ), 356 getUnreadNotificationCountController: 357 new GetUnreadNotificationCountController( 358 useCases.getUnreadNotificationCountUseCase, 359 ), 360 markNotificationsAsReadController: new MarkNotificationsAsReadController( 361 useCases.markNotificationsAsReadUseCase, 362 ), 363 markAllNotificationsAsReadController: 364 new MarkAllNotificationsAsReadController( 365 useCases.markAllNotificationsAsReadUseCase, 366 ), 367 }; 368 } 369}