@aderis-erp/cli 1.0.13 → 1.0.14

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 (62) hide show
  1. package/dist/commands/access-groups.js +4 -4
  2. package/dist/commands/account-transaction-allocations.js +4 -4
  3. package/dist/commands/account-transactions.js +4 -4
  4. package/dist/commands/accounts.js +4 -4
  5. package/dist/commands/agent-platform.js +4 -4
  6. package/dist/commands/audit-log.js +7 -7
  7. package/dist/commands/bank-accounts.js +4 -4
  8. package/dist/commands/bank-integrations.js +4 -4
  9. package/dist/commands/business-partners.js +6 -6
  10. package/dist/commands/chat.js +4 -4
  11. package/dist/commands/credit-card-accounts.js +4 -4
  12. package/dist/commands/delivery-notes.js +8 -6
  13. package/dist/commands/documents.js +5 -5
  14. package/dist/commands/dunning-configs.js +4 -4
  15. package/dist/commands/dunning-reminders.js +4 -4
  16. package/dist/commands/dunning-runs.js +4 -4
  17. package/dist/commands/email-transactions.js +4 -4
  18. package/dist/commands/employees.js +4 -4
  19. package/dist/commands/entity-configurations.js +4 -4
  20. package/dist/commands/event-processor-mappings.js +4 -4
  21. package/dist/commands/files-internal.js +4 -4
  22. package/dist/commands/health.js +4 -4
  23. package/dist/commands/inbox.d.ts +1 -0
  24. package/dist/commands/inbox.js +8 -6
  25. package/dist/commands/integrations.js +4 -4
  26. package/dist/commands/item-categories.js +4 -4
  27. package/dist/commands/items.js +4 -4
  28. package/dist/commands/journal-lines.js +4 -4
  29. package/dist/commands/journals.js +7 -5
  30. package/dist/commands/ledgers.js +4 -4
  31. package/dist/commands/office-locations.js +4 -4
  32. package/dist/commands/payment-methods.js +4 -4
  33. package/dist/commands/payment-runs.js +4 -4
  34. package/dist/commands/payment-terms.js +4 -4
  35. package/dist/commands/payments.js +4 -4
  36. package/dist/commands/price-lists.js +4 -4
  37. package/dist/commands/processor-mappings.js +4 -4
  38. package/dist/commands/processors.js +4 -4
  39. package/dist/commands/purchase-order-types.js +4 -4
  40. package/dist/commands/purchase-orders.js +4 -4
  41. package/dist/commands/reports.js +4 -4
  42. package/dist/commands/salary-types.js +4 -4
  43. package/dist/commands/sales-invoices.js +6 -6
  44. package/dist/commands/sales-orders.js +4 -4
  45. package/dist/commands/saved-views.js +4 -4
  46. package/dist/commands/scheduled-processor-mappings.d.ts +40 -0
  47. package/dist/commands/scheduled-processor-mappings.js +1178 -0
  48. package/dist/commands/schedules.js +4 -4
  49. package/dist/commands/tags.js +4 -4
  50. package/dist/commands/tax-codes.js +4 -4
  51. package/dist/commands/tax-matrix.js +4 -4
  52. package/dist/commands/tenants.js +6 -6
  53. package/dist/commands/text-templates.js +4 -4
  54. package/dist/commands/tools.js +4 -4
  55. package/dist/commands/vat-declarations.js +4 -4
  56. package/dist/commands/vendor-invoices.js +4 -4
  57. package/dist/commands/webhooks.js +4 -4
  58. package/dist/commands/workflows.js +4 -4
  59. package/dist/lib/api-client.d.ts +8 -0
  60. package/dist/lib/api-client.js +20 -0
  61. package/oclif.manifest.json +234 -60
  62. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { Command, Args, Flags } from '@oclif/core';
2
- import { apiRequest, ApiError } from '../lib/api-client.js';
2
+ import { apiRequest, ApiError, normalizeSortBy } from '../lib/api-client.js';
3
3
  import { getCurrentContext, getContext, getBaseUrls } from '../lib/config.js';
4
4
  // Add 'import' action if both create and update exist
5
5
  const HAS_IMPORT = true;
