Comparing version 2.3.3 to 2.3.4
@@ -7,2 +7,3 @@ import type { OAuth2Tokens } from "../oauth2.js"; | ||
validateAuthorizationCode(code: string): Promise<OAuth2Tokens>; | ||
refreshAccessToken(refreshToken: string): Promise<OAuth2Tokens>; | ||
} |
import { OAuth2Client } from "../client.js"; | ||
const authorizationEndpoint = "https://www.figma.com/oauth"; | ||
const tokenEndpoint = "https://www.figma.com/api/oauth/token"; | ||
const refreshEndpoint = "https://api.figma.com/v1/oauth/refresh"; | ||
export class Figma { | ||
@@ -17,2 +18,6 @@ client; | ||
} | ||
async refreshAccessToken(refreshToken) { | ||
const tokens = await this.client.refreshAccessToken(refreshEndpoint, refreshToken, []); | ||
return tokens; | ||
} | ||
} |
@@ -54,2 +54,5 @@ import { encodeBase64 } from "@oslojs/encoding"; | ||
if (response.ok) { | ||
if (response.body !== null) { | ||
await response.body.cancel(); | ||
} | ||
return; | ||
@@ -56,0 +59,0 @@ } |
{ | ||
"name": "arctic", | ||
"type": "module", | ||
"version": "2.3.3", | ||
"description": "OAuth 2.0 clients for popular providers", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"module": "dist/index.js", | ||
"files": [ | ||
"/dist/" | ||
], | ||
"author": "pilcrowOnPaper", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/pilcrowOnPaper/arctic" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20.8.6", | ||
"@typescript-eslint/eslint-plugin": "^6.7.5", | ||
"@typescript-eslint/parser": "^6.7.5", | ||
"eslint": "^8.51.0", | ||
"prettier": "^3.0.3", | ||
"typescript": "^5.2.2", | ||
"vitest": "1.6.0" | ||
}, | ||
"dependencies": { | ||
"@oslojs/crypto": "1.0.1", | ||
"@oslojs/encoding": "1.1.0", | ||
"@oslojs/jwt": "0.2.0" | ||
}, | ||
"scripts": { | ||
"build": "rm -rf dist/* && tsc", | ||
"format": "prettier -w .", | ||
"lint": "eslint src", | ||
"test": "vitest run --sequence.concurrent" | ||
} | ||
} | ||
"name": "arctic", | ||
"type": "module", | ||
"version": "2.3.4", | ||
"description": "OAuth 2.0 clients for popular providers", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"module": "dist/index.js", | ||
"scripts": { | ||
"build": "rm -rf dist/* && tsc", | ||
"format": "prettier -w .", | ||
"lint": "eslint src", | ||
"test": "vitest run --sequence.concurrent" | ||
}, | ||
"files": [ | ||
"/dist/" | ||
], | ||
"author": "pilcrowOnPaper", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/pilcrowonpaper/arctic.git" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20.8.6", | ||
"@typescript-eslint/eslint-plugin": "^6.7.5", | ||
"@typescript-eslint/parser": "^6.7.5", | ||
"eslint": "^8.51.0", | ||
"prettier": "^3.0.3", | ||
"typescript": "^5.2.2", | ||
"vitest": "1.6.0" | ||
}, | ||
"dependencies": { | ||
"@oslojs/crypto": "1.0.1", | ||
"@oslojs/encoding": "1.1.0", | ||
"@oslojs/jwt": "0.2.0" | ||
} | ||
} |
117030
2666