Importer
Importer
Parses and imports Products using the CSV import format.
Internally it is using the ImportParser to parse the CSV file, and then the FastImporterService and the AssetImporter to actually create the resulting entities in the Vendure database.
Signature
class Importer {
parseAndImport(input: string | Stream, ctxOrLanguageCode: RequestContext | LanguageCode, reportProgress: boolean = false) => Observable<ImportProgress>;
importProducts(ctx: RequestContext, rows: ParsedProductWithVariants[], onProgress: OnProgressFn) => Promise<string[]>;
}
parseAndImport
method
(input: string | Stream, ctxOrLanguageCode: RequestContext | LanguageCode, reportProgress: boolean = false) => Observable<ImportProgress>
Parses the contents of the product import CSV file and imports the resulting Product & ProductVariants, as well as any associated Assets, Facets & FacetValues.
The ctxOrLanguageCode
argument is used to specify the languageCode to be used when creating the Products.
importProducts
method
(ctx: RequestContext, rows: ParsedProductWithVariants[], onProgress: OnProgressFn) => Promise<string[]>
Imports the products specified in the rows object. Return an array of error messages.