Bỏ qua, đến nội dung

Tham chiếu API

Endpoints

EndpointMethodMô tả
{collection}:exportPOSTExport XLSX (override — tự chọn sync/async theo ngưỡng)
{collection}:exportAttachmentsPOSTExport tất cả attachments thành ZIP (luôn async)
asyncTasks:fetchFile/{taskId}GETTải file kết quả từ async task

{collection}:export (override)

Plugin override handler export của plugin cơ bản. Luồng xử lý:

  1. Server đếm số bản ghi phù hợp filter.
  2. So sánh với ngưỡng EXPORT_AUTO_MODE_THRESHOLD.
  3. Nếu dưới ngưỡng → export đồng bộ, trả binary XLSX ngay.
  4. Nếu vượt ngưỡng → tạo async job topic exportXlsxPro, trả job ID về client.

Request params: giống endpoint export cơ bản (columns, filter, sort, appends, title).

{collection}:exportAttachments

Method: POST

Xuất tất cả file đính kèm (attachment fields) của các bản ghi khớp filter thành archive ZIP. Luôn chạy ở chế độ async.

Request params: filter, fields (attachment field names).

Response: Job ID (async task).

asyncTasks:fetchFile/{taskId}

Method: GET

Tải file kết quả (XLSX hoặc ZIP) từ async task đã hoàn tất.

Response: Binary file stream.

Job topics

TopicMô tả
exportXlsxProJob xuất dữ liệu ra file XLSX (async mode)
exportAttachmentsJob xuất file đính kèm ra ZIP

CLI commands

CommandMô tả
export-xlsx-commandChạy export XLSX từ command line (hữu ích cho batch processing)
export-attachment-commandChạy export attachments từ command line

Biến môi trường

BiếnMặc địnhMô tả
EXPORT_AUTO_MODE_THRESHOLD(hệ thống)Ngưỡng số bản ghi để tự chuyển sang async mode