@saleor/app-sdk
Version:
SDK for building great Saleor Apps
43 lines (40 loc) • 1.18 kB
text/typescript
import { APL, AuthData } from '../index.mjs';
type AuthDataRequired = Omit<AuthData, "jwks" | "domain">;
type Options = {
env: Record<keyof AuthDataRequired, string>;
/**
* @deprecated instead, use GraphQL to generate token after installation
*/
printAuthDataOnRegister?: boolean;
/**
* TTL for the in-memory jwks cache, in milliseconds.
* Defaults to 5 minutes.
*/
cacheTtlMs?: number;
};
declare class EnvAPL implements APL {
private defaultOptions;
options: Options;
constructor(options: Options);
private isAuthDataValid;
private buildAuthData;
isReady(): Promise<{
readonly ready: true;
error?: undefined;
} | {
ready: boolean;
error: Error;
}>;
/**
* Always return its configured, because otherwise .set() will never be called
* so env can't be printed
*/
isConfigured(): Promise<{
readonly configured: true;
}>;
set(authData: AuthData): Promise<void>;
get(saleorApiUrl: string): Promise<AuthData | undefined>;
getAll(): Promise<AuthData[]>;
delete(saleorApiUrl: string): Promise<void>;
}
export { EnvAPL };