import { ActionType } from './apis'; import { CapiCredentials, RegionType } from './../interface'; import { Capi } from '@tencent-sdk/capi'; /** CAM (访问管理)for serverless */ export default class Cam { region: RegionType; credentials: CapiCredentials; capi: Capi; constructor(credentials: CapiCredentials, region?: RegionType); request({ Action, ...data }: { Action: ActionType; [key: string]: any }): Promise; /** 获取角色列表 */ DescribeRoleList(page: number, limit: number): Promise; ListRolePoliciesByRoleId(roleId: string, page: number, limit: number): Promise; /** 创建角色 */ CreateRole(roleName: string, policiesDocument: string, description?: string): Promise; /** 获取角色 */ GetRole(roleName: string): Promise; /** 删除角色 */ DeleteRole(roleName: string): Promise; /** * 为角色添加策略名称 * api limit qps 3/s */ AttachRolePolicyByName(roleId: string, policyName: string): Promise; /** * 角色是否存在 * @param roleName 角色名称 */ isRoleExist(roleName: string): Promise; /** 检查角色是否有云函数权限 */ CheckSCFExcuteRole(): Promise; /** 查询用户AppId */ GetUserAppId(): Promise<{ OwnerUin: string; AppId: string; Uin: string; }>; /** * checkYunTi 检查是否是云梯账号 * @returns {boolean} true: 是云梯账号; false: 非云梯账号 */ checkYunTi(): Promise; }