listStarredFiles 方法
標準模式支援
託管模式不支援
調用同步介面擷取收藏檔案清單。
const result = await client.listStarredFiles(params, options)參數說明
欄位 | 類型 | 必選 | 說明 |
params | object | 是 | 具體欄位請查看 ICustomIndexKeyReq |
options | AxiosRequestConfig | 否 | 其它配置項 |
ICustomIndexKeyReq
欄位 | 類型 | 必選 | 說明 |
drive_id | string | 是 | 雲端硬碟 |
image_thumbnail_process | string | 是 | 圖片縮圖處理規則。 |
image_url_process | string | 是 | 圖片處理規則。 |
video_thumbnail_process | string | 是 | 影片縮圖處理規則。 |
custom_index_key | string | 是 | 自訂的key。 |
fields | string | 是 | 檔案類型,全部為 '*' |
limit | number | 是 | 返回結果數量 |
marker | string | 否 | 標記 |
referer | string | 否 | 地址,location.origin 或者 undefined |
order_direction | string | 是 | 可選值 'DESC' | 'ASC' |
傳回值
欄位 | 類型 | 必選 | 說明 |
result | IListRes | 是 | 返回結果 |
IListRes
欄位 | 類型 | 必選 | 說明 |
items | IFileItem | 是 | 檔案清單,其中每一項可參考 listFiles 方法中 IFileItem 類型 |
next_marker | string | 否 | 分頁標記 |
batchToggleFilesStar 方法
標準模式支援
託管模式不支援
收藏操作
const result = await client.batchToggleFilesStar(fileItems, starred, options)參數說明
欄位 | 類型 | 必選 | 說明 |
fileItems | IFileItem[] | 是 | 其中每一項請查看 listFiles方法中的 IFileItem 類型。 |
starred | boolean | 為true表示收藏,為false表示移除最愛。 如果不傳,fileItems中含有 starred 不為 true的時,預設為收藏,否則為移除最愛。 | |
options | AxiosRequestConfig | 其它配置項 |
傳回值
欄位 | 類型 | 必選 | 說明 |
result | object | 是 | 返回結果 |
result
欄位 | 類型 | 必選 | 說明 |
type | string | 是 | 值為 star 或者 unStar |
changeItems | array | 是 | 未收藏的檔案資訊 |
successItems | array | 是 | 成功的結果清單 |
errorItems | array | 是 | 失敗的結果清單 |