MCPcopy
hub / github.com/streetwriters/notesnook / getAccessToken

Method getAccessToken

packages/core/src/api/token-manager.ts:95–109  ·  view source on GitHub ↗
(
    scopes: Scope[] = ["notesnook.sync", "IdentityServerApi"],
    forceRenew = false
  )

Source from the content-addressed store, hash-verified

93 }
94
95 async getAccessToken(
96 scopes: Scope[] = ["notesnook.sync", "IdentityServerApi"],
97 forceRenew = false
98 ) {
99 return await getSafeToken(
100 async () => {
101 const token = await this.getToken(true, forceRenew);
102 if (!token || !token.scope) return;
103 if (!scopes.some((s) => token.scope.includes(s))) return;
104 return token.access_token;
105 },
106 "Error getting access token:",
107 this.eventManager
108 );
109 }
110
111 async _refreshToken(forceRenew = false) {
112 await this.REFRESH_TOKEN_MUTEX.runExclusive(async () => {

Callers 15

createConnectionMethod · 0.95
queueDownloadsMethod · 0.80
queueUploadsMethod · 0.80
downloadFileMethod · 0.80
deleteFileMethod · 0.80
bulkDeleteFilesMethod · 0.80
redeemMethod · 0.80
connectSSEMethod · 0.80
publishMethod · 0.80
unpublishMethod · 0.80
metadataMethod · 0.80
cancelMethod · 0.80

Calls 2

getTokenMethod · 0.95
getSafeTokenFunction · 0.85

Tested by

no test coverage detected