Buckets:
| import { OAuth2Client, CodeChallengeMethod } from "../client.js"; | |
| export class Salesforce { | |
| authorizationEndpoint; | |
| tokenEndpoint; | |
| tokenRevocationEndpoint; | |
| client; | |
| constructor(domain, clientId, clientSecret, redirectURI) { | |
| this.authorizationEndpoint = `https://${domain}/services/oauth2/authorize`; | |
| this.tokenEndpoint = `https://${domain}/services/oauth2/token`; | |
| this.tokenRevocationEndpoint = `https://${domain}/services/oauth2/revoke`; | |
| this.client = new OAuth2Client(clientId, clientSecret, redirectURI); | |
| } | |
| createAuthorizationURL(state, codeVerifier, scopes) { | |
| const url = this.client.createAuthorizationURLWithPKCE(this.authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes); | |
| return url; | |
| } | |
| async validateAuthorizationCode(code, codeVerifier) { | |
| const tokens = await this.client.validateAuthorizationCode(this.tokenEndpoint, code, codeVerifier); | |
| return tokens; | |
| } | |
| async refreshAccessToken(refreshToken) { | |
| const tokens = await this.client.refreshAccessToken(this.tokenEndpoint, refreshToken, []); | |
| return tokens; | |
| } | |
| async revokeToken(token) { | |
| await this.client.revokeToken(this.tokenRevocationEndpoint, token); | |
| } | |
| } | |
Xet Storage Details
- Size:
- 1.28 kB
- Xet hash:
- a9618b93f4ba1d108b5e4d84025f326e43babb438430a158772492b138b47a44
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.