import { formatFiles, generateFiles, installPackagesTask, joinPathFragments, names, Tree } from '@nx/devkit'; import { getDMMF } from '@prisma/internals'; import { apiLibraryGenerator, getPrismaSchemaPath, ModelType, readPrismaSchema } from '../lib/engine'; import { GenerateCrudGeneratorSchema } from './schema'; import { getNpmScope } from '@nx/js/src/utils/package-json/get-npm-scope'; export interface GenerateCrudGeneratorDependencies { formatFiles: typeof formatFiles; generateFiles: typeof generateFiles; installPackagesTask: typeof installPackagesTask; joinPathFragments: typeof joinPathFragments; names: typeof names; getDMMF: typeof getDMMF; apiLibraryGenerator: typeof apiLibraryGenerator; getPrismaSchemaPath: typeof getPrismaSchemaPath; readPrismaSchema: typeof readPrismaSchema; getNpmScope: typeof getNpmScope; } export declare const GENERATED_CRUD_POSTURES: readonly ["admin", "authenticated"]; export type GeneratedCrudPosture = (typeof GENERATED_CRUD_POSTURES)[number]; export declare const GENERATED_CRUD_POSTURE_PATH = ".nestled-updates/security/generated-crud-posture.json"; export declare function readGeneratedCrudPosture(tree: Tree): { posture: GeneratedCrudPosture; invalid?: string; }; export declare const CORE_PAGING_INPUT_PATH = "libs/api/core/data-access/src/lib/dto/core-paging.input.ts"; /** * 1.1.6+ assigns a typed `FilterInput` to every `ListInput.filters`, overriding the * base class's field of the same name. If that base class — the template's `CorePagingInput` — * still declares its own `filters: Record`, the override collides under * `noImplicitOverride` and every generated model fails with TS4114 ("must have an 'override' * modifier"), pointing at generated code and naming the one fix that must not happen: adding * `override` would just move the failure to TS4113 once the base field is later removed, since * that's the whole point of this generator's output. Detecting it here, before 22,000 lines of DTO * get written, turns a wall of confusing generated-code errors into one actionable message. */ export declare function assertCorePagingInputHasNoFilters(tree: Tree): void; export declare function generateResolverContent(model: ModelType, npmScope: string, posture?: GeneratedCrudPosture): string; export declare function generateFeatureModuleContent(models: ModelType[], npmScope: string): string; export declare function generateFeatureIndexContent(models: ModelType[]): string; export declare function generateCrudLogic(tree: Tree, schema: GenerateCrudGeneratorSchema, dependencies: GenerateCrudGeneratorDependencies): Promise<() => void>; export default function (tree: Tree, schema: GenerateCrudGeneratorSchema): Promise<() => void>;