download
raw
1.05 kB
import { OAuth2Client } from "../client.js";
const authorizationEndpoint = "https://www.dropbox.com/oauth2/authorize";
const tokenEndpoint = "https://api.dropboxapi.com/oauth2/token";
const tokenRevocationEndpoint = "https://api.dropboxapi.com/2/auth/token/revoke";
export class Dropbox {
client;
constructor(clientId, clientSecret, redirectURI) {
this.client = new OAuth2Client(clientId, clientSecret, redirectURI);
}
createAuthorizationURL(state, scopes) {
const url = this.client.createAuthorizationURL(authorizationEndpoint, state, scopes);
return url;
}
async validateAuthorizationCode(code) {
const tokens = await this.client.validateAuthorizationCode(tokenEndpoint, code, null);
return tokens;
}
async refreshAccessToken(refreshToken) {
const tokens = await this.client.refreshAccessToken(tokenEndpoint, refreshToken, []);
return tokens;
}
async revokeToken(token) {
await this.client.revokeToken(tokenRevocationEndpoint, token);
}
}

Xet Storage Details

Size:
1.05 kB
·
Xet hash:
7150eb71da78205dd845520e8a15cb0e8a8a8dc2a8167b5f56d51eb862bf82d9

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.