@pokash/n8n-nodes-optima-rest-api 1.11.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',
@@ -632,7 +686,65 @@ class OptimaRestApi {
632
686
  name: 'filter',
633
687
  type: 'string',
634
688
  default: '',
635
- 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)',
636
748
  },
637
749
  {
638
750
  displayName: 'Skip',
@@ -871,6 +983,12 @@ class OptimaRestApi {
871
983
  if (options.filter) {
872
984
  queryParams.append('Filter', String(options.filter));
873
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
+ }
874
992
  if (options.skip) {
875
993
  queryParams.append('Skip', String(options.skip));
876
994
  }
@@ -1190,6 +1308,12 @@ class OptimaRestApi {
1190
1308
  if (options.filter) {
1191
1309
  queryParams.append('Filter', String(options.filter));
1192
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
+ }
1193
1317
  if (options.skip) {
1194
1318
  queryParams.append('Skip', String(options.skip));
1195
1319
  }
package/package.json CHANGED
@@ -1,60 +1,60 @@
1
- {
2
- "name": "@pokash/n8n-nodes-optima-rest-api",
3
- "version": "1.11.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
+ }