import type { EntityJSON } from "@uipath/entity-modeler/schema"; import { type AutoCreatedSolution } from "@uipath/solution-sdk"; export type { AutoCreatedSolution }; export interface EntityInitOptions { /** Initialize even if the target directory exists and is not empty. */ force?: boolean; /** * Base dir the bare project `name` resolves against, and what a relative * `uipxPath` resolves against. Required unless `uipxPath` is absolute. */ cwd?: string; /** * Path to the parent solution's `.uipx` FILE. Give this when the caller * already knows the manifest — an editor host does — so placement and * registration stop depending on where the process happens to be. * * The project is created at `/`, which is also the * directory registration searches first — so the named manifest is the one * that gets the `Projects[]` entry. Passing it suppresses the auto-scaffold: * a named manifest that does not exist is an error, not a cue to create a * solution. * * Not yet honored when that directory holds more than one `.uipx` — the * SDK's discovery refuses the ambiguity, and the run fails with that reason. * * Omit it to keep the previous behavior: place under `cwd` and take * whichever `.uipx` the upward search finds. */ uipxPath?: string; /** The first entity's own Name. */ firstEntityName: string; /** * The first entity's authored document, from `authorNewEntity`, so a * definition lands in the same write as the entity. An empty skeleton * when omitted. */ firstEntity?: EntityJSON; } /** * Outcome of registering the project in the parent `.uipx`. Structural mirror of * solution-sdk's envelope, so the published `.d.ts` stays free of the private * SDK type. * * Only `Status` is guaranteed: the SDK always returns a status — "Registered", * "AlreadyRegistered", "NotInSolution", "OptedOut", "Skipped" or "Failed" — but * the rest describe a registration that actually happened, so they are absent * when it did not. `Solution` and `ProjectId` are present for the two statuses * this service accepts; every other status makes it throw. */ export interface EntityProjectRegistration { Status: string; Message?: string; Instructions?: string; /** Absolute path to the parent `.uipx`. */ Solution?: string; /** Solution-relative path to the project file. */ Project?: string; /** GUID written into the `.uipx` `Projects[]` entry. */ ProjectId?: string; } export interface EntityInitResult { projectName: string; /** Absolute path to the created project directory. */ projectDir: string; /** Absolute path to the written `.entity` stub. */ entityFile: string; /** Absolute path to the written entity definition resource. */ resourceFile: string; registration: EntityProjectRegistration; /** Present when the SDK auto-created the parent solution. */ autoCreatedSolution?: AutoCreatedSolution; } /** * Scaffolds an Entity project: `project.uiproj`, the `.entity` pointer stub, a * `{ Type: "Entity" }` entry in the parent `.uipx` (auto-creating the solution * when outside one, like `flowInitAsync`), and the entity definition resource * under the solution root. * * Throws on failure and rolls back what it created. The resource lives outside * the project dir, so an Entity project cannot exist without a solution. */ export declare function entityInitAsync(name: string, options: EntityInitOptions): Promise;