文档

文件授权

重要

本文中含有需要您注意的重要提示信息,忽略该信息可能对您的业务造成影响,请务必仔细阅读。

文件授权和共享的一些操作方法。

listShareFiles 方法

重要

标准模式支持

警告

托管模式不支持

查询我的共享文件列表

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

参数说明

字段

类型

必选

说明

params

IListReq

默认为 {}

options

AxiosRequestConfig

其它配置项

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

文件更新时间

listReceivedShareFiles 方法

重要

标准模式支持

警告

托管模式不支持

查询收到的共享文件信息

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

参数说明

字段

类型

必选

说明

params

IListReq

默认为 {}

options

AxiosRequestConfig

其它配置项

IListReq

字段

类型

必选

说明

limit

number

一次查询多少条数据

marker

string

标记

返回

字段

类型

必选

说明

result

IListRes<IFileItem>

返回结果

IListRes

字段

类型

必选

说明

items

array

查询到的文件信息列表,items 中每一项的具体字段可参考关于 IFileItem 的说明

next_marker

string

分页标记

punished_file_count

number

文件夹会返回

listManageSharingFiles 方法

重要

标准模式支持

警告

托管模式不支持

列举当前用户管理的共享记录

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

参数说明

字段

类型

必选

说明

params

IListReq

查询参数,不传默认为 {}

options

AxiosRequestConfig

其它配置项

IListReq

字段

类型

必选

说明

limit

number

一次查询多少条数据

marker

string

标记

返回

字段

类型

必选

说明

result

IListRes

返回结果

IListRes

字段

类型

必选

说明

items

array

查询到的文件信息列表,items 中每一项的具体字段可参考第1项关于 IFileItem 的说明

next_marker

string

分页标记

addFilePermission 方法

重要

标准模式支持

警告

托管模式不支持

添加文件授权信息(创建共享,更新共享)

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

参数说明

字段

类型

必选

说明

params

IAddFilePermissionReq

创建共享的信息

options

AxiosRequestConfig

其它配置项

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

AxiosRequestConfig

其它配置项

返回值

删除成功,没有返回值,失败则抛出异常信息。

listFilePermissions 方法

重要

标准模式支持

警告

托管模式不支持

获取文件的授权成员

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

参数说明

字段

类型

必选

说明

params

IListPermissionReq

查询参数

options

AxiosRequestConfig

其它配置项

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

是否继承子团队

listFileInheritPermissions 方法

重要

标准模式支持

警告

托管模式不支持

继承自上级目录的权限

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

参数说明

字段

类型

必选

说明

params

IListPermissionReq

options

AxiosRequestConfig

其它配置项

IListPermissionReq

字段

类型

必选

说明

drive_id

string

云盘id

file_id

string

文件id

返回

字段

类型

必选

说明

result

IListRes

返回结果

IListRes

字段

类型

必选

说明

items

IListInheritRes[]

next_marker

string

分页标记

IListInheritRes

字段

类型

必选

说明

member

IListPermissionRes

file_id

string

分页标记

IListPermissionRes

字段

类型

必选

说明

disinherit_sub_group

boolean

是否继承自上级

expire_time

number

时间戳

role_id

string

角色ID

domain_id

string

domain ID

drive_id

string

云盘

file_id

string

文件ID

creator

string

创建人

created_at

number

创建时间

can_access

boolean

是否可以访问

identity

IIdentityRes

身份信息

IIdentityRes

字段

类型

必选

说明

identity_id

string

身份id

identity_name

string

名称

identity_type

string

类型

listUserPermissions 方法

重要

标准模式支持

警告

托管模式不支持

用户维度,获取用户被授权的信息

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

参数说明

字段

类型

必选

说明

params

IUserPermissionReq

查询参数

options

AxiosRequestConfig

其它配置项

IUserPermissionReq

字段

类型

必选

说明

user_id

string

用户id

type

string

用户类型,可选值 'self' | 'group'

返回

字段

类型

必选

说明

result

IListRes

返回结果

IListRes

字段

类型

必选

说明

items

IListPermissionRes[]

请查看关于 IListPermissionRes 的说明

next_marker

string

分页标记

  • 本页导读 (0)
文档反馈