@@ -44,7 +44,7 @@ export default class Schedules extends Command {
44
44
  limit: Flags.string({ description: 'Items per page' }),
45
45
  include: Flags.string({ description: 'Relations to include' }),
46
46
  search: Flags.string({ description: 'Search term' }),
47
- 'sort-by': Flags.string({ description: 'Sort field' }),
47
+ 'sort-by': Flags.string({ description: 'Sort field(s), comma-separated. Direction (:ASC/:DESC) is optional; date-like fields default to DESC, others to ASC.' }),
48
48
  filter: Flags.string({ description: 'Filter (e.g. --filter status=ACTIVE). Operators: in:A,B, like:%, gt:, lt:, null:', multiple: true }),
49
49
  query: Flags.string({ description: 'Additional query params as JSON' }),
50
50
  fields: Flags.string({ description: 'Comma-separated list of fields to show (e.g. --fields=id,name,status)' }),
@@ -118,7 +118,7 @@ export default class Schedules extends Command {
118
118
  if (flags.search)
119
119
  queryParams.search = flags.search;
120
120
  if (flags['sort-by'])
121
- queryParams.sortBy = flags['sort-by'];
121
+ queryParams.sortBy = normalizeSortBy(flags['sort-by']);
122
122
  if (flags.query) {
123
123
  try {
124
124
  Object.assign(queryParams, JSON.parse(flags.query));
@@ -577,7 +577,7 @@ export default class Schedules extends Command {
577
577
  if (flags.search)
578
578
  baseParams.search = flags.search;
579
579
  if (flags['sort-by'])
580
- baseParams.sortBy = flags['sort-by'];
580
+ baseParams.sortBy = normalizeSortBy(flags['sort-by']);
581
581
  if (flags.include)
582
582
  baseParams.include = flags.include;
583
583
  if (flags.query) {
@@ -1,5 +1,5 @@
1
1
  import { Command, Args, Flags } from '@oclif/core';
2
- import { apiRequest, ApiError } from '../lib/api-client.js';
2
+ import { apiRequest, ApiError, normalizeSortBy } from '../lib/api-client.js';
3
3
  import { getCurrentContext, getContext, getBaseUrls } from '../lib/config.js';
4
4
  // Add 'import' action if both create and update exist
5
5
  const HAS_IMPORT = true;
@@ -40,7 +40,7 @@ export default class Tags extends Command {
40
40
  limit: Flags.string({ description: 'Items per page' }),
41
41
  include: Flags.string({ description: 'Relations to include' }),
42
42
  search: Flags.string({ description: 'Search term' }),
43
- 'sort-by': Flags.string({ description: 'Sort field' }),
43
+ 'sort-by': Flags.string({ description: 'Sort field(s), comma-separated. Direction (:ASC/:DESC) is optional; date-like fields default to DESC, others to ASC.' }),
44
44
  filter: Flags.string({ description: 'Filter (e.g. --filter status=ACTIVE). Operators: in:A,B, like:%, gt:, lt:, null:', multiple: true }),
45
45
  query: Flags.string({ description: 'Additional query params as JSON' }),
46
46
  fields: Flags.string({ description: 'Comma-separated list of fields to show (e.g. --fields=id,name,status)' }),
@@ -114,7 +114,7 @@ export default class Tags extends Command {
114
114
  if (flags.search)
115
115
  queryParams.search = flags.search;
116
116
  if (flags['sort-by'])
117
- queryParams.sortBy = flags['sort-by'];
117
+ queryParams.sortBy = normalizeSortBy(flags['sort-by']);
118
118
  if (flags.query) {
119
119
  try {
120
120
  Object.assign(queryParams, JSON.parse(flags.query));
@@ -573,7 +573,7 @@ export default class Tags extends Command {
573
573
  if (flags.search)
574
574
  baseParams.search = flags.search;
575
575
  if (flags['sort-by'])
576
- baseParams.sortBy = flags['sort-by'];
576
+ baseParams.sortBy = normalizeSortBy(flags['sort-by']);
577
577
  if (flags.include)
578
578
  baseParams.include = flags.include;
579
579
  if (flags.query) {
@@ -1,5 +1,5 @@
1
1
  import { Command, Args, Flags } from '@oclif/core';
2
- import { apiRequest, ApiError } from '../lib/api-client.js';
2
+ import { apiRequest, ApiError, normalizeSortBy } from '../lib/api-client.js';
3
3
  import { getCurrentContext, getContext, getBaseUrls } from '../lib/config.js';
4
4
  // Add 'import' action if both create and update exist
5
5
  const HAS_IMPORT = true;
@@ -43,7 +43,7 @@ export default class TaxCodes extends Command {
43
43
  limit: Flags.string({ description: 'Items per page' }),
44
44
  include: Flags.string({ description: 'Relations to include' }),
45
45
  search: Flags.string({ description: 'Search term' }),
46
- 'sort-by': Flags.string({ description: 'Sort field' }),
46
+ 'sort-by': Flags.string({ description: 'Sort field(s), comma-separated. Direction (:ASC/:DESC) is optional; date-like fields default to DESC, others to ASC.' }),
47
47
  filter: Flags.string({ description: 'Filter (e.g. --filter status=ACTIVE). Operators: in:A,B, like:%, gt:, lt:, null:', multiple: true }),
48
48
  query: Flags.string({ description: 'Additional query params as JSON' }),
49
49
  fields: Flags.string({ description: 'Comma-separated list of fields to show (e.g. --fields=id,name,status)' }),
@@ -117,7 +117,7 @@ export default class TaxCodes extends Command {
117
117
  if (flags.search)
118
118
  queryParams.search = flags.search;
119
119
  if (flags['sort-by'])
120
- queryParams.sortBy = flags['sort-by'];
120
+ queryParams.sortBy = normalizeSortBy(flags['sort-by']);
121
121
  if (flags.query) {
122
122
  try {
123
123
  Object.assign(queryParams, JSON.parse(flags.query));
@@ -576,7 +576,7 @@ export default class TaxCodes extends Command {
576
576
  if (flags.search)
577
577
  baseParams.search = flags.search;
578
578
  if (flags['sort-by'])
579
- baseParams.sortBy = flags['sort-by'];
579
+ baseParams.sortBy = normalizeSortBy(flags['sort-by']);
580
580
  if (flags.include)
581
581
  baseParams.include = flags.include;
582
582
  if (flags.query) {
@@ -1,5 +1,5 @@
1
1
  import { Command, Args, Flags } from '@oclif/core';
2
- import { apiRequest, ApiError } from '../lib/api-client.js';
2
+ import { apiRequest, ApiError, normalizeSortBy } from '../lib/api-client.js';
3
3
  import { getCurrentContext, getContext, getBaseUrls } from '../lib/config.js';
4
4
  // Add 'import' action if both create and update exist
5
5
  const HAS_IMPORT = true;
@@ -40,7 +40,7 @@ export default class TaxMatrix extends Command {
40
40
  limit: Flags.string({ description: 'Items per page' }),
41
41
  include: Flags.string({ description: 'Relations to include' }),
42
42
  search: Flags.string({ description: 'Search term' }),
43
- 'sort-by': Flags.string({ description: 'Sort field' }),
43
+ 'sort-by': Flags.string({ description: 'Sort field(s), comma-separated. Direction (:ASC/:DESC) is optional; date-like fields default to DESC, others to ASC.' }),
44
44
  filter: Flags.string({ description: 'Filter (e.g. --filter status=ACTIVE). Operators: in:A,B, like:%, gt:, lt:, null:', multiple: true }),
45
45
  query: Flags.string({ description: 'Additional query params as JSON' }),
46
46
  fields: Flags.string({ description: 'Comma-separated list of fields to show (e.g. --fields=id,name,status)' }),
@@ -114,7 +114,7 @@ export default class TaxMatrix extends Command {
114
114
  if (flags.search)
115
115
  queryParams.search = flags.search;
116
116
  if (flags['sort-by'])
117
- queryParams.sortBy = flags['sort-by'];
117
+ queryParams.sortBy = normalizeSortBy(flags['sort-by']);
118
118
  if (flags.query) {
119
119
  try {
120
120
  Object.assign(queryParams, JSON.parse(flags.query));
@@ -573,7 +573,7 @@ export default class TaxMatrix extends Command {
573
573
  if (flags.search)
574
574
  baseParams.search = flags.search;
575
575
  if (flags['sort-by'])
576
- baseParams.sortBy = flags['sort-by'];
576
+ baseParams.sortBy = normalizeSortBy(flags['sort-by']);
577
577
  if (flags.include)
578
578
  baseParams.include = flags.include;
579
579
  if (flags.query) {
@@ -1,5 +1,5 @@
1
1
  import { Command, Args, Flags } from '@oclif/core';
2
- import { apiRequest, ApiError } from '../lib/api-client.js';
2
+ import { apiRequest, ApiError, normalizeSortBy } from '../lib/api-client.js';
3
3
  import { getCurrentContext, getContext, getBaseUrls } from '../lib/config.js';
4
4
  // Add 'import' action if both create and update exist
5
5
  const HAS_IMPORT = true;
@@ -9,9 +9,9 @@ const NESTED_IMPORTS = [];
9
9
  const SUBCOMMANDS = [...["list", "create", "get", "update", "delete", "logo", "icon"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
10
10
  const ENDPOINTS = {
11
11
  'list': { method: 'GET', path: '/v1/tenants', summary: 'Get all tenants with pagination (admin only)', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
12
- 'create': { method: 'POST', path: '/v1/tenants', summary: 'Create a new tenant (admin only)', pathParams: [], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['supportedLocales', 'allowedSenders', 'salesInvoiceRecipientCc', 'salesInvoiceRecipientBcc', 'salesOrderRecipientCc', 'salesOrderRecipientBcc'] },
12
+ 'create': { method: 'POST', path: '/v1/tenants', summary: 'Create a new tenant (admin only)', pathParams: [], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['supportedLocales', 'allowedSenders', 'salesInvoiceRecipientCc', 'salesInvoiceRecipientBcc', 'salesOrderRecipientCc', 'salesOrderRecipientBcc', 'deliveryNoteRecipientCc', 'deliveryNoteRecipientBcc'] },
13
13
  'get': { method: 'GET', path: '/v1/tenants/{id}', summary: 'Get a tenant by ID (own tenant or admin)', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
14
- 'update': { method: 'PATCH', path: '/v1/tenants/{id}', summary: 'Update a tenant (own tenant or admin)', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['supportedLocales', 'allowedSenders', 'salesInvoiceRecipientCc', 'salesInvoiceRecipientBcc', 'salesOrderRecipientCc', 'salesOrderRecipientBcc'] },
14
+ 'update': { method: 'PATCH', path: '/v1/tenants/{id}', summary: 'Update a tenant (own tenant or admin)', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['supportedLocales', 'allowedSenders', 'salesInvoiceRecipientCc', 'salesInvoiceRecipientBcc', 'salesOrderRecipientCc', 'salesOrderRecipientBcc', 'deliveryNoteRecipientCc', 'deliveryNoteRecipientBcc'] },
15
15
  'delete': { method: 'DELETE', path: '/v1/tenants/{id}', summary: 'Delete a tenant (admin only)', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
16
16
  'logo': { method: 'POST', path: '/v1/tenants/{id}/logo', summary: 'Upload the tenant logo to the public bucket and set logoUrl (own tenant or admin)', pathParams: ['id'], hasBody: false, isMultipart: true, isBinaryResponse: false, bodyArrayFields: [] },
17
17
  'icon': { method: 'POST', path: '/v1/tenants/{id}/icon', summary: 'Upload the tenant icon to the public bucket and set iconUrl (own tenant or admin)', pathParams: ['id'], hasBody: false, isMultipart: true, isBinaryResponse: false, bodyArrayFields: [] },
@@ -42,7 +42,7 @@ export default class Tenants extends Command {
42
42
  limit: Flags.string({ description: 'Items per page' }),
43
43
  include: Flags.string({ description: 'Relations to include' }),
44
44
  search: Flags.string({ description: 'Search term' }),
45
- 'sort-by': Flags.string({ description: 'Sort field' }),
45
+ 'sort-by': Flags.string({ description: 'Sort field(s), comma-separated. Direction (:ASC/:DESC) is optional; date-like fields default to DESC, others to ASC.' }),
46
46
  filter: Flags.string({ description: 'Filter (e.g. --filter status=ACTIVE). Operators: in:A,B, like:%, gt:, lt:, null:', multiple: true }),
47
47
  query: Flags.string({ description: 'Additional query params as JSON' }),
48
48
  fields: Flags.string({ description: 'Comma-separated list of fields to show (e.g. --fields=id,name,status)' }),
@@ -116,7 +116,7 @@ export default class Tenants extends Command {
116
116
  if (flags.search)
117
117
  queryParams.search = flags.search;
118
118
  if (flags['sort-by'])
119
- queryParams.sortBy = flags['sort-by'];
119
+ queryParams.sortBy = normalizeSortBy(flags['sort-by']);
120
120
  if (flags.query) {
121
121
  try {
122
122
  Object.assign(queryParams, JSON.parse(flags.query));
@@ -575,7 +575,7 @@ export default class Tenants extends Command {
575
575
  if (flags.search)
576
576
  baseParams.search = flags.search;
577
577
  if (flags['sort-by'])
578
- baseParams.sortBy = flags['sort-by'];
578
+ baseParams.sortBy = normalizeSortBy(flags['sort-by']);
579
579
  if (flags.include)
580
580
  baseParams.include = flags.include;
581
581
  if (flags.query) {
@@ -1,5 +1,5 @@
1
1
  import { Command, Args, Flags } from '@oclif/core';
2
- import { apiRequest, ApiError } from '../lib/api-client.js';
2
+ import { apiRequest, ApiError, normalizeSortBy } from '../lib/api-client.js';
3
3
  import { getCurrentContext, getContext, getBaseUrls } from '../lib/config.js';
4
4
  // Add 'import' action if both create and update exist
5
5
  const HAS_IMPORT = true;
@@ -40,7 +40,7 @@ export default class TextTemplates extends Command {
40
40
  limit: Flags.string({ description: 'Items per page' }),
41
41
  include: Flags.string({ description: 'Relations to include' }),
42
42
  search: Flags.string({ description: 'Search term' }),
43
- 'sort-by': Flags.string({ description: 'Sort field' }),
43
+ 'sort-by': Flags.string({ description: 'Sort field(s), comma-separated. Direction (:ASC/:DESC) is optional; date-like fields default to DESC, others to ASC.' }),
44
44
  filter: Flags.string({ description: 'Filter (e.g. --filter status=ACTIVE). Operators: in:A,B, like:%, gt:, lt:, null:', multiple: true }),
45
45
  query: Flags.string({ description: 'Additional query params as JSON' }),
46
46
  fields: Flags.string({ description: 'Comma-separated list of fields to show (e.g. --fields=id,name,status)' }),
@@ -114,7 +114,7 @@ export default class TextTemplates extends Command {
114
114
  if (flags.search)
115
115
  queryParams.search = flags.search;
116
116
  if (flags['sort-by'])
117
- queryParams.sortBy = flags['sort-by'];
117
+ queryParams.sortBy = normalizeSortBy(flags['sort-by']);
118
118
  if (flags.query) {
119
119
  try {
120
120
  Object.assign(queryParams, JSON.parse(flags.query));
@@ -573,7 +573,7 @@ export default class TextTemplates extends Command {
573
573
  if (flags.search)
574
574
  baseParams.search = flags.search;
575
575
  if (flags['sort-by'])
576
- baseParams.sortBy = flags['sort-by'];
576
+ baseParams.sortBy = normalizeSortBy(flags['sort-by']);
577
577
  if (flags.include)
578
578
  baseParams.include = flags.include;
579
579
  if (flags.query) {
@@ -1,5 +1,5 @@
1
1
  import { Command, Args, Flags } from '@oclif/core';
2
- import { apiRequest, ApiError } from '../lib/api-client.js';
2
+ import { apiRequest, ApiError, normalizeSortBy } from '../lib/api-client.js';
3
3
  import { getCurrentContext, getContext, getBaseUrls } from '../lib/config.js';
4
4
  // Add 'import' action if both create and update exist
5
5
  const HAS_IMPORT = false;
@@ -33,7 +33,7 @@ export default class Tools extends Command {
33
33
  limit: Flags.string({ description: 'Items per page' }),
34
34
  include: Flags.string({ description: 'Relations to include' }),
35
35
  search: Flags.string({ description: 'Search term' }),
36
- 'sort-by': Flags.string({ description: 'Sort field' }),
36
+ 'sort-by': Flags.string({ description: 'Sort field(s), comma-separated. Direction (:ASC/:DESC) is optional; date-like fields default to DESC, others to ASC.' }),
37
37
  filter: Flags.string({ description: 'Filter (e.g. --filter status=ACTIVE). Operators: in:A,B, like:%, gt:, lt:, null:', multiple: true }),
38
38
  query: Flags.string({ description: 'Additional query params as JSON' }),
39
39
  fields: Flags.string({ description: 'Comma-separated list of fields to show (e.g. --fields=id,name,status)' }),
@@ -107,7 +107,7 @@ export default class Tools extends Command {
107
107
  if (flags.search)
108
108
  queryParams.search = flags.search;
109
109
  if (flags['sort-by'])
110
- queryParams.sortBy = flags['sort-by'];
110
+ queryParams.sortBy = normalizeSortBy(flags['sort-by']);
111
111
  if (flags.query) {
112
112
  try {
113
113
  Object.assign(queryParams, JSON.parse(flags.query));
@@ -566,7 +566,7 @@ export default class Tools extends Command {
566
566
  if (flags.search)
567
567
  baseParams.search = flags.search;
568
568
  if (flags['sort-by'])
569
- baseParams.sortBy = flags['sort-by'];
569
+ baseParams.sortBy = normalizeSortBy(flags['sort-by']);
570
570
  if (flags.include)
571
571
  baseParams.include = flags.include;
572
572
  if (flags.query) {
@@ -1,5 +1,5 @@
1
1
  import { Command, Args, Flags } from '@oclif/core';
2
- import { apiRequest, ApiError } from '../lib/api-client.js';
2
+ import { apiRequest, ApiError, normalizeSortBy } from '../lib/api-client.js';
3
3
  import { getCurrentContext, getContext, getBaseUrls } from '../lib/config.js';
4
4
  // Add 'import' action if both create and update exist
5
5
  const HAS_IMPORT = true;
@@ -56,7 +56,7 @@ export default class VatDeclarations extends Command {
56
56
  limit: Flags.string({ description: 'Items per page' }),
57
57
  include: Flags.string({ description: 'Relations to include' }),
58
58
  search: Flags.string({ description: 'Search term' }),
59
- 'sort-by': Flags.string({ description: 'Sort field' }),
59
+ 'sort-by': Flags.string({ description: 'Sort field(s), comma-separated. Direction (:ASC/:DESC) is optional; date-like fields default to DESC, others to ASC.' }),
60
60
  filter: Flags.string({ description: 'Filter (e.g. --filter status=ACTIVE). Operators: in:A,B, like:%, gt:, lt:, null:', multiple: true }),
61
61
  query: Flags.string({ description: 'Additional query params as JSON' }),
62
62
  fields: Flags.string({ description: 'Comma-separated list of fields to show (e.g. --fields=id,name,status)' }),
@@ -130,7 +130,7 @@ export default class VatDeclarations extends Command {
130
130
  if (flags.search)
131
131
  queryParams.search = flags.search;
132
132
  if (flags['sort-by'])
133
- queryParams.sortBy = flags['sort-by'];
133
+ queryParams.sortBy = normalizeSortBy(flags['sort-by']);
134
134
  if (flags.query) {
135
135
  try {
136
136
  Object.assign(queryParams, JSON.parse(flags.query));
@@ -589,7 +589,7 @@ export default class VatDeclarations extends Command {
589
589
  if (flags.search)
590
590
  baseParams.search = flags.search;
591
591
  if (flags['sort-by'])
592
- baseParams.sortBy = flags['sort-by'];
592
+ baseParams.sortBy = normalizeSortBy(flags['sort-by']);
593
593
  if (flags.include)
594
594
  baseParams.include = flags.include;
595
595
  if (flags.query) {
@@ -1,5 +1,5 @@
1
1
  import { Command, Args, Flags } from '@oclif/core';
2
- import { apiRequest, ApiError } from '../lib/api-client.js';
2
+ import { apiRequest, ApiError, normalizeSortBy } from '../lib/api-client.js';
3
3
  import { getCurrentContext, getContext, getBaseUrls } from '../lib/config.js';
4
4
  // Add 'import' action if both create and update exist
5
5
  const HAS_IMPORT = true;
@@ -75,7 +75,7 @@ export default class VendorInvoices extends Command {
75
75
  limit: Flags.string({ description: 'Items per page' }),
76
76
  include: Flags.string({ description: 'Relations to include' }),
77
77
  search: Flags.string({ description: 'Search term' }),
78
- 'sort-by': Flags.string({ description: 'Sort field' }),
78
+ 'sort-by': Flags.string({ description: 'Sort field(s), comma-separated. Direction (:ASC/:DESC) is optional; date-like fields default to DESC, others to ASC.' }),
79
79
  filter: Flags.string({ description: 'Filter (e.g. --filter status=ACTIVE). Operators: in:A,B, like:%, gt:, lt:, null:', multiple: true }),
80
80
  query: Flags.string({ description: 'Additional query params as JSON' }),
81
81
  fields: Flags.string({ description: 'Comma-separated list of fields to show (e.g. --fields=id,name,status)' }),
@@ -149,7 +149,7 @@ export default class VendorInvoices extends Command {
149
149
  if (flags.search)
150
150
  queryParams.search = flags.search;
151
151
  if (flags['sort-by'])
152
- queryParams.sortBy = flags['sort-by'];
152
+ queryParams.sortBy = normalizeSortBy(flags['sort-by']);
153
153
  if (flags.query) {
154
154
  try {
155
155
  Object.assign(queryParams, JSON.parse(flags.query));
@@ -608,7 +608,7 @@ export default class VendorInvoices extends Command {
608
608
  if (flags.search)
609
609
  baseParams.search = flags.search;
610
610
  if (flags['sort-by'])
611
- baseParams.sortBy = flags['sort-by'];
611
+ baseParams.sortBy = normalizeSortBy(flags['sort-by']);
612
612
  if (flags.include)
613
613
  baseParams.include = flags.include;
614
614
  if (flags.query) {
@@ -1,5 +1,5 @@
1
1
  import { Command, Args, Flags } from '@oclif/core';
2
- import { apiRequest, ApiError } from '../lib/api-client.js';
2
+ import { apiRequest, ApiError, normalizeSortBy } from '../lib/api-client.js';
3
3
  import { getCurrentContext, getContext, getBaseUrls } from '../lib/config.js';
4
4
  // Add 'import' action if both create and update exist
5
5
  const HAS_IMPORT = true;
@@ -42,7 +42,7 @@ export default class Webhooks extends Command {
42
42
  limit: Flags.string({ description: 'Items per page' }),
43
43
  include: Flags.string({ description: 'Relations to include' }),
44
44
  search: Flags.string({ description: 'Search term' }),
45
- 'sort-by': Flags.string({ description: 'Sort field' }),
45
+ 'sort-by': Flags.string({ description: 'Sort field(s), comma-separated. Direction (:ASC/:DESC) is optional; date-like fields default to DESC, others to ASC.' }),
46
46
  filter: Flags.string({ description: 'Filter (e.g. --filter status=ACTIVE). Operators: in:A,B, like:%, gt:, lt:, null:', multiple: true }),
47
47
  query: Flags.string({ description: 'Additional query params as JSON' }),
48
48
  fields: Flags.string({ description: 'Comma-separated list of fields to show (e.g. --fields=id,name,status)' }),
@@ -116,7 +116,7 @@ export default class Webhooks extends Command {
116
116
  if (flags.search)
117
117
  queryParams.search = flags.search;
118
118
  if (flags['sort-by'])
119
- queryParams.sortBy = flags['sort-by'];
119
+ queryParams.sortBy = normalizeSortBy(flags['sort-by']);
120
120
  if (flags.query) {
121
121
  try {
122
122
  Object.assign(queryParams, JSON.parse(flags.query));
@@ -575,7 +575,7 @@ export default class Webhooks extends Command {
575
575
  if (flags.search)
576
576
  baseParams.search = flags.search;
577
577
  if (flags['sort-by'])
578
- baseParams.sortBy = flags['sort-by'];
578
+ baseParams.sortBy = normalizeSortBy(flags['sort-by']);
579
579
  if (flags.include)
580
580
  baseParams.include = flags.include;
581
581
  if (flags.query) {
@@ -1,5 +1,5 @@
1
1
  import { Command, Args, Flags } from '@oclif/core';
2
- import { apiRequest, ApiError } from '../lib/api-client.js';
2
+ import { apiRequest, ApiError, normalizeSortBy } from '../lib/api-client.js';
3
3
  import { getCurrentContext, getContext, getBaseUrls } from '../lib/config.js';
4
4
  // Add 'import' action if both create and update exist
5
5
  const HAS_IMPORT = false;
@@ -34,7 +34,7 @@ export default class Workflows extends Command {
34
34
  limit: Flags.string({ description: 'Items per page' }),
35
35
  include: Flags.string({ description: 'Relations to include' }),
36
36
  search: Flags.string({ description: 'Search term' }),
37
- 'sort-by': Flags.string({ description: 'Sort field' }),
37
+ 'sort-by': Flags.string({ description: 'Sort field(s), comma-separated. Direction (:ASC/:DESC) is optional; date-like fields default to DESC, others to ASC.' }),
38
38
  filter: Flags.string({ description: 'Filter (e.g. --filter status=ACTIVE). Operators: in:A,B, like:%, gt:, lt:, null:', multiple: true }),
39
39
  query: Flags.string({ description: 'Additional query params as JSON' }),
40
40
  fields: Flags.string({ description: 'Comma-separated list of fields to show (e.g. --fields=id,name,status)' }),
@@ -108,7 +108,7 @@ export default class Workflows extends Command {
108
108
  if (flags.search)
109
109
  queryParams.search = flags.search;
110
110
  if (flags['sort-by'])
111
- queryParams.sortBy = flags['sort-by'];
111
+ queryParams.sortBy = normalizeSortBy(flags['sort-by']);
112
112
  if (flags.query) {
113
113
  try {
114
114
  Object.assign(queryParams, JSON.parse(flags.query));
@@ -567,7 +567,7 @@ export default class Workflows extends Command {
567
567
  if (flags.search)
568
568
  baseParams.search = flags.search;
569
569
  if (flags['sort-by'])
570
- baseParams.sortBy = flags['sort-by'];
570
+ baseParams.sortBy = normalizeSortBy(flags['sort-by']);
571
571
  if (flags.include)
572
572
  baseParams.include = flags.include;
573
573
  if (flags.query) {
@@ -20,6 +20,14 @@ export interface PaginatedResponse<T> {
20
20
  totalPages: number;
21
21
  };
22
22
  }
23
+ /**
24
+ * Normalize a --sort-by value: comma-separated fields, each optionally suffixed
25
+ * with `:ASC` or `:DESC`. Fields without an explicit direction default to DESC
26
+ * when the leaf name ends in `At`, `Date`, or `Time` (dates read newest-first);
27
+ * everything else defaults to ASC. Returned as an array so axios expands it
28
+ * into repeated `sortBy=a:ASC&sortBy=b:DESC` params.
29
+ */
30
+ export declare function normalizeSortBy(input: string): string[];
23
31
  export declare class ApiError extends Error {
24
32
  status: number;
25
33
  data?: unknown | undefined;
@@ -1,6 +1,26 @@
1
1
  import axios from 'axios';
2
2
  import { getValidToken } from './auth.js';
3
3
  import { getBaseUrls, getCurrentContext } from './config.js';
4
+ /**
5
+ * Normalize a --sort-by value: comma-separated fields, each optionally suffixed
6
+ * with `:ASC` or `:DESC`. Fields without an explicit direction default to DESC
7
+ * when the leaf name ends in `At`, `Date`, or `Time` (dates read newest-first);
8
+ * everything else defaults to ASC. Returned as an array so axios expands it
9
+ * into repeated `sortBy=a:ASC&sortBy=b:DESC` params.
10
+ */
11
+ export function normalizeSortBy(input) {
12
+ return input
13
+ .split(',')
14
+ .map((part) => part.trim())
15
+ .filter(Boolean)
16
+ .map((part) => {
17
+ if (part.includes(':'))
18
+ return part;
19
+ const leaf = part.split('.').pop() ?? part;
20
+ const dateLike = /(?:At|Date|Time)$/.test(leaf);
21
+ return `${part}:${dateLike ? 'DESC' : 'ASC'}`;
22
+ });
23
+ }
4
24
  export class ApiError extends Error {
5
25
  status;
6
26
  data;