UNPKG

nest-square

Version:

NestJS module for Square Node.js SDK

38 lines (37 loc) 1.5 kB
import { ApiResponse, CatalogObject, Client, CreateCatalogImageResponse, ObtainTokenResponse } from "square"; import { NestSquareCatalogObjectTypeEnum } from "./nest-square-catalog-object-type.enum.js"; import { NestSquareFile } from "./nest-square-file.js"; import { type NestSquareConfigType } from "./nest-square.config.js"; export declare class NestSquareService { private config; private readonly logger; constructor(config: NestSquareConfigType); client(params?: { accessToken?: string; }): Client; retryOrThrow<T>(accessToken: string, clientFn: (client: Client) => Promise<T>): Promise<T>; retryObtainTokenOrThrow(params: { code: string; }): Promise<ApiResponse<ObtainTokenResponse>>; retryRevokeTokenOrThrow(params: { accessToken?: string | null; merchantId?: string | null; revokeOnlyAccessToken?: boolean | null; }): Promise<ApiResponse<ObtainTokenResponse>>; retryRefreshTokenOrThrow(params: { refreshToken: string; }): Promise<ApiResponse<ObtainTokenResponse>>; private pRetryOrThrow; accumulateCatalogOrThrow(params: { accessToken: string; types: NestSquareCatalogObjectTypeEnum[]; }): Promise<CatalogObject[]>; uploadCatalogImageOrThrow(params: { accessToken: string; idempotencyKey: string; id: string; objectId?: string; file: NestSquareFile; caption?: string; }): Promise<CreateCatalogImageResponse>; }