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.

92 lines (91 loc) 3.78 kB
export interface ConnectProvider { /** Unique identifier for the connect provider. */ id: number; /** ▃▃▃▃▃▃▃▃▃▃▃▃▃▃ Relations ▃▃▃▃▃▃▃▃▃▃▃▃▃▃ */ /** User created this (Owner). */ user_id: number; /** Linked connect (Add after request verified by SD admin). */ connect_id?: number | null; /** ▃▃▃▃▃▃▃▃▃▃▃▃▃▃ Officer zone ▃▃▃▃▃▃▃▃▃▃▃▃▃▃ */ /** Officer. */ officer_id?: number | null; /** Approved by officer. */ approved_at?: string | null; /** Rejected by officer. */ rejected_at?: string | null; /** Officer message for provider owner (Reject reason or, ...). */ officer_message?: string | null; /** User request to review to publish. */ reviewing: boolean; /** ▃▃▃▃▃▃▃▃▃▃▃▃▃▃ Configuration ▃▃▃▃▃▃▃▃▃▃▃▃▃▃ */ /** Unique code (After first approve it cannot change). */ code: string; /** [Same as connect->name] Name of connect. */ name: string; /** [Same as connect->icon] Icon of connect. */ icon?: string | null; /** [Same as connect->enable] Enable/Disable connect service. */ enable: boolean; /** [Same as connect->mode] {@see ConnectMode}. */ mode: string; /** {name, description, ...} Used to update the linked connect. */ info: Array<{ name: string; description: string; }>; /** {confirm, read_categories, write_categories, ...} Used to update the linked connect. */ config: Array<string>; /** ▃▃▃▃▃▃▃▃▃▃▃▃▃▃ Developer ▃▃▃▃▃▃▃▃▃▃▃▃▃▃ */ /** Keep Auth config. */ auth: Array<string>; /** Keep API configs. External service calls these endpoints on SD. */ apis: Array<string>; /** Keep webhooks configs. We call these endpoints. */ webhooks: Array<(typeof ConnectProvider.Webhooks)[keyof typeof ConnectProvider.Webhooks]>; /** ▃▃▃▃▃▃▃▃▃▃▃▃▃▃ Statistics ▃▃▃▃▃▃▃▃▃▃▃▃▃▃ */ /** Total errors (Reset by user). */ errors: number; /** Timestamp for when the connect provider was created. */ created_at: string; /** Timestamp for when the connect provider was last updated. */ updated_at: string; } export declare namespace ConnectProvider { type WebhookParamValue = "notify_shop" | "sync_category" | "sync_product" | "create_order" | "confirm_order" | "get_order" | "cancel_order" | "sync_customers"; /** * Interface representing a webhook. */ interface IWebhook { /** Parameter representing the webhook. */ param: WebhookParamValue; /** Icon associated with the webhook. */ icon: string; /** Title of the webhook. */ title: string; /** Description of the webhook. */ description: string; } export const Webhooks: Record<WebhookParamValue, IWebhook>; /** * Interface representing an authentication method. */ interface IAuthMethod { /** Value representing the authentication method. */ value: AuthMethodKey; /** Title of the authentication method. */ title: string; /** Description of the authentication method. */ description: string; /** Icon associated with the authentication method. */ icon: string; } /** * Type representing the keys of the authentication methods object. */ type AuthMethodKey = "OAuth" | "Password"; /** * Constant object containing details for each authentication method. */ export const AuthMethods: Record<AuthMethodKey, IAuthMethod>; export {}; }