|
|
@ -33,7 +33,7 @@ export function createImportRefsToModelReducer(params: ModelGeneratorParams) { |
|
|
const reduceImportRefsToInterfaces = createImportRefToInterfaceReducerCreator(params); |
|
|
const reduceImportRefsToInterfaces = createImportRefToInterfaceReducerCreator(params); |
|
|
const createRefToImportReducer = createRefToImportReducerCreator(params); |
|
|
const createRefToImportReducer = createRefToImportReducerCreator(params); |
|
|
const { solution, types } = params; |
|
|
const { solution, types } = params; |
|
|
|
|
|
console.log("import refs --->>>>"); |
|
|
return (models: Model[], importRefs: string[]) => { |
|
|
return (models: Model[], importRefs: string[]) => { |
|
|
const enums: string[] = []; |
|
|
const enums: string[] = []; |
|
|
const interfaces = importRefs.reduce(reduceImportRefsToInterfaces, []); |
|
|
const interfaces = importRefs.reduce(reduceImportRefsToInterfaces, []); |
|
|
@ -214,8 +214,6 @@ export function resolveAbpPackages(models: Model[]) { |
|
|
renamePropForTenant(model.interfaces); |
|
|
renamePropForTenant(model.interfaces); |
|
|
|
|
|
|
|
|
model.imports.forEach((imp, i) => { |
|
|
model.imports.forEach((imp, i) => { |
|
|
fixImportNameForTenant(imp); |
|
|
|
|
|
|
|
|
|
|
|
for (const ref of imp.refs) { |
|
|
for (const ref of imp.refs) { |
|
|
const path = VOLO_PACKAGE_PROXY_IMPORTS.get(ref); |
|
|
const path = VOLO_PACKAGE_PROXY_IMPORTS.get(ref); |
|
|
if (path) { |
|
|
if (path) { |
|
|
@ -234,21 +232,12 @@ function renamePropForTenant(interfaces: Interface[]) { |
|
|
|
|
|
|
|
|
if (isTenant && isSaasDto) { |
|
|
if (isTenant && isSaasDto) { |
|
|
prop.type = 'Saas' + prop.type; |
|
|
prop.type = 'Saas' + prop.type; |
|
|
|
|
|
console.log(prop.type); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function fixImportNameForTenant(imp: Import) { |
|
|
|
|
|
imp.specifiers.forEach((spe, index) => { |
|
|
|
|
|
const isTenant = spe.toLocaleLowerCase().includes(TENANT_KEY); |
|
|
|
|
|
|
|
|
|
|
|
if (isTenant) { |
|
|
|
|
|
imp.specifiers[index] = 'Saas' + spe; |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export function resolveSelfGenericProps(params: Partial<ModelGeneratorParams>) { |
|
|
export function resolveSelfGenericProps(params: Partial<ModelGeneratorParams>) { |
|
|
const { types, solution } = params; |
|
|
const { types, solution } = params; |
|
|
if (!types || !solution) { |
|
|
if (!types || !solution) { |
|
|
|