@haus-tech/product-import-export-plugin 3.6.3 → 3.6.4

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.
Files changed (33) hide show
  1. package/CHANGELOG.md +20 -64
  2. package/{README.mdx → README.md} +62 -35
  3. package/package.json +9 -9
  4. package/src/dashboard/bulk-export.tsx +1 -0
  5. package/src/dashboard/export-configuration-panel.tsx +448 -0
  6. package/src/dashboard/export-dialog.tsx +22 -285
  7. package/src/dashboard/export.tsx +52 -17
  8. package/src/dashboard/exported-list.tsx +176 -96
  9. package/src/dashboard/import.tsx +286 -149
  10. package/src/dashboard/index.tsx +27 -28
  11. package/src/dashboard/use-active-channel-key.ts +7 -0
  12. package/src/product-import-export.plugin.d.ts +6 -0
  13. package/src/product-import-export.plugin.js +29 -1
  14. package/src/product-import-export.plugin.js.map +1 -1
  15. package/src/providers/import-providers/asset-importer.js +27 -8
  16. package/src/providers/import-providers/asset-importer.js.map +1 -1
  17. package/src/providers/import-providers/import-parser.d.ts +1 -0
  18. package/src/providers/import-providers/import-parser.js +18 -2
  19. package/src/providers/import-providers/import-parser.js.map +1 -1
  20. package/src/providers/import-providers/product-importer.d.ts +10 -0
  21. package/src/providers/import-providers/product-importer.js +111 -20
  22. package/src/providers/import-providers/product-importer.js.map +1 -1
  23. package/src/services/export-storage/export-storage-strategy.d.ts +8 -0
  24. package/src/services/extended-fast-importer.service.js +20 -12
  25. package/src/services/extended-fast-importer.service.js.map +1 -1
  26. package/src/services/import-storage/import-job-storage-strategy.d.ts +9 -0
  27. package/src/services/product-export.service.d.ts +20 -6
  28. package/src/services/product-export.service.js +165 -40
  29. package/src/services/product-export.service.js.map +1 -1
  30. package/src/services/self-relation-custom-fields.d.ts +26 -0
  31. package/src/services/self-relation-custom-fields.js +67 -0
  32. package/src/services/self-relation-custom-fields.js.map +1 -0
  33. package/src/types.d.ts +7 -0
