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.

196 lines (195 loc) 11.9 kB
import { Currency } from "@selldone/core-js/enums/payment/Currency"; export declare class XAPI { selldone_xapi_url: string; /** * When creating an instance of the class containing this constructor, it will automatically search the HTML document's `<head>` section for a `<meta>` tag with the `name` attribute set to "selldone-xapi". * * If this tag is found, its `content` value (which should be a URL) will be assigned to the `selldone_xapi_url` property of the instance. * * ex: <meta name="selldone-xapi" content="https://xapi.example.com"> * */ constructor(); SHOP_LOGIN_REQUEST(shop_name: string): string; SHOP_LOGIN_VERIFY(shop_name: string): string; SHOP_LOGIN_SELECT_USER(shop_name: string): string; SHOP_LOGIN_NEW_USER(shop_name: string): string; POST_SHOP_LOGIN_EMAIL_REQUEST(shop_name: string): string; POST_SHOP_LOGIN_EMAIL_VERIFY(shop_name: string): string; /** * Retrieves the URL for getting user information. * * Note: This method only works when authenticated by passport. * * @returns {string} The URL for fetching user information. */ GET_USER(): string; LOGOUT(shop_name: string): string; GET_EXCHANGE_RATES(shop_name: string): string; POST_LEAVE_SHOP(shop_name: string): string; POST_SUBSCRIBE(shop_name: string): string; POST_SAVE_MY_CUSTOMER_PROFILE(shop_name: string): string; GET_SHOP_INFO(shop_name: string): string; GET_SHOP_PROFILE(shop_name: string, type: string): string; GET_PRODUCTS(shop_name: string): string; GET_PRODUCTS_LIST(shop_name: string): string; GET_PRODUCT_INFO(shop_name: string, product_id: string | number): string; GET_PRODUCT_INFO_CARD(shop_name: string, product_id: string | number): string; GET_PRODUCT_INFO_INSTAGRAM(shop_name: string, product_id: string | number): string; GET_PRODUCT_INFO_HYPER(shop_name: string, product_id: string | number): string; POST_SET_PRODUCT_RATING(shop_name: string, product_id: string | number): string; PUT_PHYSICAL_ITEM_IN_BASKET(shop_name: string, product_id: string | number): string; DELETE_PHYSICAL_ITEM_FROM_BASKET(shop_name: string, product_id: string | number): string; POST_BASKET_ITEM_MESSAGE(shop_name: string, product_id: string | number): string; DELETE_BASKET_ITEM_FILE(shop_name: string, basket_id: string | number, file_id: string | number): string; PUT_BASKET_ITEM_PREFERENCES(shop_name: string, product_id: string | number): string; PUT_SET_BASKET_CONFIG(shop_name: string, basket_id: string | number): string; GET_BASKET_BILL(shop_name: string, type: string): string; POST_BUY_BASKET(shop_name: string, type: string, gateway: string): string; POST_PAY_BILL(shop_name: string, basket_id: string | number, bill_id: string | number, gateway: string): string; POST_SUBMIT_SERVICE_BASKET(shop_name: string, type: string): string; POST_SET_MY_LOCATION(shop_name: string, type: string): string; PUT_ORDER_EDIT_RECEIVER_INFO(shop_name: string, basket_id: string | number): string; POST_BASKET_GENERATE_SHARE_LINK(shop_name: string, basket_id: string | number): string; POST_BASKET_IMPORT(shop_name: string, type: string): string; POST_BASKET_CREATE_SUBSCRIPTION_PORTAL_URL(shop_name: string, basket_id: string | number): string; GET_ORDER_BASKET_INFO(shop_name: string, basket_id: string | number): string; GET_ORDER_POS_BASKET_INFO(shop_name: string, basket_id: string | number): string; POST_ORDER_BASKET_CONFIRM_RECEIVED(shop_name: string, basket_id: string | number): string; PUT_ORDER_EDIT_BILLING(shop_name: string, basket_id: string | number): string; GET_MY_ORDERS_HISTORY_PHYSICAL(shop_name: string, type: string): string; GET_MY_BASKET_ITEM_RETURNS(shop_name: string): string; POST_BASKET_ITEM_RETURN_REQUEST(shop_name: string, basket_id: string | number, item_id: string | number): string; GENERATE_DOWNLOAD_PRODUCT_FILE_TEMP_URL(shop_name: string, product_id: string | number, file_id: string | number): string; GET_TAX_REGIONS(shop_name: string, country: string): string; GET_SEARCH_QUERY(shop_name: string, query: string): string; PUT_TO_WAITING_FOR_BE_AVAILABLE(shop_id: string | number, product_id: string | number): string; DELETE_FROM_WAITING_FOR_BE_AVAILABLE(shop_id: string | number, product_id: string | number): string; PUT_TO_WAITING_FOR_AUCTION(shop_id: string | number, product_id: string | number): string; DELETE_FROM_WAITING_FOR_AUCTION(shop_id: string | number, product_id: string | number): string; PUT_WISHLIST_PRODUCT(shop_name: string, product_id: string | number): string; DELETE_WISHLIST_PRODUCT(shop_name: string, product_id: string | number): string; GET_MY_COMMENTS(shop_name: string): string; GET_MY_GIFT_CARDS(shop_name: string): string; GET_MY_GIFT_CARDS_LIST(shop_name: string): string; POST_ADD_GIFT_CARDS(shop_name: string): string; GET_MY_WALLETS(shop_name: string): string; PUT_DISCOUNT_CODE(shop_name: string): string; GET_SHOP_BLOGS(shop_name: string): string; POST_SET_FCM_TOKEN(shop_name: string): string; GET_PENDING_PAYMENT_INFO(shop_name: string, gateway: string, transaction_id: string): string; GET_PAYMENT_STATUS_INTERVAL(shop_name: string, gateway: string, transaction_id: string, unique_id: string): string; POST_SET_SHOP_APP_STATUS_BY_CUSTOMER(shop_name: string, app_code: string): string; /** * * @param shop_name * @param basket_id * @param basketItem_id * @param type image , video , voice * @returns {string} * @constructor */ POST_UPLOAD_RETURN_REQUEST_FILE(shop_name: string, basket_id: string | number, basketItem_id: string | number, type: string): string; POST_CONTACT_US_FORM(shop_name: string): string; GET_FAQ_TAGS(shop_name: string): string; GET_FAQ(shop_name: string): string; POST_SEND_QUESTION(shop_name: string): string; GET_CUSTOM_HOME_PAGE(shop_name: string, page_id: string | number): string; /** * We can send page id in query (page_id) with empty page_name * @param shop_name * @param page_name * @constructor */ GET_PAGE_DATA(shop_name: string, page_name?: string | null): string; GET_PAGE_STATISTIC(shop_name: string, page_name: string): string; GET_INCLUDE_PAGE_DATA(shop_name: string, include_id?: string): string; GET_CHECK_SHOP_STRIPE_PAYMENT_INTENT(shop_name: string, paymentIntent_id: string): string; GET_PAYPAL_CLIENT_TOKEN(shop_name: string, currency: keyof typeof Currency): string; POST_UPLOAD_DIRECT_PAYMENT_RECEIPT(shop_name: string, transaction_id: number | string, currency: keyof typeof Currency): string; GET_MY_ADDRESSES(): string; DELETE_MY_ADDRESSES(address_id: string | number): string; PUT_ADDRESS(address_id: string | number): string; POST_ADDRESS(): string; GET_GEO_TO_ADDRESS(): string; GET_AUTOCOMPLETE(): string; GET_SHOP_BLOG_CATEGORIES(shop_id: number | string): string; GET_SHOP_BLOG_DATA(shop_name: string, blog_id: number | string): string; GET_LINK_PREVIEW(): string; GET_FETCH_COUPONS(shop_name: string): string; GET_COUPONS_BY_CODE(shop_name: string, code: string): string; PUT_SET_BASKET_COUPON(shop_name: string): string; GET_FETCH_OFFERS(shop_name: string): string; GET_FETCH_LOTTERIES(shop_name: string): string; POST_FETCH_LOTTERIES(shop_name: string): string; GET_FETCH_LOTTERY_WINS(shop_name: string): string; PUT_SET_BASKET_LOTTERY(shop_name: string): string; PUT_SET_USER_CURRENCY(shop_name: string): string; GET_SHOP_TICKETS_LIST(shop_name: string): string; PUT_SHOP_TICKET_UPDATE_MESSAGE(shop_name: string, contact_id: number | string): string; DELETE_SHOP_TICKET_MESSAGE_RESPONSE(shop_name: string, contact_id: number | string, index: number): string; POST_SHOP_TICKET_CLOSE(shop_name: string, contact_id: number | string): string; PUT_SHOP_TICKET_RATE(shop_name: string, contact_id: number | string): string; GET_INSTAGRAM_DATA(shop_name: string): string; GET_CUSTOMER_OPEN_AVOCADO(shop_name: string): string; GET_CUSTOMER_HISTORY_AVOCADOS(shop_name: string): string; POST_ADD_OPEN_AVOCADO_ITEM(shop_name: string, hash: string): string; DELETE_OPEN_AVOCADO_ITEM(shop_name: string, hash: string, item_id: string | number): string; POST_RESERVE_AVOCADO(shop_name: string, hash: string): string; GET_CUSTOMER_INFO_FOR_AVOCADO(shop_name: string, hash: string): string; PUT_SET_CUSTOMER_INFO_FOR_AVOCADO(shop_name: string, hash: string): string; POST_PAY_AVOCADO(shop_name: string, hash: string, gateway: string): string; GET_ORDER_AVOCADO_BASKET_INFO(shop_name: string, avocado_id: number): string; GET_CUSTOMER_OPEN_HYPER(shop_name: string): string; POST_ADD_OPEN_HYPER_ITEM(shop_name: string): string; GET_CUSTOMER_HISTORY_HYPERS(shop_name: string): string; POST_PAY_HYPER(shop_name: string, gateway: string): string; DELETE_OPEN_HYPER_ITEM(shop_name: string, item_id: string | number): string; GET_CUSTOMER_INFO_FOR_HYPER(shop_name: string, hyper_id: string | number): string; POST_PAYMENTS_PAYPAL_STANDARD_VERIFY(shop_name: string): string; GET_ARTICLE_SEO_AUDIT(shop_id: number | string, article_id: string | number): string; POST_SHOP_CONVERTER_WORD_HTML(shop_id: string | number): string; POST_TRANSLATE_PRODUCT_ARTICLE(shop_id: string | number, product_id: string | number): string; POST_LIKE_ARTICLE(article_id: string | number): string; POST_STAR_ARTICLE(article_id: string | number): string; POST_CLAPS_OF_ARTICLE(article_id: string | number): string; POST_REPORT_ARTICLE(article_id: string | number, report: number): string; GET_SHOP_ARTICLES_TIMELINE(shop_id: string | number): string; POST_ADD_EDIT_ARTICLE(type: string): string; /** * Upload article image. * @param type * @param extra shop ID * @returns {string} */ UPLOAD_ARTICLE_IMAGE(type: string, extra?: null): string; UPLOAD_ARTICLE_BLOG_IMAGE(shop_id: string | number): string; DELETE_ARTICLE(type: string, article_id: string | number): string; GET_SHOP_ARTICLE_TAGS(shop_id: string | number): string; PUT_CHANGE_TAG(shop_id: string | number): string; POST_SET_SHOP_ARTICLE_TAGS(shop_id: string | number, article_id: string | number): string; POST_ADD_COMMENT(article_id: string | number): string; PUT_UPDATE_COMMENT(comment_id: string | number): string; DELETE_COMMENT(comment_id: string | number): string; POST_FOLLOW_USER(user_id: string | number): string; POST_CUSTOMER_BASKET_CHAT_ADD_MESSAGE(shop_name: string, basket_id: string | number): string; DELETE_CUSTOMER_BASKET_CHAT_MESSAGE(shop_name: string, basket_id: string | number, message_index: number): string; GET_VENDORS(shop_name: string): string; GET_VENDOR_INFO(shop_name: string, vendor_id: number | string): string; GET_VENDOR_PAGE_DATA(shop_name: string, vendor_id?: string): string; POST_SUBSCRIBE_NOW(shop_name: string, product_id: number | string): string; GET_PRODUCT_MEMBERSHIP_CONTENTS(shop_name: string, product_id: number | string): string; POST_PRODUCT_MEMBERSHIP_CONTENTS_SEND_MY_RATING(shop_name: string, product_id: number | string, content_id: number | string): string; /** * * @param domain we need to force xapi.selldone.com ... because of It's just for showing to user in dashboard! * @param shop_id * @param key * @returns {string} * @constructor */ POST_STREAM_USER_ADD(domain: string, shop_id: string | number, key: string): string; POST_STREAM_USER_ADD_NEWSLETTER(shop_id: string | number, key?: string): string; GET_SHOP_LANGUAGE_PACK(shop_name: string, language: string): string; GET_SHOP_CASHBACK_PROGRAM(shop_name: string): string; }