@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.
- package/dist/commands/access-groups.js +17 -17
- package/dist/commands/account-transaction-allocations.js +17 -17
- package/dist/commands/account-transactions.js +19 -19
- package/dist/commands/accounts.js +19 -19
- package/dist/commands/agent-platform.js +19 -18
- package/dist/commands/analytics.d.ts +40 -0
- package/dist/commands/{documents.js → analytics.js} +29 -39
- package/dist/commands/audit-log.js +17 -17
- package/dist/commands/auth/login.js +11 -2
- package/dist/commands/auth/logout.d.ts +2 -0
- package/dist/commands/auth/logout.js +19 -6
- package/dist/commands/auth/status.js +26 -12
- package/dist/commands/auth/tenant.js +12 -3
- package/dist/commands/auth.js +32 -17
- package/dist/commands/bank-accounts.js +17 -17
- package/dist/commands/bank-integrations.js +17 -17
- package/dist/commands/business-partners.js +25 -22
- package/dist/commands/chat.js +17 -17
- package/dist/commands/config/add.d.ts +9 -0
- package/dist/commands/config/add.js +64 -2
- package/dist/commands/config/current.js +9 -4
- package/dist/commands/config/list.js +9 -4
- package/dist/commands/config/set-api-key.d.ts +10 -0
- package/dist/commands/config/set-api-key.js +49 -0
- package/dist/commands/config/use.js +3 -4
- package/dist/commands/credit-card-accounts.js +17 -17
- package/dist/commands/delivery-notes.js +22 -21
- package/dist/commands/dunning-configs.js +17 -17
- package/dist/commands/dunning-reminders.js +17 -17
- package/dist/commands/dunning-runs.js +17 -17
- package/dist/commands/email-transactions.js +17 -17
- package/dist/commands/employees.js +19 -19
- package/dist/commands/entity-configurations.js +17 -17
- package/dist/commands/event-processor-mappings.js +17 -17
- package/dist/commands/{documents.d.ts → files.d.ts} +1 -1
- package/dist/commands/{files-internal.js → files.js} +35 -29
- package/dist/commands/health.js +17 -17
- package/dist/commands/inbox.js +17 -17
- package/dist/commands/integrations.js +17 -17
- package/dist/commands/item-categories.js +17 -17
- package/dist/commands/items.js +19 -19
- package/dist/commands/journal-lines.js +17 -17
- package/dist/commands/journals.js +21 -20
- package/dist/commands/ledgers.js +21 -18
- package/dist/commands/office-locations.js +17 -17
- package/dist/commands/payment-methods.js +17 -17
- package/dist/commands/payment-runs.js +19 -18
- package/dist/commands/payment-terms.js +17 -17
- package/dist/commands/payments.js +17 -17
- package/dist/commands/price-lists.js +17 -17
- package/dist/commands/processor-mappings.js +17 -17
- package/dist/commands/processors.js +17 -17
- package/dist/commands/purchase-order-types.js +17 -17
- package/dist/commands/purchase-orders.d.ts +1 -0
- package/dist/commands/purchase-orders.js +28 -21
- package/dist/commands/reports.js +17 -17
- package/dist/commands/salary-types.js +17 -17
- package/dist/commands/sales-invoices.js +27 -25
- package/dist/commands/sales-orders.js +19 -19
- package/dist/commands/saved-views.js +17 -17
- package/dist/commands/scheduled-processor-mappings.js +17 -17
- package/dist/commands/schedules.js +17 -17
- package/dist/commands/switch.js +10 -3
- package/dist/commands/{files-internal.d.ts → tag-configurations.d.ts} +1 -1
- package/dist/commands/tag-configurations.js +1178 -0
- package/dist/commands/tags.js +17 -17
- package/dist/commands/tax-codes.js +17 -17
- package/dist/commands/tax-matrix.js +17 -17
- package/dist/commands/tenants.js +17 -17
- package/dist/commands/text-templates.js +17 -17
- package/dist/commands/tools.js +17 -17
- package/dist/commands/vat-declarations.js +17 -17
- package/dist/commands/vendor-invoices.js +21 -21
- package/dist/commands/webhooks.js +17 -17
- package/dist/commands/workflows.js +17 -17
- package/dist/lib/api-client.js +11 -6
- package/dist/lib/auth.d.ts +8 -0
- package/dist/lib/auth.js +51 -7
- package/dist/lib/base-api-command.js +6 -4
- package/dist/lib/config.d.ts +31 -1
- package/dist/lib/config.js +31 -0
- package/oclif.manifest.json +729 -247
- 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;
|
|
@@ -34,7 +34,7 @@ export default class PaymentMethods extends Command {
|
|
|
34
34
|
id: Args.string({ description: 'Resource ID (for get, update, delete operations)', required: false }),
|
|
35
35
|
};
|
|
36
36
|
static flags = {
|
|
37
|
-
context: Flags.string({ char: 'c', description: 'Context to use' }),
|
|
37
|
+
context: Flags.string({ char: 'c', aliases: ['config'], env: 'ADERIS_CONTEXT', description: 'Context to use for this command, overriding the current context (alias: --config)' }),
|
|
38
38
|
output: Flags.string({ char: 'o', description: 'Output format (default: table for import, json for other commands)', options: ['json', 'table', 'csv'] }),
|
|
39
39
|
table: Flags.boolean({ char: 't', description: 'Output as table (shortcut for --output table)' }),
|
|
40
40
|
csv: Flags.boolean({ description: 'Output as CSV (shortcut for --output csv)' }),
|
|
@@ -107,9 +107,9 @@ export default class PaymentMethods extends Command {
|
|
|
107
107
|
}
|
|
108
108
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
109
109
|
if (!context)
|
|
110
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
111
|
-
if (!context
|
|
112
|
-
this.error(
|
|
110
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
111
|
+
if (!hasCredentials(context))
|
|
112
|
+
this.error(missingCredentialsMessage(context));
|
|
113
113
|
const queryParams = {};
|
|
114
114
|
if (flags.page)
|
|
115
115
|
queryParams.page = flags.page;
|
|
@@ -352,9 +352,9 @@ export default class PaymentMethods extends Command {
|
|
|
352
352
|
async runImport(flags) {
|
|
353
353
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
354
354
|
if (!context)
|
|
355
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
356
|
-
if (!context
|
|
357
|
-
this.error(
|
|
355
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
356
|
+
if (!hasCredentials(context))
|
|
357
|
+
this.error(missingCredentialsMessage(context));
|
|
358
358
|
// Get data from file, --data, or --set flags
|
|
359
359
|
let items = [];
|
|
360
360
|
if (flags.file) {
|
|
@@ -564,9 +564,9 @@ export default class PaymentMethods extends Command {
|
|
|
564
564
|
async runExport(flags) {
|
|
565
565
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
566
566
|
if (!context)
|
|
567
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
568
|
-
if (!context
|
|
569
|
-
this.error(
|
|
567
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
568
|
+
if (!hasCredentials(context))
|
|
569
|
+
this.error(missingCredentialsMessage(context));
|
|
570
570
|
const listEndpoint = ENDPOINTS['list'];
|
|
571
571
|
if (!listEndpoint)
|
|
572
572
|
this.error('Export requires a list endpoint');
|
|
@@ -658,9 +658,9 @@ export default class PaymentMethods extends Command {
|
|
|
658
658
|
async runCamt053Import(flags) {
|
|
659
659
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
660
660
|
if (!context)
|
|
661
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
662
|
-
if (!context
|
|
663
|
-
this.error(
|
|
661
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
662
|
+
if (!hasCredentials(context))
|
|
663
|
+
this.error(missingCredentialsMessage(context));
|
|
664
664
|
if (!flags.file) {
|
|
665
665
|
this.error('CAMT.053 import requires --file (-f) flag with path to XML file');
|
|
666
666
|
}
|
|
@@ -748,9 +748,9 @@ export default class PaymentMethods extends Command {
|
|
|
748
748
|
}
|
|
749
749
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
750
750
|
if (!context)
|
|
751
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
752
|
-
if (!context
|
|
753
|
-
this.error(
|
|
751
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
752
|
+
if (!hasCredentials(context))
|
|
753
|
+
this.error(missingCredentialsMessage(context));
|
|
754
754
|
// Get data from file, --data, or --set flags
|
|
755
755
|
let items = [];
|
|
756
756
|
if (flags.file) {
|
|
@@ -1,14 +1,15 @@
|
|
|
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;
|
|
7
7
|
const HAS_CAMT053 = false;
|
|
8
8
|
const NESTED_IMPORTS = [];
|
|
9
|
-
const SUBCOMMANDS = [...["open-submissions", "list", "create", "preview", "schedule", "status", "get", "update", "delete", "create-payments", "delete-payments", "send", "painfile", "sync-status", "sync-status-xml", "sync-all"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
|
|
9
|
+
const SUBCOMMANDS = [...["open-submissions", "eligible-payments", "list", "create", "preview", "schedule", "status", "get", "update", "delete", "create-payments", "delete-payments", "send", "painfile", "sync-status", "sync-status-xml", "sync-all"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
|
|
10
10
|
const ENDPOINTS = {
|
|
11
11
|
'open-submissions': { method: 'GET', path: '/v1/payment-runs/bank-accounts/{bankAccountId}/open-submissions', summary: 'Get open submission IDs for a bank account', pathParams: ['bankAccountId'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
12
|
+
'eligible-payments': { method: 'GET', path: '/v1/payment-runs/eligible-payments/{bankAccountId}', summary: 'Show what a payment run from this bank account would pay', pathParams: ['bankAccountId'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
12
13
|
'list': { method: 'GET', path: '/v1/payment-runs', summary: 'List all payment runs with pagination', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
13
14
|
'create': { method: 'POST', path: '/v1/payment-runs', summary: 'Create a DRAFT payment run from payment IDs', pathParams: [], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['paymentIds'] },
|
|
14
15
|
'preview': { method: 'POST', path: '/v1/payment-runs/preview/{bankAccountId}', summary: 'Preview eligible and filtered invoices for a payment run', pathParams: ['bankAccountId'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['invoiceIds'] },
|
|
@@ -40,7 +41,7 @@ export default class PaymentRuns extends Command {
|
|
|
40
41
|
id: Args.string({ description: 'Resource ID (for get, update, delete operations)', required: false }),
|
|
41
42
|
};
|
|
42
43
|
static flags = {
|
|
43
|
-
context: Flags.string({ char: 'c', description: 'Context to use' }),
|
|
44
|
+
context: Flags.string({ char: 'c', aliases: ['config'], env: 'ADERIS_CONTEXT', description: 'Context to use for this command, overriding the current context (alias: --config)' }),
|
|
44
45
|
output: Flags.string({ char: 'o', description: 'Output format (default: table for import, json for other commands)', options: ['json', 'table', 'csv'] }),
|
|
45
46
|
table: Flags.boolean({ char: 't', description: 'Output as table (shortcut for --output table)' }),
|
|
46
47
|
csv: Flags.boolean({ description: 'Output as CSV (shortcut for --output csv)' }),
|
|
@@ -114,9 +115,9 @@ export default class PaymentRuns extends Command {
|
|
|
114
115
|
}
|
|
115
116
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
116
117
|
if (!context)
|
|
117
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
118
|
-
if (!context
|
|
119
|
-
this.error(
|
|
118
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
119
|
+
if (!hasCredentials(context))
|
|
120
|
+
this.error(missingCredentialsMessage(context));
|
|
120
121
|
const queryParams = {};
|
|
121
122
|
if (flags.page)
|
|
122
123
|
queryParams.page = flags.page;
|
|
@@ -359,9 +360,9 @@ export default class PaymentRuns extends Command {
|
|
|
359
360
|
async runImport(flags) {
|
|
360
361
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
361
362
|
if (!context)
|
|
362
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
363
|
-
if (!context
|
|
364
|
-
this.error(
|
|
363
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
364
|
+
if (!hasCredentials(context))
|
|
365
|
+
this.error(missingCredentialsMessage(context));
|
|
365
366
|
// Get data from file, --data, or --set flags
|
|
366
367
|
let items = [];
|
|
367
368
|
if (flags.file) {
|
|
@@ -571,9 +572,9 @@ export default class PaymentRuns extends Command {
|
|
|
571
572
|
async runExport(flags) {
|
|
572
573
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
573
574
|
if (!context)
|
|
574
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
575
|
-
if (!context
|
|
576
|
-
this.error(
|
|
575
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
576
|
+
if (!hasCredentials(context))
|
|
577
|
+
this.error(missingCredentialsMessage(context));
|
|
577
578
|
const listEndpoint = ENDPOINTS['list'];
|
|
578
579
|
if (!listEndpoint)
|
|
579
580
|
this.error('Export requires a list endpoint');
|
|
@@ -665,9 +666,9 @@ export default class PaymentRuns extends Command {
|
|
|
665
666
|
async runCamt053Import(flags) {
|
|
666
667
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
667
668
|
if (!context)
|
|
668
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
669
|
-
if (!context
|
|
670
|
-
this.error(
|
|
669
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
670
|
+
if (!hasCredentials(context))
|
|
671
|
+
this.error(missingCredentialsMessage(context));
|
|
671
672
|
if (!flags.file) {
|
|
672
673
|
this.error('CAMT.053 import requires --file (-f) flag with path to XML file');
|
|
673
674
|
}
|
|
@@ -755,9 +756,9 @@ export default class PaymentRuns extends Command {
|
|
|
755
756
|
}
|
|
756
757
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
757
758
|
if (!context)
|
|
758
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
759
|
-
if (!context
|
|
760
|
-
this.error(
|
|
759
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
760
|
+
if (!hasCredentials(context))
|
|
761
|
+
this.error(missingCredentialsMessage(context));
|
|
761
762
|
// Get data from file, --data, or --set flags
|
|
762
763
|
let items = [];
|
|
763
764
|
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;
|
|
@@ -30,7 +30,7 @@ export default class PaymentTerms extends Command {
|
|
|
30
30
|
id: Args.string({ description: 'Resource ID (for get, update, delete operations)', required: false }),
|
|
31
31
|
};
|
|
32
32
|
static flags = {
|
|
33
|
-
context: Flags.string({ char: 'c', description: 'Context to use' }),
|
|
33
|
+
context: Flags.string({ char: 'c', aliases: ['config'], env: 'ADERIS_CONTEXT', description: 'Context to use for this command, overriding the current context (alias: --config)' }),
|
|
34
34
|
output: Flags.string({ char: 'o', description: 'Output format (default: table for import, json for other commands)', options: ['json', 'table', 'csv'] }),
|
|
35
35
|
table: Flags.boolean({ char: 't', description: 'Output as table (shortcut for --output table)' }),
|
|
36
36
|
csv: Flags.boolean({ description: 'Output as CSV (shortcut for --output csv)' }),
|
|
@@ -102,9 +102,9 @@ export default class PaymentTerms extends Command {
|
|
|
102
102
|
}
|
|
103
103
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
104
104
|
if (!context)
|
|
105
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
106
|
-
if (!context
|
|
107
|
-
this.error(
|
|
105
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
106
|
+
if (!hasCredentials(context))
|
|
107
|
+
this.error(missingCredentialsMessage(context));
|
|
108
108
|
const queryParams = {};
|
|
109
109
|
if (flags.page)
|
|
110
110
|
queryParams.page = flags.page;
|
|
@@ -347,9 +347,9 @@ export default class PaymentTerms extends Command {
|
|
|
347
347
|
async runImport(flags) {
|
|
348
348
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
349
349
|
if (!context)
|
|
350
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
351
|
-
if (!context
|
|
352
|
-
this.error(
|
|
350
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
351
|
+
if (!hasCredentials(context))
|
|
352
|
+
this.error(missingCredentialsMessage(context));
|
|
353
353
|
// Get data from file, --data, or --set flags
|
|
354
354
|
let items = [];
|
|
355
355
|
if (flags.file) {
|
|
@@ -559,9 +559,9 @@ export default class PaymentTerms extends Command {
|
|
|
559
559
|
async runExport(flags) {
|
|
560
560
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
561
561
|
if (!context)
|
|
562
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
563
|
-
if (!context
|
|
564
|
-
this.error(
|
|
562
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
563
|
+
if (!hasCredentials(context))
|
|
564
|
+
this.error(missingCredentialsMessage(context));
|
|
565
565
|
const listEndpoint = ENDPOINTS['list'];
|
|
566
566
|
if (!listEndpoint)
|
|
567
567
|
this.error('Export requires a list endpoint');
|
|
@@ -653,9 +653,9 @@ export default class PaymentTerms extends Command {
|
|
|
653
653
|
async runCamt053Import(flags) {
|
|
654
654
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
655
655
|
if (!context)
|
|
656
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
657
|
-
if (!context
|
|
658
|
-
this.error(
|
|
656
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
657
|
+
if (!hasCredentials(context))
|
|
658
|
+
this.error(missingCredentialsMessage(context));
|
|
659
659
|
if (!flags.file) {
|
|
660
660
|
this.error('CAMT.053 import requires --file (-f) flag with path to XML file');
|
|
661
661
|
}
|
|
@@ -743,9 +743,9 @@ export default class PaymentTerms extends Command {
|
|
|
743
743
|
}
|
|
744
744
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
745
745
|
if (!context)
|
|
746
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
747
|
-
if (!context
|
|
748
|
-
this.error(
|
|
746
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
747
|
+
if (!hasCredentials(context))
|
|
748
|
+
this.error(missingCredentialsMessage(context));
|
|
749
749
|
// Get data from file, --data, or --set flags
|
|
750
750
|
let items = [];
|
|
751
751
|
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 Payments 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 Payments 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
|
|
108
|
-
this.error(
|
|
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 Payments 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
|
|
353
|
-
this.error(
|
|
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 Payments 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
|
|
565
|
-
this.error(
|
|
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 Payments 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
|
|
659
|
-
this.error(
|
|
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 Payments 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
|
|
749
|
-
this.error(
|
|
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;
|
|
@@ -34,7 +34,7 @@ export default class PriceLists extends Command {
|
|
|
34
34
|
id: Args.string({ description: 'Resource ID (for get, update, delete operations)', required: false }),
|
|
35
35
|
};
|
|
36
36
|
static flags = {
|
|
37
|
-
context: Flags.string({ char: 'c', description: 'Context to use' }),
|
|
37
|
+
context: Flags.string({ char: 'c', aliases: ['config'], env: 'ADERIS_CONTEXT', description: 'Context to use for this command, overriding the current context (alias: --config)' }),
|
|
38
38
|
output: Flags.string({ char: 'o', description: 'Output format (default: table for import, json for other commands)', options: ['json', 'table', 'csv'] }),
|
|
39
39
|
table: Flags.boolean({ char: 't', description: 'Output as table (shortcut for --output table)' }),
|
|
40
40
|
csv: Flags.boolean({ description: 'Output as CSV (shortcut for --output csv)' }),
|
|
@@ -107,9 +107,9 @@ export default class PriceLists extends Command {
|
|
|
107
107
|
}
|
|
108
108
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
109
109
|
if (!context)
|
|
110
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
111
|
-
if (!context
|
|
112
|
-
this.error(
|
|
110
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
111
|
+
if (!hasCredentials(context))
|
|
112
|
+
this.error(missingCredentialsMessage(context));
|
|
113
113
|
const queryParams = {};
|
|
114
114
|
if (flags.page)
|
|
115
115
|
queryParams.page = flags.page;
|
|
@@ -352,9 +352,9 @@ export default class PriceLists extends Command {
|
|
|
352
352
|
async runImport(flags) {
|
|
353
353
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
354
354
|
if (!context)
|
|
355
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
356
|
-
if (!context
|
|
357
|
-
this.error(
|
|
355
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
356
|
+
if (!hasCredentials(context))
|
|
357
|
+
this.error(missingCredentialsMessage(context));
|
|
358
358
|
// Get data from file, --data, or --set flags
|
|
359
359
|
let items = [];
|
|
360
360
|
if (flags.file) {
|
|
@@ -564,9 +564,9 @@ export default class PriceLists extends Command {
|
|
|
564
564
|
async runExport(flags) {
|
|
565
565
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
566
566
|
if (!context)
|
|
567
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
568
|
-
if (!context
|
|
569
|
-
this.error(
|
|
567
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
568
|
+
if (!hasCredentials(context))
|
|
569
|
+
this.error(missingCredentialsMessage(context));
|
|
570
570
|
const listEndpoint = ENDPOINTS['list'];
|
|
571
571
|
if (!listEndpoint)
|
|
572
572
|
this.error('Export requires a list endpoint');
|
|
@@ -658,9 +658,9 @@ export default class PriceLists extends Command {
|
|
|
658
658
|
async runCamt053Import(flags) {
|
|
659
659
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
660
660
|
if (!context)
|
|
661
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
662
|
-
if (!context
|
|
663
|
-
this.error(
|
|
661
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
662
|
+
if (!hasCredentials(context))
|
|
663
|
+
this.error(missingCredentialsMessage(context));
|
|
664
664
|
if (!flags.file) {
|
|
665
665
|
this.error('CAMT.053 import requires --file (-f) flag with path to XML file');
|
|
666
666
|
}
|
|
@@ -748,9 +748,9 @@ export default class PriceLists extends Command {
|
|
|
748
748
|
}
|
|
749
749
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
750
750
|
if (!context)
|
|
751
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
752
|
-
if (!context
|
|
753
|
-
this.error(
|
|
751
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
752
|
+
if (!hasCredentials(context))
|
|
753
|
+
this.error(missingCredentialsMessage(context));
|
|
754
754
|
// Get data from file, --data, or --set flags
|
|
755
755
|
let items = [];
|
|
756
756
|
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;
|
|
@@ -27,7 +27,7 @@ export default class ProcessorMappings extends Command {
|
|
|
27
27
|
id: Args.string({ description: 'Resource ID (for get, update, delete operations)', required: false }),
|
|
28
28
|
};
|
|
29
29
|
static flags = {
|
|
30
|
-
context: Flags.string({ char: 'c', description: 'Context to use' }),
|
|
30
|
+
context: Flags.string({ char: 'c', aliases: ['config'], env: 'ADERIS_CONTEXT', description: 'Context to use for this command, overriding the current context (alias: --config)' }),
|
|
31
31
|
output: Flags.string({ char: 'o', description: 'Output format (default: table for import, json for other commands)', options: ['json', 'table', 'csv'] }),
|
|
32
32
|
table: Flags.boolean({ char: 't', description: 'Output as table (shortcut for --output table)' }),
|
|
33
33
|
csv: Flags.boolean({ description: 'Output as CSV (shortcut for --output csv)' }),
|
|
@@ -99,9 +99,9 @@ export default class ProcessorMappings extends Command {
|
|
|
99
99
|
}
|
|
100
100
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
101
101
|
if (!context)
|
|
102
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
103
|
-
if (!context
|
|
104
|
-
this.error(
|
|
102
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
103
|
+
if (!hasCredentials(context))
|
|
104
|
+
this.error(missingCredentialsMessage(context));
|
|
105
105
|
const queryParams = {};
|
|
106
106
|
if (flags.page)
|
|
107
107
|
queryParams.page = flags.page;
|
|
@@ -344,9 +344,9 @@ export default class ProcessorMappings extends Command {
|
|
|
344
344
|
async runImport(flags) {
|
|
345
345
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
346
346
|
if (!context)
|
|
347
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
348
|
-
if (!context
|
|
349
|
-
this.error(
|
|
347
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
348
|
+
if (!hasCredentials(context))
|
|
349
|
+
this.error(missingCredentialsMessage(context));
|
|
350
350
|
// Get data from file, --data, or --set flags
|
|
351
351
|
let items = [];
|
|
352
352
|
if (flags.file) {
|
|
@@ -556,9 +556,9 @@ export default class ProcessorMappings extends Command {
|
|
|
556
556
|
async runExport(flags) {
|
|
557
557
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
558
558
|
if (!context)
|
|
559
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
560
|
-
if (!context
|
|
561
|
-
this.error(
|
|
559
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
560
|
+
if (!hasCredentials(context))
|
|
561
|
+
this.error(missingCredentialsMessage(context));
|
|
562
562
|
const listEndpoint = ENDPOINTS['list'];
|
|
563
563
|
if (!listEndpoint)
|
|
564
564
|
this.error('Export requires a list endpoint');
|
|
@@ -650,9 +650,9 @@ export default class ProcessorMappings extends Command {
|
|
|
650
650
|
async runCamt053Import(flags) {
|
|
651
651
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
652
652
|
if (!context)
|
|
653
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
654
|
-
if (!context
|
|
655
|
-
this.error(
|
|
653
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
654
|
+
if (!hasCredentials(context))
|
|
655
|
+
this.error(missingCredentialsMessage(context));
|
|
656
656
|
if (!flags.file) {
|
|
657
657
|
this.error('CAMT.053 import requires --file (-f) flag with path to XML file');
|
|
658
658
|
}
|
|
@@ -740,9 +740,9 @@ export default class ProcessorMappings extends Command {
|
|
|
740
740
|
}
|
|
741
741
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
742
742
|
if (!context)
|
|
743
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
744
|
-
if (!context
|
|
745
|
-
this.error(
|
|
743
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
744
|
+
if (!hasCredentials(context))
|
|
745
|
+
this.error(missingCredentialsMessage(context));
|
|
746
746
|
// Get data from file, --data, or --set flags
|
|
747
747
|
let items = [];
|
|
748
748
|
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;
|
|
@@ -35,7 +35,7 @@ export default class Processors extends Command {
|
|
|
35
35
|
id: Args.string({ description: 'Resource ID (for get, update, delete operations)', required: false }),
|
|
36
36
|
};
|
|
37
37
|
static flags = {
|
|
38
|
-
context: Flags.string({ char: 'c', description: 'Context to use' }),
|
|
38
|
+
context: Flags.string({ char: 'c', aliases: ['config'], env: 'ADERIS_CONTEXT', description: 'Context to use for this command, overriding the current context (alias: --config)' }),
|
|
39
39
|
output: Flags.string({ char: 'o', description: 'Output format (default: table for import, json for other commands)', options: ['json', 'table', 'csv'] }),
|
|
40
40
|
table: Flags.boolean({ char: 't', description: 'Output as table (shortcut for --output table)' }),
|
|
41
41
|
csv: Flags.boolean({ description: 'Output as CSV (shortcut for --output csv)' }),
|
|
@@ -107,9 +107,9 @@ export default class Processors extends Command {
|
|
|
107
107
|
}
|
|
108
108
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
109
109
|
if (!context)
|
|
110
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
111
|
-
if (!context
|
|
112
|
-
this.error(
|
|
110
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
111
|
+
if (!hasCredentials(context))
|
|
112
|
+
this.error(missingCredentialsMessage(context));
|
|
113
113
|
const queryParams = {};
|
|
114
114
|
if (flags.page)
|
|
115
115
|
queryParams.page = flags.page;
|
|
@@ -352,9 +352,9 @@ export default class Processors extends Command {
|
|
|
352
352
|
async runImport(flags) {
|
|
353
353
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
354
354
|
if (!context)
|
|
355
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
356
|
-
if (!context
|
|
357
|
-
this.error(
|
|
355
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
356
|
+
if (!hasCredentials(context))
|
|
357
|
+
this.error(missingCredentialsMessage(context));
|
|
358
358
|
// Get data from file, --data, or --set flags
|
|
359
359
|
let items = [];
|
|
360
360
|
if (flags.file) {
|
|
@@ -564,9 +564,9 @@ export default class Processors extends Command {
|
|
|
564
564
|
async runExport(flags) {
|
|
565
565
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
566
566
|
if (!context)
|
|
567
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
568
|
-
if (!context
|
|
569
|
-
this.error(
|
|
567
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
568
|
+
if (!hasCredentials(context))
|
|
569
|
+
this.error(missingCredentialsMessage(context));
|
|
570
570
|
const listEndpoint = ENDPOINTS['list'];
|
|
571
571
|
if (!listEndpoint)
|
|
572
572
|
this.error('Export requires a list endpoint');
|
|
@@ -658,9 +658,9 @@ export default class Processors extends Command {
|
|
|
658
658
|
async runCamt053Import(flags) {
|
|
659
659
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
660
660
|
if (!context)
|
|
661
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
662
|
-
if (!context
|
|
663
|
-
this.error(
|
|
661
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
662
|
+
if (!hasCredentials(context))
|
|
663
|
+
this.error(missingCredentialsMessage(context));
|
|
664
664
|
if (!flags.file) {
|
|
665
665
|
this.error('CAMT.053 import requires --file (-f) flag with path to XML file');
|
|
666
666
|
}
|
|
@@ -748,9 +748,9 @@ export default class Processors extends Command {
|
|
|
748
748
|
}
|
|
749
749
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
750
750
|
if (!context)
|
|
751
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
752
|
-
if (!context
|
|
753
|
-
this.error(
|
|
751
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
752
|
+
if (!hasCredentials(context))
|
|
753
|
+
this.error(missingCredentialsMessage(context));
|
|
754
754
|
// Get data from file, --data, or --set flags
|
|
755
755
|
let items = [];
|
|
756
756
|
if (flags.file) {
|