@haus-tech/product-import-export-plugin 3.6.0-next.2 → 3.6.2

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 CHANGED
@@ -1,3 +1,9 @@
1
+ ## 3.6.0-next.2
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - **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))
6
+
1
7
  ## 3.6.0-next.1
2
8
 
3
9
  ### 🚀 Features
package/README.md ADDED
@@ -0,0 +1,231 @@
1
+ <!-- This file is generated from README.mdx by scripts/update-readmes.ts. Do not edit by hand. -->
2
+
3
+ # Product Import Export Plugin
4
+
5
+ A Vendure plugin for importing and exporting product data via CSV. Supports bulk product management and data migration between environments.
6
+
7
+ ## Features
8
+
9
+ - **Import** – Bulk upload products from CSV with validation, custom fields, assets, facets, and variants
10
+ - **Export** – Export products to CSV with selected fields; export all products or a selection
11
+ - **Storage strategies** – Store exported files in S3 or locally on disk (with automatic fallback)
12
+ - **UI** – Admin UI and Dashboard integration for import and export
13
+
14
+ ![Dashboard UI](assets/Screenshot-dashboard-ui.png)
15
+
16
+ ## Compatibility
17
+
18
+ Vendure **^3.6.0**
19
+
20
+ ## Getting started
21
+
22
+ ```bash
23
+ npm install @haus-tech/product-import-export-plugin
24
+ ```
25
+
26
+ ## Configuration
27
+
28
+ Add the plugin to your Vendure configuration.
29
+
30
+ ```typescript
31
+ export const config = {
32
+ plugins: [
33
+ ProductImportExportPlugin.init({
34
+ importOptions: {}, // Configure import options
35
+ exportOptions: {
36
+ storageStrategy: 's3', // 's3' | 'disk'
37
+ s3Options: {
38
+ bucket: 'your-bucket',
39
+ region: 'your-region',
40
+ credentials: {
41
+ accessKeyId: '...',
42
+ secretAccessKey: '...',
43
+ },
44
+ },
45
+ },
46
+ }),
47
+ ],
48
+ }
49
+ ```
50
+
51
+ ## Configuration Options
52
+
53
+ ### Import options
54
+
55
+ | Option | Type | Default | Description |
56
+ | ------------------------ | -------------------------------------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------- |
57
+ | `updateProductSlug` | `boolean` | `true` | Update product slug from the `name` field in the CSV |
58
+ | `restoreSoftDeleted` | `boolean` | `true` | Restore soft-deleted products/variants found by id or SKU during import. If `false`, new products will be created instead. |
59
+ | `storageStrategy` | `ImportJobStorageStrategy` | local disk | Strategy instance for queued import file storage and retrieval. |
60
+ | `storageStrategyFactory` | `(injector: Injector) => ImportJobStorageStrategy` | `undefined` | Factory for DI-aware strategy creation (recommended for S3/remote storage). |
61
+ | `importJobStorage` | `'local' \| 's3'` | `'local'` | Deprecated compatibility flag. Prefer `storageStrategy` / `storageStrategyFactory`. |
62
+
63
+ Available import storage strategies:
64
+
65
+ - `LocalImportJobStorageStrategy` (default)
66
+ - `S3ImportJobStorageStrategy`
67
+
68
+ ### Export options
69
+
70
+ | Option | Type | Default | Description |
71
+ | ----------------------- | --------------------- | ----------------------- | ------------------------------------------------------------ |
72
+ | `defaultFileName` | `string` | `'products_export.csv'` | Default filename for exports |
73
+ | `exportAssetsAsOptions` | `('url' \| 'json')[]` | `['url', 'json']` | Available formats for asset export |
74
+ | `defaultExportAssetsAs` | `'url' \| 'json'` | `'url'` | Default asset export format |
75
+ | `defaultExportFields` | `string[]` | See above | Fields that will be pre-selected in the export UI |
76
+ | `requiredExportFields` | `string[]` | `['name', 'sku']` | Fields that must always be included |
77
+ | `storageStrategy` | `'s3' \| 'disk'` | `'disk'` | Where exported files are stored |
78
+ | `s3Options` | `object` | `undefined` | S3 configuration (required when `storageStrategy` is `'s3'`) |
79
+
80
+ ### Storage strategy
81
+
82
+ The plugin supports configurable storage for exported files:
83
+
84
+ - **S3** – Stores export files in an S3-compatible bucket
85
+ - **Disk (default)** – Saves files locally on the server
86
+
87
+ ## CSV Format for Import
88
+
89
+ ### Required columns
90
+
91
+ - `name` – Product name (use `name:en`, `name:sv` etc. for multiple languages)
92
+ - `sku` – Variant SKU (unique per variant)
93
+
94
+ ### Optional columns
95
+
96
+ | Column | Format | Example |
97
+ | ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
98
+ | `name`, `slug`, `description` | Text, or `name:en`, `name:sv` for translations | `My Product` |
99
+ | `assets` | Pipe-separated URLs, or JSON `[{"url":"...","name":"..."}]` | `https://example.com/1.jpg\|https://example.com/2.jpg` |
100
+ | `facets` | `facet:value` pairs, pipe-separated | `Brand:Acme\|Category:Electronics` |
101
+ | `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` |
102
+ | `optionValues` | Pipe-separated values (order matches option groups) | `Large\|Blue` |
103
+ | `price` | Number (in smallest currency unit) | `9999` |
104
+ | `taxCategory` | Tax category name | `standard` |
105
+ | `stockOnHand` | Number | `100` |
106
+ | `trackInventory` | `true` or `false` | `true` |
107
+ | `variantAssets` | Same format as `assets` | `https://example.com/variant.jpg` |
108
+ | `variantFacets` | Same format as `facets` | `Material:Cotton` |
109
+ | `enabled` | `true` or `false` | `true` |
110
+ | 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 |
111
+
112
+ #### Import behavior rules
113
+
114
+ - If a column is omitted from the CSV header, that field is left unchanged on existing products/variants.
115
+ - If a column exists in the header but the cell is empty, that field is explicitly cleared.
116
+ - For products with more than one variant, `optionGroups` and `optionValues` are required.
117
+
118
+ #### Sharing option groups
119
+
120
+ By default, each product gets its own option groups. To **share an option group** across
121
+ multiple products (e.g. a common "Size" group for all shoes), use the `name:code` syntax in the
122
+ `optionGroups` column: `size:shoe-size`. All products that reference the same code will share
123
+ a single option group. Products using a plain name (e.g. just `size`) will each get their own
124
+ independent option group.
125
+
126
+ ```csv
127
+ ...optionGroups , optionValues , ...
128
+ # Each shoe product shares a single "shoe-size" option group:
129
+ "size:shoe-size" , Small , ...
130
+ "size:shoe-size" , Medium , ...
131
+ # This product gets its own independent "size" group:
132
+ "size" , 4GB , ...
133
+ ```
134
+
135
+ The first product to reference a given code defines the full set of option values for that
136
+ shared group; subsequent products may use any subset of those values. Codes are language-
137
+ agnostic — only the `name` portion before the colon is translated per language column
138
+ (`optionGroups:en`, `optionGroups:sv`, etc.).
139
+
140
+ #### Multi-language support
141
+
142
+ 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`).
143
+
144
+ | Column pattern | Example columns | Use case |
145
+ | ------------------------ | ---------------------- | ------------------------------------------------ |
146
+ | `name:en`, `name:sv` | Product name per lang | Translated product names |
147
+ | `slug:en`, `slug:sv` | Slug per lang | Translated URLs |
148
+ | `description:en` | Description per lang | Translated descriptions |
149
+ | `facets:en`, `facets:sv` | Facets per lang | Translated facet names and values |
150
+ | `optionGroups:en` | Option groups per lang | Translated option group names (e.g. Size, Color) |
151
+ | `optionValues:en` | Option values per lang | Translated option values (e.g. Large, Blue) |
152
+
153
+ Example CSV with English and Swedish:
154
+
155
+ ```csv
156
+ name:en,name:sv,sku,facets:en,facets:sv
157
+ "Red Shirt","Röd tröja",SHIRT-001,"Color:Red|Size:Large","Färg:Röd|Storlek:Stor"
158
+ ```
159
+
160
+ #### Multiple values (pipe separator)
161
+
162
+ Fields that can have multiple values use the pipe character `|` as a separator:
163
+
164
+ - **Facets**: `Brand:Acme|Category:Electronics`
165
+ - **Option groups**: `Size|Color`
166
+ - **Option values**: `Large|Blue` (order matches option groups)
167
+ - **Assets**: `https://example.com/1.jpg|https://example.com/2.jpg`
168
+
169
+ ## Usage
170
+
171
+ :::note
172
+ The Admin UI offers basic import and export. Some features such as the export-all option and the list of exported files are only available in the Dashboard. New features will be added to the Dashboard only.
173
+ :::
174
+
175
+ ### Importing products
176
+
177
+ 1. Create a CSV with the columns above.
178
+ 2. Go to the Admin UI or Dashboard and open the Product Import section.
179
+ 3. Upload the CSV and choose options (update slugs, restore soft-deleted, main language).
180
+ 4. Select the update strategy: **merge** (keep existing facets/assets) or **replace** (overwrite).
181
+ 5. Start the import.
182
+
183
+ ### Exporting products
184
+
185
+ 1. In the Admin UI or Dashboard, select products to export (or use bulk export).
186
+ 2. Configure export fields (assets, facets, custom fields, etc.).
187
+ - For products with more than one variant, `optionGroups` and `optionValues` must be included.
188
+ - `productId` is not available as a selectable export field.
189
+ - If `customFields` are not selected, no custom-field columns are written to the CSV.
190
+ 3. Choose asset format: URL or JSON.
191
+ 4. Start the export (it is added to a job queue and runs in the background).
192
+ 5. Download the CSV when the export is complete. Your downloaded files will be listed in the export view.
193
+
194
+ ![Export settings](assets/Screenshot-export-settings.png)
195
+
196
+ ## Optional: Email notification on export complete
197
+
198
+ If you use `@vendure/email-plugin`, you can add an email notification when an export finishes from the `/email` subpath.
199
+
200
+ The plugin now provides a default fallback template for `product-export-complete/body.hbs`.
201
+ If you define your own template in your app's template directory, your template takes precedence.
202
+ Note: templates for `@vendure/email-plugin` should be valid MJML.
203
+
204
+ ```typescript
205
+ import path from 'path'
206
+ import {
207
+ DefaultEmailPlugin,
208
+ FileBasedTemplateLoader,
209
+ defaultEmailHandlers,
210
+ } from '@vendure/email-plugin'
211
+ import {
212
+ withProductExportedHandler,
213
+ withProductExportedTemplateFallback,
214
+ } from '@haus-tech/product-import-export-plugin/email'
215
+
216
+ export const config = {
217
+ plugins: [
218
+ DefaultEmailPlugin.init({
219
+ handlers: withProductExportedHandler(defaultEmailHandlers),
220
+ templateLoader: withProductExportedTemplateFallback(
221
+ new FileBasedTemplateLoader(path.join(__dirname, '../static/email/templates')),
222
+ ),
223
+ }),
224
+ ],
225
+ }
226
+ ```
227
+
228
+ ## Resources
229
+
230
+ - [Vendure Plugin Documentation](https://docs.vendure.io/guides/developer-guide/plugins/)
231
+ - [Vendure Import/Export Guide](https://docs.vendure.io/guides/developer-guide/importing-data/)
package/README.mdx CHANGED
@@ -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.0-next.2
6
6
  tags:
7
7
  - vendure
8
8
  - plugin
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haus-tech/product-import-export-plugin",
3
- "version": "3.6.0-next.2",
3
+ "version": "3.6.2",
4
4
  "description": "A Vendure plugin for importing and exporting products using a CSV file",
5
5
  "author": "Haus Tech",
6
6
  "repository": {
@@ -35,6 +35,7 @@
35
35
  "files": [
36
36
  "src",
37
37
  "assets",
38
+ "README.md",
38
39
  "README.mdx",
39
40
  "CHANGELOG.md"
40
41
  ],
@@ -46,13 +47,14 @@
46
47
  },
47
48
  "dependencies": {
48
49
  "@aws-sdk/client-s3": "^3.744.0",
49
- "axios": "^1.7.0",
50
+ "axios": "^1.16.1",
50
51
  "bottleneck": "^2.19.5",
51
52
  "fs-extra": "^11.2.0",
52
- "lodash": "^4.17.21"
53
+ "lodash": "^4.18.1"
53
54
  },
54
55
  "devDependencies": {
55
56
  "@types/fs-extra": "^11.0.4",
57
+ "@vendure/email-plugin": "3.6.3",
56
58
  "csv-parse": "^6.0.0",
57
59
  "csv-stringify": "^6.6.0"
58
60
  },
@@ -3,6 +3,12 @@ import { AdminUiExtension } from '@vendure/ui-devkit/compiler';
3
3
  import { PluginInitOptions } from './types';
4
4
  export declare class ProductImportExportPlugin {
5
5
  static options: PluginInitOptions;
6
+ /**
7
+ * @description
8
+ * Initialise the plugin with the given import/export options, applying sensible
9
+ * defaults for any option not provided. Pass the returned class to the `plugins`
10
+ * array of your `VendureConfig`.
11
+ */
6
12
  static init(options: PluginInitOptions): Type<ProductImportExportPlugin>;
7
13
  static ui: AdminUiExtension;
8
14
  }
@@ -64,6 +64,12 @@ const local_import_job_storage_strategy_1 = require("./services/import-storage/l
64
64
  let ProductImportExportPlugin = class ProductImportExportPlugin {
65
65
  static { ProductImportExportPlugin_1 = this; }
66
66
  static options;
67
+ /**
68
+ * @description
69
+ * Initialise the plugin with the given import/export options, applying sensible
70
+ * defaults for any option not provided. Pass the returned class to the `plugins`
71
+ * array of your `VendureConfig`.
72
+ */
67
73
  static init(options) {
68
74
  // Setup import options
69
75
  if (!options.importOptions.defaultOptions) {
@@ -211,7 +217,29 @@ exports.ProductImportExportPlugin = ProductImportExportPlugin = ProductImportExp
211
217
  return config;
212
218
  },
213
219
  dashboard: './dashboard/index.tsx',
214
- compatibility: '^2.0.0 || ^3.0.0',
220
+ compatibility: '^3.6.0',
215
221
  })
222
+ /**
223
+ * @description
224
+ * Bulk import and export of products via CSV from the Vendure admin UI / Dashboard,
225
+ * with pluggable local/S3 storage strategies for both exported files and queued
226
+ * import jobs.
227
+ *
228
+ * @example
229
+ * ```ts
230
+ * import { ProductImportExportPlugin } from '@haus-tech/product-import-export-plugin';
231
+ *
232
+ * export const config: VendureConfig = {
233
+ * plugins: [
234
+ * ProductImportExportPlugin.init({
235
+ * importOptions: {},
236
+ * exportOptions: {},
237
+ * }),
238
+ * ],
239
+ * };
240
+ * ```
241
+ *
242
+ * @category Plugin
243
+ */
216
244
  ], ProductImportExportPlugin);
217
245
  //# sourceMappingURL=product-import-export.plugin.js.map
@@ -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,wCAAiF;AAEjF,uCAAwC;AACxC,2CAA4B;AAC5B,mCAA6B;AAE7B,2CAIoB;AAGpB,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;AACpG,mHAA2G;AA8EpG,IAAM,yBAAyB,GAA/B,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CAAA;oBAC7D,CAAC;oBAED,OAAO,IAAI,iEAA6B,CAAC;wBACvC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,aAAa,CAAC;qBAC3D,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,CAwFrC"}
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,2CAIoB;AAGpB,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;AACpG,mHAA2G;AAoGpG,IAAM,yBAAyB,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sB,CAAC,QAAQ,CAAC,CAAA;oBAC7D,CAAC;oBAED,OAAO,IAAI,iEAA6B,CAAC;wBACvC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,aAAa,CAAC;qBAC3D,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,QAAQ;KACxB,CAAC;IACF;;;;;;;;;;;;;;;;;;;;;OAqBG;GACU,yBAAyB,CA8FrC"}
@@ -6,6 +6,14 @@ export type ExportedFileMetadata = {
6
6
  created: Date;
7
7
  modified: Date;
8
8
  };
9
+ /**
10
+ * @description
11
+ * Strategy that determines where exported CSV files are stored and how they are
12
+ * retrieved, listed and deleted. Implement this to back exports with custom storage
13
+ * (the plugin ships local-disk and S3 implementations).
14
+ *
15
+ * @category Strategies
16
+ */
9
17
  export interface ExportStorageStrategy {
10
18
  /**
11
19
  * @description
@@ -3,6 +3,15 @@ export type ImportJobInputFile = {
3
3
  originalname: string;
4
4
  buffer: Buffer;
5
5
  };
6
+ /**
7
+ * @description
8
+ * Strategy that determines where uploaded import files are persisted while their
9
+ * import job is queued, and how that content is later resolved and cleaned up.
10
+ * Implement this to back import jobs with custom storage (the plugin ships local-disk
11
+ * and S3 implementations).
12
+ *
13
+ * @category Strategies
14
+ */
6
15
  export interface ImportJobStorageStrategy {
7
16
  /**
8
17
  * @description
package/src/types.d.ts CHANGED
@@ -36,6 +36,13 @@ type ImportOptions = {
36
36
  */
37
37
  importJobStorage?: 'local' | 's3';
38
38
  };
39
+ /**
40
+ * @description
41
+ * Options passed to {@link ProductImportExportPlugin}.init to configure import and
42
+ * export behaviour, including which storage strategy backs each operation.
43
+ *
44
+ * @category Options
45
+ */
39
46
  export interface PluginInitOptions {
40
47
  importOptions: {
41
48
  visibleOptions?: Array<keyof ImportOptions>;