@haus-tech/product-import-export-plugin 3.2.0 → 3.3.1-next.0
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.
- package/CHANGELOG.md +8 -0
- package/README.mdx +31 -11
- package/package.json +2 -1
- package/src/api/product-export.controller.d.ts +6 -7
- package/src/api/product-export.controller.js +39 -78
- package/src/api/product-export.controller.js.map +1 -1
- package/src/constants.d.ts +1 -0
- package/src/constants.js +2 -1
- package/src/constants.js.map +1 -1
- package/src/dashboard/import.tsx +1 -1
- package/src/index.d.ts +4 -0
- package/src/index.js +3 -0
- package/src/index.js.map +1 -1
- package/src/product-import-export.plugin.js +23 -0
- package/src/product-import-export.plugin.js.map +1 -1
- package/src/providers/import-providers/import-parser.d.ts +5 -0
- package/src/providers/import-providers/import-parser.js +72 -35
- package/src/providers/import-providers/import-parser.js.map +1 -1
- package/src/providers/import-providers/product-importer.d.ts +10 -1
- package/src/providers/import-providers/product-importer.js +145 -35
- package/src/providers/import-providers/product-importer.js.map +1 -1
- package/src/services/export-storage/export-storage-strategy.d.ts +31 -0
- package/src/services/export-storage/export-storage-strategy.js +3 -0
- package/src/services/export-storage/export-storage-strategy.js.map +1 -0
- package/src/services/export-storage/local-export-storage-strategy.d.ts +20 -0
- package/src/services/export-storage/local-export-storage-strategy.js +106 -0
- package/src/services/export-storage/local-export-storage-strategy.js.map +1 -0
- package/src/services/export-storage/s3-export-storage-strategy.d.ts +15 -0
- package/src/services/export-storage/s3-export-storage-strategy.js +130 -0
- package/src/services/export-storage/s3-export-storage-strategy.js.map +1 -0
- package/src/services/export-storage.util.d.ts +18 -0
- package/src/services/export-storage.util.js +81 -0
- package/src/services/export-storage.util.js.map +1 -0
- package/src/services/extended-fast-importer.service.d.ts +3 -2
- package/src/services/extended-fast-importer.service.js +9 -2
- package/src/services/extended-fast-importer.service.js.map +1 -1
- package/src/services/product-export.service.d.ts +19 -2
- package/src/services/product-export.service.js +99 -38
- package/src/services/product-export.service.js.map +1 -1
- package/src/services/product-import.service.d.ts +2 -1
- package/src/services/product-import.service.js +3 -2
- package/src/services/product-import.service.js.map +1 -1
- package/src/types.d.ts +13 -0
- package/src/ui/components/export-dialog.component.ts +2 -2
- package/src/ui/components/product-import.component.ts +5 -5
- package/src/ui/product-export.service.ts +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## 3.2.1
|
|
2
|
+
|
|
3
|
+
This was a version bump only for product-import-export-plugin to align it with other projects, there were no code changes.
|
|
4
|
+
|
|
5
|
+
## 3.2.0
|
|
6
|
+
|
|
7
|
+
This was a version bump only for product-import-export-plugin to align it with other projects, there were no code changes.
|
|
8
|
+
|
|
1
9
|
## 3.1.10
|
|
2
10
|
|
|
3
11
|
This was a version bump only for product-import-export-plugin to align it with other projects, there were no code changes.
|
package/README.mdx
CHANGED
|
@@ -19,9 +19,10 @@ A Vendure plugin for importing and exporting product data via CSV. Supports bulk
|
|
|
19
19
|
|
|
20
20
|
## Features
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
* **Import** – Bulk upload products from CSV with validation, custom fields, assets, facets, and variants
|
|
23
|
+
* **Export** – Export products to CSV with selected fields; export all products or a selection
|
|
24
|
+
* **Storage strategies** – Store exported files in S3 or locally on disk (with automatic fallback)
|
|
25
|
+
* **UI** – Admin UI and Dashboard integration for import and export
|
|
25
26
|
|
|
26
27
|

