@saleor/app-sdk
Version:
SDK for building great Saleor Apps
44 lines (41 loc) • 1.56 kB
TypeScript
import { APL, AuthData, AplReadyResult, AplConfiguredResult } from '../index.js';
declare const UpstashAPLVariables: {
UPSTASH_TOKEN: string;
UPSTASH_URL: string;
};
declare class UpstashAplMisconfiguredError extends Error {
missingVars: string[];
constructor(missingVars: string[]);
}
declare class UpstashAplNotConfiguredError extends Error {
}
type UpstashAPLConfig = {
restURL: string;
restToken: string;
};
/**
* Upstash APL
*
* Use [Upstash](https://upstash.com) which is SaaS Redis provider, to store auth data.
* You can create free developer account and use it to develop multi-tenant apps.
*
* Configuration require 2 elements: URL to the REST service and auth token. Both can be
* found in the Upstash dashboard. You can choose to store them using environment variables
* (`UPSTASH_URL` and `UPSTASH_TOKEN`) or pass directly to APL's constructor.
*/
declare class UpstashAPL implements APL {
private restURL?;
private restToken?;
constructor(config?: UpstashAPLConfig);
private upstashRequest;
private saveDataToUpstash;
private deleteDataFromUpstash;
private fetchDataFromUpstash;
get(saleorApiUrl: string): Promise<AuthData | undefined>;
set(authData: AuthData): Promise<void>;
delete(saleorApiUrl: string): Promise<void>;
getAll(): Promise<never[]>;
isReady(): Promise<AplReadyResult>;
isConfigured(): Promise<AplConfiguredResult>;
}
export { UpstashAPL, type UpstashAPLConfig, UpstashAPLVariables, UpstashAplMisconfiguredError, UpstashAplNotConfiguredError };