全部產品
Search
文件中心

Drive and Photo Service:檔案授權

更新時間:Dec 22, 2025

檔案授權和共用的一些操作方法。

說明

請求參數中的 options: IPDSRequestConfig 基於 axios 的 request config 封裝,詳情請看:AxiosRequestConfig

listSharingFiles 方法

查詢我的共用檔案清單

const result = await client.listSharingFiles(params, options)

參數說明

欄位

類型

必選

說明

params

IListReq

預設為 {}

options

IPDSRequestConfig

其它配置項

IListReq

欄位

類型

必選

說明

limit

number

一次查詢多少條資料

marker

string

標記

返回

欄位

類型

必選

說明

result

IListRes<IFileItem>

返回結果

IListRes

欄位

類型

必選

說明

items

array

查詢到的檔案資訊列表,items 中每一項的具體欄位可查看 IFileItem 的說明

next_marker

string

分頁標記

punished_file_count

number

檔案夾會返回

IFileItem

欄位

類型

必選

說明

action_list

string[]

許可權列表

created_at

Date

建立時間

creator_id

string

建立人的id

creator_name

string

建立人的名稱

creator_type

string

建立人的類型

domain_id

string

domain ID

drive_id

string

雲端硬碟id

encrypt_mode

string

是否以加密形式分享

file_id

string

檔案id

hidden

boolean

顯示隱藏

last_modifier_id

string

修改人的id

last_modifier_name

string

修改人的名稱

last_modifier_type

string

修改人的類型

name

string

檔案名稱

parent_file_id

string

上一級目錄id

revision_id

string

版本

starred

boolean

是否收藏, true 是

status

string

檔案狀態, available | enabled

type

string

檔案類型 folder

updated_at

Date

檔案更新時間

listReceivedFiles 方法

查詢收到的共用檔案資訊。

const result = await client.listReceivedFiles(params, options)

參數說明

欄位

類型

必選

說明

params

IListReq

預設為 {}

options

IPDSRequestConfig

其它配置項

IListReq

欄位

類型

必選

說明

limit

number

一次查詢多少條資料

marker

string

標記

返回

欄位

類型

必選

說明

result

IListRes<IFileItem>

返回結果

IListRes

欄位

類型

必選

說明

items

array

查詢到的檔案資訊列表,items 中每一項的具體欄位可參考關於 IFileItem 的說明

next_marker

string

分頁標記

punished_file_count

number

檔案夾會返回

addFilePermission 方法

添加檔案授權資訊 (建立共用更新共用)

const result = await client.addFilePermission(params, options)

參數說明

欄位

類型

必選

說明

params

IAddFilePermissionReq

建立共用的資訊

options

IPDSRequestConfig

其它配置項

IAddFilePermissionReq

欄位

類型

必選

說明

drive_id

string

雲端硬碟id

file_id

string

共用檔案的ID

member_list

array

要共用給的使用者物件集合,數組每一項請參考 IPermissionStandard 說明

IPermissionStandard

欄位

類型

必選

說明

identity

object

包含 identity_type 和 identity_id 兩個欄位

expire_time

number

時間戳記

role_id

string

角色id

disinherit_sub_group

boolean

是否繼承子團隊

傳回值

StandardMode 模式下建立成功,沒有傳回值,失敗則拋出異常資訊。

removeFilePermission 方法

移除檔案許可權(刪除共用)。

await client.removeFilePermission(params, options)

參數說明

欄位

類型

必選

說明

params

IAddFilePermissionReq

要刪除的共用檔案

options

IPDSRequestConfig

其它配置項

傳回值

刪除成功,沒有傳回值,失敗則拋出異常資訊。

listFilePermissions 方法

列舉檔案的許可權。

const result = await client.listFilePermission(params, options)

參數說明

欄位

類型

必選

說明

params

IListPermissionReq

查詢參數

options

IPDSRequestConfig

其它配置項

IListPermissionReq

欄位

類型

必選

說明

drive_id

string

雲端硬碟id

file_id

string

檔案id

返回

欄位

類型

必選

說明

result

array

返回結果, 其中每一項請查看關於 IPermissionStandard 的說明

IPermissionStandard

欄位

類型

必選

說明

identity

object

包含identity_name, identity_type 和 identity_id 欄位

expire_time

number

時間戳記

role_id

string

角色id

disinherit_sub_group

boolean

是否繼承子團隊