@aderis-erp/cli 1.0.8 → 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 (55) 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 +21 -9
  7. package/dist/commands/bank-accounts.js +18 -6
  8. package/dist/commands/bank-integrations.js +18 -6
  9. package/dist/commands/business-partners.d.ts +1 -0
  10. package/dist/commands/business-partners.js +33 -8
  11. package/dist/commands/credit-card-accounts.js +18 -6
  12. package/dist/commands/documents.js +18 -6
  13. package/dist/commands/dunning-configs.js +18 -6
  14. package/dist/commands/dunning-reminders.js +18 -6
  15. package/dist/commands/dunning-runs.js +18 -6
  16. package/dist/commands/employees.js +18 -6
  17. package/dist/commands/event-processor-mappings.js +18 -6
  18. package/dist/commands/files-internal.js +18 -6
  19. package/dist/commands/health.js +18 -6
  20. package/dist/commands/inbox.js +18 -6
  21. package/dist/commands/integrations.js +18 -6
  22. package/dist/commands/item-categories.js +18 -6
  23. package/dist/commands/items.js +18 -6
  24. package/dist/commands/journal-lines.js +18 -6
  25. package/dist/commands/journals.js +18 -6
  26. package/dist/commands/ledgers.js +18 -6
  27. package/dist/commands/office-locations.js +18 -6
  28. package/dist/commands/payment-methods.d.ts +1 -0
  29. package/dist/commands/payment-methods.js +26 -8
  30. package/dist/commands/payment-runs.js +18 -6
  31. package/dist/commands/payment-terms.js +18 -6
  32. package/dist/commands/price-lists.js +18 -6
  33. package/dist/commands/processor-mappings.js +18 -6
  34. package/dist/commands/processors.js +18 -6
  35. package/dist/commands/reports.js +18 -6
  36. package/dist/commands/salary-types.js +18 -6
  37. package/dist/commands/sales-invoices.js +18 -6
  38. package/dist/commands/sales-orders.js +18 -6
  39. package/dist/commands/{payment-method-ledger-mappings.d.ts → saved-views.d.ts} +2 -3
  40. package/dist/commands/{payment-method-ledger-mappings.js → saved-views.js} +32 -20
  41. package/dist/commands/tags.js +18 -6
  42. package/dist/commands/tax-codes.js +18 -6
  43. package/dist/commands/tax-matrix.js +18 -6
  44. package/dist/commands/tenants.js +18 -6
  45. package/dist/commands/text-templates.js +18 -6
  46. package/dist/commands/tools.js +18 -6
  47. package/dist/commands/{vat-declaration.d.ts → vat-declarations.d.ts} +1 -1
  48. package/dist/commands/{vat-declaration.js → vat-declarations.js} +43 -30
  49. package/dist/commands/vendor-invoices.js +18 -6
  50. package/dist/commands/webhooks.js +18 -6
  51. package/dist/commands/workflows.js +18 -6
  52. package/oclif.manifest.json +177 -340
  53. package/package.json +1 -1
  54. package/dist/commands/business-partners---contacts.d.ts +0 -42
  55. package/dist/commands/business-partners---contacts.js +0 -1074
@@ -1017,12 +1017,24 @@ export default class AccessGroups 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);
@@ -1011,12 +1011,24 @@ export default class AccountTransactionAllocations 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);
@@ -1031,12 +1031,24 @@ export default class AccountTransactions extends Command {
1031
1031
  return { cols: flatten ? cols : cols.slice(0, 8), items: items };
1032
1032
  }
