@pokash/n8n-nodes-optima-rest-api 1.12.0 → 1.13.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.
@@ -710,6 +710,13 @@ class OptimaRestApi {
710
710
  default: '',
711
711
  description: 'Part of the product name (case-insensitive)',
712
712
  },
713
+ {
714
+ displayName: 'Name Equals',
715
+ name: 'nazwaRowna',
716
+ type: 'string',
717
+ default: '',
718
+ description: 'Whole product name (exact match, case-insensitive) — e.g. matching an invoice line to a product',
719
+ },
713
720
  {
714
721
  displayName: 'Type',
715
722
  name: 'typ',
@@ -999,11 +1006,16 @@ class OptimaRestApi {
999
1006
  const url = queryString
1000
1007
  ? `${gatewayUrl}/api/customer?${queryString}`
1001
1008
  : `${gatewayUrl}/api/customer`;
1002
- const response = await makeAuthenticatedRequest({
1003
- method: 'GET',
1004
- url,
1005
- json: true,
1006
- });
1009
+ // TNXP-791: skonfigurowany filtr dokładny z pustą wartością (np. pusty akronim z wyrażenia) = brak wyników,
1010
+ // jak dawny surowy filtr Knt_Kod='' — bez tego węzeł pominąłby filtr i zwrócił całą listę.
1011
+ const pustyFiltrDokladny = ['kod', 'nip', 'email', 'grupa'].some((pole) => { var _a; return pole in options && String((_a = options[pole]) !== null && _a !== void 0 ? _a : '').trim() === ''; });
1012
+ const response = pustyFiltrDokladny
1013
+ ? { Success: true, Customers: [], TotalCount: 0 }
1014
+ : await makeAuthenticatedRequest({
1015
+ method: 'GET',
1016
+ url,
1017
+ json: true,
1018
+ });
1007
1019
  // API returns { Success: true, Customers: [...], TotalCount: ... }
1008
1020
  const responseData = response;
1009
1021
  // Extract customers array from response
@@ -1309,7 +1321,7 @@ class OptimaRestApi {
1309
1321
  queryParams.append('Filter', String(options.filter));
1310
1322
  }
1311
1323
  // TNXP-791: jawne filtry
1312
- for (const pole of ['kod', 'ean', 'nazwa', 'typ', 'grupa', 'aktywny', 'zmienionyOd']) {
1324
+ for (const pole of ['kod', 'ean', 'nazwa', 'nazwaRowna', 'typ', 'grupa', 'aktywny', 'zmienionyOd']) {
1313
1325
  if (options[pole] !== undefined && options[pole] !== '') {
1314
1326
  queryParams.append(pole, String(options[pole]));
1315
1327
  }
@@ -1324,11 +1336,16 @@ class OptimaRestApi {
1324
1336
  const url = queryString
1325
1337
  ? `${gatewayUrl}/api/product?${queryString}`
1326
1338
  : `${gatewayUrl}/api/product`;
1327
- const response = await makeAuthenticatedRequest({
1328
- method: 'GET',
1329
- url,
1330
- json: true,
1331
- });
1339
+ // TNXP-791: skonfigurowany filtr dokładny z pustą wartością (np. pusty akronim z wyrażenia) = brak wyników,
1340
+ // jak dawny surowy filtr Knt_Kod='' — bez tego węzeł pominąłby filtr i zwrócił całą listę.
1341
+ const pustyFiltrDokladny = ['kod', 'ean', 'nazwaRowna', 'grupa'].some((pole) => { var _a; return pole in options && String((_a = options[pole]) !== null && _a !== void 0 ? _a : '').trim() === ''; });
1342
+ const response = pustyFiltrDokladny
1343
+ ? { Success: true, Products: [], TotalCount: 0 }
1344
+ : await makeAuthenticatedRequest({
1345
+ method: 'GET',
1346
+ url,
1347
+ json: true,
1348
+ });
1332
1349
  // API returns { Success: true, Products: [...], TotalCount: ... }
1333
1350
  const responseData = response;
1334
1351
  // 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.13.0",
4
4
  "description": "n8n node for Comarch Optima REST API integration",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",