@adminforth/import-export 1.3.0 → 1.3.1

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/build.log CHANGED
@@ -10,5 +10,5 @@ custom/package-lock.json
10
10
  custom/package.json
11
11
  custom/tsconfig.json
12
12
 
13
- sent 14,115 bytes received 115 bytes 28,460.00 bytes/sec
14
- total size is 13,695 speedup is 0.96
13
+ sent 14,627 bytes received 115 bytes 29,484.00 bytes/sec
14
+ total size is 14,207 speedup is 0.96
@@ -150,12 +150,20 @@ async function importCsv() {
150
150
 
151
151
  complete: async (results) => {
152
152
  if (results.errors.length > 0) {
153
+ adminforth.alert({
154
+ message: `CSV parsing errors at row ${results.errors[0]?.row + 1 || '?'}: ${results.errors[0]?.message || 'Unknown error'}`,
155
+ variant: 'danger'
156
+ });
153
157
  throw new Error(`CSV parsing errors: ${results.errors.map(e => e.message).join(', ')}`);
154
158
  }
155
159
  const data: Record<string, string[]> = {};
156
160
  const rows = results.data as Record<string, string>[];
157
161
 
158
162
  if (rows.length === 0) {
163
+ adminforth.alert({
164
+ message: `No data rows found in CSV`,
165
+ variant: 'danger'
166
+ });
159
167
  throw new Error('No data rows found in CSV');
160
168
  }
161
169
  Object.keys(rows[0]).forEach(column => {
@@ -172,6 +180,10 @@ async function importCsv() {
172
180
  inProgress.value = false;
173
181
  },
174
182
  error: (error) => {
183
+ adminforth.alert({
184
+ message: `CSV parsing errors: ${error.message}}`,
185
+ variant: 'danger'
186
+ });
175
187
  throw new Error(`Failed to parse CSV: ${error.message}`);
176
188
  }
177
189
  });
@@ -150,12 +150,20 @@ async function importCsv() {
150
150
 
151
151
  complete: async (results) => {
152
152
  if (results.errors.length > 0) {
153
+ adminforth.alert({
154
+ message: `CSV parsing errors at row ${results.errors[0]?.row + 1 || '?'}: ${results.errors[0]?.message || 'Unknown error'}`,
155
+ variant: 'danger'
156
+ });
153
157
  throw new Error(`CSV parsing errors: ${results.errors.map(e => e.message).join(', ')}`);
154
158
  }
155
159
  const data: Record<string, string[]> = {};
156
160
  const rows = results.data as Record<string, string>[];
157
161
 
158
162
  if (rows.length === 0) {
163
+ adminforth.alert({
164
+ message: `No data rows found in CSV`,
165
+ variant: 'danger'
166
+ });
159
167
  throw new Error('No data rows found in CSV');
160
168
  }
161
169
  Object.keys(rows[0]).forEach(column => {
@@ -172,6 +180,10 @@ async function importCsv() {
172
180
  inProgress.value = false;
173
181
  },
174
182
  error: (error) => {
183
+ adminforth.alert({
184
+ message: `CSV parsing errors: ${error.message}}`,
185
+ variant: 'danger'
186
+ });
175
187
  throw new Error(`Failed to parse CSV: ${error.message}`);
176
188
  }
177
189
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/import-export",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",