UNPKG

@swell/cli

Version:

Swell's command line interface/utility

32 lines (31 loc) 1.21 kB
import type Api from '../types/index.js'; export declare enum HttpMethod { GET = "get", POST = "post", PUT = "put", DELETE = "delete" } export default class Api { storeId: string | undefined; envId: string | undefined; secretKey: string | undefined; publicKey: string | undefined; constructor(storeId?: string, envId?: string, publicKey?: string, secretKey?: string); api(pathOpts: Api.Paths, options: Api.RequestOptions): Promise<any>; get(pathOpts: Api.Paths, options?: Api.RequestOptions): Promise<any>; getAll(pathOpts: Api.Paths, options?: Api.RequestOptions): Promise<{ count: number; results: any[]; }>; post(pathOpts: Api.Paths, options?: Api.RequestOptions): Promise<any>; put(pathOpts: Api.Paths, options?: Api.RequestOptions): Promise<any>; delete(pathOpts: Api.Paths, options?: Api.RequestOptions): Promise<any>; isTestEnvEnabled(): Promise<boolean>; setEnv(envId: string): Promise<void>; setStoreEnv(storeId: string, envId?: string): Promise<void>; setPublicKey(publicKey?: string): Promise<void>; private isFrontend; private isAdmin; private truncatePath; private waitForAsyncResponse; }