|
1 | 1 | //
|
2 | 2 |
|
3 |
| -import type Pg from "pg"; |
4 |
| -import type { MCP_EmailDomain_Type } from "./moncomptepro"; |
5 |
| - |
6 |
| -// |
7 |
| -// |
8 |
| -// |
9 |
| - |
10 |
| -// HACK(douglasduteil): disable typescript check on @numerique-gouv/moncomptepro |
11 |
| -// |
12 |
| -// As the @numerique-gouv/moncomptepro/database is not yet published as a standalone package |
13 |
| -// we need to disable the typescript check on it to avoid many typescript errors |
14 |
| -// |
15 |
| - |
16 |
| -const MONCOMPTEPRO_MODULE = "@numerique-gouv/moncomptepro"; |
17 |
| - |
18 |
| -// import "@numerique-gouv/moncomptepro/src/connectors/postgres"; |
19 |
| -const POSTGRES_CONNECTOR_MODULE: { |
20 |
| - setDatabaseConnection(newPool: Pg.Pool): void; |
21 |
| -} = await import(`${MONCOMPTEPRO_MODULE}/src/connectors/postgres`); |
22 |
| - |
23 |
| -// import "@numerique-gouv/moncomptepro/src/managers/organization/main"; |
24 |
| -const MAIN_ORGANIZATION_MANAGER_MODULE: { |
25 |
| - markDomainAsVerified(options: { |
26 |
| - organization_id: number; |
27 |
| - domain: string; |
28 |
| - domain_verification_type: MCP_EmailDomain_Type; |
29 |
| - }): Promise<void>; |
30 |
| -} = await import(`${MONCOMPTEPRO_MODULE}/src/managers/organization/main`); |
31 |
| - |
32 |
| -// import "@numerique-gouv/moncomptepro/src/managers/organization/join"; |
33 |
| -const JOIN_ORGANIZATION_MANAGER_MODULE: { |
34 |
| - forceJoinOrganization(options: { |
35 |
| - organization_id: number; |
36 |
| - user_id: number; |
37 |
| - is_external?: boolean; |
38 |
| - }): Promise<UserOrganizationLink>; |
39 |
| -} = await import(`${MONCOMPTEPRO_MODULE}/src/managers/organization/join`); |
40 |
| - |
41 | 3 | //
|
42 | 4 | //
|
43 | 5 | //
|
44 | 6 |
|
45 |
| -export const setDatabaseConnection = |
46 |
| - POSTGRES_CONNECTOR_MODULE.setDatabaseConnection; |
47 |
| -export const markDomainAsVerified = |
48 |
| - MAIN_ORGANIZATION_MANAGER_MODULE.markDomainAsVerified; |
49 |
| -export const forceJoinOrganization = |
50 |
| - JOIN_ORGANIZATION_MANAGER_MODULE.forceJoinOrganization; |
| 7 | +export { setDatabaseConnection } from "@numerique-gouv/moncomptepro/connectors/postgres"; |
| 8 | +export { forceJoinOrganization } from "@numerique-gouv/moncomptepro/managers/organization/join"; |
| 9 | +export { markDomainAsVerified } from "@numerique-gouv/moncomptepro/managers/organization/markDomainAsVerified"; |
0 commit comments