@aderis-erp/cli 1.0.14 → 1.0.15

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 (83) hide show
  1. package/dist/commands/access-groups.js +17 -17
  2. package/dist/commands/account-transaction-allocations.js +17 -17
  3. package/dist/commands/account-transactions.js +19 -19
  4. package/dist/commands/accounts.js +19 -19
  5. package/dist/commands/agent-platform.js +19 -18
  6. package/dist/commands/analytics.d.ts +40 -0
  7. package/dist/commands/{documents.js → analytics.js} +29 -39
  8. package/dist/commands/audit-log.js +17 -17
  9. package/dist/commands/auth/login.js +11 -2
  10. package/dist/commands/auth/logout.d.ts +2 -0
  11. package/dist/commands/auth/logout.js +19 -6
  12. package/dist/commands/auth/status.js +26 -12
  13. package/dist/commands/auth/tenant.js +12 -3
  14. package/dist/commands/auth.js +32 -17
  15. package/dist/commands/bank-accounts.js +17 -17
  16. package/dist/commands/bank-integrations.js +17 -17
  17. package/dist/commands/business-partners.js +25 -22
  18. package/dist/commands/chat.js +17 -17
  19. package/dist/commands/config/add.d.ts +9 -0
  20. package/dist/commands/config/add.js +64 -2
  21. package/dist/commands/config/current.js +9 -4
  22. package/dist/commands/config/list.js +9 -4
  23. package/dist/commands/config/set-api-key.d.ts +10 -0
  24. package/dist/commands/config/set-api-key.js +49 -0
  25. package/dist/commands/config/use.js +3 -4
  26. package/dist/commands/credit-card-accounts.js +17 -17
  27. package/dist/commands/delivery-notes.js +22 -21
  28. package/dist/commands/dunning-configs.js +17 -17
  29. package/dist/commands/dunning-reminders.js +17 -17
  30. package/dist/commands/dunning-runs.js +17 -17
  31. package/dist/commands/email-transactions.js +17 -17
  32. package/dist/commands/employees.js +19 -19
  33. package/dist/commands/entity-configurations.js +17 -17
  34. package/dist/commands/event-processor-mappings.js +17 -17
  35. package/dist/commands/{documents.d.ts → files.d.ts} +1 -1
  36. package/dist/commands/{files-internal.js → files.js} +35 -29
  37. package/dist/commands/health.js +17 -17
  38. package/dist/commands/inbox.js +17 -17
  39. package/dist/commands/integrations.js +17 -17
  40. package/dist/commands/item-categories.js +17 -17
  41. package/dist/commands/items.js +19 -19
  42. package/dist/commands/journal-lines.js +17 -17
  43. package/dist/commands/journals.js +21 -20
  44. package/dist/commands/ledgers.js +21 -18
  45. package/dist/commands/office-locations.js +17 -17
  46. package/dist/commands/payment-methods.js +17 -17
  47. package/dist/commands/payment-runs.js +19 -18
  48. package/dist/commands/payment-terms.js +17 -17
  49. package/dist/commands/payments.js +17 -17
  50. package/dist/commands/price-lists.js +17 -17
  51. package/dist/commands/processor-mappings.js +17 -17
  52. package/dist/commands/processors.js +17 -17
  53. package/dist/commands/purchase-order-types.js +17 -17
  54. package/dist/commands/purchase-orders.d.ts +1 -0
  55. package/dist/commands/purchase-orders.js +28 -21
  56. package/dist/commands/reports.js +17 -17
  57. package/dist/commands/salary-types.js +17 -17
  58. package/dist/commands/sales-invoices.js +27 -25
  59. package/dist/commands/sales-orders.js +19 -19
  60. package/dist/commands/saved-views.js +17 -17
  61. package/dist/commands/scheduled-processor-mappings.js +17 -17
  62. package/dist/commands/schedules.js +17 -17
  63. package/dist/commands/switch.js +10 -3
  64. package/dist/commands/{files-internal.d.ts → tag-configurations.d.ts} +1 -1
  65. package/dist/commands/tag-configurations.js +1178 -0
  66. package/dist/commands/tags.js +17 -17
  67. package/dist/commands/tax-codes.js +17 -17
  68. package/dist/commands/tax-matrix.js +17 -17
  69. package/dist/commands/tenants.js +17 -17
  70. package/dist/commands/text-templates.js +17 -17
  71. package/dist/commands/tools.js +17 -17
  72. package/dist/commands/vat-declarations.js +17 -17
  73. package/dist/commands/vendor-invoices.js +21 -21
  74. package/dist/commands/webhooks.js +17 -17
  75. package/dist/commands/workflows.js +17 -17
  76. package/dist/lib/api-client.js +11 -6
  77. package/dist/lib/auth.d.ts +8 -0
  78. package/dist/lib/auth.js +51 -7
  79. package/dist/lib/base-api-command.js +6 -4
  80. package/dist/lib/config.d.ts +31 -1
  81. package/dist/lib/config.js +31 -0
  82. package/oclif.manifest.json +729 -247
  83. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  import { Command, Args, Flags } from '@oclif/core';
