-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(infra): remove hack moncomptepro imports
- Loading branch information
1 parent
4c09935
commit 03b1c8a
Showing
4 changed files
with
24 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,9 @@ | ||
// | ||
|
||
import type Pg from "pg"; | ||
import type { MCP_EmailDomain_Type } from "./moncomptepro"; | ||
|
||
// | ||
// | ||
// | ||
|
||
// HACK(douglasduteil): disable typescript check on @numerique-gouv/moncomptepro | ||
// | ||
// As the @numerique-gouv/moncomptepro/database is not yet published as a standalone package | ||
// we need to disable the typescript check on it to avoid many typescript errors | ||
// | ||
|
||
const MONCOMPTEPRO_MODULE = "@numerique-gouv/moncomptepro"; | ||
|
||
// import "@numerique-gouv/moncomptepro/src/connectors/postgres"; | ||
const POSTGRES_CONNECTOR_MODULE: { | ||
setDatabaseConnection(newPool: Pg.Pool): void; | ||
} = await import(`${MONCOMPTEPRO_MODULE}/src/connectors/postgres`); | ||
|
||
// import "@numerique-gouv/moncomptepro/src/managers/organization/main"; | ||
const MAIN_ORGANIZATION_MANAGER_MODULE: { | ||
markDomainAsVerified(options: { | ||
organization_id: number; | ||
domain: string; | ||
domain_verification_type: MCP_EmailDomain_Type; | ||
}): Promise<void>; | ||
} = await import(`${MONCOMPTEPRO_MODULE}/src/managers/organization/main`); | ||
|
||
// import "@numerique-gouv/moncomptepro/src/managers/organization/join"; | ||
const JOIN_ORGANIZATION_MANAGER_MODULE: { | ||
forceJoinOrganization(options: { | ||
organization_id: number; | ||
user_id: number; | ||
is_external?: boolean; | ||
}): Promise<UserOrganizationLink>; | ||
} = await import(`${MONCOMPTEPRO_MODULE}/src/managers/organization/join`); | ||
|
||
// | ||
// | ||
// | ||
|
||
export const setDatabaseConnection = | ||
POSTGRES_CONNECTOR_MODULE.setDatabaseConnection; | ||
export const markDomainAsVerified = | ||
MAIN_ORGANIZATION_MANAGER_MODULE.markDomainAsVerified; | ||
export const forceJoinOrganization = | ||
JOIN_ORGANIZATION_MANAGER_MODULE.forceJoinOrganization; | ||
export { setDatabaseConnection } from "@numerique-gouv/moncomptepro/connectors/postgres"; | ||
export { forceJoinOrganization } from "@numerique-gouv/moncomptepro/managers/organization/join"; | ||
export { markDomainAsVerified } from "@numerique-gouv/moncomptepro/managers/organization/markDomainAsVerified"; |