@aderis-erp/cli 1.0.9 → 1.0.10

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.
Files changed (49) hide show
  1. package/dist/commands/access-groups.js +18 -6
  2. package/dist/commands/account-transaction-allocations.js +18 -6
  3. package/dist/commands/account-transactions.js +18 -6
  4. package/dist/commands/accounts.js +18 -6
  5. package/dist/commands/agent-runs.js +18 -6
  6. package/dist/commands/audit-log.js +18 -6
  7. package/dist/commands/bank-accounts.js +18 -6
  8. package/dist/commands/bank-integrations.js +18 -6
  9. package/dist/commands/business-partners.js +18 -6
  10. package/dist/commands/credit-card-accounts.js +18 -6
  11. package/dist/commands/documents.js +18 -6
  12. package/dist/commands/dunning-configs.js +18 -6
  13. package/dist/commands/dunning-reminders.js +18 -6
  14. package/dist/commands/dunning-runs.js +18 -6
  15. package/dist/commands/employees.js +18 -6
  16. package/dist/commands/event-processor-mappings.js +18 -6
  17. package/dist/commands/files-internal.js +18 -6
  18. package/dist/commands/health.js +18 -6
  19. package/dist/commands/inbox.js +18 -6
  20. package/dist/commands/integrations.js +18 -6
  21. package/dist/commands/item-categories.js +18 -6
  22. package/dist/commands/items.js +18 -6
  23. package/dist/commands/journal-lines.js +18 -6
  24. package/dist/commands/journals.js +18 -6
  25. package/dist/commands/ledgers.js +18 -6
  26. package/dist/commands/office-locations.js +18 -6
  27. package/dist/commands/payment-methods.js +18 -6
  28. package/dist/commands/payment-runs.js +18 -6
  29. package/dist/commands/payment-terms.js +18 -6
  30. package/dist/commands/price-lists.js +18 -6
  31. package/dist/commands/processor-mappings.js +18 -6
  32. package/dist/commands/processors.js +18 -6
  33. package/dist/commands/reports.js +18 -6
  34. package/dist/commands/salary-types.js +18 -6
  35. package/dist/commands/sales-invoices.js +18 -6
  36. package/dist/commands/sales-orders.js +18 -6
  37. package/dist/commands/saved-views.js +18 -6
  38. package/dist/commands/tags.js +18 -6
  39. package/dist/commands/tax-codes.js +18 -6
  40. package/dist/commands/tax-matrix.js +18 -6
  41. package/dist/commands/tenants.js +18 -6
  42. package/dist/commands/text-templates.js +18 -6
  43. package/dist/commands/tools.js +18 -6
  44. package/dist/commands/vat-declarations.js +18 -6
  45. package/dist/commands/vendor-invoices.js +18 -6
  46. package/dist/commands/webhooks.js +18 -6
  47. package/dist/commands/workflows.js +18 -6
  48. package/oclif.manifest.json +1 -1
  49. package/package.json +1 -1
@@ -1020,12 +1020,24 @@ export default class TaxCodes extends Command {
1020
1020
  return { cols: flatten ? cols : cols.slice(0, 8), items: items };
1021
1021
  }
1022
1022
  getValue(row, col) {
1023
- let val = row[col];
1024
- if (col.includes('.')) {
1025
- const parts = col.split('.');
1026
- val = parts.reduce((o, k) => (o && typeof o === 'object' ? o[k] : undefined), row);
1027
- }
1028
- return String(val ?? '');
1023
+ if (!col.includes('.'))
1024
+ return String(row[col] ?? '');
1025
+ const parts = col.split('.');
1026
+ // Walk the dot-path; descending through an array branches into every
1027
+ // element so leaf values get collected from each one. Multiple leaves are
1028
+ // joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
1029
+ const walk = (o, idx) => {
1030
+ if (idx >= parts.length)
1031
+ return [o];
1032
+ if (o == null)
1033
+ return [];
1034
+ if (Array.isArray(o))
1035
+ return o.flatMap(item => walk(item, idx));
1036
+ if (typeof o === 'object')
1037
+ return walk(o[parts[idx]], idx + 1);
1038
+ return [];
1039
+ };
1040
+ return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
1029
1041
  }