|
|
27
28
|
|
|
@@ -44,7 +45,17 @@ export const config = {
|
|
|
44
45
|
plugins: [
|
|
45
46
|
ProductImportExportPlugin.init({
|
|
46
47
|
importOptions: {}, // Configure import options
|
|
47
|
-
exportOptions: {
|
|
48
|
+
exportOptions: {
|
|
49
|
+
storageStrategy: 's3', // 's3' | 'disk'
|
|
50
|
+
s3Options: {
|
|
51
|
+
bucket: 'your-bucket',
|
|
52
|
+
region: 'your-region',
|
|
53
|
+
credentials: {
|
|
54
|
+
accessKeyId: '...',
|
|
55
|
+
secretAccessKey: '...',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
48
59
|
}),
|
|
49
60
|
],
|
|
50
61
|
}
|
|
@@ -61,13 +72,22 @@ export const config = {
|
|
|
61
72
|
|
|
62
73
|
### Export options
|
|
63
74
|
|
|
64
|
-
| Option | Type | Default | Description
|
|
65
|
-
| ----------------------- | --------------------- | ----------------------- |
|
|
66
|
-
| `defaultFileName` | `string` | `'products_export.csv'` | Default filename for exports
|
|
67
|
-
| `exportAssetsAsOptions` | `('url' \| 'json')[]` | `['url', 'json']` | Available formats for asset export
|
|
68
|
-
| `defaultExportAssetsAs` | `'url' \| 'json'` | `'url'` | Default asset export format
|
|
69
|
-
| `defaultExportFields` | `string[]` | See above | Fields that will be pre-selected in the export UI
|
|
70
|
-
| `requiredExportFields` | `string[]` | `['name', 'sku']` | Fields that must always be included
|
|
75
|
+
| Option | Type | Default | Description |
|
|
76
|
+
| ----------------------- | --------------------- | ----------------------- | ------------------------------------------------------------ |
|
|
77
|
+
| `defaultFileName` | `string` | `'products_export.csv'` | Default filename for exports |
|
|
78
|
+
| `exportAssetsAsOptions` | `('url' \| 'json')[]` | `['url', 'json']` | Available formats for asset export |
|
|
79
|
+
| `defaultExportAssetsAs` | `'url' \| 'json'` | `'url'` | Default asset export format |
|
|
80
|
+
| `defaultExportFields` | `string[]` | See above | Fields that will be pre-selected in the export UI |
|
|
81
|
+
| `requiredExportFields` | `string[]` | `['name', 'sku']` | Fields that must always be included |
|
|
82
|
+
| `storageStrategy` | `'s3' \| 'disk'` | `'disk'` | Where exported files are stored |
|
|
83
|
+
| `s3Options` | `object` | `undefined` | S3 configuration (required when `storageStrategy` is `'s3'`) |
|
|
84
|
+
|
|
85
|
+
### Storage strategy
|
|
86
|
+
|
|
87
|
+
The plugin supports configurable storage for exported files:
|
|
88
|
+
|
|
89
|
+
* **S3** – Stores export files in an S3-compatible bucket
|
|
90
|
+
* **Disk (default)** – Saves files locally on the server
|
|
71
91
|
|
|
72
92
|
## CSV Format for Import
|
|
73
93
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haus-tech/product-import-export-plugin",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.1-next.0",
|
|
4
4
|
"description": "A Vendure plugin for importing and exporting products using a CSV file",
|
|
5
5
|
"author": "Haus Tech",
|
|
6
6
|
"repository": {
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"build": "yarn run -T rimraf dist && yarn run -T tsc && yarn run -T copyfiles -u 1 'src/ui/**/*' dist/"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
+
"@aws-sdk/client-s3": "^3.744.0",
|
|
46
47
|
"axios": "^1.7.0",
|
|
47
48
|
"bottleneck": "^2.19.5",
|
|
48
49
|
"fs-extra": "^11.2.0",
|
|
@@ -3,11 +3,14 @@ import { Response } from 'express';
|
|
|
3
3
|
import { ProductExportService } from '../services/product-export.service';
|
|
4
4
|
import { ProductExportQueueService } from '../services/product-export-queue.service';
|
|
5
5
|
import { PluginInitOptions } from '../types';
|
|
6
|
+
import { ExportStorageStrategy } from '../services/export-storage/export-storage-strategy';
|
|
6
7
|
export declare class ProductExportController {
|
|
7
8
|
private options;
|
|
9
|
+
private exportStorageStrategy;
|
|
8
10
|
private productExportService;
|
|
9
11
|
private productExportQueueService;
|
|
10
|
-
constructor(options: PluginInitOptions, productExportService: ProductExportService, productExportQueueService: ProductExportQueueService);
|
|
12
|
+
constructor(options: PluginInitOptions, exportStorageStrategy: ExportStorageStrategy, productExportService: ProductExportService, productExportQueueService: ProductExportQueueService);
|
|
13
|
+
private validateExportFileName;
|
|
11
14
|
exportProducts(ctx: RequestContext, res: Response, fileName: string, customFields: string, exportAssetsAs: 'url' | 'json', selectedExportFields: string, selection: ID[]): Promise<void>;
|
|
12
15
|
exportAllProducts(ctx: RequestContext, fileName: string, customFields: string, exportAssetsAs: 'url' | 'json', selectedExportFields: string): Promise<{
|
|
13
16
|
success: boolean;
|
|
@@ -23,10 +26,6 @@ export declare class ProductExportController {
|
|
|
23
26
|
name: string;
|
|
24
27
|
type: string;
|
|
25
28
|
}[]>;
|
|
26
|
-
getExportFiles(ctx: RequestContext): Promise<
|
|
27
|
-
|
|
28
|
-
size: number;
|
|
29
|
-
created: Date;
|
|
30
|
-
modified: Date;
|
|
31
|
-
}[]>;
|
|
29
|
+
getExportFiles(ctx: RequestContext): Promise<import("../services/export-storage/export-storage-strategy").ExportedFileMetadata[]>;
|
|
30
|
+
private sanitizeFileName;
|
|
32
31
|
}
|
|
@@ -1,43 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
7
|
};
|
|
24
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
-
var ownKeys = function(o) {
|
|
26
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
-
var ar = [];
|
|
28
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
-
return ar;
|
|
30
|
-
};
|
|
31
|
-
return ownKeys(o);
|
|
32
|
-
};
|
|
33
|
-
return function (mod) {
|
|
34
|
-
if (mod && mod.__esModule) return mod;
|
|
35
|
-
var result = {};
|
|
36
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
-
__setModuleDefault(result, mod);
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
|
-
})();
|
|
41
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
42
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
43
10
|
};
|
|
@@ -50,18 +17,35 @@ const core_1 = require("@vendure/core");
|
|
|
50
17
|
const common_1 = require("@nestjs/common");
|
|
51
18
|
const product_export_service_1 = require("../services/product-export.service");
|
|
52
19
|
const product_export_queue_service_1 = require("../services/product-export-queue.service");
|
|
53
|
-
const fs_1 = require("fs");
|
|
54
|
-
const path = __importStar(require("path"));
|
|
55
20
|
const constants_1 = require("../constants");
|
|
56
21
|
let ProductExportController = class ProductExportController {
|
|
57
22
|
options;
|
|
23
|
+
exportStorageStrategy;
|
|
58
24
|
productExportService;
|
|
59
25
|
productExportQueueService;
|
|
60
|
-
constructor(options, productExportService, productExportQueueService) {
|
|
26
|
+
constructor(options, exportStorageStrategy, productExportService, productExportQueueService) {
|
|
61
27
|
this.options = options;
|
|
28
|
+
this.exportStorageStrategy = exportStorageStrategy;
|
|
62
29
|
this.productExportService = productExportService;
|
|
63
30
|
this.productExportQueueService = productExportQueueService;
|
|
64
31
|
}
|
|
32
|
+
validateExportFileName(fileName) {
|
|
33
|
+
const trimmed = fileName.trim();
|
|
34
|
+
if (!trimmed) {
|
|
35
|
+
throw new Error('Invalid fileName');
|
|
36
|
+
}
|
|
37
|
+
if (trimmed.includes('/') || trimmed.includes('\\')) {
|
|
38
|
+
throw new Error('Invalid fileName');
|
|
39
|
+
}
|
|
40
|
+
if (trimmed.includes('..')) {
|
|
41
|
+
throw new Error('Invalid fileName');
|
|
42
|
+
}
|
|
43
|
+
// Prevent header injection in the download route.
|
|
44
|
+
if (/[\r\n"]/g.test(trimmed)) {
|
|
45
|
+
throw new Error('Invalid fileName');
|
|
46
|
+
}
|
|
47
|
+
return trimmed;
|
|
48
|
+
}
|
|
65
49
|
async exportProducts(ctx, res, fileName, customFields, exportAssetsAs, selectedExportFields, selection) {
|
|
66
50
|
try {
|
|
67
51
|
if (!selection ||
|
|
@@ -82,6 +66,7 @@ let ProductExportController = class ProductExportController {
|
|
|
82
66
|
else if (!fileName.endsWith('.csv')) {
|
|
83
67
|
fileName += '.csv';
|
|
84
68
|
}
|
|
69
|
+
fileName = this.validateExportFileName(fileName);
|
|
85
70
|
if (!customFields) {
|
|
86
71
|
customFields = '';
|
|
87
72
|
}
|
|
@@ -110,6 +95,7 @@ let ProductExportController = class ProductExportController {
|
|
|
110
95
|
if (!fileName.endsWith('.csv')) {
|
|
111
96
|
fileName += '.csv';
|
|
112
97
|
}
|
|
98
|
+
fileName = this.validateExportFileName(fileName);
|
|
113
99
|
if (!customFields) {
|
|
114
100
|
customFields = '';
|
|
115
101
|
}
|
|
@@ -126,21 +112,14 @@ let ProductExportController = class ProductExportController {
|
|
|
126
112
|
}
|
|
127
113
|
async downloadExport(ctx, res, fileName) {
|
|
128
114
|
try {
|
|
129
|
-
const
|
|
130
|
-
const
|
|
131
|
-
const filePath = path.join(exportsDir, fileName);
|
|
132
|
-
if (!filePath.startsWith(exportsDir)) {
|
|
133
|
-
throw new common_1.UnprocessableEntityException('Invalid file path');
|
|
134
|
-
}
|
|
135
|
-
if (!(0, fs_1.existsSync)(filePath)) {
|
|
136
|
-
throw new common_1.UnprocessableEntityException('File not found');
|
|
137
|
-
}
|
|
115
|
+
const validatedFileName = this.validateExportFileName(fileName);
|
|
116
|
+
const sanitizedFileName = this.sanitizeFileName(validatedFileName);
|
|
138
117
|
res.set({
|
|
139
118
|
'Content-Type': 'text/csv',
|
|
140
|
-
'Content-Disposition': `attachment; filename="${
|
|
119
|
+
'Content-Disposition': `attachment; filename="${sanitizedFileName}"`,
|
|
141
120
|
});
|
|
142
|
-
const
|
|
143
|
-
|
|
121
|
+
const stream = await this.exportStorageStrategy.getExportFileStream(ctx, validatedFileName);
|
|
122
|
+
stream.pipe(res);
|
|
144
123
|
}
|
|
145
124
|
catch (e) {
|
|
146
125
|
throw new common_1.UnprocessableEntityException(e.message);
|
|
@@ -148,16 +127,8 @@ let ProductExportController = class ProductExportController {
|
|
|
148
127
|
}
|
|
149
128
|
async deleteExport(ctx, fileName) {
|
|
150
129
|
try {
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
const filePath = path.join(exportsDir, fileName);
|
|
154
|
-
if (!filePath.startsWith(exportsDir)) {
|
|
155
|
-
throw new common_1.UnprocessableEntityException('Invalid file path');
|
|
156
|
-
}
|
|
157
|
-
if (!(0, fs_1.existsSync)(filePath)) {
|
|
158
|
-
throw new common_1.UnprocessableEntityException('File not found');
|
|
159
|
-
}
|
|
160
|
-
await fs_1.promises.unlink(filePath);
|
|
130
|
+
const validatedFileName = this.validateExportFileName(fileName);
|
|
131
|
+
await this.exportStorageStrategy.deleteExportFile(ctx, validatedFileName);
|
|
161
132
|
return {
|
|
162
133
|
success: true,
|
|
163
134
|
message: 'File deleted successfully',
|
|
@@ -172,30 +143,19 @@ let ProductExportController = class ProductExportController {
|
|
|
172
143
|
}
|
|
173
144
|
async getExportFiles(ctx) {
|
|
174
145
|
try {
|
|
175
|
-
|
|
176
|
-
const exportsDir = path.join(process.cwd(), 'static', 'exports', channelToken);
|
|
177
|
-
if (!(0, fs_1.existsSync)(exportsDir)) {
|
|
178
|
-
return [];
|
|
179
|
-
}
|
|
180
|
-
const files = await fs_1.promises.readdir(exportsDir);
|
|
181
|
-
const fileList = await Promise.all(files
|
|
182
|
-
.filter((file) => file.endsWith('.csv') && !file.endsWith('.tmp'))
|
|
183
|
-
.map(async (file) => {
|
|
184
|
-
const filePath = path.join(exportsDir, file);
|
|
185
|
-
const stats = await fs_1.promises.stat(filePath);
|
|
186
|
-
return {
|
|
187
|
-
fileName: file,
|
|
188
|
-
size: stats.size,
|
|
189
|
-
created: stats.birthtime,
|
|
190
|
-
modified: stats.mtime,
|
|
191
|
-
};
|
|
192
|
-
}));
|
|
193
|
-
return fileList.sort((a, b) => b.created.getTime() - a.created.getTime());
|
|
146
|
+
return await this.exportStorageStrategy.listExportFiles(ctx);
|
|
194
147
|
}
|
|
195
148
|
catch (e) {
|
|
196
149
|
throw new common_1.UnprocessableEntityException(e.message);
|
|
197
150
|
}
|
|
198
151
|
}
|
|
152
|
+
sanitizeFileName(fileName) {
|
|
153
|
+
const cleaned = fileName.replace(/[\r\n"]/g, '');
|
|
154
|
+
if (!cleaned || cleaned.trim().length === 0) {
|
|
155
|
+
return 'export.csv';
|
|
156
|
+
}
|
|
157
|
+
return cleaned;
|
|
158
|
+
}
|
|
199
159
|
};
|
|
200
160
|
exports.ProductExportController = ProductExportController;
|
|
201
161
|
__decorate([
|
|
@@ -257,7 +217,8 @@ __decorate([
|
|
|
257
217
|
exports.ProductExportController = ProductExportController = __decorate([
|
|
258
218
|
(0, common_1.Controller)('product-export'),
|
|
259
219
|
__param(0, (0, common_1.Inject)(constants_1.PRODUCT_IMPORT_EXPORT_PLUGIN_OPTIONS)),
|
|
260
|
-
|
|
220
|
+
__param(1, (0, common_1.Inject)(constants_1.EXPORT_STORAGE_STRATEGY)),
|
|
221
|
+
__metadata("design:paramtypes", [Object, Object, product_export_service_1.ProductExportService,
|
|
261
222
|
product_export_queue_service_1.ProductExportQueueService])
|
|
262
223
|
], ProductExportController);
|
|
263
224
|
//# sourceMappingURL=product-export.controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-export.controller.js","sourceRoot":"","sources":["../../../../../packages/product-import-export-plugin/src/api/product-export.controller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"product-export.controller.js","sourceRoot":"","sources":["../../../../../packages/product-import-export-plugin/src/api/product-export.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,wCAAuD;AACvD,2CAWuB;AAEvB,+EAAyE;AACzE,2FAAoF;AACpF,4CAA4F;AAKrF,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAEsB;IACb;IACjC;IACA;IAJV,YACwD,OAA0B,EACvC,qBAA4C,EAC7E,oBAA0C,EAC1C,yBAAoD;QAHN,YAAO,GAAP,OAAO,CAAmB;QACvC,0BAAqB,GAArB,qBAAqB,CAAuB;QAC7E,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,8BAAyB,GAAzB,yBAAyB,CAA2B;IAC3D,CAAC;IAEI,sBAAsB,CAAC,QAAgB;QAC7C,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAA;QAC/B,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAA;QACrC,CAAC;QAED,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACpD,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAA;QACrC,CAAC;QAED,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAA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EAAC,YAAY,CAAC;IAEhB,WAAA,IAAA,UAAG,GAAE,CAAA;IACL,WAAA,IAAA,cAAK,EAAC,UAAU,CAAC,CAAA;IACjB,WAAA,IAAA,cAAK,EAAC,cAAc,CAAC,CAAA;IACrB,WAAA,IAAA,cAAK,EAAC,gBAAgB,CAAC,CAAA;IACvB,WAAA,IAAA,cAAK,EAAC,sBAAsB,CAAC,CAAA;;qCAJlB,qBAAc;;gEAyC3B;AAGK;IADL,IAAA,YAAG,EAAC,oBAAoB,CAAC;IAEvB,WAAA,IAAA,UAAG,GAAE,CAAA;IACL,WAAA,IAAA,YAAG,GAAE,CAAA;IACL,WAAA,IAAA,cAAK,EAAC,UAAU,CAAC,CAAA;;qCAFN,qBAAc;;6DAiB3B;AAGK;IADL,IAAA,eAAM,EAAC,kBAAkB,CAAC;IACP,WAAA,IAAA,UAAG,GAAE,CAAA;IAAuB,WAAA,IAAA,cAAK,EAAC,UAAU,CAAC,CAAA;;qCAAlC,qBAAc;;2DAY5C;AAGK;IADL,IAAA,aAAI,EAAC,eAAe,CAAC;IACC,WAAA,IAAA,UAAG,GAAE,CAAA;IAAuB,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAvB,qBAAc;;8DAE/C;AAGK;IADL,IAAA,YAAG,EAAC,gBAAgB,CAAC;IACA,WAAA,IAAA,UAAG,GAAE,CAAA;;qCAAM,qBAAc;;6DAM9C;kCA1LU,uBAAuB;IADnC,IAAA,mBAAU,EAAC,gBAAgB,CAAC;IAGxB,WAAA,IAAA,eAAM,EAAC,gDAAoC,CAAC,CAAA;IAC5C,WAAA,IAAA,eAAM,EAAC,mCAAuB,CAAC,CAAA;qDACF,6CAAoB;QACf,wDAAyB;GALnD,uBAAuB,CAqMnC"}
|
package/src/constants.d.ts
CHANGED
package/src/constants.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.loggerCtx = exports.PRODUCT_IMPORT_EXPORT_PLUGIN_OPTIONS = void 0;
|
|
3
|
+
exports.loggerCtx = exports.EXPORT_STORAGE_STRATEGY = exports.PRODUCT_IMPORT_EXPORT_PLUGIN_OPTIONS = void 0;
|
|
4
4
|
exports.PRODUCT_IMPORT_EXPORT_PLUGIN_OPTIONS = Symbol('PRODUCT_IMPORT_EXPORT_PLUGIN_OPTIONS');
|
|
5
|
+
exports.EXPORT_STORAGE_STRATEGY = Symbol('EXPORT_STORAGE_STRATEGY');
|
|
5
6
|
exports.loggerCtx = 'ProductImportExportPlugin';
|
|
6
7
|
//# sourceMappingURL=constants.js.map
|
package/src/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../packages/product-import-export-plugin/src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,oCAAoC,GAAG,MAAM,CAAC,sCAAsC,CAAC,CAAA;AACrF,QAAA,SAAS,GAAG,2BAA2B,CAAA"}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../packages/product-import-export-plugin/src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,oCAAoC,GAAG,MAAM,CAAC,sCAAsC,CAAC,CAAA;AACrF,QAAA,uBAAuB,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAA;AAC3D,QAAA,SAAS,GAAG,2BAA2B,CAAA"}
|
package/src/dashboard/import.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import { Button, Switch, Label, RadioGroup, RadioGroupItem } from '@vendure/dash
|
|
|
2
2
|
import { UploadIcon } from 'lucide-react'
|
|
3
3
|
import { useState, useRef, useEffect } from 'react'
|
|
4
4
|
import { toast } from 'sonner'
|
|
5
|
-
import
|
|
5
|
+
import { LanguageCode, Channel } from '@vendure/core'
|
|
6
6
|
import { size, startsWith, endsWith, uniq } from 'lodash-es'
|
|
7
7
|
import {
|
|
8
8
|
getServerLocation,
|
package/src/index.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
export * from './product-import-export.plugin';
|
|
2
2
|
export type { PluginInitOptions, UpdatingStrategy, JsonAsset } from './types';
|
|
3
|
+
export * from './services/export-storage/export-storage-strategy';
|
|
4
|
+
export * from './services/export-storage/local-export-storage-strategy';
|
|
5
|
+
export * from './services/export-storage/s3-export-storage-strategy';
|
|
6
|
+
export type { S3ExportStorageConfig } from './services/export-storage.util';
|
package/src/index.js
CHANGED
|
@@ -15,4 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./product-import-export.plugin"), exports);
|
|
18
|
+
__exportStar(require("./services/export-storage/export-storage-strategy"), exports);
|
|
19
|
+
__exportStar(require("./services/export-storage/local-export-storage-strategy"), exports);
|
|
20
|
+
__exportStar(require("./services/export-storage/s3-export-storage-strategy"), exports);
|
|
18
21
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/product-import-export-plugin/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iEAA8C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/product-import-export-plugin/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iEAA8C;AAG9C,oFAAiE;AACjE,0FAAuE;AACvE,uFAAoE"}
|
|
@@ -42,6 +42,7 @@ var ProductImportExportPlugin_1;
|
|
|
42
42
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
43
|
exports.ProductImportExportPlugin = void 0;
|
|
44
44
|
const core_1 = require("@vendure/core");
|
|
45
|
+
const core_2 = require("@nestjs/core");
|
|
45
46
|
const path = __importStar(require("path"));
|
|
46
47
|
const lodash_1 = require("lodash");
|
|
47
48
|
const constants_1 = require("./constants");
|
|
@@ -58,6 +59,7 @@ const product_import_service_1 = require("./services/product-import.service");
|
|
|
58
59
|
const extended_fast_importer_service_1 = require("./services/extended-fast-importer.service");
|
|
59
60
|
const product_export_service_1 = require("./services/product-export.service");
|
|
60
61
|
const product_export_queue_service_1 = require("./services/product-export-queue.service");
|
|
62
|
+
const local_export_storage_strategy_1 = require("./services/export-storage/local-export-storage-strategy");
|
|
61
63
|
let ProductImportExportPlugin = class ProductImportExportPlugin {
|
|
62
64
|
static { ProductImportExportPlugin_1 = this; }
|
|
63
65
|
static options;
|
|
@@ -69,6 +71,10 @@ let ProductImportExportPlugin = class ProductImportExportPlugin {
|
|
|
69
71
|
restoreSoftDeleted: true,
|
|
70
72
|
};
|
|
71
73
|
}
|
|
74
|
+
// Ensure exportOptions exists
|
|
75
|
+
if (!options.exportOptions) {
|
|
76
|
+
options.exportOptions = {};
|
|
77
|
+
}
|
|
72
78
|
// Setup export options
|
|
73
79
|
if (!options.exportOptions.defaultFileName) {
|
|
74
80
|
options.exportOptions.defaultFileName = 'products_export.csv';
|
|
@@ -137,6 +143,23 @@ exports.ProductImportExportPlugin = ProductImportExportPlugin = ProductImportExp
|
|
|
137
143
|
provide: constants_1.PRODUCT_IMPORT_EXPORT_PLUGIN_OPTIONS,
|
|
138
144
|
useFactory: () => ProductImportExportPlugin.options,
|
|
139
145
|
},
|
|
146
|
+
{
|
|
147
|
+
provide: constants_1.EXPORT_STORAGE_STRATEGY,
|
|
148
|
+
useFactory: async (moduleRef) => {
|
|
149
|
+
const exportOptions = ProductImportExportPlugin.options?.exportOptions;
|
|
150
|
+
const injector = new core_1.Injector(moduleRef);
|
|
151
|
+
if (exportOptions?.storageStrategy) {
|
|
152
|
+
return exportOptions.storageStrategy;
|
|
153
|
+
}
|
|
154
|
+
if (exportOptions?.storageStrategyFactory) {
|
|
155
|
+
return await exportOptions.storageStrategyFactory(injector);
|
|
156
|
+
}
|
|
157
|
+
return new local_export_storage_strategy_1.LocalExportStorageStrategy({
|
|
158
|
+
baseDir: path.join(process.cwd(), 'static', 'exports'),
|
|
159
|
+
});
|
|
160
|
+
},
|
|
161
|
+
inject: [core_2.ModuleRef],
|
|
162
|
+
},
|
|
140
163
|
product_import_service_1.ProductImportService,
|
|
141
164
|
product_importer_1.ProductImporter,
|
|
142
165
|
extended_fast_importer_service_1.ExtendedFastImporterService,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-import-export.plugin.js","sourceRoot":"","sources":["../../../../packages/product-import-export-plugin/src/product-import-export.plugin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"product-import-export.plugin.js","sourceRoot":"","sources":["../../../../packages/product-import-export-plugin/src/product-import-export.plugin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAAiF;AAEjF,uCAAwC;AACxC,2CAA4B;AAC5B,mCAA6B;AAE7B,2CAA2F;AAG3F,iBAAiB;AACjB,+EAAyE;AACzE,+EAAyE;AACzE,+DAA6E;AAC7E,eAAe;AACf,oFAA+E;AAC/E,8EAAyE;AACzE,gFAAmF;AACnF,cAAc;AACd,8EAAwE;AACxE,8FAAuF;AACvF,8EAAwE;AACxE,0FAAmF;AACnF,2GAAoG;AA0D7F,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;;IACpC,MAAM,CAAC,OAAO,CAAmB;IAEjC,MAAM,CAAC,IAAI,CAAC,OAA0B;QACpC,uBAAuB;QACvB,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,cAAc,EAAE,CAAC;YAC1C,OAAO,CAAC,aAAa,CAAC,cAAc,GAAG;gBACrC,iBAAiB,EAAE,IAAI;gBACvB,kBAAkB,EAAE,IAAI;aACzB,CAAA;QACH,CAAC;QAED,8BAA8B;QAC9B,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;YAC3B,OAAO,CAAC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AC,sBAAsB,CAAC,QAAQ,CAAC,CAAA;oBAC7D,CAAC;oBAED,OAAO,IAAI,0DAA0B,CAAC;wBACpC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,SAAS,CAAC;qBACvD,CAAC,CAAA;gBACJ,CAAC;gBACD,MAAM,EAAE,CAAC,gBAAS,CAAC;aACpB;YACD,6CAAoB;YACpB,kCAAe;YACf,4DAA2B;YAC3B,4BAAY;YACZ,sCAAqB;YACrB,6CAAoB;YACpB,wDAAyB;SAC1B;QACD,WAAW,EAAE;YACX,mDAAuB;YACvB,mDAAuB;YACvB,uDAAmC;SACpC;QAED,aAAa,EAAE,CAAC,MAAM,EAAE,EAAE;YACxB,gCAAgC;YAChC,6CAA6C;YAC7C,4CAA4C;YAC5C,iCAAiC;YACjC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC;gBAC7B,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf,CAAC,CAAA;YACF,OAAO,MAAM,CAAA;QACf,CAAC;QACD,SAAS,EAAE,uBAAuB;QAClC,aAAa,EAAE,kBAAkB;KAClC,CAAC;GACW,yBAAyB,CAiFrC"}
|
|
@@ -130,7 +130,12 @@ export declare class ImportParser {
|
|
|
130
130
|
*/
|
|
131
131
|
parseProducts(input: string | Stream, mainLanguage?: LanguageCode): Promise<ParseResult<ParsedProductWithVariants>>;
|
|
132
132
|
private processRawRecords;
|
|
133
|
+
/**
|
|
134
|
+
* Maps a CSV column key (e.g. `product:relatedProducts:product`) to the Vendure custom field `name`.
|
|
135
|
+
*/
|
|
136
|
+
private resolveCustomFieldImportFieldName;
|
|
133
137
|
private validateCustomFields;
|
|
138
|
+
private parseCustomFieldsFromRow;
|
|
134
139
|
private isTranslatable;
|
|
135
140
|
private validateHeaderTranslations;
|
|
136
141
|
private parseProductFromRecord;
|