@aderis-erp/cli 1.0.12 → 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 (73) 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-runs.d.ts → agent-platform.d.ts} +2 -2
  6. package/dist/commands/agent-platform.js +1175 -0
  7. package/dist/commands/audit-log.js +7 -7
  8. package/dist/commands/auth/login.js +2 -3
  9. package/dist/commands/bank-accounts.js +4 -4
  10. package/dist/commands/bank-integrations.js +4 -4
  11. package/dist/commands/business-partners.js +6 -6
  12. package/dist/commands/chat.js +12 -8
  13. package/dist/commands/config/add.js +2 -3
  14. package/dist/commands/config/rename.d.ts +10 -0
  15. package/dist/commands/config/rename.js +68 -0
  16. package/dist/commands/credit-card-accounts.js +4 -4
  17. package/dist/commands/delivery-notes.d.ts +43 -0
  18. package/dist/commands/delivery-notes.js +1206 -0
  19. package/dist/commands/documents.js +5 -5
  20. package/dist/commands/dunning-configs.js +4 -4
  21. package/dist/commands/dunning-reminders.js +4 -4
  22. package/dist/commands/dunning-runs.js +4 -4
  23. package/dist/commands/email-transactions.js +4 -4
  24. package/dist/commands/employees.js +4 -4
  25. package/dist/commands/entity-configurations.js +4 -4
  26. package/dist/commands/event-processor-mappings.js +4 -4
  27. package/dist/commands/files-internal.js +4 -4
  28. package/dist/commands/health.js +4 -4
  29. package/dist/commands/inbox.d.ts +1 -0
  30. package/dist/commands/inbox.js +10 -8
  31. package/dist/commands/integrations.js +4 -4
  32. package/dist/commands/item-categories.js +4 -4
  33. package/dist/commands/items.js +4 -4
  34. package/dist/commands/journal-lines.js +4 -4
  35. package/dist/commands/journals.js +7 -5
  36. package/dist/commands/ledgers.js +4 -4
  37. package/dist/commands/office-locations.js +4 -4
  38. package/dist/commands/payment-methods.js +4 -4
  39. package/dist/commands/payment-runs.js +5 -7
  40. package/dist/commands/payment-terms.js +4 -4
  41. package/dist/commands/payments.d.ts +40 -0
  42. package/dist/commands/payments.js +1180 -0
  43. package/dist/commands/price-lists.js +4 -4
  44. package/dist/commands/processor-mappings.js +4 -4
  45. package/dist/commands/processors.js +4 -4
  46. package/dist/commands/purchase-order-types.js +4 -4
  47. package/dist/commands/purchase-orders.js +4 -4
  48. package/dist/commands/reports.js +4 -4
  49. package/dist/commands/salary-types.js +4 -4
  50. package/dist/commands/sales-invoices.js +13 -12
  51. package/dist/commands/sales-orders.js +7 -5
  52. package/dist/commands/saved-views.js +4 -4
  53. package/dist/commands/scheduled-processor-mappings.d.ts +40 -0
  54. package/dist/commands/{agent-runs.js → scheduled-processor-mappings.js} +22 -23
  55. package/dist/commands/schedules.d.ts +40 -0
  56. package/dist/commands/schedules.js +1182 -0
  57. package/dist/commands/tags.js +4 -4
  58. package/dist/commands/tax-codes.js +4 -4
  59. package/dist/commands/tax-matrix.js +4 -4
  60. package/dist/commands/tenants.js +9 -7
  61. package/dist/commands/text-templates.js +4 -4
  62. package/dist/commands/tools.js +4 -4
  63. package/dist/commands/vat-declarations.js +4 -4
  64. package/dist/commands/vendor-invoices.js +8 -8
  65. package/dist/commands/webhooks.js +4 -4
  66. package/dist/commands/workflows.js +4 -4
  67. package/dist/lib/api-client.d.ts +8 -0
  68. package/dist/lib/api-client.js +20 -0
  69. package/dist/lib/auth.js +2 -2
  70. package/dist/lib/config.d.ts +2 -1
  71. package/dist/lib/config.js +20 -5
  72. package/oclif.manifest.json +956 -231
  73. package/package.json +2 -2
