UNPKG

@selldone/sdk-storefront

Version:

A TypeScript SDK to connect to your shop and build a fully functional storefront and website by simply developing a frontend web application. All backend operations are seamlessly managed by the serverless Selldone solution.

65 lines (64 loc) 2.13 kB
import { ConnectProvider } from "./connect.provider.model"; export interface Connect { id: number; user_id: number; code: string; mode: keyof typeof Connect.Modes; name: string; description: string; icon: string; enable: boolean; form?: any[] | null; confirm: boolean; read_categories: boolean; write_categories: boolean; read_products: boolean; write_products: boolean; read_orders: boolean; write_orders: boolean; read_customers: boolean; write_customers: boolean; shipping: boolean; created_at: Date; updated_at: Date; } export declare namespace Connect { /** * Enum representing connect scopes. */ type ScopeValue = "read_categories" | "write_categories" | "read_products" | "write_products" | "read_orders" | "write_orders" | "read_customers" | "write_customers"; /** * Interface representing a scope. */ interface IScope { /** Code representing the scope. */ code: ScopeValue; /** Color associated with the scope. */ color: string; /** Title of the scope. */ title: string; /** Description of the scope. */ desc: string; } export const Scopes: Record<ScopeValue, IScope>; type ConnectModeValue = "Migration" | "Dropshipping" | "Marketplace" | "Accounting" | "Other"; /** * Interface representing a connect mode. */ interface IConnectMode { /** Code representing the connect mode. */ code: ConnectModeValue; /** Title of the connect mode. */ title: string; /** Description of the connect mode. */ desc: string; /** Array of webhooks associated with the connect mode. */ webhooks: Array<(typeof ConnectProvider.Webhooks)[keyof typeof ConnectProvider.Webhooks]>; /** Array of access scopes associated with the connect mode. */ access: IScope[]; /** Availability of the connect mode for public selection. */ available: boolean; } export const Modes: Record<ConnectModeValue, IConnectMode>; export {}; }