refactor(db): group database domain modules
This commit is contained in:
1 parent
e43a89096d
commit
6da0a58769
160 files changed
+2124
-1999
No files matched your search
@@ -14,12 +14,14 @@ interface ConnectorModelPolicyDeps {
|
||||
* domain modules so we do not repeat the closure literal at every site.
|
||||
*/
|
||||
export function connectorPolicyDepsFromDb(db: {
|
||||
connectorsCrud: { getConnector: (id: ConnectorId) => { id: ConnectorId; label?: string | null; model: string | null } };
|
||||
settings: { getDisabledModels: (companyId: string, connectorId: string) => Array<{ id: string; label: string }> };
|
||||
core: {
|
||||
connectors: { getConnector: (id: ConnectorId) => { id: ConnectorId; label?: string | null; model: string | null } };
|
||||
settings: { getDisabledModels: (companyId: string, connectorId: string) => Array<{ id: string; label: string }> };
|
||||
};
|
||||
}): ConnectorModelPolicyDeps {
|
||||
return {
|
||||
getConnector: (id) => db.connectorsCrud.getConnector(id),
|
||||
getDisabledModels: (cid, connId) => db.settings.getDisabledModels(cid, connId),
|
||||
getConnector: (id) => db.core.connectors.getConnector(id),
|
||||
getDisabledModels: (cid, connId) => db.core.settings.getDisabledModels(cid, connId),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user