pcs-cli
Version:
Baidu Personal Cloud Storage's Command Line Interface.
2 lines (1 loc) • 722 B
JavaScript
import{_ as r}from"../_tslib-NbJOzQvB.js";import e from"chalk";import{f as o,l as t}from"../index-7szJY7Td.js";import s from"../services/pcs.js";import"fs";import"os";import"path";import"crypto";import"https";import"progress";import"../utils/axios.js";import"axios";var i=i=>{i.command("refresh").description("refresh token").option("-t --token [token]","access token").action((i=>r(void 0,void 0,void 0,(function*(){try{const r=yield s.refreshToken(i.key,i.secret,i.refresh_token);o("TOKEN",Object.assign(Object.assign({},r),{key:i.key,secret:i.secret})),t("Successfully refreshed token",e.green)}catch(r){const{response:{data:o}}=r;t(`OAuth error ${o.error} : ${o.error_description}`,e.red)}}))))};export{i as default};