import { IEditor } from './explorer'; import { IWebFormStyleClass } from './webform-editor'; import { WebformStateCondition } from './webform-state'; export declare enum FolderRootType { /** * Represent the methods folder */ METHODS = "method", /** * Represent the webforms folder */ WEBFORMS = "webform", /** * Represent the classes folder */ CLASSES = "class", WELCOME = "welcome", SETTINGS = "settings", ROOT = "root", REPORTS = "report" } export declare const FolderRootPath: { CLASSES: string; METHODS: string; SHARED: string; WEBFORMS: string; CLASSES_FOLDER: string; REPORTS: string; DEBUGGER: string; }; /** * Folder child type enumeration */ export declare enum FileFolderType { /** * Represent a Folder */ FOLDER = "folder", /** * Represent a WebForm */ WEBFORM = "webform", REPORT = "report", /** * Represent a Method */ METHOD = "method", /** * Represent a Class */ CLASS = "class", /** * Represent a Class */ CLASS_FOLDER = "classfolder", /** * Represent a Debugger */ DEBUGGER = "debugger", /** * Represent welcome screen */ WELCOME = "welcome", /** * Represent settings screen */ SETTINGS = "settings", /** * Represent the methods folder */ METHODS = "method", /** * Represent the webforms folder */ WEBFORMS = "webform", /** * Represent the classes folder */ CLASSES = "class", /** * Represent the debuggers folder */ DEBUGGERS = "debugger", /** * Represent the data models folder */ MODELS = "models", /** * Represent the roles */ ROLES = "roles", /** * Represent the http handler */ HTTP_HANDLERS = "http-handlers", /** * Represent the data models file */ LOCALIZATION = "localization", /** * Represent the data models file */ MODEL = "model", /** * Represent the data explorer */ DATA_EXPLORER = "dataexplorer", /** * Represent the mobile form */ MOBILE = "mobile", MOBILEFORM = "mform", FILE = "file", TEXT = "text" } /** * Folder child with content. It represents files and excludes folders */ export type FileFolderTypeWithContent = FileFolderType.CLASS | FileFolderType.WEBFORM | FileFolderType.METHOD | FileFolderType.WELCOME | FileFolderType.ROLES | FileFolderType.MODEL | FileFolderType.FILE | FileFolderType.DEBUGGER | FileFolderType.DATA_EXPLORER | FileFolderType.SETTINGS | FileFolderType.TEXT | FileFolderType.HTTP_HANDLERS; /** * Designer request verb enumeration */ export declare enum DesignerRequestVerb { /** * The verb to get a folder content */ GET_FOLDER = "getFolder", /** * The verb to get a file content */ GET = "get", /** * The verb to save or create a file with content */ SAVE = "save", /** * The verb to rename an existing file or folder */ RENAME = "rename", /** * The verb to drop an existing file or folder */ DROP = "drop", /** * The verb to add new folder */ ADD_FOLDER = "addFolder", /** * The verb to create new folder */ CREATE_FOLDER = "mkdir", /** * the verb to rename a folder */ RENAME_FOLDER = "renameFolder", /** * the verb to drop a folder */ DROP_FOLDER = "dropFolder", /** * the verb to remove a file/folder */ REMOVE_ITEM = "removeItem", /** * the verb to rename or move a file/folder */ MOVE_ITEM = "moveItem", /** * the verb to get a file or folder info */ GET_INFO = "getInfo", /** * the verb to save a file */ SAVE_CONTENT = "save", /** * the verb to check for updates */ UPDATE_CHECK = "update:check", /** * the verb to install updates */ UPDATE_INSTALL = "update:install", /** * the verb to get the web server info */ GET_APP_SETTINGS = "getWebServerInfo", /** * the verb to get a file content */ GET_FILE_CONTENT = "getFileContent", /** * the verb to set a file content */ SET_FILE_CONTENT = "setFileContent", /** * the verb to get files info */ GET_FILES_INFO = "getFilesInfo" } /******************************************************************************* * Interfaces goes here * *******************************************************************************/ /** * Generic interface representing every designer request */ export interface IDesignerRequest { verb: DesignerRequestVerb; root?: FolderRootType; path?: string; name?: string; } /** * Represent a folder child */ export interface IFolderChild { name: string; date?: string; type?: FileFolderType; ext: string; } /** * The Get Folder request body */ export interface IGetFolderRequest extends IDesignerRequest { verb: DesignerRequestVerb.GET_FOLDER; } /** * The Get Folder response body */ export interface IGetFolderResponse { name: string; date: string; type: FileFolderType.FOLDER; children: IFolderChild[]; } /** * The Get file request body */ export interface IGetFileRequest extends IDesignerRequest { verb: DesignerRequestVerb.GET; type: FileFolderTypeWithContent; } /** * The Get file response body */ export interface IGetFileResponse { name: string; date: string; type: FileFolderTypeWithContent; content: T; } /** * Check updates */ export interface ICheckUpdatesRequest { verb: DesignerRequestVerb.UPDATE_CHECK; } /** * Check updates response */ export interface ICheckUpdatesResponse { name: string; version: string; changelog: string; url: string; sha256: string; md5: string; } /** * Install updates */ export interface IInstallUpdatesRequest { verb: DesignerRequestVerb.UPDATE_INSTALL; } /** * Install updates response */ export interface IInstallUpdatesResponse { } export interface IAppSettingsRequest { verb: DesignerRequestVerb.GET_APP_SETTINGS; } export interface IAppSettingsResponse { projectOpened: boolean; remoteDebuggerMode: RemoteDebuggerMode; baseUrl: string; qodly: boolean; urls: { renderer: string; debugger: string; lsp: string; }; isRestActive: boolean; } export declare enum RemoteDebuggerMode { DISABLED = 0, ENABLED = 1 } /** * The Save file request body */ export interface ISaveFileRequest extends IDesignerRequest { verb: DesignerRequestVerb.SAVE; type: FileFolderTypeWithContent; content: any; } /** * The Save file response body */ export interface ISaveFileResponse { name: string; date?: string; type: FileFolderTypeWithContent; } /** * The rename request body */ export interface IRenameFileRequest extends IDesignerRequest { verb: DesignerRequestVerb.RENAME; newname: string; type: FileFolderType; } /** * The rename response body */ export interface IRenameFileResponse { name: string; date: string; type: FileFolderTypeWithContent; } /** * The Drop file request body */ export interface IDropFileRequest extends IDesignerRequest { verb: DesignerRequestVerb.DROP; type: FileFolderTypeWithContent; } /** * The Drop file response body */ export interface IDropFileResponse { deleted: boolean; } /** * The add folder request body */ export interface IAddFolderRequest extends IDesignerRequest { verb: DesignerRequestVerb.ADD_FOLDER; type: FileFolderType.FOLDER; } export interface ICreateFolderRequest extends IDesignerRequest { verb: DesignerRequestVerb.CREATE_FOLDER; path: string; recursive?: boolean; } /** * The add folder response body */ export interface IAddFolderResponse { name: string; date: string; type: FileFolderType.FOLDER; } /** * Rename Folder Request body */ export interface IRenameFolderRequest extends IDesignerRequest { verb: DesignerRequestVerb.RENAME_FOLDER; type: FileFolderType.FOLDER; newname: string; } /** * Rename Folder Response body */ export interface IRenameFolderResponse { name: string; date: string; type: FileFolderType.FOLDER; } /** * Drop Folder Request body */ export interface IDropFolderRequest extends IDesignerRequest { verb: DesignerRequestVerb.DROP_FOLDER; type: FileFolderType; /** * True to delete all children of the folder */ withChildren: boolean; } /** * Drop Node Request body */ export interface IRemoveItemRequest { verb: DesignerRequestVerb.REMOVE_ITEM; path: string; /** * True to delete all children of the folder */ force: boolean; } export interface IMoveItemRequest { verb: DesignerRequestVerb.MOVE_ITEM; path: string; newpath: string; } export interface IGetNodeInfoRequest { verb: DesignerRequestVerb.GET_INFO; path: string; content?: boolean; as?: string; } export interface ISaveContentRequest { verb: DesignerRequestVerb.SAVE_CONTENT; path: string; content?: boolean; } export interface INodeInfo { name: string; type: FileFolderType; ext: string; date: string; content?: any; size?: number; } export type IGetNodeInfoResponse = INodeInfo[] | INodeInfo; export type TRESTResponseError = { message: string; componentSignature: string; errCode: number; }; export type ISaveContentResponse = { permissionsErrors: TRESTResponseError[] | [] | undefined; modelErrors: TRESTResponseError[] | [] | undefined; name: string; type: string; ext: string; date: string; }; export default interface IMoveItemResponse { name: string; type: string; ext: string; date: string; } /** * Drop Folder Response Body */ export interface IDropFolderResponse { deleted: boolean; } /** * Get file info request item */ export interface IGetFileInfo { path: string; } /** * Get file info response item */ export interface IFileInfo { name: string; type: FileFolderType; path: string; date: string; editor?: IEditor; } /** * Get file info request body */ export interface IFileInfoRequest { verb: string; files: IGetFileInfo[]; } /** * Get file info response body */ export interface IFileInfoResponse { files: (IFileInfo & { deleted: boolean; })[]; } export interface ILoginResponse { success: boolean; isLogged: boolean; } export interface IGetFileContentRequest { verb: DesignerRequestVerb.GET_FILE_CONTENT; /** * The root folder of the file.\ * root = 'project/Sources'.\ * shared = 'project/Sources/Shared'\ * ...etc */ root: 'root' | 'shared' | string; /** * Path to the file inside the root folder.\ * EX:\ * path=‘myfolder/myotherfolder’\ * root='shared'\ * => '/project/Shared/myfolder/myotherfolder’ */ path: string; /** * name of the file to be retrieved. */ name: string; /** * if true, the file will be retrieved as a string.\ * if false, the file will be retrieved as a json. */ asText: boolean; } export interface IGetFileContentResponse { name: string; date: string; content: string; } export interface ISetFileContentRequest { verb: DesignerRequestVerb.SET_FILE_CONTENT; /** * The root folder of the file.\ * root = 'project/Sources'.\ * shared = 'project/Sources/Shared'\ * ...etc */ root: string; /** * Path to the file inside the root folder.\ * EX:\ * path=‘myfolder/myotherfolder’\ * root='shared'\ * => '/project/Shared/myfolder/myotherfolder’ */ path: string; /** * name of the file to be saved. */ name: string; /** * if true, the file will be saved as a string.\ * if false, the file will be saved as a json. */ asText: boolean; /** * Content of the file. can be a string or a json. */ content: string | object; } export type ISharedDatasourcesResponse = { [key: string]: datasources.ICreateDataSource[]; }; export type ISharedCSSResponse = { classes: IWebFormStyleClass[]; }; export type ISavedConditionsResponse = { conditions: WebformStateCondition[]; }; export interface IUserPrivilege { privilege: string; } export type IUserPrivilegesResponse = { privileges: IUserPrivilege[]; };