Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cloudbase-accesstoken-cache

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cloudbase-accesstoken-cache - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

42

dist/types/index.d.ts

@@ -20,9 +20,28 @@ import type { Database } from '@cloudbase/node-sdk';

collectionName?: string;
/**
* 是否在内存中备份,多次调用时只会验证内存中的access token的过期时间,
* 直到过期才会重新从 cloudbase db 远端获取
* 优点为, 不同每次都从远端 db 中去获取
* 缺点为,当另外一个获取access token的请求,让内存中的这个 token 强制过期时,需要手动干预
* 默认为 true
*/
memoize?: boolean;
}
export interface ISingleCacheManagerInnerCache {
appid: string;
accessToken: string;
expiresIn: number;
}
export interface IRemoteTokenResponse {
access_token: string;
expires_in: number;
}
export declare class SingleCacheManager {
appid: string;
secret: string;
db: Database.Db;
collectionName: string;
tokenCol: Database.CollectionReference;
private appid;
private secret;
private db;
private collectionName;
private tokenCol;
private cache?;
private memoize;
constructor(config: ISingleCacheManagerConfig);

@@ -33,3 +52,3 @@ private getAccessTokenByHttp;

*/
forceGetAccessTokenByHttp(): Promise<any>;
forceGetAccessTokenByHttp(): Promise<IRemoteTokenResponse>;
/**

@@ -39,3 +58,14 @@ * 创建此 Collection

createCollection(): import("@cloudbase/node-sdk").IBaseRes;
createCacheItem(ts: number): Promise<ISingleCacheManagerInnerCache>;
/**
* 远端策略
* @returns
*/
remoteStrategy(): Promise<any>;
/**
* 内存策略
* @returns
*/
memoizeStrategy(): Promise<any>;
/**
* 调用时,请确保 Collection 存在,如果不存在请调用 createCollection

@@ -42,0 +72,0 @@ */

2

package.json
{
"name": "cloudbase-accesstoken-cache",
"version": "1.1.0",
"version": "1.1.1",
"description": "cloudbase-accesstoken-cache , use cloudbase database to manager your accesstoken easily !",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

# cloudbase-accesstoken-cache
> 轻松快捷的管理您的 Access Token
> 微信公众号和小程序的 Access Token 小助手, 轻松快捷的管理您的Token策略

@@ -5,0 +5,0 @@ ## Usage

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc