16 lines
806 B
TypeScript
16 lines
806 B
TypeScript
|
|
import {z} from "zod/v4";
|
||
|
|
import {ConfigurationSchema} from "./access/access-definition";
|
||
|
|
export const FolderMappingInputSchema=z.strictObject({
|
||
|
|
profileId:z.uuid(),needId:z.uuid(),path:z.string().trim().min(1).max(255),
|
||
|
|
driveLetter:z.string().trim().regex(/^[A-Za-z]:?$/).nullable(),
|
||
|
|
state:ConfigurationSchema,notes:z.string().trim().max(4000).nullable(),
|
||
|
|
});
|
||
|
|
export type FolderMappingInput=z.infer<typeof FolderMappingInputSchema>;
|
||
|
|
export class FolderMappingError extends Error {constructor(public readonly code:string){super(code);}}
|
||
|
|
export const FOLDER_STATE_TRANSITIONS={
|
||
|
|
pending:["pending","configured","never_configured"],
|
||
|
|
configured:["configured","removal_pending"],
|
||
|
|
removal_pending:["removal_pending","removed"],
|
||
|
|
removed:["removed"],never_configured:["never_configured"],
|
||
|
|
} as const;
|