api

Files plugin API operations.

Defines the typed API operations for the files plugin. These operations are available via runtime.plugins.files.api when the plugin is installed.

Available Operations

  • list_files - List files in a directory
  • upload - Upload a new file
  • save_file - Save file content
  • download_data - Download from data directory
  • download_cache - Download from cache directory
  • download_upload - Download from upload directory

Example

const { plugins } = useStatelyUi();

// List files
const { data } = await plugins.files.api.list_files({
  params: { query: { dir: '/configs' } }
});

// Upload a file
await plugins.files.api.upload({ body: formData });

Type Aliases

FilesApi

FilesApi = TypedOperations<FilesPaths, typeof FILES_OPERATIONS>

Defined in: files/src/api.ts:72

Typed API client for files operations.

Access via runtime.plugins.files.api.


FilesOperations

FilesOperations = DefineOperations<operations>

Defined in: files/src/api.ts:44

OpenAPI operations type for the files plugin


FilesPaths

FilesPaths = DefinePaths<paths>

Defined in: files/src/api.ts:41

OpenAPI paths type for the files plugin

Variables

FILES_OPERATIONS

const FILES_OPERATIONS: object

Defined in: files/src/api.ts:52

Files plugin operation bindings.

Maps friendly operation names to their HTTP method and path. Paths do NOT include any prefix - that's provided via plugin options.

Type Declaration

download_cache

readonly download_cache: object

Download a file from the cache directory

download_cache.method

readonly method: "get" = 'get'

download_cache.path

readonly path: "/file/cache/{path}" = '/file/cache/{path}'

download_data

readonly download_data: object

Download a file from the data directory

download_data.method

readonly method: "get" = 'get'

download_data.path

readonly path: "/file/data/{path}" = '/file/data/{path}'

download_upload

readonly download_upload: object

Download a file from the upload directory

download_upload.method

readonly method: "get" = 'get'

download_upload.path

readonly path: "/file/upload/{path}" = '/file/upload/{path}'

list_files

readonly list_files: object

List files in a directory

list_files.method

readonly method: "get" = 'get'

list_files.path

readonly path: "/list" = '/list'

save_file

readonly save_file: object

Save content to a file

save_file.method

readonly method: "post" = 'post'

save_file.path

readonly path: "/save" = '/save'

upload

readonly upload: object

Upload a file via multipart form

upload.method

readonly method: "post" = 'post'

upload.path

readonly path: "/upload" = '/upload'