@adminforth/bulk-ai-flow 1.17.7 → 1.17.9

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
@@ -13,5 +13,5 @@ custom/package-lock.json
13
13
  custom/package.json
14
14
  custom/tsconfig.json
15
15
 
16
- sent 90,341 bytes received 172 bytes 181,026.00 bytes/sec
17
- total size is 89,696 speedup is 0.99
16
+ sent 91,084 bytes received 172 bytes 182,512.00 bytes/sec
17
+ total size is 90,439 speedup is 0.99
@@ -193,10 +193,10 @@ const aiGenerationErrorMessage = ref<string[]>([]);
193
193
  const isAiImageGenerationError = ref<boolean[]>([false]);
194
194
 
195
195
  const isImageToTextGenerationError = ref<boolean[]>([false]);
196
- const imageToTextErrorMessages = ref<string[]>([]);
196
+ const imageToTextErrorMessages = ref<Record<string, string>[]>([]);
197
197
 
198
198
  const isTextToTextGenerationError = ref<boolean[]>([false]);
199
- const textToTextErrorMessages = ref<string[]>([]);
199
+ const textToTextErrorMessages = ref<Record<string, string>[]>([]);
200
200
 
201
201
  const imageGenerationErrorMessage = ref<string[]>([]);
202
202
  const isImageHasPreviewUrl = ref<Record<string, boolean>>({});
@@ -728,11 +728,19 @@ async function runAiAction({
728
728
  isAiImageGenerationError.value[index] = true;
729
729
  imageGenerationErrorMessage.value[index] = jobResponse.job?.error || 'Unknown error';
730
730
  } else if (actionType === 'analyze') {
731
- isImageToTextGenerationError.value[index] = true;
732
- imageToTextErrorMessages.value[index] = jobResponse.job?.error || 'Unknown error';
731
+ for (const field of Object.keys(props.meta.outputFieldsForAnalizeFromImages ) ) {
732
+ if (!imageToTextErrorMessages.value[index]) {
733
+ imageToTextErrorMessages.value[index] = {};
734
+ }
735
+ imageToTextErrorMessages.value[index][props.meta.outputFieldsForAnalizeFromImages[field]] = jobResponse.job?.error || 'Unknown error';
736
+ }
733
737
  } else if (actionType === 'analyze_no_images') {
734
- isTextToTextGenerationError.value[index] = true;
735
- textToTextErrorMessages.value[index] = jobResponse.job?.error || 'Unknown error';
738
+ for( const field of Object.keys(props.meta.outputPlainFields ) ) {
739
+ if (!textToTextErrorMessages.value[index]) {
740
+ textToTextErrorMessages.value[index] = {};
741
+ }
742
+ textToTextErrorMessages.value[index][props.meta.outputPlainFields[field]] = jobResponse.job?.error || 'Unknown error';
743
+ }
736
744
  }
737
745
  }
738
746
  }
@@ -1062,6 +1070,11 @@ async function regenerateCell(recordInfo: any) {
1062
1070
  [primaryKey]: pk,
1063
1071
  };
1064
1072
  }
1073
+ if (actionType === 'analyze') {
1074
+ imageToTextErrorMessages.value[index][recordInfo.fieldName] = '';
1075
+ } else if (actionType === 'analyze_no_images') {
1076
+ textToTextErrorMessages.value[index][recordInfo.fieldName] = '';
1077
+ }
1065
1078
  regeneratingFieldsStatus.value[recordInfo.recordId][recordInfo.fieldName] = false;
1066
1079
  }
1067
1080
 
