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