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 { 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 { CookieService } from '../services/CookieService';
50
51export interface Controllers {
52 // User controllers
53 loginWithAppPasswordController: LoginWithAppPasswordController;
54 logoutController: LogoutController;
55 initiateOAuthSignInController: InitiateOAuthSignInController;
56 completeOAuthSignInController: CompleteOAuthSignInController;
57 getMyProfileController: GetMyProfileController;
58 getUserProfileController: GetUserProfileController;
59 refreshAccessTokenController: RefreshAccessTokenController;
60 generateExtensionTokensController: GenerateExtensionTokensController;
61 followTargetController: FollowTargetController;
62 unfollowTargetController: UnfollowTargetController;
63 // Card controllers
64 addUrlToLibraryController: AddUrlToLibraryController;
65 addCardToLibraryController: AddCardToLibraryController;
66 addCardToCollectionController: AddCardToCollectionController;
67 updateNoteCardController: UpdateNoteCardController;
68 updateUrlCardAssociationsController: UpdateUrlCardAssociationsController;
69 removeCardFromLibraryController: RemoveCardFromLibraryController;
70 removeCardFromCollectionController: RemoveCardFromCollectionController;
71 getUrlMetadataController: GetUrlMetadataController;
72 getUrlCardViewController: GetUrlCardViewController;
73 getLibrariesForCardController: GetLibrariesForCardController;
74 getMyUrlCardsController: GetMyUrlCardsController;
75 getUserUrlCardsController: GetUserUrlCardsController;
76 createCollectionController: CreateCollectionController;
77 updateCollectionController: UpdateCollectionController;
78 deleteCollectionController: DeleteCollectionController;
79 getCollectionPageController: GetCollectionPageController;
80 getCollectionPageByAtUriController: GetCollectionPageByAtUriController;
81 getMyCollectionsController: GetMyCollectionsController;
82 getCollectionsController: GetUserCollectionsController;
83 searchCollectionsController: SearchCollectionsController;
84 getOpenCollectionsWithContributorController: GetOpenCollectionsWithContributorController;
85 getUrlStatusForMyLibraryController: GetUrlStatusForMyLibraryController;
86 getLibrariesForUrlController: GetLibrariesForUrlController;
87 getCollectionsForUrlController: GetCollectionsForUrlController;
88 getNoteCardsForUrlController: GetNoteCardsForUrlController;
89 // Feed controllers
90 getGlobalFeedController: GetGlobalFeedController;
91 getGemActivityFeedController: GetGemActivityFeedController;
92 getFollowingFeedController: GetFollowingFeedController;
93 // Search controllers
94 getSimilarUrlsForUrlController: GetSimilarUrlsForUrlController;
95 semanticSearchUrlsController: SemanticSearchUrlsController;
96 searchBskyPostsForUrlController: SearchBskyPostsForUrlController;
97 searchAtProtoAccountsController: SearchAtProtoAccountsController;
98 searchLeafletDocsForUrlController: SearchLeafletDocsForUrlController;
99 // Notification controllers
100 getMyNotificationsController: GetMyNotificationsController;
101 getUnreadNotificationCountController: GetUnreadNotificationCountController;
102 markNotificationsAsReadController: MarkNotificationsAsReadController;
103 markAllNotificationsAsReadController: MarkAllNotificationsAsReadController;
104}
105
106export class ControllerFactory {
107 static create(useCases: UseCases, cookieService: CookieService): Controllers {
108 return {
109 // User controllers
110 loginWithAppPasswordController: new LoginWithAppPasswordController(
111 useCases.loginWithAppPasswordUseCase,
112 cookieService,
113 ),
114 logoutController: new LogoutController(
115 useCases.logoutUseCase,
116 cookieService,
117 ),
118 initiateOAuthSignInController: new InitiateOAuthSignInController(
119 useCases.initiateOAuthSignInUseCase,
120 ),
121 completeOAuthSignInController: new CompleteOAuthSignInController(
122 useCases.completeOAuthSignInUseCase,
123 cookieService,
124 ),
125 getMyProfileController: new GetMyProfileController(
126 useCases.getProfileUseCase,
127 ),
128 getUserProfileController: new GetUserProfileController(
129 useCases.getProfileUseCase,
130 ),
131 refreshAccessTokenController: new RefreshAccessTokenController(
132 useCases.refreshAccessTokenUseCase,
133 cookieService,
134 ),
135 generateExtensionTokensController: new GenerateExtensionTokensController(
136 useCases.generateExtensionTokensUseCase,
137 ),
138 followTargetController: new FollowTargetController(
139 useCases.followTargetUseCase,
140 ),
141 unfollowTargetController: new UnfollowTargetController(
142 useCases.unfollowTargetUseCase,
143 ),
144
145 // Card controllers
146 addUrlToLibraryController: new AddUrlToLibraryController(
147 useCases.addUrlToLibraryUseCase,
148 ),
149 addCardToLibraryController: new AddCardToLibraryController(
150 useCases.addCardToLibraryUseCase,
151 ),
152 addCardToCollectionController: new AddCardToCollectionController(
153 useCases.addCardToCollectionUseCase,
154 ),
155 updateNoteCardController: new UpdateNoteCardController(
156 useCases.updateNoteCardUseCase,
157 ),
158 updateUrlCardAssociationsController:
159 new UpdateUrlCardAssociationsController(
160 useCases.updateUrlCardAssociationsUseCase,
161 ),
162 removeCardFromLibraryController: new RemoveCardFromLibraryController(
163 useCases.removeCardFromLibraryUseCase,
164 ),
165 removeCardFromCollectionController:
166 new RemoveCardFromCollectionController(
167 useCases.removeCardFromCollectionUseCase,
168 ),
169 getUrlMetadataController: new GetUrlMetadataController(
170 useCases.getUrlMetadataUseCase,
171 ),
172 getUrlCardViewController: new GetUrlCardViewController(
173 useCases.getUrlCardViewUseCase,
174 ),
175 getLibrariesForCardController: new GetLibrariesForCardController(
176 useCases.getLibrariesForCardUseCase,
177 ),
178 getMyUrlCardsController: new GetMyUrlCardsController(
179 useCases.getMyUrlCardsUseCase,
180 ),
181 getUserUrlCardsController: new GetUserUrlCardsController(
182 useCases.getMyUrlCardsUseCase,
183 ),
184 createCollectionController: new CreateCollectionController(
185 useCases.createCollectionUseCase,
186 ),
187 updateCollectionController: new UpdateCollectionController(
188 useCases.updateCollectionUseCase,
189 ),
190 deleteCollectionController: new DeleteCollectionController(
191 useCases.deleteCollectionUseCase,
192 ),
193 getCollectionPageController: new GetCollectionPageController(
194 useCases.getCollectionPageUseCase,
195 ),
196 getCollectionPageByAtUriController:
197 new GetCollectionPageByAtUriController(
198 useCases.getCollectionPageByAtUriUseCase,
199 ),
200 getMyCollectionsController: new GetMyCollectionsController(
201 useCases.getCollectionsUseCase,
202 ),
203 getCollectionsController: new GetUserCollectionsController(
204 useCases.getCollectionsUseCase,
205 ),
206 searchCollectionsController: new SearchCollectionsController(
207 useCases.searchCollectionsUseCase,
208 ),
209 getOpenCollectionsWithContributorController:
210 new GetOpenCollectionsWithContributorController(
211 useCases.getOpenCollectionsWithContributorUseCase,
212 ),
213 getUrlStatusForMyLibraryController:
214 new GetUrlStatusForMyLibraryController(
215 useCases.getUrlStatusForMyLibraryUseCase,
216 ),
217 getLibrariesForUrlController: new GetLibrariesForUrlController(
218 useCases.getLibrariesForUrlUseCase,
219 ),
220 getCollectionsForUrlController: new GetCollectionsForUrlController(
221 useCases.getCollectionsForUrlUseCase,
222 ),
223 getNoteCardsForUrlController: new GetNoteCardsForUrlController(
224 useCases.getNoteCardsForUrlUseCase,
225 ),
226
227 // Feed controllers
228 getGlobalFeedController: new GetGlobalFeedController(
229 useCases.getGlobalFeedUseCase,
230 ),
231 getGemActivityFeedController: new GetGemActivityFeedController(
232 useCases.getGemActivityFeedUseCase,
233 ),
234 getFollowingFeedController: new GetFollowingFeedController(
235 useCases.getFollowingFeedUseCase,
236 ),
237 // Search controllers
238 getSimilarUrlsForUrlController: new GetSimilarUrlsForUrlController(
239 useCases.getSimilarUrlsForUrlUseCase,
240 ),
241 semanticSearchUrlsController: new SemanticSearchUrlsController(
242 useCases.semanticSearchUrlsUseCase,
243 ),
244 searchBskyPostsForUrlController: new SearchBskyPostsForUrlController(
245 useCases.searchBskyPostsForUrlUseCase,
246 ),
247 searchAtProtoAccountsController: new SearchAtProtoAccountsController(
248 useCases.searchAtProtoAccountsUseCase,
249 ),
250 searchLeafletDocsForUrlController: new SearchLeafletDocsForUrlController(
251 useCases.searchLeafletDocsForUrlUseCase,
252 ),
253 // Notification controllers
254 getMyNotificationsController: new GetMyNotificationsController(
255 useCases.getMyNotificationsUseCase,
256 ),
257 getUnreadNotificationCountController:
258 new GetUnreadNotificationCountController(
259 useCases.getUnreadNotificationCountUseCase,
260 ),
261 markNotificationsAsReadController: new MarkNotificationsAsReadController(
262 useCases.markNotificationsAsReadUseCase,
263 ),
264 markAllNotificationsAsReadController:
265 new MarkAllNotificationsAsReadController(
266 useCases.markAllNotificationsAsReadUseCase,
267 ),
268 };
269 }
270}