n8n-nodes-prestashop8 1.2.6 → 2.0.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.
@@ -5,6 +5,7 @@ export declare class PrestaShop8 implements INodeType {
5
5
  loadOptions: {
6
6
  getOperations(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
7
7
  getRequiredFields(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
8
+ getAvailableFields(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
8
9
  };
9
10
  };
10
11
  execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
@@ -208,7 +208,7 @@ exports.PrestaShop8Description = {
208
208
  placeholder: '[id,name,price,reference]',
209
209
  description: 'PrestaShop field list format: [field1,field2,field3] or comma-separated: field1,field2,field3',
210
210
  },
211
- // Search Filters
211
+ // Search Filters - Images resource (custom filter only)
212
212
  {
213
213
  displayName: 'Search Filters',
214
214
  name: 'filters',
@@ -216,6 +216,7 @@ exports.PrestaShop8Description = {
216
216
  displayOptions: {
217
217
  show: {
218
218
  operation: ['search'],
219
+ resource: ['images'],
219
220
  },
220
221
  },
221
222
  default: {},
@@ -225,8 +226,8 @@ exports.PrestaShop8Description = {
225
226
  },
226
227
  options: [
227
228
  {
228
- name: 'filter',
229
- displayName: 'Filter',
229
+ name: 'customFilter',
230
+ displayName: 'Custom Filter',
230
231
  values: [
231
232
  {
232
233
  displayName: 'Field',
@@ -234,7 +235,85 @@ exports.PrestaShop8Description = {
234
235
  type: 'string',
235
236
  default: '',
236
237
  placeholder: 'name, reference, price, etc.',
237
- description: 'Name of field to filter. Examples: name, reference, price, active, id_manufacturer, etc.',
238
+ description: 'Name of field to filter.',
239
+ displayOptions: {
240
+ hide: {
241
+ operator: ['CUSTOM'],
242
+ },
243
+ },
244
+ },
245
+ {
246
+ displayName: 'Operator',
247
+ name: 'operator',
248
+ type: 'options',
249
+ options: types_1.FILTER_OPERATORS,
250
+ default: '=',
251
+ noDataExpression: true,
252
+ description: 'Comparison operator for filtering. Custom allows you to write your own filter expression.',
253
+ },
254
+ {
255
+ displayName: 'Value',
256
+ name: 'value',
257
+ type: 'string',
258
+ default: '',
259
+ placeholder: 'search value or interval',
260
+ description: 'Value to search for. For Equal/Not Equal: use "10,20" for intervals (becomes [10,20]).',
261
+ displayOptions: {
262
+ hide: {
263
+ operator: ['IS_EMPTY', 'IS_NOT_EMPTY', 'CUSTOM'],
264
+ },
265
+ },
266
+ },
267
+ {
268
+ displayName: 'Custom Filter Expression',
269
+ name: 'customFilterExpression',
270
+ type: 'string',
271
+ default: '',
272
+ placeholder: 'filter[name]=[Product]%',
273
+ description: 'Complete filter expression in PrestaShop format. Example: filter[name]=[Product]%, filter[price]=>[100], etc.',
274
+ displayOptions: {
275
+ show: {
276
+ operator: ['CUSTOM'],
277
+ },
278
+ },
279
+ },
280
+ ],
281
+ },
282
+ ],
283
+ description: 'PrestaShop filters to apply to the search. Enter field names directly.',
284
+ },
285
+ // Search Filters - Other resources (with 2 filter types)
286
+ {
287
+ displayName: 'Search Filters',
288
+ name: 'filters',
289
+ type: 'fixedCollection',
290
+ displayOptions: {
291
+ show: {
292
+ operation: ['search'],
293
+ },
294
+ hide: {
295
+ resource: ['images'],
296
+ },
297
+ },
298
+ default: {},
299
+ placeholder: 'Add Filter',
300
+ typeOptions: {
301
+ multipleValues: true,
302
+ },
303
+ options: [
304
+ {
305
+ name: 'standardFilter',
306
+ displayName: 'Standard Filter',
307
+ values: [
308
+ {
309
+ displayName: 'Field',
310
+ name: 'field',
311
+ type: 'options',
312
+ typeOptions: {
313
+ loadOptionsMethod: 'getAvailableFields',
314
+ },
315
+ default: '',
316
+ description: 'Select a field from the PrestaShop schema.',
238
317
  displayOptions: {
239
318
  hide: {
240
319
  operator: ['CUSTOM'],
@@ -265,7 +344,61 @@ exports.PrestaShop8Description = {
265
344
  },
266
345
  {
267
346
  displayName: 'Custom Filter Expression',
268
- name: 'customFilter',
347
+ name: 'customFilterExpression',
348
+ type: 'string',
349
+ default: '',
350
+ placeholder: 'filter[name]=[Product]%',
351
+ description: 'Complete filter expression in PrestaShop format. Example: filter[name]=[Product]%, filter[price]=>[100], etc.',
352
+ displayOptions: {
353
+ show: {
354
+ operator: ['CUSTOM'],
355
+ },
356
+ },
357
+ },
358
+ ],
359
+ },
360
+ {
361
+ name: 'customFilter',
362
+ displayName: 'Custom Filter',
363
+ values: [
364
+ {
365
+ displayName: 'Field',
366
+ name: 'field',
367
+ type: 'string',
368
+ default: '',
369
+ placeholder: 'name, reference, price, etc.',
370
+ description: 'Enter your custom field name.',
371
+ displayOptions: {
372
+ hide: {
373
+ operator: ['CUSTOM'],
374
+ },
375
+ },
376
+ },
377
+ {
378
+ displayName: 'Operator',
379
+ name: 'operator',
380
+ type: 'options',
381
+ options: types_1.FILTER_OPERATORS,
382
+ default: '=',
383
+ noDataExpression: true,
384
+ description: 'Comparison operator for filtering. Custom allows you to write your own filter expression.',
385
+ },
386
+ {
387
+ displayName: 'Value',
388
+ name: 'value',
389
+ type: 'string',
390
+ default: '',
391
+ placeholder: 'search value or interval',
392
+ description: 'Value to search for. Examples: "Product Name", "1" (active), "29.99" (price). For Equal/Not Equal: use "10,20" for intervals (becomes [10,20]).',
393
+ displayOptions: {
394
+ hide: {
395
+ operator: ['IS_EMPTY', 'IS_NOT_EMPTY', 'CUSTOM'],
396
+ },
397
+ },
398
+ },
399
+ {
400
+ displayName: 'Custom Filter Expression',
401
+ name: 'customFilterExpression',
269
402
  type: 'string',
270
403
  default: '',
271
404
  placeholder: 'filter[name]=[Product]%',
@@ -279,7 +412,7 @@ exports.PrestaShop8Description = {
279
412
  ],
280
413
  },
281
414
  ],
282
- description: 'PrestaShop filters to apply to the search',
415
+ description: 'PrestaShop filters to apply to the search. Choose "Standard Filter" to select from schema or "Custom Filter" to enter your own field name.',
283
416
  },
284
417
  // === REQUIRED FIELDS FOR PRODUCTS ===
285
418
  {
@@ -535,127 +668,148 @@ exports.PrestaShop8Description = {
535
668
  required: true,
536
669
  description: 'Whether the manufacturer is active (visible) or not.',
537
670
  },
538
- // === REQUIRED FIELDS FOR STOCK_AVAILABLES (UPDATE) ===
671
+ // Additional Fields for CREATE (for non-required fields)
539
672
  {
540
- displayName: 'Product ID',
541
- name: 'stockProductId',
542
- type: 'number',
673
+ displayName: 'Additional Fields',
674
+ name: 'additionalFieldsSection',
675
+ type: 'notice',
543
676
  displayOptions: {
544
677
  show: {
545
- resource: ['stock_availables'],
546
- operation: ['update'],
678
+ operation: ['create'],
547
679
  },
548
680
  },
549
- default: 0,
550
- required: true,
551
- placeholder: '1',
552
- description: 'ID of the product (id_product)',
553
- },
554
- {
555
- displayName: 'Product Attribute ID',
556
- name: 'stockProductAttributeId',
557
- type: 'number',
558
- displayOptions: {
559
- show: {
560
- resource: ['stock_availables'],
561
- operation: ['update'],
562
- },
681
+ default: '',
682
+ typeOptions: {
683
+ theme: 'info',
563
684
  },
564
- default: 0,
565
- required: true,
566
- placeholder: '0',
567
- description: 'ID of the product combination/attribute (id_product_attribute). Use 0 for products without combinations',
568
685
  },
686
+ // Additional Fields for Create operation - Images resource (custom field only)
569
687
  {
570
- displayName: 'Quantity',
571
- name: 'stockQuantity',
572
- type: 'number',
688
+ displayName: 'Additional Fields',
689
+ name: 'fieldsToCreate',
690
+ type: 'fixedCollection',
573
691
  displayOptions: {
574
692
  show: {
575
- resource: ['stock_availables'],
576
- operation: ['update'],
693
+ operation: ['create'],
694
+ resource: ['images'],
577
695
  },
578
696
  },
579
- default: 0,
580
- required: true,
581
- placeholder: '100',
582
- description: 'Available quantity in stock',
583
- },
584
- {
585
- displayName: 'Depends On Stock',
586
- name: 'stockDependsOnStock',
587
- type: 'options',
588
- displayOptions: {
589
- show: {
590
- resource: ['stock_availables'],
591
- operation: ['update'],
592
- },
697
+ default: {},
698
+ placeholder: 'Add field',
699
+ typeOptions: {
700
+ multipleValues: true,
701
+ sortable: true,
593
702
  },
594
703
  options: [
595
704
  {
596
- name: 'Yes',
597
- value: '1',
598
- },
599
- {
600
- name: 'No',
601
- value: '0',
705
+ displayName: 'Custom Field',
706
+ name: 'customField',
707
+ values: [
708
+ {
709
+ displayName: 'Name',
710
+ name: 'name',
711
+ type: 'string',
712
+ default: '',
713
+ required: true,
714
+ placeholder: 'Field name',
715
+ description: 'Name of the field to set.',
716
+ },
717
+ {
718
+ displayName: 'Value',
719
+ name: 'value',
720
+ type: 'string',
721
+ default: '',
722
+ required: true,
723
+ placeholder: 'Field value',
724
+ description: 'Value to set. Will be properly escaped for XML.',
725
+ },
726
+ ],
602
727
  },
603
728
  ],
604
- default: '0',
605
- required: true,
606
- description: 'Whether stock management depends on warehouse stock',
729
+ description: 'Additional optional fields for images. Enter field names directly.',
607
730
  },
731
+ // Additional Fields for Create operation - Other resources (with 2 field types)
608
732
  {
609
- displayName: 'Out Of Stock',
610
- name: 'stockOutOfStock',
611
- type: 'options',
733
+ displayName: 'Additional Fields',
734
+ name: 'fieldsToCreate',
735
+ type: 'fixedCollection',
612
736
  displayOptions: {
613
737
  show: {
614
- resource: ['stock_availables'],
615
- operation: ['update'],
738
+ operation: ['create'],
739
+ },
740
+ hide: {
741
+ resource: ['images'],
616
742
  },
617
743
  },
744
+ default: {},
745
+ placeholder: 'Add field',
746
+ typeOptions: {
747
+ multipleValues: true,
748
+ sortable: true,
749
+ },
618
750
  options: [
619
751
  {
620
- name: 'Deny Orders',
621
- value: '0',
622
- },
623
- {
624
- name: 'Allow Orders',
625
- value: '1',
752
+ displayName: 'Standard Field',
753
+ name: 'standardField',
754
+ values: [
755
+ {
756
+ displayName: 'Name',
757
+ name: 'name',
758
+ type: 'options',
759
+ typeOptions: {
760
+ loadOptionsMethod: 'getAvailableFields',
761
+ },
762
+ default: '',
763
+ required: true,
764
+ description: 'Select a field from the PrestaShop schema.',
765
+ },
766
+ {
767
+ displayName: 'Value',
768
+ name: 'value',
769
+ type: 'string',
770
+ default: '',
771
+ required: true,
772
+ placeholder: 'Field value',
773
+ description: 'Value to set. Will be properly escaped for XML.',
774
+ },
775
+ ],
626
776
  },
627
777
  {
628
- name: 'Use Default',
629
- value: '2',
778
+ displayName: 'Custom Field',
779
+ name: 'customField',
780
+ values: [
781
+ {
782
+ displayName: 'Name',
783
+ name: 'name',
784
+ type: 'string',
785
+ default: '',
786
+ required: true,
787
+ placeholder: 'my_custom_field',
788
+ description: 'Enter your custom field name.',
789
+ },
790
+ {
791
+ displayName: 'Value',
792
+ name: 'value',
793
+ type: 'string',
794
+ default: '',
795
+ required: true,
796
+ placeholder: 'Field value',
797
+ description: 'Value to set. Will be properly escaped for XML.',
798
+ },
799
+ ],
630
800
  },
631
801
  ],
632
- default: '2',
633
- required: true,
634
- description: 'Behavior when product is out of stock',
635
- },
636
- // Additional Fields for CREATE (for non-required fields)
637
- {
638
- displayName: 'Additional Fields',
639
- name: 'additionalFieldsSection',
640
- type: 'notice',
641
- displayOptions: {
642
- show: {
643
- operation: ['create'],
644
- },
645
- },
646
- default: '',
647
- typeOptions: {
648
- theme: 'info',
649
- },
802
+ description: 'Additional optional fields for the resource. Choose "Standard Field" to select from schema or "Custom Field" to enter your own.',
650
803
  },
651
- // Additional Fields for Create operation
804
+ // Fields to Update - Images resource (custom field only)
652
805
  {
653
- displayName: 'Additional Fields',
654
- name: 'fieldsToCreate',
806
+ displayName: 'Fields to Update',
807
+ name: 'fieldsToUpdate',
655
808
  type: 'fixedCollection',
656
809
  displayOptions: {
657
810
  show: {
658
- operation: ['create'],
811
+ operation: ['update'],
812
+ resource: ['images'],
659
813
  },
660
814
  },
661
815
  default: {},
@@ -666,8 +820,8 @@ exports.PrestaShop8Description = {
666
820
  },
667
821
  options: [
668
822
  {
669
- displayName: 'Field',
670
- name: 'field',
823
+ displayName: 'Custom Field',
824
+ name: 'customField',
671
825
  values: [
672
826
  {
673
827
  displayName: 'Name',
@@ -675,8 +829,8 @@ exports.PrestaShop8Description = {
675
829
  type: 'string',
676
830
  default: '',
677
831
  required: true,
678
- placeholder: 'Field name (e.g., name, price, active, name-1)',
679
- description: 'Name of the field to set. Use the required fields shown above. For multilingual fields, use format: fieldname-langid (e.g., name-1, description-2).',
832
+ placeholder: 'Field name',
833
+ description: 'Name of the field to update.',
680
834
  },
681
835
  {
682
836
  displayName: 'Value',
@@ -690,9 +844,9 @@ exports.PrestaShop8Description = {
690
844
  ],
691
845
  },
692
846
  ],
693
- description: 'Additional optional fields for the resource. Required fields are provided above as dedicated input fields.',
847
+ description: 'Fields to update for images. Enter field names directly.',
694
848
  },
695
- // Fields to Update (Key-Value pairs like Set node)
849
+ // Fields to Update - Other resources (with 2 field types)
696
850
  {
697
851
  displayName: 'Fields to Update',
698
852
  name: 'fieldsToUpdate',
@@ -701,6 +855,9 @@ exports.PrestaShop8Description = {
701
855
  show: {
702
856
  operation: ['update'],
703
857
  },
858
+ hide: {
859
+ resource: ['images'],
860
+ },
704
861
  },
705
862
  default: {},
706
863
  placeholder: 'Add field',
@@ -710,8 +867,34 @@ exports.PrestaShop8Description = {
710
867
  },
711
868
  options: [
712
869
  {
713
- displayName: 'Field',
714
- name: 'field',
870
+ displayName: 'Standard Field',
871
+ name: 'standardField',
872
+ values: [
873
+ {
874
+ displayName: 'Name',
875
+ name: 'name',
876
+ type: 'options',
877
+ typeOptions: {
878
+ loadOptionsMethod: 'getAvailableFields',
879
+ },
880
+ default: '',
881
+ required: true,
882
+ description: 'Select a field from the PrestaShop schema.',
883
+ },
884
+ {
885
+ displayName: 'Value',
886
+ name: 'value',
887
+ type: 'string',
888
+ default: '',
889
+ required: true,
890
+ placeholder: 'Field value',
891
+ description: 'Value to set. Will be properly escaped for XML.',
892
+ },
893
+ ],
894
+ },
895
+ {
896
+ displayName: 'Custom Field',
897
+ name: 'customField',
715
898
  values: [
716
899
  {
717
900
  displayName: 'Name',
@@ -719,8 +902,8 @@ exports.PrestaShop8Description = {
719
902
  type: 'string',
720
903
  default: '',
721
904
  required: true,
722
- placeholder: 'Field name (e.g., width, price, name, name-1)',
723
- description: 'Name of the field to update. For multilingual fields, use format: fieldname-langid (e.g., name-1 for name in language ID 1, description-2 for description in language ID 2).',
905
+ placeholder: 'my_custom_field',
906
+ description: 'Enter your custom field name.',
724
907
  },
725
908
  {
726
909
  displayName: 'Value',
@@ -734,7 +917,7 @@ exports.PrestaShop8Description = {
734
917
  ],
735
918
  },
736
919
  ],
737
- description: 'Fields to update in the resource. Add multiple field/value pairs as needed. For multilingual fields (names, descriptions), use format: fieldname-langid (e.g., name-1, name-2 for different languages).',
920
+ description: 'Fields to update in the resource. Choose "Standard Field" to select from schema or "Custom Field" to enter your own. For multilingual fields, use format: fieldname-langid (e.g., name-1, name-2).',
738
921
  },
739
922
  // Options
740
923
  {