@adminforth/bulk-ai-flow 1.17.3 → 1.17.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.
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 88,319 bytes received 172 bytes 176,982.00 bytes/sec
17
- total size is 87,674 speedup is 0.99
16
+ sent 88,969 bytes received 172 bytes 178,282.00 bytes/sec
17
+ total size is 88,333 speedup is 0.99
@@ -137,7 +137,9 @@ import VisionTable from './VisionTable.vue'
137
137
  import adminforth from '@/adminforth';
138
138
  import { useI18n } from 'vue-i18n';
139
139
  import { AdminUser, type AdminForthResourceCommon } from '@/types/Common';
140
- import { run } from 'node:test';
140
+ import { useCoreStore } from '@/stores/core';
141
+
142
+ const coreStore = useCoreStore();
141
143
 
142
144
  const { t } = useI18n();
143
145
  const props = defineProps<{
@@ -658,6 +660,10 @@ async function runAiAction({
658
660
  body: { jobId },
659
661
  });
660
662
  //check for errors
663
+ if (!jobResponse) {
664
+ isAtLeastOneInProgress = true;
665
+ continue;
666
+ }
661
667
  if (jobResponse?.error) {
662
668
  console.error(`Error during ${actionType}:`, jobResponse.error);
663
669
  break;
@@ -839,6 +845,14 @@ async function uploadImage(imgBlob, id, fieldName) {
839
845
  }
840
846
 
841
847
  function regenerateImages(recordInfo: any) {
848
+ if (coreStore.isInternetError) {
849
+ adminforth.alert({
850
+ message: t('Cannot regenerate images while internet connection is lost. Please check your connection and try again.'),
851
+ variant: 'danger',
852
+ timeout: 'unlimited',
853
+ });
854
+ return;
855
+ }
842
856
  isGeneratingImages.value = true;
843
857
  runAiAction({
844
858
  endpoint: 'initial_image_generate',
@@ -950,6 +964,14 @@ function checkAndAddNewFieldsToPrompts(savedPrompts, defaultPrompts) {
950
964
  }
951
965
 
952
966
  async function regenerateCell(recordInfo: any) {
967
+ if (coreStore.isInternetError) {
968
+ adminforth.alert({
969
+ message: t('Cannot regenerate column while internet connection is lost. Please check your connection and try again.'),
970
+ variant: 'danger',
971
+ timeout: 'unlimited',
972
+ });
973
+ return;
974
+ }
953
975
  if (!regeneratingFieldsStatus.value[recordInfo.recordId]) {
954
976
  regeneratingFieldsStatus.value[recordInfo.recordId] = {};
955
977
  }
@@ -137,7 +137,9 @@ import VisionTable from './VisionTable.vue'
137
137
  import adminforth from '@/adminforth';
138
138
  import { useI18n } from 'vue-i18n';
139
139
  import { AdminUser, type AdminForthResourceCommon } from '@/types/Common';
140
- import { run } from 'node:test';
140
+ import { useCoreStore } from '@/stores/core';
141
+
142
+ const coreStore = useCoreStore();
141
143
 
142
144
  const { t } = useI18n();
143
145
  const props = defineProps<{
@@ -658,6 +660,10 @@ async function runAiAction({
658
660
  body: { jobId },
659
661
  });
660
662
  //check for errors
663
+ if (!jobResponse) {
664
+ isAtLeastOneInProgress = true;
665
+ continue;
666
+ }
661
667
  if (jobResponse?.error) {
662
668
  console.error(`Error during ${actionType}:`, jobResponse.error);
663
669
  break;
@@ -839,6 +845,14 @@ async function uploadImage(imgBlob, id, fieldName) {
839
845
  }
840
846
 
841
847
  function regenerateImages(recordInfo: any) {
848
+ if (coreStore.isInternetError) {
849
+ adminforth.alert({
850
+ message: t('Cannot regenerate images while internet connection is lost. Please check your connection and try again.'),
851
+ variant: 'danger',
852
+ timeout: 'unlimited',
853
+ });
854
+ return;
855
+ }
842
856
  isGeneratingImages.value = true;
843
857
  runAiAction({
844
858
  endpoint: 'initial_image_generate',
@@ -950,6 +964,14 @@ function checkAndAddNewFieldsToPrompts(savedPrompts, defaultPrompts) {
950
964
  }
951
965
 
952
966
  async function regenerateCell(recordInfo: any) {
967
+ if (coreStore.isInternetError) {
968
+ adminforth.alert({
969
+ message: t('Cannot regenerate column while internet connection is lost. Please check your connection and try again.'),
970
+ variant: 'danger',
971
+ timeout: 'unlimited',
972
+ });
973
+ return;
974
+ }
953
975
  if (!regeneratingFieldsStatus.value[recordInfo.recordId]) {
954
976
  regeneratingFieldsStatus.value[recordInfo.recordId] = {};
955
977
  }
package/index.ts CHANGED
@@ -7,7 +7,7 @@ import { RateLimiter } from "adminforth";
7
7
  import { randomUUID } from "crypto";
8
8
 
9
9
  const STUB_MODE = false;
10
- const jobs = new Map();
10
+ const jobs = new Map();
11
11
  export default class BulkAiFlowPlugin extends AdminForthPlugin {
12
12
  options: PluginOptions;
13
13
  uploadPlugin: AdminForthPlugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/bulk-ai-flow",
3
- "version": "1.17.3",
3
+ "version": "1.17.4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },