@pokash/n8n-nodes-optima-rest-api 1.10.0 → 1.12.0

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.
@@ -141,7 +141,61 @@ class OptimaRestApi {
141
141
  type: 'string',
142
142
  default: '',
143
143
  placeholder: 'Knt_Kod = \'TEST\'',
144
- description: 'SQL-like filter string for searching customers (e.g., Knt_Kod = \'ACME\' or Knt_Nip = \'1234567890\')',
144
+ description: 'Deprecated — raw SQL condition, admin only on secured gateways. Use the named filters below.',
145
+ },
146
+ // TNXP-791: jawne filtry (GET /api/customer?kod=…) — wartości jako parametry, bez SQL
147
+ {
148
+ displayName: 'Code (Akronim)',
149
+ name: 'kod',
150
+ type: 'string',
151
+ default: '',
152
+ description: 'Customer code (exact match)',
153
+ },
154
+ {
155
+ displayName: 'NIP',
156
+ name: 'nip',
157
+ type: 'string',
158
+ default: '',
159
+ description: 'Tax ID — dashes, spaces and country prefix are ignored',
160
+ },
161
+ {
162
+ displayName: 'Name Contains',
163
+ name: 'nazwa',
164
+ type: 'string',
165
+ default: '',
166
+ description: 'Part of the first name line (case-insensitive)',
167
+ },
168
+ {
169
+ displayName: 'Email',
170
+ name: 'email',
171
+ type: 'string',
172
+ default: '',
173
+ description: 'Email address (exact match)',
174
+ },
175
+ {
176
+ displayName: 'Group',
177
+ name: 'grupa',
178
+ type: 'string',
179
+ default: '',
180
+ description: 'Customer group (exact match)',
181
+ },
182
+ {
183
+ displayName: 'Active',
184
+ name: 'aktywny',
185
+ type: 'options',
186
+ options: [
187
+ { name: 'Only Active', value: 'true' },
188
+ { name: 'Only Inactive', value: 'false' },
189
+ ],
190
+ default: 'true',
191
+ description: 'Filter by active flag',
192
+ },
193
+ {
194
+ displayName: 'Changed Since',
195
+ name: 'zmienionyOd',
196
+ type: 'dateTime',
197
+ default: '',
198
+ description: 'Only records changed at or after this date and time (incremental sync)',
145
199
  },
146
200
  {
147
201
  displayName: 'Skip',
@@ -525,6 +579,60 @@ class OptimaRestApi {
525
579
  },
526
580
  description: 'Link weryfikacyjny KSeF (QR). Puste = bez zmian.',
527
581
  },
582
+ {
583
+ displayName: 'Operator Wysyłający',
584
+ name: 'operatorWysylajacy',
585
+ type: 'string',
586
+ default: '',
587
+ displayOptions: {
588
+ show: {
589
+ resource: ['document'],
590
+ operation: ['updateKSeF'],
591
+ },
592
+ },
593
+ description: 'Operator wysyłający (nazwisko). Puste = bez zmian.',
594
+ },
595
+ {
596
+ displayName: 'Operator Odbierający',
597
+ name: 'operatorOdbierajacy',
598
+ type: 'string',
599
+ default: '',
600
+ displayOptions: {
601
+ show: {
602
+ resource: ['document'],
603
+ operation: ['updateKSeF'],
604
+ },
605
+ },
606
+ description: 'Operator odbierający UPO (nazwisko). Puste = bez zmian.',
607
+ },
608
+ {
609
+ displayName: 'Data Wysłania',
610
+ name: 'dataWyslania',
611
+ type: 'string',
612
+ default: '',
613
+ placeholder: '2026-07-31',
614
+ displayOptions: {
615
+ show: {
616
+ resource: ['document'],
617
+ operation: ['updateKSeF'],
618
+ },
619
+ },
620
+ description: 'Data wysłania do KSeF (yyyy-MM-dd). Puste = bez zmian.',
621
+ },
622
+ {
623
+ displayName: 'Data Odebrania',
624
+ name: 'dataOdebrania',
625
+ type: 'string',
626
+ default: '',
627
+ placeholder: '2026-07-31',
628
+ displayOptions: {
629
+ show: {
630
+ resource: ['document'],
631
+ operation: ['updateKSeF'],
632
+ },
633
+ },
634
+ description: 'Data odebrania UPO (yyyy-MM-dd). Puste = bez zmian.',
635
+ },
528
636
  // Product Operations
