@haus-tech/product-import-export-plugin 3.0.11-rc.1 → 3.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -10,7 +10,7 @@ export declare class ProductExportService {
|
|
|
10
10
|
private configService;
|
|
11
11
|
constructor(options: PluginInitOptions, productService: ProductService, stockLevelService: StockLevelService, channelService: ChannelService, configService: ConfigService);
|
|
12
12
|
createExportFile(ctx: RequestContext, selectionIds: ID[], fileName: string, selectedCustomFields: string, exportAssetsAs: 'url' | 'json', selectedExportFields: string, pageSize?: number, concurrency?: number): Promise<string>;
|
|
13
|
-
exportProduct(ctx: RequestContext, product: Product, languages: LanguageCode[], filteredCustomFieldNames: string[], exportAssetsAs: 'url' | 'json', csvWriter: CsvWriter<any
|
|
13
|
+
exportProduct(ctx: RequestContext, product: Product, languages: LanguageCode[], filteredCustomFieldNames: string[], exportAssetsAs: 'url' | 'json', csvWriter: CsvWriter<any>): Promise<void>;
|
|
14
14
|
private handleAssets;
|
|
15
15
|
private handleCustomFields;
|
|
16
16
|
private getStockOnHand;
|
|
@@ -110,7 +110,6 @@ let ProductExportService = class ProductExportService {
|
|
|
110
110
|
});
|
|
111
111
|
let currentPage = 1;
|
|
112
112
|
let hasMore = true;
|
|
113
|
-
const records = [];
|
|
114
113
|
while (hasMore) {
|
|
115
114
|
const { items, totalItems } = await this.productService.findAll(ctx, {
|
|
116
115
|
filter: {
|
|
@@ -130,13 +129,14 @@ let ProductExportService = class ProductExportService {
|
|
|
130
129
|
'variants.options',
|
|
131
130
|
]);
|
|
132
131
|
hasMore = currentPage * pageSize < totalItems;
|
|
133
|
-
const exportPromises = items.map((product) => limiter.schedule(async () => this.exportProduct(ctx, product, languages, filteredCustomFieldNames, exportAssetsAs, csvWriter
|
|
132
|
+
const exportPromises = items.map((product) => limiter.schedule(async () => this.exportProduct(ctx, product, languages, filteredCustomFieldNames, exportAssetsAs, csvWriter)));
|
|
134
133
|
await Promise.all(exportPromises);
|
|
135
134
|
currentPage++;
|
|
136
135
|
}
|
|
137
136
|
return exportFile;
|
|
138
137
|
}
|
|
139
|
-
async exportProduct(ctx, product, languages, filteredCustomFieldNames, exportAssetsAs, csvWriter
|
|
138
|
+
async exportProduct(ctx, product, languages, filteredCustomFieldNames, exportAssetsAs, csvWriter) {
|
|
139
|
+
const records = [];
|
|
140
140
|
const { assets = [], facetValues = [], optionGroups = [], variants = [], translations = [], customFields = {}, } = product;
|
|
141
141
|
const nameTranslations = this.mapTranslations(translations, 'name', languages);
|
|
142
142
|
const slugTranslations = this.mapTranslations(translations, 'slug', languages);
|
package/package.json
CHANGED