1033
1033
  getValue(row, col) {
1034
- let val = row[col];
1035
- if (col.includes('.')) {
1036
- const parts = col.split('.');
1037
- val = parts.reduce((o, k) => (o && typeof o === 'object' ? o[k] : undefined), row);
1038
- }
1039
- return String(val ?? '');
1034
+ if (!col.includes('.'))
1035
+ return String(row[col] ?? '');
1036
+ const parts = col.split('.');
1037
+ // Walk the dot-path; descending through an array branches into every
1038
+ // element so leaf values get collected from each one. Multiple leaves are
1039
+ // joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
1040
+ const walk = (o, idx) => {
1041
+ if (idx >= parts.length)
1042
+ return [o];
1043
+ if (o == null)
1044
+ return [];
1045
+ if (Array.isArray(o))
1046
+ return o.flatMap(item => walk(item, idx));
1047
+ if (typeof o === 'object')
1048
+ return walk(o[parts[idx]], idx + 1);
1049
+ return [];
1050
+ };
1051
+ return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
1040
1052
  }
1041
1053
  printTable(data, fields) {
1042
1054
  const { cols, items } = this.getColumns(data, fields);
@@ -1023,12 +1023,24 @@ export default class Accounts extends Command {
1023
1023
  return { cols: flatten ? cols : cols.slice(0, 8), items: items };
1024
1024
  }
1025
1025
  getValue(row, col) {
1026
- let val = row[col];
1027
- if (col.includes('.')) {
1028
- const parts = col.split('.');
1029
- val = parts.reduce((o, k) => (o && typeof o === 'object' ? o[k] : undefined), row);
1030
- }
1031
- return String(val ?? '');
1026
+ if (!col.includes('.'))
1027
+ return String(row[col] ?? '');
1028
+ const parts = col.split('.');
1029
+ // Walk the dot-path; descending through an array branches into every
1030
+ // element so leaf values get collected from each one. Multiple leaves are
1031
+ // joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
1032
+ const walk = (o, idx) => {
1033
+ if (idx >= parts.length)
1034
+ return [o];
1035
+ if (o == null)
1036
+ return [];
1037
+ if (Array.isArray(o))
1038
+ return o.flatMap(item => walk(item, idx));
1039
+ if (typeof o === 'object')
1040
+ return walk(o[parts[idx]], idx + 1);
1041
+ return [];
1042
+ };
1043
+ return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
1032
1044
  }
1033
1045
  printTable(data, fields) {
1034
1046
  const { cols, items } = this.getColumns(data, fields);
@@ -1014,12 +1014,24 @@ export default class AgentRuns extends Command {
1014
1014
  return { cols: flatten ? cols : cols.slice(0, 8), items: items };
1015
1015
  }
1016
1016
  getValue(row, col) {
1017
- let val = row[col];
1018
- if (col.includes('.')) {
1019
- const parts = col.split('.');
1020
- val = parts.reduce((o, k) => (o && typeof o === 'object' ? o[k] : undefined), row);
1021
- }
1022
- return String(val ?? '');
1017
+ if (!col.includes('.'))
1018
+ return String(row[col] ?? '');
1019
+ const parts = col.split('.');
1020
+ // Walk the dot-path; descending through an array branches into every
1021
+ // element so leaf values get collected from each one. Multiple leaves are
1022
+ // joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
1023
+ const walk = (o, idx) => {
1024
+ if (idx >= parts.length)
1025
+ return [o];
1026
+ if (o == null)
1027
+ return [];
1028
+ if (Array.isArray(o))
1029
+ return o.flatMap(item => walk(item, idx));
1030
+ if (typeof o === 'object')
1031
+ return walk(o[parts[idx]], idx + 1);
1032
+ return [];
1033
+ };
1034
+ return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
1023
1035
  }
1024
1036
  printTable(data, fields) {
1025
1037
  const { cols, items } = this.getColumns(data, fields);
@@ -8,9 +8,9 @@ const HAS_CAMT053 = false;
8
8
  const NESTED_IMPORTS = [];
9
9
  const SUBCOMMANDS = [...["list", "find-entity", "find-workflow"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
10
10
  const ENDPOINTS = {
11
- 'list': { method: 'GET', path: '/v1/audit-log', summary: 'Get audit log entries', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
12
- 'find-entity': { method: 'GET', path: '/v1/audit-log/entity/{entityId}', summary: 'Get audit history for a specific entity', pathParams: ['entityId'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
13
- 'find-workflow': { method: 'GET', path: '/v1/audit-log/workflow/{workflowId}', summary: 'Get audit log entries for a specific workflow', pathParams: ['workflowId'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
11
+ 'list': { method: 'GET', path: '/v1/audit-logs', summary: 'Get audit log entries', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
12
+ 'find-entity': { method: 'GET', path: '/v1/audit-logs/entity/{entityId}', summary: 'Get audit history for a specific entity', pathParams: ['entityId'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
13
+ 'find-workflow': { method: 'GET', path: '/v1/audit-logs/workflow/{workflowId}', summary: 'Get audit log entries for a specific workflow', pathParams: ['workflowId'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
14
14
  };
15
15
  export default class AuditLog extends Command {
16
16
  static description = 'Manage audit log';
@@ -1011,12 +1011,24 @@ export default class AuditLog 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);
@@ -1031,12 +1031,24 @@ export default class BankAccounts extends Command {
1031
1031
  return { cols: flatten ? cols : cols.slice(0, 8), items: items };
1032
1032
  }
1033
1033
  getValue(row, col) {
1034
- let val = row[col];
1035
- if (col.includes('.')) {
1036
- const parts = col.split('.');
1037
- val = parts.reduce((o, k) => (o && typeof o === 'object' ? o[k] : undefined), row);
1038
- }
1039
- return String(val ?? '');
1034
+ if (!col.includes('.'))
1035
+ return String(row[col] ?? '');
1036
+ const parts = col.split('.');
1037
+ // Walk the dot-path; descending through an array branches into every
1038
+ // element so leaf values get collected from each one. Multiple leaves are
1039
+ // joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
1040
+ const walk = (o, idx) => {
1041
+ if (idx >= parts.length)
1042
+ return [o];
1043
+ if (o == null)
1044
+ return [];
1045
+ if (Array.isArray(o))
1046
+ return o.flatMap(item => walk(item, idx));
1047
+ if (typeof o === 'object')
1048
+ return walk(o[parts[idx]], idx + 1);
1049
+ return [];
1050
+ };
1051
+ return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
1040
1052
  }
1041
1053
  printTable(data, fields) {
1042
1054
  const { cols, items } = this.getColumns(data, fields);
@@ -1032,12 +1032,24 @@ export default class BankIntegrations extends Command {
1032
1032
  return { cols: flatten ? cols : cols.slice(0, 8), items: items };
1033
1033
  }
1034
1034
  getValue(row, col) {
1035
- let val = row[col];
1036
- if (col.includes('.')) {
1037
- const parts = col.split('.');
1038
- val = parts.reduce((o, k) => (o && typeof o === 'object' ? o[k] : undefined), row);
1039
- }
1040
- return String(val ?? '');
1035
+ if (!col.includes('.'))
1036
+ return String(row[col] ?? '');
1037
+ const parts = col.split('.');
1038
+ // Walk the dot-path; descending through an array branches into every
1039
+ // element so leaf values get collected from each one. Multiple leaves are
1040
+ // joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
1041
+ const walk = (o, idx) => {
1042
+ if (idx >= parts.length)
1043
+ return [o];
1044
+ if (o == null)
1045
+ return [];
1046
+ if (Array.isArray(o))
1047
+ return o.flatMap(item => walk(item, idx));
1048
+ if (typeof o === 'object')
1049
+ return walk(o[parts[idx]], idx + 1);
1050
+ return [];
1051
+ };
1052
+ return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
1041
1053
  }
1042
1054
  printTable(data, fields) {
1043
1055
  const { cols, items } = this.getColumns(data, fields);
@@ -15,6 +15,7 @@ export default class BusinessPartners extends Command {
15
15
  file: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
16
  set: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
17
  'note-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
+ 'business-partner-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
19
  page: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
20
  limit: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
20
21
  include: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
@@ -5,19 +5,31 @@ import { getCurrentContext, getContext, getBaseUrls } from '../lib/config.js';
5
5
  const HAS_IMPORT = true;
6
6
  const HAS_EXPORT = true;
7
7
  const HAS_CAMT053 = false;
8
- const NESTED_IMPORTS = ["notes"];
9
- const SUBCOMMANDS = [...["list", "create", "get", "update", "delete", "list-notes", "create-notes", "get-notes", "update-notes", "delete-notes"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
8
+ const NESTED_IMPORTS = ["notes", "contacts", "contacts-notes"];
9
+ const SUBCOMMANDS = [...["list", "create", "get", "update", "delete", "merge", "activate", "list-notes", "create-notes", "get-notes", "update-notes", "delete-notes", "list-contacts", "create-contacts", "get-contacts", "update-contacts", "delete-contacts", "list-contacts-notes", "create-contacts-notes", "get-contacts-notes", "update-contacts-notes", "delete-contacts-notes"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
10
10
  const ENDPOINTS = {
11
11
  'list': { method: 'GET', path: '/v1/business-partners', summary: 'Get all business partners with pagination', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
12
12
  'create': { method: 'POST', path: '/v1/business-partners', summary: 'Create a new business partner', pathParams: [], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['invoiceEmailCc', 'contacts', 'tagIds', 'notes'] },
13
13
  'get': { method: 'GET', path: '/v1/business-partners/{id}', summary: 'Get a business partner by ID', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
14
14
  'update': { method: 'PATCH', path: '/v1/business-partners/{id}', summary: 'Update a business partner', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['invoiceEmailCc', 'contacts', 'tagIds', 'notes'] },
15
15
  'delete': { method: 'DELETE', path: '/v1/business-partners/{id}', summary: 'Delete a business partner', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
16
+ 'merge': { method: 'POST', path: '/v1/business-partners/{id}/merge', summary: 'Merge a business partner into another', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
17
+ 'activate': { method: 'POST', path: '/v1/business-partners/{id}/activate', summary: 'Activate a business partner', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
16
18
  'list-notes': { method: 'GET', path: '/v1/business-partners/{businessPartnerId}/notes', summary: 'Get all notes for a business partner', pathParams: ['businessPartnerId'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
17
19
  'create-notes': { method: 'POST', path: '/v1/business-partners/{businessPartnerId}/notes', summary: 'Create a note for a business partner', pathParams: ['businessPartnerId'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
18
20
  'get-notes': { method: 'GET', path: '/v1/business-partners/{businessPartnerId}/notes/{noteId}', summary: 'Get a specific note for a business partner', pathParams: ['businessPartnerId', 'noteId'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
19
21
  'update-notes': { method: 'PATCH', path: '/v1/business-partners/{businessPartnerId}/notes/{noteId}', summary: 'Update a note for a business partner', pathParams: ['businessPartnerId', 'noteId'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
20
22
  'delete-notes': { method: 'DELETE', path: '/v1/business-partners/{businessPartnerId}/notes/{noteId}', summary: 'Delete a note from a business partner', pathParams: ['businessPartnerId', 'noteId'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
23
+ 'list-contacts': { method: 'GET', path: '/v1/business-partners/{businessPartnerId}/contacts', summary: 'Get all contacts for a business partner with pagination', pathParams: ['businessPartnerId'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
24
+ 'create-contacts': { method: 'POST', path: '/v1/business-partners/{businessPartnerId}/contacts', summary: 'Create a new contact for a business partner', pathParams: ['businessPartnerId'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['notes'] },
25
+ 'get-contacts': { method: 'GET', path: '/v1/business-partners/{businessPartnerId}/contacts/{id}', summary: 'Get a contact by ID', pathParams: ['id', 'businessPartnerId'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
26
+ 'update-contacts': { method: 'PATCH', path: '/v1/business-partners/{businessPartnerId}/contacts/{id}', summary: 'Update a contact', pathParams: ['id', 'businessPartnerId'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['notes'] },
27
+ 'delete-contacts': { method: 'DELETE', path: '/v1/business-partners/{businessPartnerId}/contacts/{id}', summary: 'Delete a contact', pathParams: ['id', 'businessPartnerId'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
28
+ 'list-contacts-notes': { method: 'GET', path: '/v1/business-partners/contacts/{contactId}/notes', summary: 'Get all notes for a contact', pathParams: ['contactId'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
29
+ 'create-contacts-notes': { method: 'POST', path: '/v1/business-partners/contacts/{contactId}/notes', summary: 'Create a note for a contact', pathParams: ['contactId'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
30
+ 'get-contacts-notes': { method: 'GET', path: '/v1/business-partners/contacts/{contactId}/notes/{noteId}', summary: 'Get a specific note for a contact', pathParams: ['contactId', 'noteId'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
31
+ 'update-contacts-notes': { method: 'PATCH', path: '/v1/business-partners/contacts/{contactId}/notes/{noteId}', summary: 'Update a note for a contact', pathParams: ['contactId', 'noteId'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
32
+ 'delete-contacts-notes': { method: 'DELETE', path: '/v1/business-partners/contacts/{contactId}/notes/{noteId}', summary: 'Delete a note from a contact', pathParams: ['contactId', 'noteId'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
21
33
  };
22
34
  export default class BusinessPartners extends Command {
23
35
  static description = 'Manage business partners';
@@ -42,6 +54,7 @@ export default class BusinessPartners extends Command {
42
54
  file: Flags.string({ char: 'f', description: 'Read request body from file' }),
43
55
  set: Flags.string({ char: 's', description: 'Set individual field (e.g. --set firstName=John)', multiple: true }),
44
56
  'note-id': Flags.string({ description: 'Path param: noteId' }),
57
+ 'business-partner-id': Flags.string({ description: 'Path param: businessPartnerId' }),
45
58
  page: Flags.string({ description: 'Page number' }),
46
59
  limit: Flags.string({ description: 'Items per page' }),
47
60
  include: Flags.string({ description: 'Relations to include' }),
@@ -1023,12 +1036,24 @@ export default class BusinessPartners extends Command {
1023
1036
  return { cols: flatten ? cols : cols.slice(0, 8), items: items };
1024
1037
  }
1025
1038
  getValue(row, col) {
1026
- let val = row[col];
1027
- if (col.includes('.')) {
1028
- const parts = col.split('.');
1029
- val = parts.reduce((o, k) => (o && typeof o === 'object' ? o[k] : undefined), row);
1030
- }
1031
- return String(val ?? '');
1039
+ if (!col.includes('.'))
1040
+ return String(row[col] ?? '');
1041
+ const parts = col.split('.');
1042
+ // Walk the dot-path; descending through an array branches into every
1043
+ // element so leaf values get collected from each one. Multiple leaves are
1044
+ // joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
1045
+ const walk = (o, idx) => {
1046
+ if (idx >= parts.length)
1047
+ return [o];
1048
+ if (o == null)
1049
+ return [];
1050
+ if (Array.isArray(o))
1051
+ return o.flatMap(item => walk(item, idx));
1052
+ if (typeof o === 'object')
1053
+ return walk(o[parts[idx]], idx + 1);
1054
+ return [];
1055
+ };
1056
+ return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
1032
1057
  }
1033
1058
  printTable(data, fields) {
1034
1059
  const { cols, items } = this.getColumns(data, fields);
@@ -1029,12 +1029,24 @@ export default class CreditCardAccounts extends Command {
1029
1029
  return { cols: flatten ? cols : cols.slice(0, 8), items: items };
1030
1030
  }
1031
1031
  getValue(row, col) {
1032
- let val = row[col];
1033
- if (col.includes('.')) {
1034
- const parts = col.split('.');
1035
- val = parts.reduce((o, k) => (o && typeof o === 'object' ? o[k] : undefined), row);
1036
- }
1037
- return String(val ?? '');
1032
+ if (!col.includes('.'))
1033
+ return String(row[col] ?? '');
1034
+ const parts = col.split('.');
1035
+ // Walk the dot-path; descending through an array branches into every
1036
+ // element so leaf values get collected from each one. Multiple leaves are
1037
+ // joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
1038
+ const walk = (o, idx) => {
1039
+ if (idx >= parts.length)
1040
+ return [o];
1041
+ if (o == null)
1042
+ return [];
1043
+ if (Array.isArray(o))
1044
+ return o.flatMap(item => walk(item, idx));
1045
+ if (typeof o === 'object')
1046
+ return walk(o[parts[idx]], idx + 1);
1047
+ return [];
1048
+ };
1049
+ return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
1038
1050
  }
1039
1051
  printTable(data, fields) {
1040
1052
  const { cols, items } = this.getColumns(data, fields);
@@ -1018,12 +1018,24 @@ export default class Documents extends Command {
1018
1018
  return { cols: flatten ? cols : cols.slice(0, 8), items: items };
1019
1019
  }
1020
1020
  getValue(row, col) {
1021
- let val = row[col];
1022
- if (col.includes('.')) {
1023
- const parts = col.split('.');
1024
- val = parts.reduce((o, k) => (o && typeof o === 'object' ? o[k] : undefined), row);
1025
- }
1026
- return String(val ?? '');
1021
+ if (!col.includes('.'))
1022
+ return String(row[col] ?? '');
1023
+ const parts = col.split('.');
1024
+ // Walk the dot-path; descending through an array branches into every
1025
+ // element so leaf values get collected from each one. Multiple leaves are
1026
+ // joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
1027
+ const walk = (o, idx) => {
1028
+ if (idx >= parts.length)
1029
+ return [o];
1030
+ if (o == null)
1031
+ return [];
1032
+ if (Array.isArray(o))
1033
+ return o.flatMap(item => walk(item, idx));
1034
+ if (typeof o === 'object')
1035
+ return walk(o[parts[idx]], idx + 1);
1036
+ return [];
1037
+ };
1038
+ return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
1027
1039
  }
1028
1040
  printTable(data, fields) {
1029
1041
  const { cols, items } = this.getColumns(data, fields);
@@ -1017,12 +1017,24 @@ export default class DunningConfigs 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);
@@ -1018,12 +1018,24 @@ export default class DunningReminders extends Command {
1018
1018
  return { cols: flatten ? cols : cols.slice(0, 8), items: items };
1019
1019
  }
1020
1020
  getValue(row, col) {
1021
- let val = row[col];
1022
- if (col.includes('.')) {
1023
- const parts = col.split('.');
1024
- val = parts.reduce((o, k) => (o && typeof o === 'object' ? o[k] : undefined), row);
1025
- }
1026
- return String(val ?? '');
1021
+ if (!col.includes('.'))
1022
+ return String(row[col] ?? '');
1023
+ const parts = col.split('.');
1024
+ // Walk the dot-path; descending through an array branches into every
1025
+ // element so leaf values get collected from each one. Multiple leaves are
1026
+ // joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
1027
+ const walk = (o, idx) => {
1028
+ if (idx >= parts.length)
1029
+ return [o];
1030
+ if (o == null)
1031
+ return [];
1032
+ if (Array.isArray(o))
1033
+ return o.flatMap(item => walk(item, idx));
1034
+ if (typeof o === 'object')
1035
+ return walk(o[parts[idx]], idx + 1);
1036
+ return [];
1037
+ };
1038
+ return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
1027
1039
  }
1028
1040
  printTable(data, fields) {
1029
1041
  const { cols, items } = this.getColumns(data, fields);
@@ -1006,12 +1006,24 @@ export default class DunningRuns extends Command {
1006
1006
  return { cols: flatten ? cols : cols.slice(0, 8), items: items };
1007
1007
  }
1008
1008
  getValue(row, col) {
1009
- let val = row[col];
1010
- if (col.includes('.')) {
1011
- const parts = col.split('.');
1012
- val = parts.reduce((o, k) => (o && typeof o === 'object' ? o[k] : undefined), row);
1013
- }
1014
- return String(val ?? '');
1009
+ if (!col.includes('.'))
1010
+ return String(row[col] ?? '');
1011
+ const parts = col.split('.');
1012
+ // Walk the dot-path; descending through an array branches into every
1013
+ // element so leaf values get collected from each one. Multiple leaves are
1014
+ // joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
1015
+ const walk = (o, idx) => {
1016
+ if (idx >= parts.length)
1017
+ return [o];
1018
+ if (o == null)
1019
+ return [];
1020
+ if (Array.isArray(o))
1021
+ return o.flatMap(item => walk(item, idx));
1022
+ if (typeof o === 'object')
1023
+ return walk(o[parts[idx]], idx + 1);
1024
+ return [];
1025
+ };
1026
+ return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
1015
1027
  }
1016
1028
  printTable(data, fields) {
1017
1029
  const { cols, items } = this.getColumns(data, fields);
@@ -1048,12 +1048,24 @@ export default class Employees extends Command {
1048
1048
  return { cols: flatten ? cols : cols.slice(0, 8), items: items };
1049
1049
  }
1050
1050
  getValue(row, col) {
1051
- let val = row[col];
1052
- if (col.includes('.')) {
1053
- const parts = col.split('.');
1054
- val = parts.reduce((o, k) => (o && typeof o === 'object' ? o[k] : undefined), row);
1055
- }
1056
- return String(val ?? '');
1051
+ if (!col.includes('.'))
1052
+ return String(row[col] ?? '');
1053
+ const parts = col.split('.');
1054
+ // Walk the dot-path; descending through an array branches into every
1055
+ // element so leaf values get collected from each one. Multiple leaves are
1056
+ // joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
1057
+ const walk = (o, idx) => {
1058
+ if (idx >= parts.length)
1059
+ return [o];
1060
+ if (o == null)
1061
+ return [];
1062
+ if (Array.isArray(o))
1063
+ return o.flatMap(item => walk(item, idx));
1064
+ if (typeof o === 'object')
1065
+ return walk(o[parts[idx]], idx + 1);
1066
+ return [];
1067
+ };
1068
+ return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
1057
1069
  }
1058
1070
  printTable(data, fields) {
1059
1071
  const { cols, items } = this.getColumns(data, fields);
@@ -1016,12 +1016,24 @@ export default class EventProcessorMappings extends Command {
1016
1016
  return { cols: flatten ? cols : cols.slice(0, 8), items: items };
1017
1017
  }
1018
1018
  getValue(row, col) {
1019
- let val = row[col];
1020
- if (col.includes('.')) {
1021
- const parts = col.split('.');
1022
- val = parts.reduce((o, k) => (o && typeof o === 'object' ? o[k] : undefined), row);
1023
- }
1024
- return String(val ?? '');
1019
+ if (!col.includes('.'))
1020
+ return String(row[col] ?? '');
1021
+ const parts = col.split('.');
1022
+ // Walk the dot-path; descending through an array branches into every
1023
+ // element so leaf values get collected from each one. Multiple leaves are
1024
+ // joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
1025
+ const walk = (o, idx) => {
1026
+ if (idx >= parts.length)
1027
+ return [o];
1028
+ if (o == null)
1029
+ return [];
1030
+ if (Array.isArray(o))
1031
+ return o.flatMap(item => walk(item, idx));
1032
+ if (typeof o === 'object')
1033
+ return walk(o[parts[idx]], idx + 1);
1034
+ return [];
1035
+ };
1036
+ return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
1025
1037
  }
1026
1038
  printTable(data, fields) {
1027
1039
  const { cols, items } = this.getColumns(data, fields);