@@ -1,21 +1,21 @@
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;
6
6
  const HAS_EXPORT = true;
7
7
  const HAS_CAMT053 = false;
8
8
  const NESTED_IMPORTS = [];
9
- const SUBCOMMANDS = [...["list", "find-entity", "find-workflow"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
9
+ const SUBCOMMANDS = [...["list", "get"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
10
10
  const ENDPOINTS = {
11
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: [] },
12
+ 'get': { method: 'GET', path: '/v1/audit-logs/{id}', summary: 'Get a single audit log entry', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
14
13
  };
15
14
  export default class AuditLog extends Command {
16
15
  static description = 'Manage audit log';
17
16
  static examples = [
18
17
  '<%= config.bin %> audit-log list',
18
+ '<%= config.bin %> audit-log get <id>',
19
19
  '<%= config.bin %> audit-log export --csv > audit-log.csv',
20
20
  ];
21
21
  static args = {
@@ -34,7 +34,7 @@ export default class AuditLog 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 AuditLog 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 AuditLog 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,8 +20,8 @@ export default class AuthLogin extends Command {
20
20
  }),
21
21
  environment: Flags.string({
22
22
  char: 'e',
23
- description: 'Environment (dev, test, staging, live)',
24
- options: ['dev', 'test', 'staging', 'live'],
23
+ description: 'Environment (dev, staging, live)',
24
+ options: ['dev', 'staging', 'live'],
25
25
  }),
26
26
  name: Flags.string({
27
27
  description: 'Name for the new context (required with --new)',
@@ -93,7 +93,6 @@ export default class AuthLogin extends Command {
93
93
  const environment = flags.environment ? flags.environment : (await select({
94
94
  choices: [
95
95
  { description: 'Development environment', name: 'dev', value: 'dev' },
96
- { description: 'Test environment', name: 'test', value: 'test' },
97
96
  { description: 'Staging environment', name: 'staging', value: 'staging' },
98
97
  { description: 'Production environment', name: 'live', value: 'live' },
99
98
  ],
@@ -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;
@@ -54,7 +54,7 @@ export default class BankAccounts extends Command {
54
54
  limit: Flags.string({ description: 'Items per page' }),
55
55
  include: Flags.string({ description: 'Relations to include' }),
56
56
  search: Flags.string({ description: 'Search term' }),
57
- 'sort-by': Flags.string({ description: 'Sort field' }),
57
+ 'sort-by': Flags.string({ description: 'Sort field(s), comma-separated. Direction (:ASC/:DESC) is optional; date-like fields default to DESC, others to ASC.' }),
58
58
  filter: Flags.string({ description: 'Filter (e.g. --filter status=ACTIVE). Operators: in:A,B, like:%, gt:, lt:, null:', multiple: true }),
59
59
  query: Flags.string({ description: 'Additional query params as JSON' }),
60
60
  fields: Flags.string({ description: 'Comma-separated list of fields to show (e.g. --fields=id,name,status)' }),
@@ -128,7 +128,7 @@ export default class BankAccounts extends Command {
128
128
  if (flags.search)
129
129
  queryParams.search = flags.search;
130
130
  if (flags['sort-by'])
131
- queryParams.sortBy = flags['sort-by'];
131
+ queryParams.sortBy = normalizeSortBy(flags['sort-by']);
132
132
  if (flags.query) {
133
133
  try {
134
134
  Object.assign(queryParams, JSON.parse(flags.query));
@@ -587,7 +587,7 @@ export default class BankAccounts extends Command {
587
587
  if (flags.search)
588
588
  baseParams.search = flags.search;
589
589
  if (flags['sort-by'])
590
- baseParams.sortBy = flags['sort-by'];
590
+ baseParams.sortBy = normalizeSortBy(flags['sort-by']);
591
591
  if (flags.include)
592
592
  baseParams.include = flags.include;
593
593
  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;
@@ -55,7 +55,7 @@ export default class BankIntegrations extends Command {
55
55
  limit: Flags.string({ description: 'Items per page' }),
56
56
  include: Flags.string({ description: 'Relations to include' }),
57
57
  search: Flags.string({ description: 'Search term' }),
58
- 'sort-by': Flags.string({ description: 'Sort field' }),
58
+ 'sort-by': Flags.string({ description: 'Sort field(s), comma-separated. Direction (:ASC/:DESC) is optional; date-like fields default to DESC, others to ASC.' }),
59
59
  filter: Flags.string({ description: 'Filter (e.g. --filter status=ACTIVE). Operators: in:A,B, like:%, gt:, lt:, null:', multiple: true }),
60
60
  query: Flags.string({ description: 'Additional query params as JSON' }),
61
61
  fields: Flags.string({ description: 'Comma-separated list of fields to show (e.g. --fields=id,name,status)' }),
@@ -129,7 +129,7 @@ export default class BankIntegrations extends Command {
129
129
  if (flags.search)
130
130
  queryParams.search = flags.search;
131
131
  if (flags['sort-by'])
132
- queryParams.sortBy = flags['sort-by'];
132
+ queryParams.sortBy = normalizeSortBy(flags['sort-by']);
133
133
  if (flags.query) {
134
134
  try {
135
135
  Object.assign(queryParams, JSON.parse(flags.query));
@@ -588,7 +588,7 @@ export default class BankIntegrations extends Command {
588
588
  if (flags.search)
589
589
  baseParams.search = flags.search;
590
590
  if (flags['sort-by'])
591
- baseParams.sortBy = flags['sort-by'];
591
+ baseParams.sortBy = normalizeSortBy(flags['sort-by']);
592
592
  if (flags.include)
593
593
  baseParams.include = flags.include;
594
594
  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 = ["notes", "contacts", "contacts-notes"];
9
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
- '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'] },
12
+ 'create': { method: 'POST', path: '/v1/business-partners', summary: 'Create a new business partner', pathParams: [], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['salesOrderRecipientCc', 'salesOrderRecipientBcc', 'salesInvoiceRecipientCc', 'salesInvoiceRecipientBcc', 'deliveryNoteRecipientCc', 'deliveryNoteRecipientBcc', 'contacts', 'tagIds', 'salesEarlyPaymentDiscounts', 'purchaseEarlyPaymentDiscounts', '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
- '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'] },
14
+ 'update': { method: 'PATCH', path: '/v1/business-partners/{id}', summary: 'Update a business partner', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['salesOrderRecipientCc', 'salesOrderRecipientBcc', 'salesInvoiceRecipientCc', 'salesInvoiceRecipientBcc', 'deliveryNoteRecipientCc', 'deliveryNoteRecipientBcc', 'contacts', 'tagIds', 'salesEarlyPaymentDiscounts', 'purchaseEarlyPaymentDiscounts', '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
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
17
  'activate': { method: 'POST', path: '/v1/business-partners/{id}/activate', summary: 'Activate a business partner', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
@@ -59,7 +59,7 @@ export default class BusinessPartners extends Command {
59
59
  limit: Flags.string({ description: 'Items per page' }),
60
60
  include: Flags.string({ description: 'Relations to include' }),
61
61
  search: Flags.string({ description: 'Search term' }),
62
- 'sort-by': Flags.string({ description: 'Sort field' }),
62
+ 'sort-by': Flags.string({ description: 'Sort field(s), comma-separated. Direction (:ASC/:DESC) is optional; date-like fields default to DESC, others to ASC.' }),
63
63
  filter: Flags.string({ description: 'Filter (e.g. --filter status=ACTIVE). Operators: in:A,B, like:%, gt:, lt:, null:', multiple: true }),
64
64
  query: Flags.string({ description: 'Additional query params as JSON' }),
65
65
  fields: Flags.string({ description: 'Comma-separated list of fields to show (e.g. --fields=id,name,status)' }),
@@ -133,7 +133,7 @@ export default class BusinessPartners extends Command {
133
133
  if (flags.search)
134
134
  queryParams.search = flags.search;
135
135
  if (flags['sort-by'])
136
- queryParams.sortBy = flags['sort-by'];
136
+ queryParams.sortBy = normalizeSortBy(flags['sort-by']);
137
137
  if (flags.query) {
138
138
  try {
139
139
  Object.assign(queryParams, JSON.parse(flags.query));
@@ -592,7 +592,7 @@ export default class BusinessPartners extends Command {
592
592
  if (flags.search)
593
593
  baseParams.search = flags.search;
594
594
  if (flags['sort-by'])
595
- baseParams.sortBy = flags['sort-by'];
595
+ baseParams.sortBy = normalizeSortBy(flags['sort-by']);
596
596
  if (flags.include)
597
597
  baseParams.include = flags.include;
598
598
  if (flags.query) {
@@ -1,23 +1,27 @@
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
- const HAS_IMPORT = false;
5
+ const HAS_IMPORT = true;
6
6
  const HAS_EXPORT = false;
7
7
  const HAS_CAMT053 = false;
8
8
  const NESTED_IMPORTS = [];
9
- const SUBCOMMANDS = [...["create", "get", "get-all", "delete"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
9
+ const SUBCOMMANDS = [...["create", "get", "get-all", "update", "delete", "stream"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
10
10
  const ENDPOINTS = {
11
- 'create': { method: 'POST', path: '/v1/chat', summary: 'Send a chat message and stream the assistant reply (SSE).', pathParams: [], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
12
- 'get': { method: 'GET', path: '/v1/conversations', summary: 'List the caller\'s chat conversations.', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
11
+ 'create': { method: 'POST', path: '/v1/chat', summary: 'Send a chat message and stream the assistant reply (SSE).', pathParams: [], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['attachments'] },
12
+ 'get': { method: 'GET', path: '/v1/conversations', summary: 'List the caller\'s chat conversations, most recently updated first.', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
13
13
  'get-all': { method: 'GET', path: '/v1/conversations/{id}', summary: 'Fetch one conversation with its messages.', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
14
+ 'update': { method: 'PATCH', path: '/v1/conversations/{id}', summary: 'Store client-owned UI state on a conversation.', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
14
15
  'delete': { method: 'DELETE', path: '/v1/conversations/{id}', summary: 'Delete one conversation.', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
16
+ 'stream': { method: 'GET', path: '/v1/conversations/{id}/stream', summary: 'Reattach to a conversation\'s running turn (SSE replay + follow).', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
15
17
  };
16
18
  export default class Chat extends Command {
17
19
  static description = 'Manage chat';
18
20
  static examples = [
19
21
  '<%= config.bin %> chat get <id>',
20
22
  '<%= config.bin %> chat create --data \'{...}\'',
23
+ '<%= config.bin %> chat update <id> --set field=value',
24
+ '<%= config.bin %> chat import --file data.json',
21
25
  ];
22
26
  static args = {
23
27
  action: Args.string({ description: 'Action: ' + SUBCOMMANDS.join(', '), required: true }),
@@ -35,7 +39,7 @@ export default class Chat extends Command {
35
39
  limit: Flags.string({ description: 'Items per page' }),
36
40
  include: Flags.string({ description: 'Relations to include' }),
37
41
  search: Flags.string({ description: 'Search term' }),
38
- 'sort-by': Flags.string({ description: 'Sort field' }),
42
+ 'sort-by': Flags.string({ description: 'Sort field(s), comma-separated. Direction (:ASC/:DESC) is optional; date-like fields default to DESC, others to ASC.' }),
39
43
  filter: Flags.string({ description: 'Filter (e.g. --filter status=ACTIVE). Operators: in:A,B, like:%, gt:, lt:, null:', multiple: true }),
40
44
  query: Flags.string({ description: 'Additional query params as JSON' }),
41
45
  fields: Flags.string({ description: 'Comma-separated list of fields to show (e.g. --fields=id,name,status)' }),
@@ -109,7 +113,7 @@ export default class Chat extends Command {
109
113
  if (flags.search)
110
114
  queryParams.search = flags.search;
111
115
  if (flags['sort-by'])
112
- queryParams.sortBy = flags['sort-by'];
116
+ queryParams.sortBy = normalizeSortBy(flags['sort-by']);
113
117
  if (flags.query) {
114
118
  try {
115
119
  Object.assign(queryParams, JSON.parse(flags.query));
@@ -568,7 +572,7 @@ export default class Chat extends Command {
568
572
  if (flags.search)
569
573
  baseParams.search = flags.search;
570
574
  if (flags['sort-by'])
571
- baseParams.sortBy = flags['sort-by'];
575
+ baseParams.sortBy = normalizeSortBy(flags['sort-by']);
572
576
  if (flags.include)
573
577
  baseParams.include = flags.include;
574
578
  if (flags.query) {
@@ -17,8 +17,8 @@ export default class ConfigAdd extends Command {
17
17
  }),
18
18
  environment: Flags.string({
19
19
  char: 'e',
20
- description: 'Environment (dev, test, staging, live)',
21
- options: ['dev', 'test', 'staging', 'live'],
20
+ description: 'Environment (dev, staging, live)',
21
+ options: ['dev', 'staging', 'live'],
22
22
  }),
23
23
  force: Flags.boolean({
24
24
  char: 'f',
@@ -66,7 +66,6 @@ export default class ConfigAdd extends Command {
66
66
  choices: [
67
67
  { name: 'live (production)', value: 'live' },
68
68
  { name: 'staging', value: 'staging' },
69
- { name: 'test', value: 'test' },
70
69
  { name: 'dev (development)', value: 'dev' },
71
70
  ],
72
71
  message: 'Environment:',
@@ -0,0 +1,10 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class ConfigRename extends Command {
3
+ static args: {
4
+ oldName: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
5
+ newName: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
6
+ };
7
+ static description: string;
8
+ static examples: string[];
9
+ run(): Promise<void>;
10
+ }
@@ -0,0 +1,68 @@
1
+ import { input, select } from '@inquirer/prompts';
2
+ import { Args, Command } from '@oclif/core';
3
+ import { getContext, getCurrentContext, listContexts, renameContext } from '../../lib/config.js';
4
+ export default class ConfigRename extends Command {
5
+ static args = {
6
+ oldName: Args.string({
7
+ description: 'Current name of the context to rename',
8
+ required: false,
9
+ }),
10
+ newName: Args.string({
11
+ description: 'New name for the context',
12
+ required: false,
13
+ }),
14
+ };
15
+ static description = 'Rename a configured context';
16
+ static examples = [
17
+ '<%= config.bin %> config rename aderis-erp aderis-erp-dev',
18
+ '<%= config.bin %> config rename',
19
+ ];
20
+ async run() {
21
+ const { args } = await this.parse(ConfigRename);
22
+ let { oldName } = args;
23
+ if (!oldName) {
24
+ const contexts = listContexts();
25
+ if (contexts.length === 0) {
26
+ this.error('No contexts configured. Create one with: aderis auth login --new');
27
+ }
28
+ oldName = await select({
29
+ choices: contexts.map((c) => ({
30
+ name: `${c.name} (${c.environment})`,
31
+ value: c.name,
32
+ })),
33
+ message: 'Select a context to rename:',
34
+ });
35
+ }
36
+ if (!getContext(oldName)) {
37
+ this.error(`Context "${oldName}" not found.`);
38
+ }
39
+ let { newName } = args;
40
+ if (!newName) {
41
+ newName = await input({
42
+ message: `New name for "${oldName}":`,
43
+ validate: (value) => {
44
+ const trimmed = value.trim();
45
+ if (!trimmed)
46
+ return 'Name cannot be empty';
47
+ if (trimmed === oldName)
48
+ return 'New name must be different from the current name';
49
+ if (getContext(trimmed))
50
+ return `Context "${trimmed}" already exists`;
51
+ return true;
52
+ },
53
+ });
54
+ }
55
+ newName = newName.trim();
56
+ const wasCurrent = getCurrentContext()?.name === oldName;
57
+ try {
58
+ renameContext(oldName, newName);
59
+ }
60
+ catch (error) {
61
+ this.error(error instanceof Error ? error.message : String(error));
62
+ }
63
+ this.log(`Context "${oldName}" renamed to "${newName}".`);
64
+ if (wasCurrent) {
65
+ this.log(`"${newName}" is now your current context.`);
66
+ }
67
+ }
68
+ }
@@ -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;
@@ -52,7 +52,7 @@ export default class CreditCardAccounts extends Command {
52
52
  limit: Flags.string({ description: 'Items per page' }),
53
53
  include: Flags.string({ description: 'Relations to include' }),
54
54
  search: Flags.string({ description: 'Search term' }),
55
- 'sort-by': Flags.string({ description: 'Sort field' }),
55
+ 'sort-by': Flags.string({ description: 'Sort field(s), comma-separated. Direction (:ASC/:DESC) is optional; date-like fields default to DESC, others to ASC.' }),
56
56
  filter: Flags.string({ description: 'Filter (e.g. --filter status=ACTIVE). Operators: in:A,B, like:%, gt:, lt:, null:', multiple: true }),
57
57
  query: Flags.string({ description: 'Additional query params as JSON' }),
58
58
  fields: Flags.string({ description: 'Comma-separated list of fields to show (e.g. --fields=id,name,status)' }),
@@ -126,7 +126,7 @@ export default class CreditCardAccounts extends Command {
126
126
  if (flags.search)
127
127
  queryParams.search = flags.search;
128
128
  if (flags['sort-by'])
129
- queryParams.sortBy = flags['sort-by'];
129
+ queryParams.sortBy = normalizeSortBy(flags['sort-by']);
130
130
  if (flags.query) {
131
131
  try {
132
132
  Object.assign(queryParams, JSON.parse(flags.query));
@@ -585,7 +585,7 @@ export default class CreditCardAccounts extends Command {
585
585
  if (flags.search)
586
586
  baseParams.search = flags.search;
587
587
  if (flags['sort-by'])
588
- baseParams.sortBy = flags['sort-by'];
588
+ baseParams.sortBy = normalizeSortBy(flags['sort-by']);
589
589
  if (flags.include)
590
590
  baseParams.include = flags.include;
591
591
  if (flags.query) {
@@ -0,0 +1,43 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class DeliveryNotes extends Command {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ action: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
7
+ id: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
8
+ };
9
+ static flags: {
10
+ context: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ output: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ table: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
+ csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
+ data: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
+ file: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
+ set: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
+ 'line-item-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
+ 'note-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
+ 'file-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
20
+ page: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
21
+ limit: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
22
+ include: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
23
+ search: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
24
+ 'sort-by': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
25
+ filter: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
26
+ query: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
27
+ fields: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
28
+ sanitize: import("@oclif/core/interfaces").BooleanFlag<boolean>;
29
+ 'show-http-request': import("@oclif/core/interfaces").BooleanFlag<boolean>;
30
+ };
31
+ run(): Promise<void>;
32
+ private runImport;
33
+ private runExport;
34
+ private runCamt053Import;
35
+ private runNestedImport;
36
+ private parseFilterValue;
37
+ private filterFields;
38
+ private sanitizeOutput;
39
+ private getColumns;
40
+ private getValue;
41
+ private printTable;
42
+ private printCsv;
43
+ }