@@ -249,9 +249,9 @@ const props = defineProps<{
249
249
  isImageHasPreviewUrl: Record<string, boolean>
250
250
  imageGenerationPrompts: Record<string, any>
251
251
  isImageToTextGenerationError: boolean[],
252
- imageToTextErrorMessages: string[],
252
+ imageToTextErrorMessages: Record<string, string>[],
253
253
  isTextToTextGenerationError: boolean[],
254
- textToTextErrorMessages: string[],
254
+ textToTextErrorMessages: Record<string, string>[],
255
255
  outputImageFields: string[],
256
256
  outputFieldsForAnalizeFromImages: string[],
257
257
  outputPlainFields: string[],
@@ -340,7 +340,7 @@ function regerenerateFieldIconClick(item, name) {
340
340
 
341
341
  function shouldDisableRegenerateFieldIcon(item, name) {
342
342
  if (props.outputFieldsForAnalizeFromImages.findIndex( el => el === name) !== -1 &&
343
- props.imageToTextErrorMessages[props.tableColumnsIndexes.findIndex(el => el[props.primaryKey] === item[props.primaryKey])] === 'No source images found') {
343
+ props.imageToTextErrorMessages[props.tableColumnsIndexes.findIndex(el => el[props.primaryKey] === item[props.primaryKey])][name] === 'No source images found') {
344
344
  return true;
345
345
  }
346
346
  return false;
@@ -348,13 +348,13 @@ function shouldDisableRegenerateFieldIcon(item, name) {
348
348
 
349
349
  function checkForError(item, name) {
350
350
  if (props.outputFieldsForAnalizeFromImages.findIndex( el => el === name) !== -1) {
351
- const errorMessage = props.imageToTextErrorMessages[props.tableColumnsIndexes.findIndex(el => el[props.primaryKey] === item[props.primaryKey])];
351
+ const errorMessage = props.imageToTextErrorMessages?.[props.tableColumnsIndexes.findIndex(el => el[props.primaryKey] === item[props.primaryKey])]?.[name];
352
352
  if (errorMessage) {
353
353
  return errorMessage;
354
354
  }
355
355
  }
356
356
  if (props.outputPlainFields.findIndex( el => el === name) !== -1) {
357
- const errorMessage = props.textToTextErrorMessages[props.tableColumnsIndexes.findIndex(el => el[props.primaryKey] === item[props.primaryKey])];
357
+ const errorMessage = props.textToTextErrorMessages?.[props.tableColumnsIndexes.findIndex(el => el[props.primaryKey] === item[props.primaryKey])]?.[name];
358
358
  if (errorMessage) {
359
359
  return errorMessage;
360
360
  }
@@ -193,10 +193,10 @@ const aiGenerationErrorMessage = ref<string[]>([]);
193
193
  const isAiImageGenerationError = ref<boolean[]>([false]);
194
194
 
195
195
  const isImageToTextGenerationError = ref<boolean[]>([false]);
196
- const imageToTextErrorMessages = ref<string[]>([]);
196
+ const imageToTextErrorMessages = ref<Record<string, string>[]>([]);
197
197
 
198
198
  const isTextToTextGenerationError = ref<boolean[]>([false]);
199
- const textToTextErrorMessages = ref<string[]>([]);
199
+ const textToTextErrorMessages = ref<Record<string, string>[]>([]);
200
200
 
201
201
  const imageGenerationErrorMessage = ref<string[]>([]);
202
202
  const isImageHasPreviewUrl = ref<Record<string, boolean>>({});
@@ -728,11 +728,19 @@ async function runAiAction({
728
728
  isAiImageGenerationError.value[index] = true;
729
729
  imageGenerationErrorMessage.value[index] = jobResponse.job?.error || 'Unknown error';
730
730
  } else if (actionType === 'analyze') {
731
- isImageToTextGenerationError.value[index] = true;
732
- imageToTextErrorMessages.value[index] = jobResponse.job?.error || 'Unknown error';
731
+ for (const field of Object.keys(props.meta.outputFieldsForAnalizeFromImages ) ) {
732
+ if (!imageToTextErrorMessages.value[index]) {
733
+ imageToTextErrorMessages.value[index] = {};
734
+ }
735
+ imageToTextErrorMessages.value[index][props.meta.outputFieldsForAnalizeFromImages[field]] = jobResponse.job?.error || 'Unknown error';
736
+ }
733
737
  } else if (actionType === 'analyze_no_images') {
734
- isTextToTextGenerationError.value[index] = true;
735
- textToTextErrorMessages.value[index] = jobResponse.job?.error || 'Unknown error';
738
+ for( const field of Object.keys(props.meta.outputPlainFields ) ) {
739
+ if (!textToTextErrorMessages.value[index]) {
740
+ textToTextErrorMessages.value[index] = {};
741
+ }
742
+ textToTextErrorMessages.value[index][props.meta.outputPlainFields[field]] = jobResponse.job?.error || 'Unknown error';
743
+ }
736
744
  }
737
745
  }
738
746
  }
@@ -1062,6 +1070,11 @@ async function regenerateCell(recordInfo: any) {
1062
1070
  [primaryKey]: pk,
1063
1071
  };
1064
1072
  }
1073
+ if (actionType === 'analyze') {
1074
+ imageToTextErrorMessages.value[index][recordInfo.fieldName] = '';
1075
+ } else if (actionType === 'analyze_no_images') {
1076
+ textToTextErrorMessages.value[index][recordInfo.fieldName] = '';
1077
+ }
1065
1078
  regeneratingFieldsStatus.value[recordInfo.recordId][recordInfo.fieldName] = false;
1066
1079
  }
1067
1080
 
@@ -249,9 +249,9 @@ const props = defineProps<{
249
249
  isImageHasPreviewUrl: Record<string, boolean>
250
250
  imageGenerationPrompts: Record<string, any>
251
251
  isImageToTextGenerationError: boolean[],
252
- imageToTextErrorMessages: string[],
252
+ imageToTextErrorMessages: Record<string, string>[],
253
253
  isTextToTextGenerationError: boolean[],
254
- textToTextErrorMessages: string[],
254
+ textToTextErrorMessages: Record<string, string>[],
255
255
  outputImageFields: string[],
256
256
  outputFieldsForAnalizeFromImages: string[],
257
257
  outputPlainFields: string[],
@@ -340,7 +340,7 @@ function regerenerateFieldIconClick(item, name) {
340
340
 
341
341
  function shouldDisableRegenerateFieldIcon(item, name) {
342
342
  if (props.outputFieldsForAnalizeFromImages.findIndex( el => el === name) !== -1 &&
343
- props.imageToTextErrorMessages[props.tableColumnsIndexes.findIndex(el => el[props.primaryKey] === item[props.primaryKey])] === 'No source images found') {
343
+ props.imageToTextErrorMessages[props.tableColumnsIndexes.findIndex(el => el[props.primaryKey] === item[props.primaryKey])][name] === 'No source images found') {
344
344
  return true;
345
345
  }
346
346
  return false;
@@ -348,13 +348,13 @@ function shouldDisableRegenerateFieldIcon(item, name) {
348
348
 
349
349
  function checkForError(item, name) {
350
350
  if (props.outputFieldsForAnalizeFromImages.findIndex( el => el === name) !== -1) {
351
- const errorMessage = props.imageToTextErrorMessages[props.tableColumnsIndexes.findIndex(el => el[props.primaryKey] === item[props.primaryKey])];
351
+ const errorMessage = props.imageToTextErrorMessages?.[props.tableColumnsIndexes.findIndex(el => el[props.primaryKey] === item[props.primaryKey])]?.[name];
352
352
  if (errorMessage) {
353
353
  return errorMessage;
354
354
  }
355
355
  }
356
356
  if (props.outputPlainFields.findIndex( el => el === name) !== -1) {
357
- const errorMessage = props.textToTextErrorMessages[props.tableColumnsIndexes.findIndex(el => el[props.primaryKey] === item[props.primaryKey])];
357
+ const errorMessage = props.textToTextErrorMessages?.[props.tableColumnsIndexes.findIndex(el => el[props.primaryKey] === item[props.primaryKey])]?.[name];
358
358
  if (errorMessage) {
359
359
  return errorMessage;
360
360
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/bulk-ai-flow",
3
- "version": "1.17.7",
3
+ "version": "1.17.9",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },