更新实例指纹

最近更新:2025-04-18 19:07:06

更新实例指纹

const update = async () => {
  const res = await sdk.update(
    "c78f137783584d18946955cac****",
    "fad77b07f127427da825d3df****",
    {
      flag: 0,
      sessionId: "fad77b07f127427da825d3df****",
      sessionName: "实例名称112233",
      browser: {
        system: "Windows 10",
        uaVersion: "122",
        publicIp: "192.168.0.171",
        ipChannel: "ipdata",
        kernel: "chrome",
        kernelVersion: "122",
      },
    }
  );
};

参数

名称类型是否必须字段含义备注
flagint更新标识0: 更新基础信息 2:更新指纹信息 4:更新代理信息 8:清除 cookie 16:清除缓存

cookies 结构

名称类型是否必须字段含义备注
creation_utcfloat64Cookie 创建的 UTC 时间戳以浮点数形式表示
expires_utcfloat64Cookie 过期的 UTC 时间戳以浮点数形式表示,若值为 0 可能表示不过期
has_expiresint表示是否有过期时间可以用不同整数值代表不同状态,如 1 表示有过期时间,0 表示无
host_keystring关联的主机键用于标识 Cookie 所属的主机
is_httponlyint表示是否为 HttpOnly Cookie通常用 1 表示是,0 表示否,HttpOnly 的 Cookie 不能通过脚本访问
is_persistentint表示是否为持久化 Cookie用不同整数值代表不同状态,如 1 表示持久化,0 表示非持久化
is_same_partyint表示是否为 SameParty Cookie用于跨站请求相关的安全控制,用不同整数值代表不同状态
is_secureint表示是否为安全 Cookie通常用 1 表示是,0 表示否,安全 Cookie 仅在 HTTPS 连接中传输
last_access_utcfloat64最后访问的 UTC 时间戳以浮点数形式表示,记录最后一次访问该 Cookie 的时间
last_update_utcfloat64最后更新的 UTC 时间戳以浮点数形式表示,记录最后一次更新该 Cookie 的时间
namestringCookie 的名称用于标识该 Cookie 的唯一名称
pathstringCookie 适用的路径表示该 Cookie 在哪些路径下是有效的
priorityintCookie 的优先级不同整数值代表不同优先级,如 1 表示低,2 表示中,3 表示高
samesiteint表示 SameSite 属性值用于控制跨站请求时 Cookie 的发送,不同整数值代表不同属性值
source_portint源端口号记录创建该 Cookie 的源端口号
source_schemeint源协议方案不同整数值代表不同协议,如 1 表示 HTTP,2 表示 HTTPS
top_frame_site_keystring顶级框架的站点键用于标识顶级框架的站点信息
valuestringCookie 的值存储 Cookie 的实际内容

browser 结构

名称类型是否必须字段含义备注
systemstring操作系统目前支持: Windows 7,Windows 8,Windows 8.1,Windows 10,Windows 11
uaVersionstringua 大版本号范围 100-124
publicIpstring公网 ip代理 IP,未设置代理,将会取所在主机IP
ipChannelstringip 检测渠道可为空,枚举 ip2location,ipdata
kernelstring内核类型枚举 chrome,firefox
kernelVersionstring内核版本107,119,122
proxyobject代理信息
site_accountsarray账号信息数组,每个元素为一个账号信息,包含 user,pwd,site
  • 请求
{
  "flag": 0,
  "sessionId": "c61458b4d8464453b9f120dfbea736db",
  "sessionName": "实例名称",
  "browser": {
    "system": "",
    "uaVersion": "",
    "publicIp": "192.168.0.171",
    "ipChannel": "",
    "kernel": "chrome",
    "kernelVersion": "127",
    "proxy": {
      "protocol": "http",
      "host": "192.168.0.171",
      "port": 10809,
      "userName": "",
      "password": ""
    }
  }
}

interface

提供接口数据,方便用户快速使用

/** 环境信息 */
export interface EnvData {
    id: number;
    userId: string;
    companyId: string;
    apiKey: string;
    sessionId: string;
    /** 名称 */
    sessionName: string;
    productId: string;
    /**
     * 服务器类型
     *
     * @description 海外:包含“hwtest” 其他国内
     */
    cloudId: string;
    /** 到期类型  到期类型 1:不过期 2:到期时间 3:剩余时长(单位秒)*/
    expiredType: number;
    /** 到期时间 */
    expired: number;
    sessionLogId: number;
    /** rpa连接ws地址 */
    browserUrl: string;
    /**
     * 状态 1:运行 2:关闭 3:删除
     */
    status: number;
    checktime: string;
    errorNum: number;
    duration: number;
    clientNum: number;
    info: null;
    /** 环境信息 */
    browser: any;
    /** 更新日期 */
    updatedAt: string;
    /** 创建日期 */
    createdAt: string;
}
/** 环境列表数据 */
export interface SessionListData {
    /** 环境列表信息 */
    list: envData[];
    /** 总数 */
    total: number;
    /** 每页显示条数 */
    pageSize: number;
    /** 当前页 */
    currentPage: number;
}
export interface SessionListResponse {
    reqId: string;
    /**
     * 状态码 200:成功
     */
    code: number;
    msg: "OK";
    /** 环境信息 */
    data: SessionListData;
}

// 请求接口 ********************************************
/** 账号信息 */
export interface IAccounts {
    /** 账号 */
    user: string;
    /** 密码 */
    pwd: string;
    /** 站点 */
    site: string;
}
/** 代理信息 */
export interface IProxy {
    /** 协议类型 */
    protocol: string;
    /** 地址 */
    host: string;
    /** 端口 */
    port: number;
    /** 账号 */
    userName: string;
    /** 密码 */
    password: string;
}

/** 环境信息 */
export interface IBrowser {
    /**
     * 操作系统
     *
     * @description 目前支持: Windows 7,Windows 8,Windows 8.1,Windows 10,Windows 11
     */
    system: string;
    /**
     * ua 大版本号
     * @description 范围 100-124
     */
    uaVersion?: string;
    /**
     * 公网 ip
     * @description 设置代理取代理里的 IP
     */
    publicIp: string;
    /**
     * ip 检测渠道
     * @description 可为空,枚举 ip2location,ipdata
     */
    ipChannel?: string;
    /**
     * 内核类型 chrome,firefox
     */
    kernel: string;
    /**
     * 内核版本 107,119,122
     */
    kernelVersion: string;
    /** 代理信息 */
    proxy?: IProxy;
    /** 账号信息 */
    site_accounts?: IAccounts[];
}

/** 环境创建入参 */
export interface ICreateReqParams {
    /** 实例名称 */
    sessionName: string;
    /** 产品 ID,决定主机所在的区域 */
    productId: string;
    /** 到期类型  1:不过期 2:到期时间 3:剩余时长(单位秒)*/
    expiredType: number;
    /**
     * 到期时间
     * @description 当 expiredType = 1 时 值为 Unix 时间戳,expiredType = 2 时为时长秒数
     */
    expired: number;
    /** 环境指纹信息 */
    browser: IBrowser;
}

/** 环境更新信息入参 */
export interface IUpdateReqParams {
    /**
     * 更新标识 0:更新基础信息 2:更新指纹信息 4:更新代理信息 8:清除 cookie 16:清除缓存
     */
    flag?: number;
    sessionId: string;
    sessionName: string;
    browser: IBrowser;
}



全新服务市场

亿级流量来解锁,开拓企业新格局

立即免费加入
售前咨询
2885542529
17767162660

添加客服微信咨询产品


扫一扫关注云登小程序


扫一扫关注云登公众号


扫码获取专属企业定制

在线咨询