2
2
  import { apiRequest, ApiError, normalizeSortBy } from '../lib/api-client.js';
3
- import { getCurrentContext, getContext, getBaseUrls } from '../lib/config.js';
3
+ import { getCurrentContext, getContext, getBaseUrls, hasCredentials, missingCredentialsMessage } from '../lib/config.js';
4
4
  // Add 'import' action if both create and update exist
5
5
  const HAS_IMPORT = true;
6
6
  const HAS_EXPORT = true;
@@ -29,7 +29,7 @@ export default class Tags extends Command {
29
29
  id: Args.string({ description: 'Resource ID (for get, update, delete operations)', required: false }),
30
30
  };
31
31
  static flags = {
32
- context: Flags.string({ char: 'c', description: 'Context to use' }),
32
+ context: Flags.string({ char: 'c', aliases: ['config'], env: 'ADERIS_CONTEXT', description: 'Context to use for this command, overriding the current context (alias: --config)' }),
33
33
  output: Flags.string({ char: 'o', description: 'Output format (default: table for import, json for other commands)', options: ['json', 'table', 'csv'] }),
34
34
  table: Flags.boolean({ char: 't', description: 'Output as table (shortcut for --output table)' }),
35
35
  csv: Flags.boolean({ description: 'Output as CSV (shortcut for --output csv)' }),
@@ -101,9 +101,9 @@ export default class Tags extends Command {
101
101
  }
102
102
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
103
103
  if (!context)
104
- this.error('No context configured. Run: aderis auth login --new');
105
- if (!context.tokens)
106
- this.error('Not logged in. Run: aderis auth login');
104
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
105
+ if (!hasCredentials(context))
106
+ this.error(missingCredentialsMessage(context));
107
107
  const queryParams = {};
108
108
  if (flags.page)
109
109
  queryParams.page = flags.page;
@@ -346,9 +346,9 @@ export default class Tags extends Command {
346
346
  async runImport(flags) {
347
347
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
348
348
  if (!context)
349
- this.error('No context configured. Run: aderis auth login --new');
350
- if (!context.tokens)
351
- this.error('Not logged in. Run: aderis auth login');
349
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
350
+ if (!hasCredentials(context))
351
+ this.error(missingCredentialsMessage(context));
352
352
  // Get data from file, --data, or --set flags
353
353
  let items = [];
354
354
  if (flags.file) {
@@ -558,9 +558,9 @@ export default class Tags extends Command {
558
558
  async runExport(flags) {
559
559
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
560
560
  if (!context)
561
- this.error('No context configured. Run: aderis auth login --new');
562
- if (!context.tokens)
563
- this.error('Not logged in. Run: aderis auth login');
561
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
562
+ if (!hasCredentials(context))
563
+ this.error(missingCredentialsMessage(context));
564
564
  const listEndpoint = ENDPOINTS['list'];
565
565
  if (!listEndpoint)
566
566
  this.error('Export requires a list endpoint');
@@ -652,9 +652,9 @@ export default class Tags extends Command {
652
652
  async runCamt053Import(flags) {
653
653
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
654
654
  if (!context)
655
- this.error('No context configured. Run: aderis auth login --new');
656
- if (!context.tokens)
657
- this.error('Not logged in. Run: aderis auth login');
655
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
656
+ if (!hasCredentials(context))
657
+ this.error(missingCredentialsMessage(context));
658
658
  if (!flags.file) {
659
659
  this.error('CAMT.053 import requires --file (-f) flag with path to XML file');
660
660
  }
@@ -742,9 +742,9 @@ export default class Tags extends Command {
742
742
  }
743
743
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
744
744
  if (!context)
745
- this.error('No context configured. Run: aderis auth login --new');
746
- if (!context.tokens)
747
- this.error('Not logged in. Run: aderis auth login');
745
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
746
+ if (!hasCredentials(context))
747
+ this.error(missingCredentialsMessage(context));
748
748
  // Get data from file, --data, or --set flags
749
749
  let items = [];
750
750
  if (flags.file) {
@@ -1,6 +1,6 @@
1
1
  import { Command, Args, Flags } from '@oclif/core';
2
2
  import { apiRequest, ApiError, normalizeSortBy } from '../lib/api-client.js';
3
- import { getCurrentContext, getContext, getBaseUrls } from '../lib/config.js';
3
+ import { getCurrentContext, getContext, getBaseUrls, hasCredentials, missingCredentialsMessage } from '../lib/config.js';
4
4
  // Add 'import' action if both create and update exist
5
5
  const HAS_IMPORT = true;
6
6
  const HAS_EXPORT = true;
@@ -32,7 +32,7 @@ export default class TaxCodes extends Command {
32
32
  id: Args.string({ description: 'Resource ID (for get, update, delete operations)', required: false }),
33
33
  };
34
34
  static flags = {
35
- context: Flags.string({ char: 'c', description: 'Context to use' }),
35
+ context: Flags.string({ char: 'c', aliases: ['config'], env: 'ADERIS_CONTEXT', description: 'Context to use for this command, overriding the current context (alias: --config)' }),
36
36
  output: Flags.string({ char: 'o', description: 'Output format (default: table for import, json for other commands)', options: ['json', 'table', 'csv'] }),
37
37
  table: Flags.boolean({ char: 't', description: 'Output as table (shortcut for --output table)' }),
38
38
  csv: Flags.boolean({ description: 'Output as CSV (shortcut for --output csv)' }),
@@ -104,9 +104,9 @@ export default class TaxCodes extends Command {
104
104
  }
105
105
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
106
106
  if (!context)
107
- this.error('No context configured. Run: aderis auth login --new');
108
- if (!context.tokens)
109
- this.error('Not logged in. Run: aderis auth login');
107
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
108
+ if (!hasCredentials(context))
109
+ this.error(missingCredentialsMessage(context));
110
110
  const queryParams = {};
111
111
  if (flags.page)
112
112
  queryParams.page = flags.page;
@@ -349,9 +349,9 @@ export default class TaxCodes extends Command {
349
349
  async runImport(flags) {
350
350
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
351
351
  if (!context)
352
- this.error('No context configured. Run: aderis auth login --new');
353
- if (!context.tokens)
354
- this.error('Not logged in. Run: aderis auth login');
352
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
353
+ if (!hasCredentials(context))
354
+ this.error(missingCredentialsMessage(context));
355
355
  // Get data from file, --data, or --set flags
356
356
  let items = [];
357
357
  if (flags.file) {
@@ -561,9 +561,9 @@ export default class TaxCodes extends Command {
561
561
  async runExport(flags) {
562
562
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
563
563
  if (!context)
564
- this.error('No context configured. Run: aderis auth login --new');
565
- if (!context.tokens)
566
- this.error('Not logged in. Run: aderis auth login');
564
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
565
+ if (!hasCredentials(context))
566
+ this.error(missingCredentialsMessage(context));
567
567
  const listEndpoint = ENDPOINTS['list'];
568
568
  if (!listEndpoint)
569
569
  this.error('Export requires a list endpoint');
@@ -655,9 +655,9 @@ export default class TaxCodes extends Command {
655
655
  async runCamt053Import(flags) {
656
656
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
657
657
  if (!context)
658
- this.error('No context configured. Run: aderis auth login --new');
659
- if (!context.tokens)
660
- this.error('Not logged in. Run: aderis auth login');
658
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
659
+ if (!hasCredentials(context))
660
+ this.error(missingCredentialsMessage(context));
661
661
  if (!flags.file) {
662
662
  this.error('CAMT.053 import requires --file (-f) flag with path to XML file');
663
663
  }
@@ -745,9 +745,9 @@ export default class TaxCodes extends Command {
745
745
  }
746
746
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
747
747
  if (!context)
748
- this.error('No context configured. Run: aderis auth login --new');
749
- if (!context.tokens)
750
- this.error('Not logged in. Run: aderis auth login');
748
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
749
+ if (!hasCredentials(context))
750
+ this.error(missingCredentialsMessage(context));
751
751
  // Get data from file, --data, or --set flags
752
752
  let items = [];
753
753
  if (flags.file) {
@@ -1,6 +1,6 @@
1
1
  import { Command, Args, Flags } from '@oclif/core';
2
2
  import { apiRequest, ApiError, normalizeSortBy } from '../lib/api-client.js';
3
- import { getCurrentContext, getContext, getBaseUrls } from '../lib/config.js';
3
+ import { getCurrentContext, getContext, getBaseUrls, hasCredentials, missingCredentialsMessage } from '../lib/config.js';
4
4
  // Add 'import' action if both create and update exist
5
5
  const HAS_IMPORT = true;
6
6
  const HAS_EXPORT = true;
@@ -29,7 +29,7 @@ export default class TaxMatrix extends Command {
29
29
  id: Args.string({ description: 'Resource ID (for get, update, delete operations)', required: false }),
30
30
  };
31
31
  static flags = {
32
- context: Flags.string({ char: 'c', description: 'Context to use' }),
32
+ context: Flags.string({ char: 'c', aliases: ['config'], env: 'ADERIS_CONTEXT', description: 'Context to use for this command, overriding the current context (alias: --config)' }),
33
33
  output: Flags.string({ char: 'o', description: 'Output format (default: table for import, json for other commands)', options: ['json', 'table', 'csv'] }),
34
34
  table: Flags.boolean({ char: 't', description: 'Output as table (shortcut for --output table)' }),
35
35
  csv: Flags.boolean({ description: 'Output as CSV (shortcut for --output csv)' }),
@@ -101,9 +101,9 @@ export default class TaxMatrix extends Command {
101
101
  }
102
102
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
103
103
  if (!context)
104
- this.error('No context configured. Run: aderis auth login --new');
105
- if (!context.tokens)
106
- this.error('Not logged in. Run: aderis auth login');
104
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
105
+ if (!hasCredentials(context))
106
+ this.error(missingCredentialsMessage(context));
107
107
  const queryParams = {};
108
108
  if (flags.page)
109
109
  queryParams.page = flags.page;
@@ -346,9 +346,9 @@ export default class TaxMatrix extends Command {
346
346
  async runImport(flags) {
347
347
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
348
348
  if (!context)
349
- this.error('No context configured. Run: aderis auth login --new');
350
- if (!context.tokens)
351
- this.error('Not logged in. Run: aderis auth login');
349
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
350
+ if (!hasCredentials(context))
351
+ this.error(missingCredentialsMessage(context));
352
352
  // Get data from file, --data, or --set flags
353
353
  let items = [];
354
354
  if (flags.file) {
@@ -558,9 +558,9 @@ export default class TaxMatrix extends Command {
558
558
  async runExport(flags) {
559
559
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
560
560
  if (!context)
561
- this.error('No context configured. Run: aderis auth login --new');
562
- if (!context.tokens)
563
- this.error('Not logged in. Run: aderis auth login');
561
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
562
+ if (!hasCredentials(context))
563
+ this.error(missingCredentialsMessage(context));
564
564
  const listEndpoint = ENDPOINTS['list'];
565
565
  if (!listEndpoint)
566
566
  this.error('Export requires a list endpoint');
@@ -652,9 +652,9 @@ export default class TaxMatrix extends Command {
652
652
  async runCamt053Import(flags) {
653
653
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
654
654
  if (!context)
655
- this.error('No context configured. Run: aderis auth login --new');
656
- if (!context.tokens)
657
- this.error('Not logged in. Run: aderis auth login');
655
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
656
+ if (!hasCredentials(context))
657
+ this.error(missingCredentialsMessage(context));
658
658
  if (!flags.file) {
659
659
  this.error('CAMT.053 import requires --file (-f) flag with path to XML file');
660
660
  }
@@ -742,9 +742,9 @@ export default class TaxMatrix extends Command {
742
742
  }
743
743
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
744
744
  if (!context)
745
- this.error('No context configured. Run: aderis auth login --new');
746
- if (!context.tokens)
747
- this.error('Not logged in. Run: aderis auth login');
745
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
746
+ if (!hasCredentials(context))
747
+ this.error(missingCredentialsMessage(context));
748
748
  // Get data from file, --data, or --set flags
749
749
  let items = [];
750
750
  if (flags.file) {
@@ -1,6 +1,6 @@
1
1
  import { Command, Args, Flags } from '@oclif/core';
2
2
  import { apiRequest, ApiError, normalizeSortBy } from '../lib/api-client.js';
3
- import { getCurrentContext, getContext, getBaseUrls } from '../lib/config.js';
3
+ import { getCurrentContext, getContext, getBaseUrls, hasCredentials, missingCredentialsMessage } from '../lib/config.js';
4
4
  // Add 'import' action if both create and update exist
5
5
  const HAS_IMPORT = true;
6
6
  const HAS_EXPORT = true;
@@ -31,7 +31,7 @@ export default class Tenants extends Command {
31
31
  id: Args.string({ description: 'Resource ID (for get, update, delete operations)', required: false }),
32
32
  };
33
33
  static flags = {
34
- context: Flags.string({ char: 'c', description: 'Context to use' }),
34
+ context: Flags.string({ char: 'c', aliases: ['config'], env: 'ADERIS_CONTEXT', description: 'Context to use for this command, overriding the current context (alias: --config)' }),
35
35
  output: Flags.string({ char: 'o', description: 'Output format (default: table for import, json for other commands)', options: ['json', 'table', 'csv'] }),
36
36
  table: Flags.boolean({ char: 't', description: 'Output as table (shortcut for --output table)' }),
37
37
  csv: Flags.boolean({ description: 'Output as CSV (shortcut for --output csv)' }),
@@ -103,9 +103,9 @@ export default class Tenants extends Command {
103
103
  }
104
104
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
105
105
  if (!context)
106
- this.error('No context configured. Run: aderis auth login --new');
107
- if (!context.tokens)
108
- this.error('Not logged in. Run: aderis auth login');
106
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
107
+ if (!hasCredentials(context))
108
+ this.error(missingCredentialsMessage(context));
109
109
  const queryParams = {};
110
110
  if (flags.page)
111
111
  queryParams.page = flags.page;
@@ -348,9 +348,9 @@ export default class Tenants extends Command {
348
348
  async runImport(flags) {
349
349
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
350
350
  if (!context)
351
- this.error('No context configured. Run: aderis auth login --new');
352
- if (!context.tokens)
353
- this.error('Not logged in. Run: aderis auth login');
351
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
352
+ if (!hasCredentials(context))
353
+ this.error(missingCredentialsMessage(context));
354
354
  // Get data from file, --data, or --set flags
355
355
  let items = [];
356
356
  if (flags.file) {
@@ -560,9 +560,9 @@ export default class Tenants extends Command {
560
560
  async runExport(flags) {
561
561
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
562
562
  if (!context)
563
- this.error('No context configured. Run: aderis auth login --new');
564
- if (!context.tokens)
565
- this.error('Not logged in. Run: aderis auth login');
563
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
564
+ if (!hasCredentials(context))
565
+ this.error(missingCredentialsMessage(context));
566
566
  const listEndpoint = ENDPOINTS['list'];
567
567
  if (!listEndpoint)
568
568
  this.error('Export requires a list endpoint');
@@ -654,9 +654,9 @@ export default class Tenants extends Command {
654
654
  async runCamt053Import(flags) {
655
655
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
656
656
  if (!context)
657
- this.error('No context configured. Run: aderis auth login --new');
658
- if (!context.tokens)
659
- this.error('Not logged in. Run: aderis auth login');
657
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
658
+ if (!hasCredentials(context))
659
+ this.error(missingCredentialsMessage(context));
660
660
  if (!flags.file) {
661
661
  this.error('CAMT.053 import requires --file (-f) flag with path to XML file');
662
662
  }
@@ -744,9 +744,9 @@ export default class Tenants extends Command {
744
744
  }
745
745
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
746
746
  if (!context)
747
- this.error('No context configured. Run: aderis auth login --new');
748
- if (!context.tokens)
749
- this.error('Not logged in. Run: aderis auth login');
747
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
748
+ if (!hasCredentials(context))
749
+ this.error(missingCredentialsMessage(context));
750
750
  // Get data from file, --data, or --set flags
751
751
  let items = [];
752
752
  if (flags.file) {
@@ -1,6 +1,6 @@
1
1
  import { Command, Args, Flags } from '@oclif/core';
2
2
  import { apiRequest, ApiError, normalizeSortBy } from '../lib/api-client.js';
3
- import { getCurrentContext, getContext, getBaseUrls } from '../lib/config.js';
3
+ import { getCurrentContext, getContext, getBaseUrls, hasCredentials, missingCredentialsMessage } from '../lib/config.js';
4
4
  // Add 'import' action if both create and update exist
5
5
  const HAS_IMPORT = true;
6
6
  const HAS_EXPORT = true;
@@ -29,7 +29,7 @@ export default class TextTemplates extends Command {
29
29
  id: Args.string({ description: 'Resource ID (for get, update, delete operations)', required: false }),
30
30
  };
31
31
  static flags = {
32
- context: Flags.string({ char: 'c', description: 'Context to use' }),
32
+ context: Flags.string({ char: 'c', aliases: ['config'], env: 'ADERIS_CONTEXT', description: 'Context to use for this command, overriding the current context (alias: --config)' }),
33
33
  output: Flags.string({ char: 'o', description: 'Output format (default: table for import, json for other commands)', options: ['json', 'table', 'csv'] }),
34
34
  table: Flags.boolean({ char: 't', description: 'Output as table (shortcut for --output table)' }),
35
35
  csv: Flags.boolean({ description: 'Output as CSV (shortcut for --output csv)' }),
@@ -101,9 +101,9 @@ export default class TextTemplates extends Command {
101
101
  }
102
102
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
103
103
  if (!context)
104
- this.error('No context configured. Run: aderis auth login --new');
105
- if (!context.tokens)
106
- this.error('Not logged in. Run: aderis auth login');
104
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
105
+ if (!hasCredentials(context))
106
+ this.error(missingCredentialsMessage(context));
107
107
  const queryParams = {};
108
108
  if (flags.page)
109
109
  queryParams.page = flags.page;
@@ -346,9 +346,9 @@ export default class TextTemplates extends Command {
346
346
  async runImport(flags) {
347
347
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
348
348
  if (!context)
349
- this.error('No context configured. Run: aderis auth login --new');
350
- if (!context.tokens)
351
- this.error('Not logged in. Run: aderis auth login');
349
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
350
+ if (!hasCredentials(context))
351
+ this.error(missingCredentialsMessage(context));
352
352
  // Get data from file, --data, or --set flags
353
353
  let items = [];
354
354
  if (flags.file) {
@@ -558,9 +558,9 @@ export default class TextTemplates extends Command {
558
558
  async runExport(flags) {
559
559
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
560
560
  if (!context)
561
- this.error('No context configured. Run: aderis auth login --new');
562
- if (!context.tokens)
563
- this.error('Not logged in. Run: aderis auth login');
561
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
562
+ if (!hasCredentials(context))
563
+ this.error(missingCredentialsMessage(context));
564
564
  const listEndpoint = ENDPOINTS['list'];
565
565
  if (!listEndpoint)
566
566
  this.error('Export requires a list endpoint');
@@ -652,9 +652,9 @@ export default class TextTemplates extends Command {
652
652
  async runCamt053Import(flags) {
653
653
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
654
654
  if (!context)
655
- this.error('No context configured. Run: aderis auth login --new');
656
- if (!context.tokens)
657
- this.error('Not logged in. Run: aderis auth login');
655
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
656
+ if (!hasCredentials(context))
657
+ this.error(missingCredentialsMessage(context));
658
658
  if (!flags.file) {
659
659
  this.error('CAMT.053 import requires --file (-f) flag with path to XML file');
660
660
  }
@@ -742,9 +742,9 @@ export default class TextTemplates extends Command {
742
742
  }
743
743
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
744
744
  if (!context)
745
- this.error('No context configured. Run: aderis auth login --new');
746
- if (!context.tokens)
747
- this.error('Not logged in. Run: aderis auth login');
745
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
746
+ if (!hasCredentials(context))
747
+ this.error(missingCredentialsMessage(context));
748
748
  // Get data from file, --data, or --set flags
749
749
  let items = [];
750
750
  if (flags.file) {
@@ -1,6 +1,6 @@
1
1
  import { Command, Args, Flags } from '@oclif/core';
2
2
  import { apiRequest, ApiError, normalizeSortBy } from '../lib/api-client.js';
3
- import { getCurrentContext, getContext, getBaseUrls } from '../lib/config.js';
3
+ import { getCurrentContext, getContext, getBaseUrls, hasCredentials, missingCredentialsMessage } 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;
@@ -22,7 +22,7 @@ export default class Tools extends Command {
22
22
  id: Args.string({ description: 'Resource ID (for get, update, delete operations)', required: false }),
23
23
  };
24
24
  static flags = {
25
- context: Flags.string({ char: 'c', description: 'Context to use' }),
25
+ context: Flags.string({ char: 'c', aliases: ['config'], env: 'ADERIS_CONTEXT', description: 'Context to use for this command, overriding the current context (alias: --config)' }),
26
26
  output: Flags.string({ char: 'o', description: 'Output format (default: table for import, json for other commands)', options: ['json', 'table', 'csv'] }),
27
27
  table: Flags.boolean({ char: 't', description: 'Output as table (shortcut for --output table)' }),
28
28
  csv: Flags.boolean({ description: 'Output as CSV (shortcut for --output csv)' }),
@@ -94,9 +94,9 @@ export default class Tools extends Command {
94
94
  }
95
95
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
96
96
  if (!context)
97
- this.error('No context configured. Run: aderis auth login --new');
98
- if (!context.tokens)
99
- this.error('Not logged in. Run: aderis auth login');
97
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
98
+ if (!hasCredentials(context))
99
+ this.error(missingCredentialsMessage(context));
100
100
  const queryParams = {};
101
101
  if (flags.page)
102
102
  queryParams.page = flags.page;
@@ -339,9 +339,9 @@ export default class Tools extends Command {
339
339
  async runImport(flags) {
340
340
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
341
341
  if (!context)
342
- this.error('No context configured. Run: aderis auth login --new');
343
- if (!context.tokens)
344
- this.error('Not logged in. Run: aderis auth login');
342
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
343
+ if (!hasCredentials(context))
344
+ this.error(missingCredentialsMessage(context));
345
345
  // Get data from file, --data, or --set flags
346
346
  let items = [];
347
347
  if (flags.file) {
@@ -551,9 +551,9 @@ export default class Tools extends Command {
551
551
  async runExport(flags) {
552
552
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
553
553
  if (!context)
554
- this.error('No context configured. Run: aderis auth login --new');
555
- if (!context.tokens)
556
- this.error('Not logged in. Run: aderis auth login');
554
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
555
+ if (!hasCredentials(context))
556
+ this.error(missingCredentialsMessage(context));
557
557
  const listEndpoint = ENDPOINTS['list'];
558
558
  if (!listEndpoint)
559
559
  this.error('Export requires a list endpoint');
@@ -645,9 +645,9 @@ export default class Tools extends Command {
645
645
  async runCamt053Import(flags) {
646
646
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
647
647
  if (!context)
648
- this.error('No context configured. Run: aderis auth login --new');
649
- if (!context.tokens)
650
- this.error('Not logged in. Run: aderis auth login');
648
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
649
+ if (!hasCredentials(context))
650
+ this.error(missingCredentialsMessage(context));
651
651
  if (!flags.file) {
652
652
  this.error('CAMT.053 import requires --file (-f) flag with path to XML file');
653
653
  }
@@ -735,9 +735,9 @@ export default class Tools extends Command {
735
735
  }
736
736
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
737
737
  if (!context)
738
- this.error('No context configured. Run: aderis auth login --new');
739
- if (!context.tokens)
740
- this.error('Not logged in. Run: aderis auth login');
738
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
739
+ if (!hasCredentials(context))
740
+ this.error(missingCredentialsMessage(context));
741
741
  // Get data from file, --data, or --set flags
742
742
  let items = [];
743
743
  if (flags.file) {
@@ -1,6 +1,6 @@
1
1
  import { Command, Args, Flags } from '@oclif/core';
2
2
  import { apiRequest, ApiError, normalizeSortBy } from '../lib/api-client.js';
3
- import { getCurrentContext, getContext, getBaseUrls } from '../lib/config.js';
3
+ import { getCurrentContext, getContext, getBaseUrls, hasCredentials, missingCredentialsMessage } from '../lib/config.js';
4
4
  // Add 'import' action if both create and update exist
5
5
  const HAS_IMPORT = true;
6
6
  const HAS_EXPORT = true;
@@ -43,7 +43,7 @@ export default class VatDeclarations extends Command {
43
43
  id: Args.string({ description: 'Resource ID (for get, update, delete operations)', required: false }),
44
44
  };
45
45
  static flags = {
46
- context: Flags.string({ char: 'c', description: 'Context to use' }),
46
+ context: Flags.string({ char: 'c', aliases: ['config'], env: 'ADERIS_CONTEXT', description: 'Context to use for this command, overriding the current context (alias: --config)' }),
47
47
  output: Flags.string({ char: 'o', description: 'Output format (default: table for import, json for other commands)', options: ['json', 'table', 'csv'] }),
48
48
  table: Flags.boolean({ char: 't', description: 'Output as table (shortcut for --output table)' }),
49
49
  csv: Flags.boolean({ description: 'Output as CSV (shortcut for --output csv)' }),
@@ -117,9 +117,9 @@ export default class VatDeclarations extends Command {
117
117
  }
118
118
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
119
119
  if (!context)
120
- this.error('No context configured. Run: aderis auth login --new');
121
- if (!context.tokens)
122
- this.error('Not logged in. Run: aderis auth login');
120
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
121
+ if (!hasCredentials(context))
122
+ this.error(missingCredentialsMessage(context));
123
123
  const queryParams = {};
124
124
  if (flags.page)
125
125
  queryParams.page = flags.page;
@@ -362,9 +362,9 @@ export default class VatDeclarations extends Command {
362
362
  async runImport(flags) {
363
363
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
364
364
  if (!context)
365
- this.error('No context configured. Run: aderis auth login --new');
366
- if (!context.tokens)
367
- this.error('Not logged in. Run: aderis auth login');
365
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
366
+ if (!hasCredentials(context))
367
+ this.error(missingCredentialsMessage(context));
368
368
  // Get data from file, --data, or --set flags
369
369
  let items = [];
370
370
  if (flags.file) {
@@ -574,9 +574,9 @@ export default class VatDeclarations extends Command {
574
574
  async runExport(flags) {
575
575
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
576
576
  if (!context)
577
- this.error('No context configured. Run: aderis auth login --new');
578
- if (!context.tokens)
579
- this.error('Not logged in. Run: aderis auth login');
577
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
578
+ if (!hasCredentials(context))
579
+ this.error(missingCredentialsMessage(context));
580
580
  const listEndpoint = ENDPOINTS['list'];
581
581
  if (!listEndpoint)
582
582
  this.error('Export requires a list endpoint');
@@ -668,9 +668,9 @@ export default class VatDeclarations extends Command {
668
668
  async runCamt053Import(flags) {
669
669
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
670
670
  if (!context)
671
- this.error('No context configured. Run: aderis auth login --new');
672
- if (!context.tokens)
673
- this.error('Not logged in. Run: aderis auth login');
671
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
672
+ if (!hasCredentials(context))
673
+ this.error(missingCredentialsMessage(context));
674
674
  if (!flags.file) {
675
675
  this.error('CAMT.053 import requires --file (-f) flag with path to XML file');
676
676
  }
@@ -758,9 +758,9 @@ export default class VatDeclarations extends Command {
758
758
  }
759
759
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
760
760
  if (!context)
761
- this.error('No context configured. Run: aderis auth login --new');
762
- if (!context.tokens)
763
- this.error('Not logged in. Run: aderis auth login');
761
+ this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
762
+ if (!hasCredentials(context))
763
+ this.error(missingCredentialsMessage(context));
764
764
  // Get data from file, --data, or --set flags
765
765
  let items = [];
766
766
  if (flags.file) {