@vymalo/medusa-printful
Version:
Connect your MedusaJS store to Printful
29 lines (28 loc) • 1.91 kB
TypeScript
import { AbstractFulfillmentProviderService } from '@medusajs/utils';
import { CalculatedShippingOptionPrice, CalculateShippingOptionPriceDTO, CreateFulfillmentResult, CreateShippingOptionDTO, FulfillmentDTO, FulfillmentItemDTO, FulfillmentOption, FulfillmentOrderDTO, Logger } from '@medusajs/types';
import type { Order } from '../../../core';
import { PrintfulModules } from '../../../utils';
import type { IPrintfulService } from '../../../types';
type InjectedDependencies = {
logger: Logger;
[PrintfulModules.printful]: IPrintfulService;
};
type PrintfulFullfillmentData = {
printfulOrder: Order;
};
export default class PrintfulFulfillment extends AbstractFulfillmentProviderService {
static identifier: string;
private readonly logger_;
private readonly printfulService;
private readonly productModuleService;
constructor({ logger, printful }: InjectedDependencies);
canCalculate({ data, }: CreateShippingOptionDTO): Promise<boolean>;
calculatePrice(optionData: CalculateShippingOptionPriceDTO['optionData'], data: CalculateShippingOptionPriceDTO['data'], context: CalculateShippingOptionPriceDTO['context']): Promise<CalculatedShippingOptionPrice>;
validateOption(data: Record<string, unknown>): Promise<boolean>;
validateFulfillmentData(optionData: Record<string, unknown>, data: Record<string, unknown>, context: Record<string, unknown>): Promise<any>;
getFulfillmentOptions(): Promise<FulfillmentOption[]>;
cancelFulfillment(data: PrintfulFullfillmentData): Promise<void>;
createFulfillment(data: Record<string, unknown>, items: Partial<Omit<FulfillmentItemDTO, 'fulfillment'>>[], order: Partial<FulfillmentOrderDTO> | undefined, _fulfillment: Partial<Omit<FulfillmentDTO, 'provider_id' | 'data' | 'items'>>): Promise<CreateFulfillmentResult>;
createReturnFulfillment(fulfillment: Record<string, unknown>): Promise<any>;
}
export {};