@aiteza/n8n-nodes-aiteza 0.2.2 → 0.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/dist/nodes/Aiteza/Aiteza.node.js +307 -50
- package/dist/nodes/Aiteza/AitezaProgress.node.d.ts +5 -0
- package/dist/nodes/Aiteza/AitezaProgress.node.js +271 -0
- package/dist/nodes/Aiteza/AitezaTrigger.node.js +21 -10
- package/dist/nodes/Aiteza/AitezaWorkflowResult.node.d.ts +5 -0
- package/dist/nodes/Aiteza/AitezaWorkflowResult.node.js +261 -0
- package/dist/nodes/Aiteza/GenericFunctions.d.ts +6 -0
- package/dist/nodes/Aiteza/GenericFunctions.js +82 -2
- package/package.json +4 -2
|
@@ -46,7 +46,7 @@ class Aiteza {
|
|
|
46
46
|
{
|
|
47
47
|
name: 'From AITEZA Trigger',
|
|
48
48
|
value: 'trigger',
|
|
49
|
-
description: 'Use the auth token (and optionally base URL) passed by an upstream AITEZA Trigger node (acts on behalf of the calling user)',
|
|
49
|
+
description: 'Use the auth token (and optionally base URL) passed by an upstream AITEZA Trigger node (acts on behalf of the calling user). The node never falls back to configured credentials – those would belong to a different identity.',
|
|
50
50
|
},
|
|
51
51
|
],
|
|
52
52
|
default: 'credentials',
|
|
@@ -252,23 +252,25 @@ class Aiteza {
|
|
|
252
252
|
},
|
|
253
253
|
// Dataroom → Delete
|
|
254
254
|
{
|
|
255
|
-
displayName: 'Dataroom IDs',
|
|
255
|
+
displayName: 'Dataroom Names or IDs',
|
|
256
256
|
name: 'dataroomIds',
|
|
257
|
-
type: '
|
|
257
|
+
type: 'multiOptions',
|
|
258
|
+
typeOptions: { loadOptionsMethod: 'getDatarooms' },
|
|
258
259
|
required: true,
|
|
259
|
-
default:
|
|
260
|
+
default: [],
|
|
260
261
|
displayOptions: { show: { resource: ['dataroom'], operation: ['delete'] } },
|
|
261
|
-
description: '
|
|
262
|
+
description: 'Datarooms to delete. Choose from the list (prepopulated with recently used), or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
262
263
|
},
|
|
263
264
|
// Dataroom → Set Connected
|
|
264
265
|
{
|
|
265
|
-
displayName: 'Connected Dataroom IDs',
|
|
266
|
+
displayName: 'Connected Dataroom Names or IDs',
|
|
266
267
|
name: 'connectedDataroomIds',
|
|
267
|
-
type: '
|
|
268
|
+
type: 'multiOptions',
|
|
269
|
+
typeOptions: { loadOptionsMethod: 'getDatarooms' },
|
|
268
270
|
required: true,
|
|
269
|
-
default:
|
|
271
|
+
default: [],
|
|
270
272
|
displayOptions: { show: { resource: ['dataroom'], operation: ['setConnected'] } },
|
|
271
|
-
description: '
|
|
273
|
+
description: 'Datarooms to set as default connected datarooms. Choose from the list (prepopulated with recently used), or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
272
274
|
},
|
|
273
275
|
// Dataroom → Get Chats pagination
|
|
274
276
|
{
|
|
@@ -480,6 +482,9 @@ class Aiteza {
|
|
|
480
482
|
displayOptions: { show: { resource: ['file'] } },
|
|
481
483
|
options: [
|
|
482
484
|
{ name: 'Assign to Dataroom', value: 'assign', action: 'Assign a standalone file to a dataroom' },
|
|
485
|
+
{ name: 'Bulk Delete', value: 'bulkDelete', action: 'Delete multiple files from a dataroom' },
|
|
486
|
+
{ name: 'Bulk Move', value: 'bulkMove', action: 'Move multiple files to another dataroom' },
|
|
487
|
+
{ name: 'Bulk Patch', value: 'bulkPatch', action: 'Bulk patch or reprocess files in a dataroom' },
|
|
483
488
|
{ name: 'Delete', value: 'delete', action: 'Delete a file from a dataroom' },
|
|
484
489
|
{ name: 'Delete All (Dataroom)', value: 'deleteAllDataroom', action: 'Delete all files from a dataroom' },
|
|
485
490
|
{ name: 'Delete Standalone', value: 'deleteStandalone', action: 'Delete a standalone file' },
|
|
@@ -509,7 +514,7 @@ class Aiteza {
|
|
|
509
514
|
required: true,
|
|
510
515
|
default: '',
|
|
511
516
|
displayOptions: {
|
|
512
|
-
show: { resource: ['file'], operation: ['getMany', 'get', 'delete', 'upload', 'deleteAllDataroom', 'reprocess', 'move', 'getOriginalUrlDataroom', 'getChunksDataroom'] },
|
|
517
|
+
show: { resource: ['file'], operation: ['getMany', 'get', 'delete', 'upload', 'deleteAllDataroom', 'reprocess', 'move', 'getOriginalUrlDataroom', 'getChunksDataroom', 'bulkDelete', 'bulkMove', 'bulkPatch'] },
|
|
513
518
|
},
|
|
514
519
|
description: 'The dataroom. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
515
520
|
},
|
|
@@ -537,6 +542,48 @@ class Aiteza {
|
|
|
537
542
|
},
|
|
538
543
|
description: 'The standalone file. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
539
544
|
},
|
|
545
|
+
// File → Bulk: file IDs (dataroom-scoped)
|
|
546
|
+
{
|
|
547
|
+
displayName: 'File Names or IDs',
|
|
548
|
+
name: 'fileIds',
|
|
549
|
+
type: 'multiOptions',
|
|
550
|
+
typeOptions: { loadOptionsMethod: 'getFilesInDataroom', loadOptionsDependsOn: ['dataroomId'] },
|
|
551
|
+
required: true,
|
|
552
|
+
default: [],
|
|
553
|
+
displayOptions: { show: { resource: ['file'], operation: ['bulkDelete', 'bulkMove', 'bulkPatch'] } },
|
|
554
|
+
description: 'Files to operate on. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
555
|
+
},
|
|
556
|
+
// File → Bulk Patch options
|
|
557
|
+
{
|
|
558
|
+
displayName: 'Reprocess',
|
|
559
|
+
name: 'reprocess',
|
|
560
|
+
type: 'boolean',
|
|
561
|
+
default: false,
|
|
562
|
+
displayOptions: { show: { resource: ['file'], operation: ['bulkPatch'] } },
|
|
563
|
+
description: 'Whether to trigger reprocessing of the selected files',
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
displayName: 'Processing Pipeline',
|
|
567
|
+
name: 'processingPipeline',
|
|
568
|
+
type: 'options',
|
|
569
|
+
default: 'DOCLING',
|
|
570
|
+
displayOptions: { show: { resource: ['file'], operation: ['bulkPatch'], reprocess: [true] } },
|
|
571
|
+
options: [
|
|
572
|
+
{ name: 'TIKA', value: 'TIKA' },
|
|
573
|
+
{ name: 'DOCLING', value: 'DOCLING' },
|
|
574
|
+
{ name: 'DOCLING Force OCR', value: 'DOCLING_FORCE_OCR' },
|
|
575
|
+
{ name: 'VLM', value: 'VLM' },
|
|
576
|
+
],
|
|
577
|
+
description: 'Processing pipeline to use (required when Reprocess is enabled)',
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
displayName: 'VLM Model',
|
|
581
|
+
name: 'vlmModel',
|
|
582
|
+
type: 'string',
|
|
583
|
+
default: '',
|
|
584
|
+
displayOptions: { show: { resource: ['file'], operation: ['bulkPatch'], reprocess: [true], processingPipeline: ['VLM'] } },
|
|
585
|
+
description: 'VLM model name to use (required when pipeline is VLM)',
|
|
586
|
+
},
|
|
540
587
|
// File → Assign: target dataroom
|
|
541
588
|
{
|
|
542
589
|
displayName: 'Target Dataroom Name or ID',
|
|
@@ -545,8 +592,8 @@ class Aiteza {
|
|
|
545
592
|
typeOptions: { loadOptionsMethod: 'getDatarooms' },
|
|
546
593
|
required: true,
|
|
547
594
|
default: '',
|
|
548
|
-
displayOptions: { show: { resource: ['file'], operation: ['assign', 'move'] } },
|
|
549
|
-
description: 'The dataroom to assign/move the file to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
595
|
+
displayOptions: { show: { resource: ['file'], operation: ['assign', 'move', 'bulkMove'] } },
|
|
596
|
+
description: 'The dataroom to assign/move the file(s) to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
550
597
|
},
|
|
551
598
|
// File → Get Many (pagination)
|
|
552
599
|
{
|
|
@@ -666,6 +713,9 @@ class Aiteza {
|
|
|
666
713
|
displayOptions: { show: { resource: ['image'] } },
|
|
667
714
|
options: [
|
|
668
715
|
{ name: 'Assign to Dataroom', value: 'assign', action: 'Assign a standalone image to a dataroom' },
|
|
716
|
+
{ name: 'Bulk Delete (Dataroom)', value: 'bulkDelete', action: 'Delete multiple images from a dataroom' },
|
|
717
|
+
{ name: 'Bulk Move', value: 'bulkMove', action: 'Move multiple images to another dataroom' },
|
|
718
|
+
{ name: 'Bulk Patch', value: 'bulkPatch', action: 'Bulk patch or reprocess images in a dataroom' },
|
|
669
719
|
{ name: 'Delete (Dataroom)', value: 'deleteDataroom', action: 'Delete an image from a dataroom' },
|
|
670
720
|
{ name: 'Delete All (Dataroom)', value: 'deleteAllDataroom', action: 'Delete all images from a dataroom' },
|
|
671
721
|
{ name: 'Delete Standalone', value: 'deleteStandalone', action: 'Delete a standalone image' },
|
|
@@ -691,7 +741,7 @@ class Aiteza {
|
|
|
691
741
|
required: true,
|
|
692
742
|
default: '',
|
|
693
743
|
displayOptions: {
|
|
694
|
-
show: { resource: ['image'], operation: ['getManyDataroom', 'getDataroom', 'deleteDataroom', 'uploadDataroom', 'deleteAllDataroom', 'move', 'getOriginalUrlDataroom'] },
|
|
744
|
+
show: { resource: ['image'], operation: ['getManyDataroom', 'getDataroom', 'deleteDataroom', 'uploadDataroom', 'deleteAllDataroom', 'move', 'getOriginalUrlDataroom', 'bulkDelete', 'bulkMove', 'bulkPatch'] },
|
|
695
745
|
},
|
|
696
746
|
description: 'The dataroom. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
697
747
|
},
|
|
@@ -727,8 +777,39 @@ class Aiteza {
|
|
|
727
777
|
typeOptions: { loadOptionsMethod: 'getDatarooms' },
|
|
728
778
|
required: true,
|
|
729
779
|
default: '',
|
|
730
|
-
displayOptions: { show: { resource: ['image'], operation: ['assign', 'move'] } },
|
|
731
|
-
description: 'The dataroom to assign/move the image to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
780
|
+
displayOptions: { show: { resource: ['image'], operation: ['assign', 'move', 'bulkMove'] } },
|
|
781
|
+
description: 'The dataroom to assign/move the image(s) to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
782
|
+
},
|
|
783
|
+
// Image → Bulk: image IDs (dataroom-scoped)
|
|
784
|
+
{
|
|
785
|
+
displayName: 'Image Names or IDs',
|
|
786
|
+
name: 'imageIds',
|
|
787
|
+
type: 'multiOptions',
|
|
788
|
+
typeOptions: { loadOptionsMethod: 'getImagesInDataroom', loadOptionsDependsOn: ['dataroomId'] },
|
|
789
|
+
required: true,
|
|
790
|
+
default: [],
|
|
791
|
+
displayOptions: { show: { resource: ['image'], operation: ['bulkDelete', 'bulkMove', 'bulkPatch'] } },
|
|
792
|
+
description: 'Images to operate on. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
793
|
+
},
|
|
794
|
+
// Image → Bulk Patch options
|
|
795
|
+
{
|
|
796
|
+
displayName: 'Reprocess',
|
|
797
|
+
name: 'reprocess',
|
|
798
|
+
type: 'boolean',
|
|
799
|
+
default: false,
|
|
800
|
+
displayOptions: { show: { resource: ['image'], operation: ['bulkPatch'] } },
|
|
801
|
+
description: 'Whether to trigger reprocessing of the selected images',
|
|
802
|
+
},
|
|
803
|
+
{
|
|
804
|
+
displayName: 'Patch Options',
|
|
805
|
+
name: 'patchOptions',
|
|
806
|
+
type: 'collection',
|
|
807
|
+
placeholder: 'Add Option',
|
|
808
|
+
default: {},
|
|
809
|
+
displayOptions: { show: { resource: ['image'], operation: ['bulkPatch'] } },
|
|
810
|
+
options: [
|
|
811
|
+
{ displayName: 'Name', name: 'name', type: 'string', default: '', description: 'Override display name for all items' },
|
|
812
|
+
],
|
|
732
813
|
},
|
|
733
814
|
// Image → Get Many pagination
|
|
734
815
|
{
|
|
@@ -799,10 +880,14 @@ class Aiteza {
|
|
|
799
880
|
displayOptions: { show: { resource: ['webSource'] } },
|
|
800
881
|
options: [
|
|
801
882
|
{ name: 'Add', value: 'add', action: 'Add a web source to a dataroom' },
|
|
883
|
+
{ name: 'Bulk Delete', value: 'bulkDelete', action: 'Delete multiple web sources from a dataroom' },
|
|
884
|
+
{ name: 'Bulk Move', value: 'bulkMove', action: 'Move multiple web sources to another dataroom' },
|
|
885
|
+
{ name: 'Bulk Patch', value: 'bulkPatch', action: 'Bulk patch or rescan web sources in a dataroom' },
|
|
802
886
|
{ name: 'Delete', value: 'delete', action: 'Delete a web source' },
|
|
803
887
|
{ name: 'Delete All', value: 'deleteAll', action: 'Delete all web sources from a dataroom' },
|
|
804
888
|
{ name: 'Get', value: 'get', action: 'Get a web source' },
|
|
805
889
|
{ name: 'Get Many', value: 'getMany', action: 'Get web sources in a dataroom' },
|
|
890
|
+
{ name: 'Get URLs', value: 'getUrls', action: 'Get crawled URLs of a web source' },
|
|
806
891
|
{ name: 'Move', value: 'move', action: 'Move a web source to another dataroom' },
|
|
807
892
|
{ name: 'Rescan', value: 'rescan', action: 'Rescan a web source' },
|
|
808
893
|
],
|
|
@@ -826,7 +911,7 @@ class Aiteza {
|
|
|
826
911
|
typeOptions: { loadOptionsMethod: 'getWebSourcesInDataroom', loadOptionsDependsOn: ['dataroomId'] },
|
|
827
912
|
required: true,
|
|
828
913
|
default: '',
|
|
829
|
-
displayOptions: { show: { resource: ['webSource'], operation: ['get', 'delete', 'rescan', 'move'] } },
|
|
914
|
+
displayOptions: { show: { resource: ['webSource'], operation: ['get', 'delete', 'rescan', 'move', 'getUrls'] } },
|
|
830
915
|
description: 'The web source. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
831
916
|
},
|
|
832
917
|
// Web Source → Move target
|
|
@@ -837,9 +922,43 @@ class Aiteza {
|
|
|
837
922
|
typeOptions: { loadOptionsMethod: 'getDatarooms' },
|
|
838
923
|
required: true,
|
|
839
924
|
default: '',
|
|
840
|
-
displayOptions: { show: { resource: ['webSource'], operation: ['move'] } },
|
|
925
|
+
displayOptions: { show: { resource: ['webSource'], operation: ['move', 'bulkMove'] } },
|
|
841
926
|
description: 'The target dataroom. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
842
927
|
},
|
|
928
|
+
// Web Source → Bulk: IDs
|
|
929
|
+
{
|
|
930
|
+
displayName: 'Web Source Names or IDs',
|
|
931
|
+
name: 'webSourceIds',
|
|
932
|
+
type: 'multiOptions',
|
|
933
|
+
typeOptions: { loadOptionsMethod: 'getWebSourcesInDataroom', loadOptionsDependsOn: ['dataroomId'] },
|
|
934
|
+
required: true,
|
|
935
|
+
default: [],
|
|
936
|
+
displayOptions: { show: { resource: ['webSource'], operation: ['bulkDelete', 'bulkMove', 'bulkPatch'] } },
|
|
937
|
+
description: 'Web sources to operate on. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
938
|
+
},
|
|
939
|
+
// Web Source → Bulk Patch options
|
|
940
|
+
{
|
|
941
|
+
displayName: 'Reprocess',
|
|
942
|
+
name: 'reprocess',
|
|
943
|
+
type: 'boolean',
|
|
944
|
+
default: false,
|
|
945
|
+
displayOptions: { show: { resource: ['webSource'], operation: ['bulkPatch'] } },
|
|
946
|
+
description: 'Whether to trigger rescanning of the selected web sources',
|
|
947
|
+
},
|
|
948
|
+
{
|
|
949
|
+
displayName: 'Patch Options',
|
|
950
|
+
name: 'patchOptions',
|
|
951
|
+
type: 'collection',
|
|
952
|
+
placeholder: 'Add Option',
|
|
953
|
+
default: {},
|
|
954
|
+
displayOptions: { show: { resource: ['webSource'], operation: ['bulkPatch'] } },
|
|
955
|
+
options: [
|
|
956
|
+
{ displayName: 'Name', name: 'name', type: 'string', default: '', description: 'Override display name for all items' },
|
|
957
|
+
{ displayName: 'Include Subpages', name: 'includeSubpages', type: 'boolean', default: false },
|
|
958
|
+
{ displayName: 'Max Subpages', name: 'maxSubpages', type: 'number', default: 10 },
|
|
959
|
+
{ displayName: 'Max Depth', name: 'maxDepth', type: 'number', default: 1 },
|
|
960
|
+
],
|
|
961
|
+
},
|
|
843
962
|
// Web Source → Add
|
|
844
963
|
{
|
|
845
964
|
displayName: 'URL',
|
|
@@ -946,6 +1065,31 @@ class Aiteza {
|
|
|
946
1065
|
},
|
|
947
1066
|
],
|
|
948
1067
|
},
|
|
1068
|
+
// Web Source → Get URLs pagination
|
|
1069
|
+
{
|
|
1070
|
+
displayName: 'Additional Fields',
|
|
1071
|
+
name: 'additionalFields',
|
|
1072
|
+
type: 'collection',
|
|
1073
|
+
placeholder: 'Add Field',
|
|
1074
|
+
default: {},
|
|
1075
|
+
displayOptions: { show: { resource: ['webSource'], operation: ['getUrls'] } },
|
|
1076
|
+
options: [
|
|
1077
|
+
{
|
|
1078
|
+
displayName: 'Page',
|
|
1079
|
+
name: 'page',
|
|
1080
|
+
type: 'number',
|
|
1081
|
+
default: 0,
|
|
1082
|
+
description: 'Page number (0-based)',
|
|
1083
|
+
},
|
|
1084
|
+
{
|
|
1085
|
+
displayName: 'Size',
|
|
1086
|
+
name: 'size',
|
|
1087
|
+
type: 'number',
|
|
1088
|
+
default: 20,
|
|
1089
|
+
description: 'Number of items per page',
|
|
1090
|
+
},
|
|
1091
|
+
],
|
|
1092
|
+
},
|
|
949
1093
|
// ==================================================================
|
|
950
1094
|
// CHAT
|
|
951
1095
|
// ==================================================================
|
|
@@ -1073,11 +1217,12 @@ class Aiteza {
|
|
|
1073
1217
|
displayOptions: { show: { resource: ['chat'], operation: ['generate', 'estimate'] } },
|
|
1074
1218
|
options: [
|
|
1075
1219
|
{
|
|
1076
|
-
displayName: 'Connected Dataroom IDs',
|
|
1220
|
+
displayName: 'Connected Dataroom Names or IDs',
|
|
1077
1221
|
name: 'connectedDatarooms',
|
|
1078
|
-
type: '
|
|
1079
|
-
|
|
1080
|
-
|
|
1222
|
+
type: 'multiOptions',
|
|
1223
|
+
typeOptions: { loadOptionsMethod: 'getDatarooms' },
|
|
1224
|
+
default: [],
|
|
1225
|
+
description: 'Datarooms for context. Choose from the list (prepopulated with recently used), or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
1081
1226
|
},
|
|
1082
1227
|
{
|
|
1083
1228
|
displayName: 'File IDs',
|
|
@@ -1150,11 +1295,12 @@ class Aiteza {
|
|
|
1150
1295
|
displayOptions: { show: { resource: ['chat'], operation: ['tempChat'] } },
|
|
1151
1296
|
options: [
|
|
1152
1297
|
{
|
|
1153
|
-
displayName: 'Connected Dataroom IDs',
|
|
1298
|
+
displayName: 'Connected Dataroom Names or IDs',
|
|
1154
1299
|
name: 'connectedDatarooms',
|
|
1155
|
-
type: '
|
|
1156
|
-
|
|
1157
|
-
|
|
1300
|
+
type: 'multiOptions',
|
|
1301
|
+
typeOptions: { loadOptionsMethod: 'getDatarooms' },
|
|
1302
|
+
default: [],
|
|
1303
|
+
description: 'Datarooms to search. Choose from the list (prepopulated with recently used), or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
1158
1304
|
},
|
|
1159
1305
|
{
|
|
1160
1306
|
displayName: 'File IDs',
|
|
@@ -1248,12 +1394,13 @@ class Aiteza {
|
|
|
1248
1394
|
description: 'The search query text',
|
|
1249
1395
|
},
|
|
1250
1396
|
{
|
|
1251
|
-
displayName: 'Dataroom IDs',
|
|
1397
|
+
displayName: 'Dataroom Names or IDs',
|
|
1252
1398
|
name: 'dataroomIds',
|
|
1253
|
-
type: '
|
|
1254
|
-
|
|
1399
|
+
type: 'multiOptions',
|
|
1400
|
+
typeOptions: { loadOptionsMethod: 'getDatarooms' },
|
|
1401
|
+
default: [],
|
|
1255
1402
|
displayOptions: { show: { resource: ['search'], operation: ['hybridSearch'] } },
|
|
1256
|
-
description: '
|
|
1403
|
+
description: 'Datarooms to search across. Can be empty for standalone file/image workflows. Choose from the list (prepopulated with recently used), or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
1257
1404
|
},
|
|
1258
1405
|
{
|
|
1259
1406
|
displayName: 'Additional Fields',
|
|
@@ -1296,6 +1443,20 @@ class Aiteza {
|
|
|
1296
1443
|
default: 0,
|
|
1297
1444
|
description: 'Maximum number of tokens in result set (0 = no limit)',
|
|
1298
1445
|
},
|
|
1446
|
+
{
|
|
1447
|
+
displayName: 'File IDs',
|
|
1448
|
+
name: 'fileIds',
|
|
1449
|
+
type: 'string',
|
|
1450
|
+
default: '',
|
|
1451
|
+
description: 'Comma-separated list of standalone file IDs to include in the search scope. Used when files are attached directly (e.g., in workflow executions) without a dataroom.',
|
|
1452
|
+
},
|
|
1453
|
+
{
|
|
1454
|
+
displayName: 'Image IDs',
|
|
1455
|
+
name: 'imageIds',
|
|
1456
|
+
type: 'string',
|
|
1457
|
+
default: '',
|
|
1458
|
+
description: 'Comma-separated list of standalone image IDs to include in the search scope. Used when images are attached directly (e.g., in workflow executions) without a dataroom.',
|
|
1459
|
+
},
|
|
1299
1460
|
],
|
|
1300
1461
|
},
|
|
1301
1462
|
// ==================================================================
|
|
@@ -1362,6 +1523,7 @@ class Aiteza {
|
|
|
1362
1523
|
async execute() {
|
|
1363
1524
|
const items = this.getInputData();
|
|
1364
1525
|
const returnData = [];
|
|
1526
|
+
const CHAT_REQUEST_TIMEOUT_MS = 20 * 60 * 1000;
|
|
1365
1527
|
const resource = this.getNodeParameter('resource', 0);
|
|
1366
1528
|
const operation = this.getNodeParameter('operation', 0);
|
|
1367
1529
|
const authMode = this.getNodeParameter('authSource', 0, 'credentials');
|
|
@@ -1370,7 +1532,12 @@ class Aiteza {
|
|
|
1370
1532
|
const triggerToken = (0, GenericFunctions_1.getUpstreamAuthToken)(this);
|
|
1371
1533
|
if (!triggerToken) {
|
|
1372
1534
|
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Authentication is set to "From AITEZA Trigger" but no auth token was found in the input data. ' +
|
|
1373
|
-
'Make sure this node is connected to an AITEZA Trigger node.');
|
|
1535
|
+
'Make sure this node is connected (directly or indirectly) to an AITEZA Trigger node so its _authToken is forwarded.');
|
|
1536
|
+
}
|
|
1537
|
+
if ((0, GenericFunctions_1.isJwtExpired)(triggerToken)) {
|
|
1538
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'The auth token forwarded by the AITEZA Trigger has expired. ' +
|
|
1539
|
+
'User tokens are short-lived (typically ~5 minutes) and cannot be refreshed from inside the workflow. ' +
|
|
1540
|
+
'Re-trigger the workflow, shorten its runtime, or have AITEZA mint a longer-lived token for delegated workflow execution.');
|
|
1374
1541
|
}
|
|
1375
1542
|
const paramBaseUrl = this.getNodeParameter('baseUrl', 0, '').replace(/\/+$/, '');
|
|
1376
1543
|
const baseUrl = paramBaseUrl || (0, GenericFunctions_1.getUpstreamBaseUrl)(this) || '';
|
|
@@ -1433,6 +1600,15 @@ class Aiteza {
|
|
|
1433
1600
|
return url;
|
|
1434
1601
|
};
|
|
1435
1602
|
const splitCsv = (val) => val.split(',').map((s) => s.trim()).filter(Boolean);
|
|
1603
|
+
// Accepts a value from a multiOptions field (array), a comma-separated string,
|
|
1604
|
+
// or an expression-supplied array/string. Returns a clean list of IDs.
|
|
1605
|
+
const toIdArray = (val) => {
|
|
1606
|
+
if (Array.isArray(val))
|
|
1607
|
+
return val.map((v) => String(v).trim()).filter(Boolean);
|
|
1608
|
+
if (typeof val === 'string')
|
|
1609
|
+
return splitCsv(val);
|
|
1610
|
+
return [];
|
|
1611
|
+
};
|
|
1436
1612
|
for (let i = 0; i < items.length; i++) {
|
|
1437
1613
|
try {
|
|
1438
1614
|
let responseData;
|
|
@@ -1471,7 +1647,7 @@ class Aiteza {
|
|
|
1471
1647
|
}
|
|
1472
1648
|
else if (operation === 'delete') {
|
|
1473
1649
|
const idsRaw = this.getNodeParameter('dataroomIds', i);
|
|
1474
|
-
const dataroomIds =
|
|
1650
|
+
const dataroomIds = toIdArray(idsRaw);
|
|
1475
1651
|
(0, GenericFunctions_1.validateRequiredField)(this, dataroomIds.length > 0 ? 'ok' : '', 'Dataroom IDs');
|
|
1476
1652
|
responseData = await apiReq('DELETE', '/api/dataroom/delete', { dataroomIds });
|
|
1477
1653
|
}
|
|
@@ -1496,7 +1672,7 @@ class Aiteza {
|
|
|
1496
1672
|
else if (operation === 'setConnected') {
|
|
1497
1673
|
const id = this.getNodeParameter('dataroomId', i);
|
|
1498
1674
|
const idsRaw = this.getNodeParameter('connectedDataroomIds', i);
|
|
1499
|
-
const connectedDataroomIds =
|
|
1675
|
+
const connectedDataroomIds = toIdArray(idsRaw);
|
|
1500
1676
|
responseData = await apiReq('PUT', `/api/dataroom/${id}/connected`, { connectedDataroomIds });
|
|
1501
1677
|
}
|
|
1502
1678
|
else if (operation === 'getChats') {
|
|
@@ -1666,6 +1842,33 @@ class Aiteza {
|
|
|
1666
1842
|
const url = await buildFileUploadUrl(i, '/api/files');
|
|
1667
1843
|
responseData = await doUpload(i, url, 'files', 'file');
|
|
1668
1844
|
}
|
|
1845
|
+
else if (operation === 'bulkDelete') {
|
|
1846
|
+
const dataroomId = this.getNodeParameter('dataroomId', i);
|
|
1847
|
+
const ids = toIdArray(this.getNodeParameter('fileIds', i, []));
|
|
1848
|
+
(0, GenericFunctions_1.validateRequiredField)(this, ids.length > 0 ? 'ok' : '', 'File IDs');
|
|
1849
|
+
responseData = await apiReq('DELETE', `/api/dataroom/${dataroomId}/files/bulk`, { ids });
|
|
1850
|
+
}
|
|
1851
|
+
else if (operation === 'bulkMove') {
|
|
1852
|
+
const dataroomId = this.getNodeParameter('dataroomId', i);
|
|
1853
|
+
const ids = toIdArray(this.getNodeParameter('fileIds', i, []));
|
|
1854
|
+
const targetDataroom = this.getNodeParameter('targetDataroomId', i);
|
|
1855
|
+
(0, GenericFunctions_1.validateRequiredField)(this, ids.length > 0 ? 'ok' : '', 'File IDs');
|
|
1856
|
+
responseData = await apiReq('PUT', `/api/dataroom/${dataroomId}/files/bulk`, { ids, targetDataroom });
|
|
1857
|
+
}
|
|
1858
|
+
else if (operation === 'bulkPatch') {
|
|
1859
|
+
const dataroomId = this.getNodeParameter('dataroomId', i);
|
|
1860
|
+
const ids = toIdArray(this.getNodeParameter('fileIds', i, []));
|
|
1861
|
+
const reprocess = this.getNodeParameter('reprocess', i, false);
|
|
1862
|
+
(0, GenericFunctions_1.validateRequiredField)(this, ids.length > 0 ? 'ok' : '', 'File IDs');
|
|
1863
|
+
const body = { ids, reprocess };
|
|
1864
|
+
if (reprocess) {
|
|
1865
|
+
body.processingPipeline = this.getNodeParameter('processingPipeline', i);
|
|
1866
|
+
const vlmModel = this.getNodeParameter('vlmModel', i, '');
|
|
1867
|
+
if (vlmModel)
|
|
1868
|
+
body.vlmModel = vlmModel;
|
|
1869
|
+
}
|
|
1870
|
+
responseData = await apiReq('PATCH', `/api/dataroom/${dataroomId}/files/bulk`, body);
|
|
1871
|
+
}
|
|
1669
1872
|
}
|
|
1670
1873
|
// ── IMAGE ────────────────────────────────────────────────
|
|
1671
1874
|
else if (resource === 'image') {
|
|
@@ -1743,6 +1946,27 @@ class Aiteza {
|
|
|
1743
1946
|
const baseUrl = await getBaseUrl();
|
|
1744
1947
|
responseData = await doUpload(i, `${baseUrl}/api/images`, 'images', 'image');
|
|
1745
1948
|
}
|
|
1949
|
+
else if (operation === 'bulkDelete') {
|
|
1950
|
+
const dataroomId = this.getNodeParameter('dataroomId', i);
|
|
1951
|
+
const ids = toIdArray(this.getNodeParameter('imageIds', i, []));
|
|
1952
|
+
(0, GenericFunctions_1.validateRequiredField)(this, ids.length > 0 ? 'ok' : '', 'Image IDs');
|
|
1953
|
+
responseData = await apiReq('DELETE', `/api/dataroom/${dataroomId}/images/bulk`, { ids });
|
|
1954
|
+
}
|
|
1955
|
+
else if (operation === 'bulkMove') {
|
|
1956
|
+
const dataroomId = this.getNodeParameter('dataroomId', i);
|
|
1957
|
+
const ids = toIdArray(this.getNodeParameter('imageIds', i, []));
|
|
1958
|
+
const targetDataroom = this.getNodeParameter('targetDataroomId', i);
|
|
1959
|
+
(0, GenericFunctions_1.validateRequiredField)(this, ids.length > 0 ? 'ok' : '', 'Image IDs');
|
|
1960
|
+
responseData = await apiReq('PUT', `/api/dataroom/${dataroomId}/images/bulk`, { ids, targetDataroom });
|
|
1961
|
+
}
|
|
1962
|
+
else if (operation === 'bulkPatch') {
|
|
1963
|
+
const dataroomId = this.getNodeParameter('dataroomId', i);
|
|
1964
|
+
const ids = toIdArray(this.getNodeParameter('imageIds', i, []));
|
|
1965
|
+
const reprocess = this.getNodeParameter('reprocess', i, false);
|
|
1966
|
+
const patchOptions = this.getNodeParameter('patchOptions', i, {});
|
|
1967
|
+
(0, GenericFunctions_1.validateRequiredField)(this, ids.length > 0 ? 'ok' : '', 'Image IDs');
|
|
1968
|
+
responseData = await apiReq('PATCH', `/api/dataroom/${dataroomId}/images/bulk`, { ids, reprocess, ...patchOptions });
|
|
1969
|
+
}
|
|
1746
1970
|
}
|
|
1747
1971
|
// ── WEB SOURCE ───────────────────────────────────────────
|
|
1748
1972
|
else if (resource === 'webSource') {
|
|
@@ -1754,6 +1978,10 @@ class Aiteza {
|
|
|
1754
1978
|
const webSourceId = this.getNodeParameter('webSourceId', i);
|
|
1755
1979
|
responseData = await apiReq('GET', `/api/dataroom/${dataroomId}/websites/${webSourceId}`);
|
|
1756
1980
|
}
|
|
1981
|
+
else if (operation === 'getUrls') {
|
|
1982
|
+
const webSourceId = this.getNodeParameter('webSourceId', i);
|
|
1983
|
+
responseData = await apiReq('GET', `/api/dataroom/${dataroomId}/websites/${webSourceId}/urls`, {}, buildPaginationQs(i));
|
|
1984
|
+
}
|
|
1757
1985
|
else if (operation === 'add') {
|
|
1758
1986
|
const url = this.getNodeParameter('url', i);
|
|
1759
1987
|
const additionalFields = this.getNodeParameter('additionalFields', i, {});
|
|
@@ -1777,45 +2005,63 @@ class Aiteza {
|
|
|
1777
2005
|
const targetDataroomId = this.getNodeParameter('targetDataroomId', i);
|
|
1778
2006
|
responseData = await apiReq('PATCH', `/api/dataroom/${dataroomId}/websites/${webSourceId}/move`, {}, { targetDataroom: targetDataroomId });
|
|
1779
2007
|
}
|
|
2008
|
+
else if (operation === 'bulkDelete') {
|
|
2009
|
+
const ids = toIdArray(this.getNodeParameter('webSourceIds', i, []));
|
|
2010
|
+
(0, GenericFunctions_1.validateRequiredField)(this, ids.length > 0 ? 'ok' : '', 'Web Source IDs');
|
|
2011
|
+
responseData = await apiReq('DELETE', `/api/dataroom/${dataroomId}/websites/bulk`, { ids });
|
|
2012
|
+
}
|
|
2013
|
+
else if (operation === 'bulkMove') {
|
|
2014
|
+
const ids = toIdArray(this.getNodeParameter('webSourceIds', i, []));
|
|
2015
|
+
const targetDataroom = this.getNodeParameter('targetDataroomId', i);
|
|
2016
|
+
(0, GenericFunctions_1.validateRequiredField)(this, ids.length > 0 ? 'ok' : '', 'Web Source IDs');
|
|
2017
|
+
responseData = await apiReq('PUT', `/api/dataroom/${dataroomId}/websites/bulk`, { ids, targetDataroom });
|
|
2018
|
+
}
|
|
2019
|
+
else if (operation === 'bulkPatch') {
|
|
2020
|
+
const ids = toIdArray(this.getNodeParameter('webSourceIds', i, []));
|
|
2021
|
+
const reprocess = this.getNodeParameter('reprocess', i, false);
|
|
2022
|
+
const patchOptions = this.getNodeParameter('patchOptions', i, {});
|
|
2023
|
+
(0, GenericFunctions_1.validateRequiredField)(this, ids.length > 0 ? 'ok' : '', 'Web Source IDs');
|
|
2024
|
+
responseData = await apiReq('PATCH', `/api/dataroom/${dataroomId}/websites/bulk`, { ids, reprocess, ...patchOptions });
|
|
2025
|
+
}
|
|
1780
2026
|
}
|
|
1781
2027
|
// ── CHAT ─────────────────────────────────────────────────
|
|
1782
2028
|
else if (resource === 'chat') {
|
|
1783
2029
|
if (operation === 'create') {
|
|
1784
2030
|
const chatName = this.getNodeParameter('chatName', i, '');
|
|
1785
|
-
responseData = await apiReq('POST', '/api/chat', chatName ? { name: chatName } : {});
|
|
2031
|
+
responseData = await apiReq('POST', '/api/chat', chatName ? { name: chatName } : {}, {}, { timeout: CHAT_REQUEST_TIMEOUT_MS });
|
|
1786
2032
|
}
|
|
1787
2033
|
else if (operation === 'get') {
|
|
1788
2034
|
const chatId = this.getNodeParameter('chatId', i);
|
|
1789
|
-
responseData = await apiReq('GET', `/api/chat/${chatId}
|
|
2035
|
+
responseData = await apiReq('GET', `/api/chat/${chatId}`, {}, {}, { timeout: CHAT_REQUEST_TIMEOUT_MS });
|
|
1790
2036
|
}
|
|
1791
2037
|
else if (operation === 'getMany') {
|
|
1792
|
-
responseData = await apiReq('GET', '/api/chat', {}, buildPaginationQs(i));
|
|
2038
|
+
responseData = await apiReq('GET', '/api/chat', {}, buildPaginationQs(i), { timeout: CHAT_REQUEST_TIMEOUT_MS });
|
|
1793
2039
|
}
|
|
1794
2040
|
else if (operation === 'getMessages') {
|
|
1795
2041
|
const chatId = this.getNodeParameter('chatId', i);
|
|
1796
|
-
responseData = await apiReq('GET', `/api/chat/${chatId}/messages
|
|
2042
|
+
responseData = await apiReq('GET', `/api/chat/${chatId}/messages`, {}, {}, { timeout: CHAT_REQUEST_TIMEOUT_MS });
|
|
1797
2043
|
}
|
|
1798
2044
|
else if (operation === 'getMessage') {
|
|
1799
2045
|
const chatId = this.getNodeParameter('chatId', i);
|
|
1800
2046
|
const messageId = this.getNodeParameter('messageId', i);
|
|
1801
|
-
responseData = await apiReq('GET', `/api/chat/${chatId}/messages/${messageId}
|
|
2047
|
+
responseData = await apiReq('GET', `/api/chat/${chatId}/messages/${messageId}`, {}, {}, { timeout: CHAT_REQUEST_TIMEOUT_MS });
|
|
1802
2048
|
}
|
|
1803
2049
|
else if (operation === 'getLatestMessage') {
|
|
1804
2050
|
const chatId = this.getNodeParameter('chatId', i);
|
|
1805
|
-
responseData = await apiReq('GET', `/api/chat/${chatId}/messages/latest
|
|
2051
|
+
responseData = await apiReq('GET', `/api/chat/${chatId}/messages/latest`, {}, {}, { timeout: CHAT_REQUEST_TIMEOUT_MS });
|
|
1806
2052
|
}
|
|
1807
2053
|
else if (operation === 'delete') {
|
|
1808
2054
|
const chatId = this.getNodeParameter('chatId', i);
|
|
1809
|
-
responseData = await apiReq('DELETE', `/api/chat/${chatId}
|
|
2055
|
+
responseData = await apiReq('DELETE', `/api/chat/${chatId}`, {}, {}, { timeout: CHAT_REQUEST_TIMEOUT_MS });
|
|
1810
2056
|
}
|
|
1811
2057
|
else if (operation === 'deleteMessages') {
|
|
1812
2058
|
const chatId = this.getNodeParameter('chatId', i);
|
|
1813
|
-
responseData = await apiReq('DELETE', `/api/chat/${chatId}/messages
|
|
2059
|
+
responseData = await apiReq('DELETE', `/api/chat/${chatId}/messages`, {}, {}, { timeout: CHAT_REQUEST_TIMEOUT_MS });
|
|
1814
2060
|
}
|
|
1815
2061
|
else if (operation === 'rename') {
|
|
1816
2062
|
const chatId = this.getNodeParameter('chatId', i);
|
|
1817
2063
|
const newName = this.getNodeParameter('newName', i);
|
|
1818
|
-
responseData = await apiReq('PATCH', `/api/chat/${chatId}`, { name: newName });
|
|
2064
|
+
responseData = await apiReq('PATCH', `/api/chat/${chatId}`, { name: newName }, {}, { timeout: CHAT_REQUEST_TIMEOUT_MS });
|
|
1819
2065
|
}
|
|
1820
2066
|
else if (operation === 'generate') {
|
|
1821
2067
|
const chatId = this.getNodeParameter('chatId', i);
|
|
@@ -1826,8 +2072,8 @@ class Aiteza {
|
|
|
1826
2072
|
form.append('prompt', prompt);
|
|
1827
2073
|
form.append('model', model);
|
|
1828
2074
|
for (const key of ['connectedDatarooms', 'fileIds', 'imageIds']) {
|
|
1829
|
-
if (additionalFields[key]) {
|
|
1830
|
-
for (const val of
|
|
2075
|
+
if (additionalFields[key] !== undefined && additionalFields[key] !== '') {
|
|
2076
|
+
for (const val of toIdArray(additionalFields[key])) {
|
|
1831
2077
|
form.append(key, val);
|
|
1832
2078
|
}
|
|
1833
2079
|
}
|
|
@@ -1841,6 +2087,7 @@ class Aiteza {
|
|
|
1841
2087
|
method: 'POST',
|
|
1842
2088
|
url: `${baseUrl}/api/chat/${chatId}/generate`,
|
|
1843
2089
|
body: form,
|
|
2090
|
+
timeout: CHAT_REQUEST_TIMEOUT_MS,
|
|
1844
2091
|
returnFullResponse: true,
|
|
1845
2092
|
});
|
|
1846
2093
|
responseData = typeof response === 'object' && response.body !== undefined ? response.body : response;
|
|
@@ -1857,8 +2104,8 @@ class Aiteza {
|
|
|
1857
2104
|
form.append('prompt', prompt);
|
|
1858
2105
|
form.append('model', model);
|
|
1859
2106
|
for (const key of ['connectedDatarooms', 'fileIds', 'imageIds']) {
|
|
1860
|
-
if (additionalFields[key]) {
|
|
1861
|
-
for (const val of
|
|
2107
|
+
if (additionalFields[key] !== undefined && additionalFields[key] !== '') {
|
|
2108
|
+
for (const val of toIdArray(additionalFields[key])) {
|
|
1862
2109
|
form.append(key, val);
|
|
1863
2110
|
}
|
|
1864
2111
|
}
|
|
@@ -1872,6 +2119,7 @@ class Aiteza {
|
|
|
1872
2119
|
method: 'POST',
|
|
1873
2120
|
url: `${baseUrl}/api/chat/estimate`,
|
|
1874
2121
|
body: form,
|
|
2122
|
+
timeout: CHAT_REQUEST_TIMEOUT_MS,
|
|
1875
2123
|
});
|
|
1876
2124
|
}
|
|
1877
2125
|
else if (operation === 'tempChat') {
|
|
@@ -1882,8 +2130,8 @@ class Aiteza {
|
|
|
1882
2130
|
form.append('prompt', prompt);
|
|
1883
2131
|
form.append('model', model);
|
|
1884
2132
|
for (const key of ['connectedDatarooms', 'fileIds', 'imageIds']) {
|
|
1885
|
-
if (additionalFields[key]) {
|
|
1886
|
-
for (const val of
|
|
2133
|
+
if (additionalFields[key] !== undefined && additionalFields[key] !== '') {
|
|
2134
|
+
for (const val of toIdArray(additionalFields[key])) {
|
|
1887
2135
|
form.append(key, val);
|
|
1888
2136
|
}
|
|
1889
2137
|
}
|
|
@@ -1897,6 +2145,7 @@ class Aiteza {
|
|
|
1897
2145
|
method: 'POST',
|
|
1898
2146
|
url: `${baseUrl}/api/chat/temp`,
|
|
1899
2147
|
body: form,
|
|
2148
|
+
timeout: CHAT_REQUEST_TIMEOUT_MS,
|
|
1900
2149
|
});
|
|
1901
2150
|
if (typeof responseData === 'string') {
|
|
1902
2151
|
responseData = { result: responseData };
|
|
@@ -1923,11 +2172,12 @@ class Aiteza {
|
|
|
1923
2172
|
else if (resource === 'search') {
|
|
1924
2173
|
if (operation === 'hybridSearch') {
|
|
1925
2174
|
const query = this.getNodeParameter('searchQuery', i);
|
|
1926
|
-
const dataroomIdsRaw = this.getNodeParameter('dataroomIds', i,
|
|
2175
|
+
const dataroomIdsRaw = this.getNodeParameter('dataroomIds', i, []);
|
|
1927
2176
|
const additionalFields = this.getNodeParameter('additionalFields', i, {});
|
|
1928
2177
|
const body = { query };
|
|
1929
|
-
|
|
1930
|
-
|
|
2178
|
+
const dataroomIds = toIdArray(dataroomIdsRaw);
|
|
2179
|
+
if (dataroomIds.length > 0)
|
|
2180
|
+
body.dataroomIds = dataroomIds;
|
|
1931
2181
|
for (const key of ['topK', 'vectorThreshold', 'enableReranking', 'enableFullTextSearch']) {
|
|
1932
2182
|
if (additionalFields[key] !== undefined)
|
|
1933
2183
|
body[key] = additionalFields[key];
|
|
@@ -1935,6 +2185,13 @@ class Aiteza {
|
|
|
1935
2185
|
if (additionalFields.maxTokens && additionalFields.maxTokens > 0) {
|
|
1936
2186
|
body.maxTokens = additionalFields.maxTokens;
|
|
1937
2187
|
}
|
|
2188
|
+
for (const key of ['fileIds', 'imageIds']) {
|
|
2189
|
+
if (additionalFields[key] !== undefined && additionalFields[key] !== '') {
|
|
2190
|
+
const ids = toIdArray(additionalFields[key]);
|
|
2191
|
+
if (ids.length > 0)
|
|
2192
|
+
body[key] = ids;
|
|
2193
|
+
}
|
|
2194
|
+
}
|
|
1938
2195
|
responseData = await apiReq('POST', '/api/dataroom/search', body);
|
|
1939
2196
|
}
|
|
1940
2197
|
}
|