529
637
  {
530
638
  displayName: 'Operation',
@@ -578,7 +686,65 @@ class OptimaRestApi {
578
686
  name: 'filter',
579
687
  type: 'string',
580
688
  default: '',
581
- description: 'SQL-like filter expression (e.g., "Twr_Kod=\'PROD01\'" or "Twr_Nazwa LIKE \'%laptop%\'")',
689
+ description: 'Deprecated — raw SQL condition, admin only on secured gateways. Use the named filters below.',
690
+ },
691
+ // TNXP-791: jawne filtry (GET /api/product?kod=…) — wartości jako parametry, bez SQL
692
+ {
693
+ displayName: 'Code',
694
+ name: 'kod',
695
+ type: 'string',
696
+ default: '',
697
+ description: 'Product code (exact match)',
698
+ },
699
+ {
700
+ displayName: 'EAN',
701
+ name: 'ean',
702
+ type: 'string',
703
+ default: '',
704
+ description: 'EAN code (exact match)',
705
+ },
706
+ {
707
+ displayName: 'Name Contains',
708
+ name: 'nazwa',
709
+ type: 'string',
710
+ default: '',
711
+ description: 'Part of the product name (case-insensitive)',
712
+ },
713
+ {
714
+ displayName: 'Type',
715
+ name: 'typ',
716
+ type: 'options',
717
+ options: [
718
+ { name: 'Towar', value: 'Towar' },
719
+ { name: 'Usługa', value: 'Usługa' },
720
+ ],
721
+ default: 'Towar',
722
+ description: 'Product or service',
723
+ },
724
+ {
725
+ displayName: 'Group',
726
+ name: 'grupa',
727
+ type: 'string',
728
+ default: '',
729
+ description: 'Product group code (exact match)',
730
+ },
731
+ {
732
+ displayName: 'Active',
733
+ name: 'aktywny',
734
+ type: 'options',
735
+ options: [
736
+ { name: 'Only Active', value: 'true' },
737
+ { name: 'Only Inactive', value: 'false' },
738
+ ],
739
+ default: 'true',
740
+ description: 'Filter by active flag',
741
+ },
742
+ {
743
+ displayName: 'Changed Since',
744
+ name: 'zmienionyOd',
745
+ type: 'dateTime',
746
+ default: '',
747
+ description: 'Only records changed at or after this date and time (incremental sync)',
582
748
  },
583
749
  {
584
750
  displayName: 'Skip',
@@ -817,6 +983,12 @@ class OptimaRestApi {
817
983
  if (options.filter) {
818
984
  queryParams.append('Filter', String(options.filter));
819
985
  }
986
+ // TNXP-791: jawne filtry
987
+ for (const pole of ['kod', 'nip', 'nazwa', 'email', 'grupa', 'aktywny', 'zmienionyOd']) {
988
+ if (options[pole] !== undefined && options[pole] !== '') {
989
+ queryParams.append(pole, String(options[pole]));
990
+ }
991
+ }
820
992
  if (options.skip) {
821
993
  queryParams.append('Skip', String(options.skip));
822
994
  }
@@ -973,6 +1145,10 @@ class OptimaRestApi {
973
1145
  const formaPlatnosci = this.getNodeParameter('formaPlatnosci', i, '');
974
1146
  const srodowisko = this.getNodeParameter('srodowisko', i, '');
975
1147
  const linkWeryfikacyjny = this.getNodeParameter('linkWeryfikacyjny', i, '');
1148
+ const operatorWysylajacy = this.getNodeParameter('operatorWysylajacy', i, '');
1149
+ const operatorOdbierajacy = this.getNodeParameter('operatorOdbierajacy', i, '');
1150
+ const dataWyslania = this.getNodeParameter('dataWyslania', i, '');
1151
+ const dataOdebrania = this.getNodeParameter('dataOdebrania', i, '');
976
1152
  const body = {};
977
1153
  if (numerPelny)
978
1154
  body.NumerPelny = numerPelny;
@@ -992,6 +1168,14 @@ class OptimaRestApi {
992
1168
  body.Srodowisko = srodowisko;
993
1169
  if (linkWeryfikacyjny)
994
1170
  body.LinkWeryfikacyjny = linkWeryfikacyjny;
1171
+ if (operatorWysylajacy)
1172
+ body.OperatorWysylajacy = operatorWysylajacy;
1173
+ if (operatorOdbierajacy)
1174
+ body.OperatorOdbierajacy = operatorOdbierajacy;
1175
+ if (dataWyslania)
1176
+ body.DataWyslania = dataWyslania;
1177
+ if (dataOdebrania)
1178
+ body.DataOdebrania = dataOdebrania;
995
1179
  const response = await makeAuthenticatedRequest({
996
1180
  method: 'PUT',
997
1181
  url: `${gatewayUrl}/api/Documents/KSeF`,
@@ -1124,6 +1308,12 @@ class OptimaRestApi {
1124
1308
  if (options.filter) {
1125
1309
  queryParams.append('Filter', String(options.filter));
1126
1310
  }
1311
+ // TNXP-791: jawne filtry
1312
+ for (const pole of ['kod', 'ean', 'nazwa', 'typ', 'grupa', 'aktywny', 'zmienionyOd']) {
1313
+ if (options[pole] !== undefined && options[pole] !== '') {
1314
+ queryParams.append(pole, String(options[pole]));
1315
+ }
1316
+ }
1127
1317
  if (options.skip) {
1128
1318
  queryParams.append('Skip', String(options.skip));
1129
1319
  }
package/package.json CHANGED
@@ -1,60 +1,60 @@
1
- {
2
- "name": "@pokash/n8n-nodes-optima-rest-api",
3
- "version": "1.10.0",
4
- "description": "n8n node for Comarch Optima REST API integration",
5
- "keywords": [
6
- "n8n-community-node-package",
7
- "n8n",
8
- "optima",
9
- "comarch",
10
- "erp"
11
- ],
12
- "license": "MIT",
13
- "homepage": "https://github.com/pokash-pl/n8n-nodes-optima-rest-api",
14
- "author": {
15
- "name": "POKASH.PL Sp. z o. o.",
16
- "email": "hello@pokash.cloud"
17
- },
18
- "repository": {
19
- "type": "git",
20
- "url": "git+https://github.com/pokash-pl/n8n-nodes-optima-rest-api.git"
21
- },
22
- "main": "index.js",
23
- "scripts": {
24
- "build": "tsc && gulp build:icons",
25
- "dev": "tsc --watch",
26
- "format": "prettier nodes --write",
27
- "lint": "eslint nodes/**/*.ts package.json",
28
- "lintfix": "eslint nodes/**/*.ts package.json --fix",
29
- "prepublishOnly": "npm run build"
30
- },
31
- "files": [
32
- "dist"
33
- ],
34
- "n8n": {
35
- "n8nNodesApiVersion": 1,
36
- "credentials": [
37
- "dist/credentials/OptimaRestApiCredentials.credentials.js"
38
- ],
39
- "nodes": [
40
- "dist/nodes/OptimaRestApi/OptimaRestApi.node.js"
41
- ]
42
- },
43
- "devDependencies": {
44
- "@types/node": "^20.0.0",
45
- "@typescript-eslint/eslint-plugin": "^6.21.0",
46
- "@typescript-eslint/parser": "^6.21.0",
47
- "eslint": "^8.57.0",
48
- "eslint-plugin-n8n-nodes-base": "^1.16.0",
49
- "gulp": "^5.0.0",
50
- "n8n-workflow": "^2.2.2",
51
- "prettier": "^3.3.0",
52
- "typescript": "~5.6.0"
53
- },
54
- "peerDependencies": {
55
- "n8n-workflow": "^2.0.0"
56
- },
57
- "overrides": {
58
- "form-data": "^4.0.4"
59
- }
60
- }
1
+ {
2
+ "name": "@pokash/n8n-nodes-optima-rest-api",
3
+ "version": "1.12.0",
4
+ "description": "n8n node for Comarch Optima REST API integration",
5
+ "keywords": [
6
+ "n8n-community-node-package",
7
+ "n8n",
8
+ "optima",
9
+ "comarch",
10
+ "erp"
11
+ ],
12
+ "license": "MIT",
13
+ "homepage": "https://github.com/pokash-pl/n8n-nodes-optima-rest-api",
14
+ "author": {
15
+ "name": "POKASH.PL Sp. z o. o.",
16
+ "email": "hello@pokash.cloud"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/pokash-pl/n8n-nodes-optima-rest-api.git"
21
+ },
22
+ "main": "index.js",
23
+ "scripts": {
24
+ "build": "tsc && gulp build:icons",
25
+ "dev": "tsc --watch",
26
+ "format": "prettier nodes --write",
27
+ "lint": "eslint nodes/**/*.ts package.json",
28
+ "lintfix": "eslint nodes/**/*.ts package.json --fix",
29
+ "prepublishOnly": "npm run build"
30
+ },
31
+ "files": [
32
+ "dist"
33
+ ],
34
+ "n8n": {
35
+ "n8nNodesApiVersion": 1,
36
+ "credentials": [
37
+ "dist/credentials/OptimaRestApiCredentials.credentials.js"
38
+ ],
39
+ "nodes": [
40
+ "dist/nodes/OptimaRestApi/OptimaRestApi.node.js"
41
+ ]
42
+ },
43
+ "devDependencies": {
44
+ "@types/node": "^20.0.0",
45
+ "@typescript-eslint/eslint-plugin": "^6.21.0",
46
+ "@typescript-eslint/parser": "^6.21.0",
47
+ "eslint": "^8.57.0",
48
+ "eslint-plugin-n8n-nodes-base": "^1.16.0",
49
+ "gulp": "^5.0.0",
50
+ "n8n-workflow": "^2.2.2",
51
+ "prettier": "^3.3.0",
52
+ "typescript": "~5.6.0"
53
+ },
54
+ "peerDependencies": {
55
+ "n8n-workflow": "^2.0.0"
56
+ },
57
+ "overrides": {
58
+ "form-data": "^4.0.4"
59
+ }
60
+ }