package/CHANGELOG.md CHANGED
@@ -1,85 +1,34 @@
1
- ## 3.3.11-next.1
2
-
3
- ### 🚀 Features
4
-
5
- - **product-import-export-plugin:** backport id export field + customExportColumns to 3.5 line (3.3.11-next.0) ([#22](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/pull/22))
6
-
7
- ## 3.3.11-next.0
8
-
9
- ### 🚀 Features
10
-
11
- - **product-import-export-plugin:** add progress reporting to product export process ([ed6220e](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/ed6220e))
12
- - **product-import-export-plugin:** optimize product export process and stock level retrieval ([d281929](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/d281929))
13
- - **product-import-export-plugin:** enhance email notification and import/export functionality ([c133dc5](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/c133dc5))
14
- - **product-import-export-plugin:** enforce import/export acceptance criteria and enhance documentation ([b1a93b6](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/b1a93b6))
15
- - **product-import-export-plugin:** update pre-version command and clean up export artifacts ([1cde024](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/1cde024))
16
- - **product-import-export-plugin:** optimize asset handling and caching in product importer ([9d2888e](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/9d2888e))
17
- - **product-import-export-plugin:** enhance testing and export functionality ([1764eb2](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/1764eb2))
1
+ ## 3.6.3
18
2
 
19
3
  ### 🩹 Fixes
20
4
 
21
- - **product-import-export-plugin:** ensure tax category is always assigned to product variants ([276bed5](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/276bed5))
22
- - **product-import-export-plugin:** poll exports list and restore featured asset on import ([2c61b48](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/2c61b48))
5
+ - **product-import-export-plugin:** secure REST API, stop leaking storage credentials ([#24](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/pull/24))
23
6
 
24
- ## 3.3.10-next.6
7
+ ## 3.6.2
25
8
 
26
- ### 🩹 Fixes
27
-
28
- - **product-import-export-plugin:** ensure tax category is always assigned to product variants ([276bed5](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/276bed5))
29
-
30
- ## 3.3.10-next.5
31
-
32
- ### 🚀 Features
33
-
34
- - **product-import-export-plugin:** add progress reporting to product export process ([ed6220e](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/ed6220e))
9
+ This was a version bump only for product-import-export-plugin to align it with other projects, there were no code changes.
35
10
 
36
- ## 3.3.10-next.4
11
+ ## 3.6.1
37
12
 
38
13
  ### 🚀 Features
39
14
 
40
- - **product-import-export-plugin:** optimize product export process and stock level retrieval ([d281929](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/d281929))
15
+ - add custom changelog renderer to filter out prerelease versions ([4412746](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/4412746))
41
16
 
42
- ## 3.3.10-next.3
43
-
44
- ### 🚀 Features
45
-
46
- - **product-import-export-plugin:** optimize product export process and stock level retrieval ([d281929](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/d281929))
47
-
48
- ## 3.3.10-next.2
49
-
50
- ### 🩹 Fixes
51
-
52
- - **product-import-export-plugin:** poll exports list and restore featured asset on import ([2c61b48](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/2c61b48))
53
-
54
- ## 3.3.2-next.2
17
+ ## 3.6.0
55
18
 
56
19
  ### 🚀 Features
57
20
 
21
+ - **product-import-export-plugin:** integrate active channel management into export and import components ([1d3eef1](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/1d3eef1))
22
+ - **product-import-export-plugin:** add installation ID and enhance e2e database management ([78eeffb](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/78eeffb))
23
+ - **product-import-export-plugin:** add popover help for export asset options ([7aa8373](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/7aa8373))
24
+ - **product-import-export-plugin:** implement export configuration panel and enhance export dialog ([d2e1f34](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/d2e1f34))
25
+ - **product-import-export-plugin:** enhance product export functionality and update tests ([de56d44](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/de56d44))
26
+ - **product-import-export-plugin:** update dependencies and enhance import/export functionality ([9c78665](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/9c78665))
58
27
  - **product-import-export-plugin:** enhance email notification and import/export functionality ([c133dc5](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/c133dc5))
59
-
60
- ## 3.3.2-next.1
61
-
62
- ### 🚀 Features
63
-
64
28
  - **product-import-export-plugin:** enforce import/export acceptance criteria and enhance documentation ([b1a93b6](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/b1a93b6))
65
29
  - **product-import-export-plugin:** update pre-version command and clean up export artifacts ([1cde024](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/1cde024))
66
-
67
- ## 3.3.2-next.0
68
-
69
- ### 🚀 Features
70
-
71
30
  - **product-import-export-plugin:** optimize asset handling and caching in product importer ([9d2888e](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/9d2888e))
72
31
  - **product-import-export-plugin:** enhance testing and export functionality ([1764eb2](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/1764eb2))
73
- - **product-import-export-plugin:** enforce import/export acceptance criteria (column-presence updates, multi-variant option requirements, no ProductID export option, clearer import CTA, and strict required relation custom-field validation)
74
-
75
- ## 3.3.1
76
-
77
- This was a version bump only for product-import-export-plugin to align it with other projects, there were no code changes.
78
-
79
- ## 3.3.1-next.0
80
-
81
- ### 🚀 Features
82
-
83
32
  - enhance file name validation for product export functionality ([f9d5a45](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/f9d5a45))
84
33
  - enhance export storage strategy configuration ([d589906](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/d589906))
85
34
  - abstract logic into separate strategies ([1c7d0c7](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/1c7d0c7))
@@ -88,8 +37,15 @@ This was a version bump only for product-import-export-plugin to align it with o
88
37
 
89
38
  ### 🩹 Fixes
90
39
 
40
+ - **plugins:** correct Vendure compatibility and add hub-required JSDoc ([ae089bd](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/ae089bd))
41
+ - **product-import-export-plugin:** poll exports list and restore featured asset on import ([644099a](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/644099a))
42
+ - **product-import-export-plugin:** update dashboard and export settings screenshots ([2129b39](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/2129b39))
91
43
  - correct file path handling and ensure consistent file name sanitization in product export ([03a5bb5](https://github.com/WeAreHausTech/haus-tech-vendure-plugins-public/commit/03a5bb5))
92
44
 
45
+ ## 3.3.1
46
+
47
+ This was a version bump only for product-import-export-plugin to align it with other projects, there were no code changes.
48
+
93
49
  ## 3.2.1
94
50
 
95
51
  This was a version bump only for product-import-export-plugin to align it with other projects, there were no code changes.
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  name: product-import-export-plugin
3
- title: Product Import & Export Plugin
3
+ title: Product Import & Export
4
4
  description: Vendure plugin for importing and exporting product data via CSV.
5
- version: 3.3.1
5
+ version: 3.6.3
6
6
  tags:
7
7
  - vendure
8
8
  - plugin
@@ -19,20 +19,20 @@ A Vendure plugin for importing and exporting product data via CSV. Supports bulk
19
19
 
20
20
  ## Features
21
21
 
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
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
26
26
 
27
27
  ![Dashboard UI](assets/Screenshot-dashboard-ui.png)
28
28
 
29
29
  ## Compatibility
30
30
 
31
- Vendure **^2.0.0** or **^3.0.0**
31
+ Vendure **^3.6.0**
32
32
 
33
33
  ## Getting started
34
34
 
35
- ```bash npm2yarn
35
+ ```bash
36
36
  npm install @haus-tech/product-import-export-plugin
37
37
  ```
38
38
 
@@ -65,13 +65,13 @@ export const config = {
65
65
 
66
66
  ### Import options
67
67
 
68
- | Option | Type | Default | Description |
69
- | ------------------------ | ----------------------------------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------- |
70
- | `updateProductSlug` | `boolean` | `true` | Update product slug from the `name` field in the CSV |
71
- | `restoreSoftDeleted` | `boolean` | `true` | Restore soft-deleted products/variants found by id or SKU during import. If `false`, new products will be created instead. |
72
- | `storageStrategy` | `ImportJobStorageStrategy` | local disk | Strategy instance for queued import file storage and retrieval. |
73
- | `storageStrategyFactory` | `(injector: Injector) => ImportJobStorageStrategy` | `undefined` | Factory for DI-aware strategy creation (recommended for S3/remote storage). |
74
- | `importJobStorage` | `'local' \| 's3'` | `'local'` | Deprecated compatibility flag. Prefer `storageStrategy` / `storageStrategyFactory`. |
68
+ | Option | Type | Default | Description |
69
+ | ------------------------ | -------------------------------------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------- |
70
+ | `updateProductSlug` | `boolean` | `true` | Update product slug from the `name` field in the CSV |
71
+ | `restoreSoftDeleted` | `boolean` | `true` | Restore soft-deleted products/variants found by id or SKU during import. If `false`, new products will be created instead. |
72
+ | `storageStrategy` | `ImportJobStorageStrategy` | local disk | Strategy instance for queued import file storage and retrieval. |
73
+ | `storageStrategyFactory` | `(injector: Injector) => ImportJobStorageStrategy` | `undefined` | Factory for DI-aware strategy creation (recommended for S3/remote storage). |
74
+ | `importJobStorage` | `'local' \| 's3'` | `'local'` | Deprecated compatibility flag. Prefer `storageStrategy` / `storageStrategyFactory`. |
75
75
 
76
76
  Available import storage strategies:
77
77
 
@@ -95,8 +95,8 @@ Available import storage strategies:
95
95
 
96
96
  The plugin supports configurable storage for exported files:
97
97
 
98
- * **S3** – Stores export files in an S3-compatible bucket
99
- * **Disk (default)** – Saves files locally on the server
98
+ - **S3** – Stores export files in an S3-compatible bucket
99
+ - **Disk (default)** – Saves files locally on the server
100
100
 
101
101
  ### Custom export columns
102
102
 
@@ -140,22 +140,21 @@ export const config = {
140
140
 
141
141
  ### Optional columns
142
142
 
143
- | Column | Format | Example |
144
- | ----------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
145
- | `id` | Vendure product id | `42` |
146
- | `name`, `slug`, `description` | Text, or `name:en`, `name:sv` for translations | `My Product` |
147
- | `assets` | Pipe-separated URLs, or JSON `[{"url":"...","name":"..."}]` | `https://example.com/1.jpg\|https://example.com/2.jpg` |
148
- | `facets` | `facet:value` pairs, pipe-separated | `Brand:Acme\|Category:Electronics` |
149
- | `optionGroups` | Pipe-separated group names | `Size\|Color` |
150
- | `optionValues` | Pipe-separated values (order matches option groups) | `Large\|Blue` |
151
- | `price` | Number (in smallest currency unit) | `9999` |
152
- | `taxCategory` | Tax category name | `standard` |
153
- | `stockOnHand` | Number | `100` |
154
- | `trackInventory` | `true` or `false` | `true` |
155
- | `variantAssets` | Same format as `assets` | `https://example.com/variant.jpg` |
156
- | `variantFacets` | Same format as `facets` | `Material:Cotton` |
157
- | `enabled` | `true` or `false` | `true` |
158
- | Custom fields | Column name = custom field name; value depends on field type | Add columns for any Product or ProductVariant custom fields defined in your Vendure config |
143
+ | Column | Format | Example |
144
+ | ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
145
+ | `name`, `slug`, `description` | Text, or `name:en`, `name:sv` for translations | `My Product` |
146
+ | `assets` | Pipe-separated URLs, or JSON `[{"url":"...","name":"..."}]` | `https://example.com/1.jpg\|https://example.com/2.jpg` |
147
+ | `facets` | `facet:value` pairs, pipe-separated | `Brand:Acme\|Category:Electronics` |
148
+ | `optionGroups` | Pipe-separated group names. Use `name:code` to share a group across products (see [Sharing option groups](#sharing-option-groups)) | `Size\|Color` or `size:shoe-size` |
149
+ | `optionValues` | Pipe-separated values (order matches option groups) | `Large\|Blue` |
150
+ | `price` | Number (in smallest currency unit) | `9999` |
151
+ | `taxCategory` | Tax category name | `standard` |
152
+ | `stockOnHand` | Number | `100` |
153
+ | `trackInventory` | `true` or `false` | `true` |
154
+ | `variantAssets` | Same format as `assets` | `https://example.com/variant.jpg` |
155
+ | `variantFacets` | Same format as `facets` | `Material:Cotton` |
156
+ | `enabled` | `true` or `false` | `true` |
157
+ | Custom fields | Column name = custom field name; value depends on field type | Add columns for any Product or ProductVariant custom fields defined in your Vendure config. Relation custom fields export the related entity's id (`id\|id` for list fields), including fields that relate a product or variant to its own entity type. |
159
158
 
160
159
  #### Import behavior rules
161
160
 
@@ -163,6 +162,28 @@ export const config = {
163
162
  - If a column exists in the header but the cell is empty, that field is explicitly cleared.
164
163
  - For products with more than one variant, `optionGroups` and `optionValues` are required.
165
164
 
165
+ #### Sharing option groups
166
+
167
+ By default, each product gets its own option groups. To **share an option group** across
168
+ multiple products (e.g. a common "Size" group for all shoes), use the `name:code` syntax in the
169
+ `optionGroups` column: `size:shoe-size`. All products that reference the same code will share
170
+ a single option group. Products using a plain name (e.g. just `size`) will each get their own
171
+ independent option group.
172
+
173
+ ```csv
174
+ ...optionGroups , optionValues , ...
175
+ # Each shoe product shares a single "shoe-size" option group:
176
+ "size:shoe-size" , Small , ...
177
+ "size:shoe-size" , Medium , ...
178
+ # This product gets its own independent "size" group:
179
+ "size" , 4GB , ...
180
+ ```
181
+
182
+ The first product to reference a given code defines the full set of option values for that
183
+ shared group; subsequent products may use any subset of those values. Codes are language-
184
+ agnostic — only the `name` portion before the colon is translated per language column
185
+ (`optionGroups:en`, `optionGroups:sv`, etc.).
186
+
166
187
  #### Multi-language support
167
188
 
168
189
  Use language-specific columns by suffixing the field name with the language code. The language codes must match those configured in your Vendure instance (e.g. `en`, `sv`).
@@ -212,8 +233,10 @@ The Admin UI offers basic import and export. Some features such as the export-al
212
233
  2. Configure export fields (assets, facets, custom fields, etc.).
213
234
  - For products with more than one variant, `optionGroups` and `optionValues` must be included.
214
235
  - `id` (the Vendure product id) is available as a selectable export field. It is written after the translated `name`/`slug`/`description` columns, so it is never CSV column 0, since import treats column 0 positionally as a product id for by-id matching.
215
- - If `customFields` are not selected, no custom-field columns are written to the CSV.
216
236
  - If `customExportColumns` is configured, only the columns whose `name` is selected are written to the CSV.
237
+ - The job reports progress per page; the Dashboard job queue shows it.
238
+ - `productId` is not available as a selectable export field.
239
+ - If `customFields` are not selected, no custom-field columns are written to the CSV.
217
240
  3. Choose asset format: URL or JSON.
218
241
  4. Start the export (it is added to a job queue and runs in the background).
219
242
  5. Download the CSV when the export is complete. Your downloaded files will be listed in the export view.
@@ -230,7 +253,11 @@ Note: templates for `@vendure/email-plugin` should be valid MJML.
230
253
 
231
254
  ```typescript
232
255
  import path from 'path'
233
- import { DefaultEmailPlugin, FileBasedTemplateLoader, defaultEmailHandlers } from '@vendure/email-plugin'
256
+ import {
257
+ DefaultEmailPlugin,
258
+ FileBasedTemplateLoader,
259
+ defaultEmailHandlers,
260
+ } from '@vendure/email-plugin'
234
261
  import {
235
262
  withProductExportedHandler,
236
263
  withProductExportedTemplateFallback,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haus-tech/product-import-export-plugin",
3
- "version": "3.6.3",
3
+ "version": "3.6.4",
4
4
  "description": "A Vendure plugin for importing and exporting products using a CSV file",
5
5
  "author": "Haus Tech",
6
6
  "repository": {
@@ -35,7 +35,7 @@
35
35
  "files": [
36
36
  "src",
37
37
  "assets",
38
- "README.mdx",
38
+ "README.md",
39
39
  "CHANGELOG.md"
40
40
  ],
41
41
  "scripts": {
@@ -46,20 +46,20 @@
46
46
  },
47
47
  "dependencies": {
48
48
  "@aws-sdk/client-s3": "^3.744.0",
49
- "axios": "^1.7.0",
50
- "bottleneck": "^2.19.5",
49
+ "axios": "^1.16.1",
51
50
  "fs-extra": "^11.2.0",
52
- "lodash": "^4.17.21"
51
+ "lodash": "^4.18.1"
53
52
  },
54
53
  "devDependencies": {
55
54
  "@types/fs-extra": "^11.0.4",
56
- "csv-parse": "^5.6.0",
55
+ "@vendure/email-plugin": "3.6.3",
56
+ "csv-parse": "^6.0.0",
57
57
  "csv-stringify": "^6.6.0"
58
58
  },
59
59
  "peerDependencies": {
60
- "@vendure/core": "^2.0.0 || ^3.0.0",
61
- "@vendure/email-plugin": "^2.0.0 || ^3.0.0",
62
- "csv-parse": "^5.5.6",
60
+ "@vendure/core": "^3.6.0",
61
+ "@vendure/email-plugin": "^3.6.0",
62
+ "csv-parse": "^6.0.0",
63
63
  "csv-stringify": "^6.5.1",
64
64
  "slug": "^9.1.0"
65
65
  },
@@ -22,6 +22,7 @@ export function ExportProductsBulkAction({
22
22
  return (
23
23
  <>
24
24
  <DataTableBulkActionItem
25
+ closeOnClick={false}
25
26
  onClick={() => setDialogOpen(true)}
26
27
  label="Export products to CSV"
27
28
  icon={DownloadIcon}