1030
1042
  printTable(data, fields) {
1031
1043
  const { cols, items } = this.getColumns(data, fields);
@@ -1017,12 +1017,24 @@ export default class TaxMatrix extends Command {
1017
1017
  return { cols: flatten ? cols : cols.slice(0, 8), items: items };
1018
1018
  }
1019
1019
  getValue(row, col) {
1020
- let val = row[col];
1021
- if (col.includes('.')) {
1022
- const parts = col.split('.');
1023
- val = parts.reduce((o, k) => (o && typeof o === 'object' ? o[k] : undefined), row);
1024
- }
1025
- return String(val ?? '');
1020
+ if (!col.includes('.'))
1021
+ return String(row[col] ?? '');
1022
+ const parts = col.split('.');
1023
+ // Walk the dot-path; descending through an array branches into every
1024
+ // element so leaf values get collected from each one. Multiple leaves are
1025
+ // joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
1026
+ const walk = (o, idx) => {
1027
+ if (idx >= parts.length)
1028
+ return [o];
1029
+ if (o == null)
1030
+ return [];
1031
+ if (Array.isArray(o))
1032
+ return o.flatMap(item => walk(item, idx));
1033
+ if (typeof o === 'object')
1034
+ return walk(o[parts[idx]], idx + 1);
1035
+ return [];
1036
+ };
1037
+ return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
1026
1038
  }
1027
1039
  printTable(data, fields) {
1028
1040
  const { cols, items } = this.getColumns(data, fields);
@@ -1017,12 +1017,24 @@ export default class Tenants extends Command {
1017
1017
  return { cols: flatten ? cols : cols.slice(0, 8), items: items };
1018
1018
  }
1019
1019
  getValue(row, col) {
1020
- let val = row[col];
1021
- if (col.includes('.')) {
1022
- const parts = col.split('.');
1023
- val = parts.reduce((o, k) => (o && typeof o === 'object' ? o[k] : undefined), row);
1024
- }
1025
- return String(val ?? '');
1020
+ if (!col.includes('.'))
1021
+ return String(row[col] ?? '');
1022
+ const parts = col.split('.');
1023
+ // Walk the dot-path; descending through an array branches into every
1024
+ // element so leaf values get collected from each one. Multiple leaves are
1025
+ // joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
1026
+ const walk = (o, idx) => {
1027
+ if (idx >= parts.length)
1028
+ return [o];
1029
+ if (o == null)
1030
+ return [];
1031
+ if (Array.isArray(o))
1032
+ return o.flatMap(item => walk(item, idx));
1033
+ if (typeof o === 'object')
1034
+ return walk(o[parts[idx]], idx + 1);
1035
+ return [];
1036
+ };
1037
+ return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
1026
1038
  }
1027
1039
  printTable(data, fields) {
1028
1040
  const { cols, items } = this.getColumns(data, fields);
@@ -1017,12 +1017,24 @@ export default class TextTemplates extends Command {
1017
1017
  return { cols: flatten ? cols : cols.slice(0, 8), items: items };
1018
1018
  }
1019
1019
  getValue(row, col) {
1020
- let val = row[col];
1021
- if (col.includes('.')) {
1022
- const parts = col.split('.');
1023
- val = parts.reduce((o, k) => (o && typeof o === 'object' ? o[k] : undefined), row);
1024
- }
1025
- return String(val ?? '');
1020
+ if (!col.includes('.'))
1021
+ return String(row[col] ?? '');
1022
+ const parts = col.split('.');
1023
+ // Walk the dot-path; descending through an array branches into every
1024
+ // element so leaf values get collected from each one. Multiple leaves are
1025
+ // joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
1026
+ const walk = (o, idx) => {
1027
+ if (idx >= parts.length)
1028
+ return [o];
1029
+ if (o == null)
1030
+ return [];
1031
+ if (Array.isArray(o))
1032
+ return o.flatMap(item => walk(item, idx));
1033
+ if (typeof o === 'object')
1034
+ return walk(o[parts[idx]], idx + 1);
1035
+ return [];
1036
+ };
1037
+ return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
1026
1038
  }
1027
1039
  printTable(data, fields) {
1028
1040
  const { cols, items } = this.getColumns(data, fields);
@@ -1010,12 +1010,24 @@ export default class Tools extends Command {
1010
1010
  return { cols: flatten ? cols : cols.slice(0, 8), items: items };
1011
1011
  }
1012
1012
  getValue(row, col) {
1013
- let val = row[col];
1014
- if (col.includes('.')) {
1015
- const parts = col.split('.');
1016
- val = parts.reduce((o, k) => (o && typeof o === 'object' ? o[k] : undefined), row);
1017
- }
1018
- return String(val ?? '');
1013
+ if (!col.includes('.'))
1014
+ return String(row[col] ?? '');
1015
+ const parts = col.split('.');
1016
+ // Walk the dot-path; descending through an array branches into every
1017
+ // element so leaf values get collected from each one. Multiple leaves are
1018
+ // joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
1019
+ const walk = (o, idx) => {
1020
+ if (idx >= parts.length)
1021
+ return [o];
1022
+ if (o == null)
1023
+ return [];
1024
+ if (Array.isArray(o))
1025
+ return o.flatMap(item => walk(item, idx));
1026
+ if (typeof o === 'object')
1027
+ return walk(o[parts[idx]], idx + 1);
1028
+ return [];
1029
+ };
1030
+ return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
1019
1031
  }
1020
1032
  printTable(data, fields) {
1021
1033
  const { cols, items } = this.getColumns(data, fields);
@@ -1026,12 +1026,24 @@ export default class VatDeclarations extends Command {
1026
1026
  return { cols: flatten ? cols : cols.slice(0, 8), items: items };
1027
1027
  }
1028
1028
  getValue(row, col) {
1029
- let val = row[col];
1030
- if (col.includes('.')) {
1031
- const parts = col.split('.');
1032
- val = parts.reduce((o, k) => (o && typeof o === 'object' ? o[k] : undefined), row);
1033
- }
1034
- return String(val ?? '');
1029
+ if (!col.includes('.'))
1030
+ return String(row[col] ?? '');
1031
+ const parts = col.split('.');
1032
+ // Walk the dot-path; descending through an array branches into every
1033
+ // element so leaf values get collected from each one. Multiple leaves are
1034
+ // joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
1035
+ const walk = (o, idx) => {
1036
+ if (idx >= parts.length)
1037
+ return [o];
1038
+ if (o == null)
1039
+ return [];
1040
+ if (Array.isArray(o))
1041
+ return o.flatMap(item => walk(item, idx));
1042
+ if (typeof o === 'object')
1043
+ return walk(o[parts[idx]], idx + 1);
1044
+ return [];
1045
+ };
1046
+ return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
1035
1047
  }
1036
1048
  printTable(data, fields) {
1037
1049
  const { cols, items } = this.getColumns(data, fields);
@@ -1050,12 +1050,24 @@ export default class VendorInvoices extends Command {
1050
1050
  return { cols: flatten ? cols : cols.slice(0, 8), items: items };
1051
1051
  }
1052
1052
  getValue(row, col) {
1053
- let val = row[col];
1054
- if (col.includes('.')) {
1055
- const parts = col.split('.');
1056
- val = parts.reduce((o, k) => (o && typeof o === 'object' ? o[k] : undefined), row);
1057
- }
1058
- return String(val ?? '');
1053
+ if (!col.includes('.'))
1054
+ return String(row[col] ?? '');
1055
+ const parts = col.split('.');
1056
+ // Walk the dot-path; descending through an array branches into every
1057
+ // element so leaf values get collected from each one. Multiple leaves are
1058
+ // joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
1059
+ const walk = (o, idx) => {
1060
+ if (idx >= parts.length)
1061
+ return [o];
1062
+ if (o == null)
1063
+ return [];
1064
+ if (Array.isArray(o))
1065
+ return o.flatMap(item => walk(item, idx));
1066
+ if (typeof o === 'object')
1067
+ return walk(o[parts[idx]], idx + 1);
1068
+ return [];
1069
+ };
1070
+ return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
1059
1071
  }
1060
1072
  printTable(data, fields) {
1061
1073
  const { cols, items } = this.getColumns(data, fields);
@@ -1019,12 +1019,24 @@ export default class Webhooks extends Command {
1019
1019
  return { cols: flatten ? cols : cols.slice(0, 8), items: items };
1020
1020
  }
1021
1021
  getValue(row, col) {
1022
- let val = row[col];
1023
- if (col.includes('.')) {
1024
- const parts = col.split('.');
1025
- val = parts.reduce((o, k) => (o && typeof o === 'object' ? o[k] : undefined), row);
1026
- }
1027
- return String(val ?? '');
1022
+ if (!col.includes('.'))
1023
+ return String(row[col] ?? '');
1024
+ const parts = col.split('.');
1025
+ // Walk the dot-path; descending through an array branches into every
1026
+ // element so leaf values get collected from each one. Multiple leaves are
1027
+ // joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
1028
+ const walk = (o, idx) => {
1029
+ if (idx >= parts.length)
1030
+ return [o];
1031
+ if (o == null)
1032
+ return [];
1033
+ if (Array.isArray(o))
1034
+ return o.flatMap(item => walk(item, idx));
1035
+ if (typeof o === 'object')
1036
+ return walk(o[parts[idx]], idx + 1);
1037
+ return [];
1038
+ };
1039
+ return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
1028
1040
  }
1029
1041
  printTable(data, fields) {
1030
1042
  const { cols, items } = this.getColumns(data, fields);
@@ -1011,12 +1011,24 @@ export default class Workflows extends Command {
1011
1011
  return { cols: flatten ? cols : cols.slice(0, 8), items: items };
1012
1012
  }
1013
1013
  getValue(row, col) {
1014
- let val = row[col];
1015
- if (col.includes('.')) {
1016
- const parts = col.split('.');
1017
- val = parts.reduce((o, k) => (o && typeof o === 'object' ? o[k] : undefined), row);
1018
- }
1019
- return String(val ?? '');
1014
+ if (!col.includes('.'))
1015
+ return String(row[col] ?? '');
1016
+ const parts = col.split('.');
1017
+ // Walk the dot-path; descending through an array branches into every
1018
+ // element so leaf values get collected from each one. Multiple leaves are
1019
+ // joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
1020
+ const walk = (o, idx) => {
1021
+ if (idx >= parts.length)
1022
+ return [o];
1023
+ if (o == null)
1024
+ return [];
1025
+ if (Array.isArray(o))
1026
+ return o.flatMap(item => walk(item, idx));
1027
+ if (typeof o === 'object')
1028
+ return walk(o[parts[idx]], idx + 1);
1029
+ return [];
1030
+ };
1031
+ return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
1020
1032
  }
1021
1033
  printTable(data, fields) {
1022
1034
  const { cols, items } = this.getColumns(data, fields);
@@ -8568,5 +8568,5 @@
8568
8568
  ]
8569
8569
  }
8570
8570
  },
8571
- "version": "1.0.9"
8571
+ "version": "1.0.10"
8572
8572
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aderis-erp/cli",
3
3
  "description": "Aderis Live Finance Platform CLI - Manage your Aderis account from the command line",
4
- "version": "1.0.9",
4
+ "version": "1.0.10",
5
5
  "author": "Aderis AG",
6
6
  "publishConfig": {
7
7
  "access": "public"