@pokash/n8n-nodes-optima-rest-api 1.12.0 → 1.12.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.
@@ -999,11 +999,16 @@ class OptimaRestApi {
999
999
  const url = queryString
1000
1000
  ? `${gatewayUrl}/api/customer?${queryString}`
1001
1001
  : `${gatewayUrl}/api/customer`;
1002
- const response = await makeAuthenticatedRequest({
1003
- method: 'GET',
1004
- url,
1005
- json: true,
1006
- });
1002
+ // TNXP-791: skonfigurowany filtr dokładny z pustą wartością (np. pusty akronim z wyrażenia) = brak wyników,
1003
+ // jak dawny surowy filtr Knt_Kod='' — bez tego węzeł pominąłby filtr i zwrócił całą listę.
1004
+ const pustyFiltrDokladny = ['kod', 'nip', 'email', 'grupa'].some((pole) => { var _a; return pole in options && String((_a = options[pole]) !== null && _a !== void 0 ? _a : '').trim() === ''; });
1005
+ const response = pustyFiltrDokladny
1006
+ ? { Success: true, Customers: [], TotalCount: 0 }
1007
+ : await makeAuthenticatedRequest({
1008
+ method: 'GET',
1009
+ url,
1010
+ json: true,
1011
+ });
1007
1012
  // API returns { Success: true, Customers: [...], TotalCount: ... }
1008
1013
  const responseData = response;
1009
1014
  // Extract customers array from response
@@ -1324,11 +1329,16 @@ class OptimaRestApi {
1324
1329
  const url = queryString
1325
1330
  ? `${gatewayUrl}/api/product?${queryString}`
1326
1331
  : `${gatewayUrl}/api/product`;
1327
- const response = await makeAuthenticatedRequest({
1328
- method: 'GET',
1329
- url,
1330
- json: true,
1331
- });
1332
+ // TNXP-791: skonfigurowany filtr dokładny z pustą wartością (np. pusty akronim z wyrażenia) = brak wyników,
1333
+ // jak dawny surowy filtr Knt_Kod='' — bez tego węzeł pominąłby filtr i zwrócił całą listę.
1334
+ const pustyFiltrDokladny = ['kod', 'ean', 'grupa'].some((pole) => { var _a; return pole in options && String((_a = options[pole]) !== null && _a !== void 0 ? _a : '').trim() === ''; });
1335
+ const response = pustyFiltrDokladny
1336
+ ? { Success: true, Products: [], TotalCount: 0 }
1337
+ : await makeAuthenticatedRequest({
1338
+ method: 'GET',
1339
+ url,
1340
+ json: true,
1341
+ });
1332
1342
  // API returns { Success: true, Products: [...], TotalCount: ... }
1333
1343
  const responseData = response;
1334
1344
  // Extract products array from response
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pokash/n8n-nodes-optima-rest-api",
3
- "version": "1.12.0",
3
+ "version": "1.12.1",
4
4
  "description": "n8n node for Comarch Optima REST API integration",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",