import { BatchJob, BatchJobService, EventBusService, ShippingProfileService, Store, StoreService, TransactionBaseService, UserService } from "@medusajs/medusa"; import { StoreRepository } from "@medusajs/medusa/dist/repositories/store"; import { ConfigModule, Logger } from "@medusajs/medusa/dist/types/global"; import { ClientOptions, FetchedShopifyData, ShopifyData, ShopifyImportCallBack, ShopifyImportRequest, ShopifyRequest } from "interfaces/shopify-interfaces"; import { EntityManager } from "typeorm"; import ShopifyClientService from "./shopify-client"; import ShopifyCollectionService from "./shopify-collection"; import ShopifyProductService from "./shopify-product"; import { ShopifyPath } from "../interfaces/shopify-interfaces"; export interface ShopifyServiceParams { manager: EntityManager; eventBusService: EventBusService; shippingProfileService: ShippingProfileService; storeService: StoreService; shopifyProductService: ShopifyProductService; shopifyCollectionService: ShopifyCollectionService; shopifyClientService: ShopifyClientService; storeRepository: typeof StoreRepository; userService: UserService; batchJobService: BatchJobService; logger: Logger; configModule: ConfigModule; } export type ShopifyBatchTask = { path: string; batchJobId: string; }; export type BatchActionCallBack = (BatchJob: any) => Promise; declare class ShopifyService extends TransactionBaseService { static LIFE_TIME: import("awilix").LifetimeType; storeRepository: typeof StoreRepository; options: ClientOptions; shippingProfileService_: ShippingProfileService; shopifyProductService_: ShopifyProductService; shopifyCollectionService_: ShopifyCollectionService; shopifyClientService_: ShopifyClientService; storeService_: StoreService; logger: Logger; buildService_: any; lastFetchedProducts: ShopifyData; lastFetchedCustomCollections: ShopifyData; lastFetchedSmartCollections: ShopifyData; batchJobService_: BatchJobService; userService: UserService; configModule: ConfigModule; eventBus_: EventBusService; lastFetchedCollects: ShopifyData; defaultBatchActionNotifier: BatchActionCallBack; requestBatchTasks: Map; lastFetchedMetafields: ShopifyData; constructor(container: ShopifyServiceParams, options: ClientOptions); withTransaction(transactionManager: EntityManager): this; fetchFromShopifyAndProcess(shopifyRequest: ShopifyRequest, userId?: string, gotPageCallBack?: ShopifyImportCallBack): Promise; fetchFromShopifyAndProcessSingleCategory(shopifyRequest: ShopifyRequest, category?: ShopifyPath, userId?: string, gotPageCallBack?: ShopifyImportCallBack): Promise; importIntoStore(shopifyImportRequest: ShopifyRequest, defaultJobNotifier?: BatchActionCallBack): Promise; createBatchAndProcess(self: ShopifyService, shopifyData: ShopifyData[], shopifyImportRequest: ShopifyImportRequest, userId: string, path: ShopifyPath): Promise; getStoreById(store_id: string): Promise; getStoreByName(store_name: string): Promise; getAndUpdateBuildTime_(name: string): Promise; handleError(e: Error): Promise; handleWarn(e: Error): Promise; getBatchTasks(requestId: any): Promise; } export default ShopifyService;