import { APIPayloadStatusOnly, APIPayload } from '../../common/v2.js'; import { APIReadFile } from '../../payloads/v2/files.js'; import '../../utils.js'; /** * @see https://docs.squarecloud.app/en/api-reference/endpoint/apps/filemanager/content */ interface RESTGetAPIFileContentQuery { path: string; } /** * Query for the file listing. `path` defaults to `/` when omitted. * @see https://docs.squarecloud.app/en/api-reference/endpoint/apps/filemanager/list */ interface RESTGetAPIFilesListQuery { path?: string; } /** * Body for `PUT /v2/apps/{appId}/files`. `content` accepts either a UTF-8 * string (text files) or a Node-style Buffer JSON object (binary files). * @see https://docs.squarecloud.app/en/api-reference/endpoint/apps/filemanager/put */ interface RESTPutAPIFileUpsertJSONBody { path: string; content: string | APIReadFile; } /** * @see https://docs.squarecloud.app/en/api-reference/endpoint/apps/filemanager/put */ interface RESTPutAPIFileUpsertResult { written: boolean; } type RESTPutAPIFileUpsertResultPayload = APIPayload; /** * @see https://docs.squarecloud.app/en/api-reference/endpoint/apps/filemanager/patch */ interface RESTPatchAPIFileMoveJSONBody { path: string; to: string; } type RESTPatchAPIFileMoveResultPayload = APIPayloadStatusOnly; /** * @see https://docs.squarecloud.app/en/api-reference/endpoint/apps/filemanager/delete */ interface RESTDeleteAPIFileDeleteQuery { path: string; } type RESTDeleteAPIFileDeleteResultPayload = APIPayloadStatusOnly; export type { RESTDeleteAPIFileDeleteQuery, RESTDeleteAPIFileDeleteResultPayload, RESTGetAPIFileContentQuery, RESTGetAPIFilesListQuery, RESTPatchAPIFileMoveJSONBody, RESTPatchAPIFileMoveResultPayload, RESTPutAPIFileUpsertJSONBody, RESTPutAPIFileUpsertResult, RESTPutAPIFileUpsertResultPayload };