@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 = false;
|
|
6
6
|
const HAS_EXPORT = false;
|
|
@@ -20,7 +20,7 @@ export default class EntityConfigurations extends Command {
|
|
|
20
20
|
id: Args.string({ description: 'Resource ID (for get, update, delete operations)', required: false }),
|
|
21
21
|
};
|
|
22
22
|
static flags = {
|
|
23
|
-
context: Flags.string({ char: 'c', description: 'Context to use' }),
|
|
23
|
+
context: Flags.string({ char: 'c', aliases: ['config'], env: 'ADERIS_CONTEXT', description: 'Context to use for this command, overriding the current context (alias: --config)' }),
|
|
24
24
|
output: Flags.string({ char: 'o', description: 'Output format (default: table for import, json for other commands)', options: ['json', 'table', 'csv'] }),
|
|
25
25
|
table: Flags.boolean({ char: 't', description: 'Output as table (shortcut for --output table)' }),
|
|
26
26
|
csv: Flags.boolean({ description: 'Output as CSV (shortcut for --output csv)' }),
|
|
@@ -92,9 +92,9 @@ export default class EntityConfigurations extends Command {
|
|
|
92
92
|
}
|
|
93
93
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
94
94
|
if (!context)
|
|
95
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
96
|
-
if (!context
|
|
97
|
-
this.error(
|
|
95
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
96
|
+
if (!hasCredentials(context))
|
|
97
|
+
this.error(missingCredentialsMessage(context));
|
|
98
98
|
const queryParams = {};
|
|
99
99
|
if (flags.page)
|
|
100
100
|
queryParams.page = flags.page;
|
|
@@ -337,9 +337,9 @@ export default class EntityConfigurations extends Command {
|
|
|
337
337
|
async runImport(flags) {
|
|
338
338
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
339
339
|
if (!context)
|
|
340
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
341
|
-
if (!context
|
|
342
|
-
this.error(
|
|
340
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
341
|
+
if (!hasCredentials(context))
|
|
342
|
+
this.error(missingCredentialsMessage(context));
|
|
343
343
|
// Get data from file, --data, or --set flags
|
|
344
344
|
let items = [];
|
|
345
345
|
if (flags.file) {
|
|
@@ -549,9 +549,9 @@ export default class EntityConfigurations extends Command {
|
|
|
549
549
|
async runExport(flags) {
|
|
550
550
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
551
551
|
if (!context)
|
|
552
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
553
|
-
if (!context
|
|
554
|
-
this.error(
|
|
552
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
553
|
+
if (!hasCredentials(context))
|
|
554
|
+
this.error(missingCredentialsMessage(context));
|
|
555
555
|
const listEndpoint = ENDPOINTS['list'];
|
|
556
556
|
if (!listEndpoint)
|
|
557
557
|
this.error('Export requires a list endpoint');
|
|
@@ -643,9 +643,9 @@ export default class EntityConfigurations extends Command {
|
|
|
643
643
|
async runCamt053Import(flags) {
|
|
644
644
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
645
645
|
if (!context)
|
|
646
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
647
|
-
if (!context
|
|
648
|
-
this.error(
|
|
646
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
647
|
+
if (!hasCredentials(context))
|
|
648
|
+
this.error(missingCredentialsMessage(context));
|
|
649
649
|
if (!flags.file) {
|
|
650
650
|
this.error('CAMT.053 import requires --file (-f) flag with path to XML file');
|
|
651
651
|
}
|
|
@@ -733,9 +733,9 @@ export default class EntityConfigurations extends Command {
|
|
|
733
733
|
}
|
|
734
734
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
735
735
|
if (!context)
|
|
736
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
737
|
-
if (!context
|
|
738
|
-
this.error(
|
|
736
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
737
|
+
if (!hasCredentials(context))
|
|
738
|
+
this.error(missingCredentialsMessage(context));
|
|
739
739
|
// Get data from file, --data, or --set flags
|
|
740
740
|
let items = [];
|
|
741
741
|
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;
|
|
@@ -28,7 +28,7 @@ export default class EventProcessorMappings extends Command {
|
|
|
28
28
|
id: Args.string({ description: 'Resource ID (for get, update, delete operations)', required: false }),
|
|
29
29
|
};
|
|
30
30
|
static flags = {
|
|
31
|
-
context: Flags.string({ char: 'c', description: 'Context to use' }),
|
|
31
|
+
context: Flags.string({ char: 'c', aliases: ['config'], env: 'ADERIS_CONTEXT', description: 'Context to use for this command, overriding the current context (alias: --config)' }),
|
|
32
32
|
output: Flags.string({ char: 'o', description: 'Output format (default: table for import, json for other commands)', options: ['json', 'table', 'csv'] }),
|
|
33
33
|
table: Flags.boolean({ char: 't', description: 'Output as table (shortcut for --output table)' }),
|
|
34
34
|
csv: Flags.boolean({ description: 'Output as CSV (shortcut for --output csv)' }),
|
|
@@ -100,9 +100,9 @@ export default class EventProcessorMappings extends Command {
|
|
|
100
100
|
}
|
|
101
101
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
102
102
|
if (!context)
|
|
103
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
104
|
-
if (!context
|
|
105
|
-
this.error(
|
|
103
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
104
|
+
if (!hasCredentials(context))
|
|
105
|
+
this.error(missingCredentialsMessage(context));
|
|
106
106
|
const queryParams = {};
|
|
107
107
|
if (flags.page)
|
|
108
108
|
queryParams.page = flags.page;
|
|
@@ -345,9 +345,9 @@ export default class EventProcessorMappings extends Command {
|
|
|
345
345
|
async runImport(flags) {
|
|
346
346
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
347
347
|
if (!context)
|
|
348
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
349
|
-
if (!context
|
|
350
|
-
this.error(
|
|
348
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
349
|
+
if (!hasCredentials(context))
|
|
350
|
+
this.error(missingCredentialsMessage(context));
|
|
351
351
|
// Get data from file, --data, or --set flags
|
|
352
352
|
let items = [];
|
|
353
353
|
if (flags.file) {
|
|
@@ -557,9 +557,9 @@ export default class EventProcessorMappings extends Command {
|
|
|
557
557
|
async runExport(flags) {
|
|
558
558
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
559
559
|
if (!context)
|
|
560
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
561
|
-
if (!context
|
|
562
|
-
this.error(
|
|
560
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
561
|
+
if (!hasCredentials(context))
|
|
562
|
+
this.error(missingCredentialsMessage(context));
|
|
563
563
|
const listEndpoint = ENDPOINTS['list'];
|
|
564
564
|
if (!listEndpoint)
|
|
565
565
|
this.error('Export requires a list endpoint');
|
|
@@ -651,9 +651,9 @@ export default class EventProcessorMappings extends Command {
|
|
|
651
651
|
async runCamt053Import(flags) {
|
|
652
652
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
653
653
|
if (!context)
|
|
654
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
655
|
-
if (!context
|
|
656
|
-
this.error(
|
|
654
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
655
|
+
if (!hasCredentials(context))
|
|
656
|
+
this.error(missingCredentialsMessage(context));
|
|
657
657
|
if (!flags.file) {
|
|
658
658
|
this.error('CAMT.053 import requires --file (-f) flag with path to XML file');
|
|
659
659
|
}
|
|
@@ -741,9 +741,9 @@ export default class EventProcessorMappings extends Command {
|
|
|
741
741
|
}
|
|
742
742
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
743
743
|
if (!context)
|
|
744
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
745
|
-
if (!context
|
|
746
|
-
this.error(
|
|
744
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
745
|
+
if (!hasCredentials(context))
|
|
746
|
+
this.error(missingCredentialsMessage(context));
|
|
747
747
|
// Get data from file, --data, or --set flags
|
|
748
748
|
let items = [];
|
|
749
749
|
if (flags.file) {
|
|
@@ -1,36 +1,42 @@
|
|
|
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
|
-
const HAS_EXPORT =
|
|
6
|
+
const HAS_EXPORT = true;
|
|
7
7
|
const HAS_CAMT053 = false;
|
|
8
8
|
const NESTED_IMPORTS = [];
|
|
9
|
-
const SUBCOMMANDS = [...["create", "download-all", "download", "references", "update", "
|
|
9
|
+
const SUBCOMMANDS = [...["list", "create", "download-all", "download", "get", "references", "update", "discard", "move", "retention", "hold", "reclassify"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
|
|
10
10
|
const ENDPOINTS = {
|
|
11
|
+
'list': { method: 'GET', path: '/v1/files', summary: 'List files (paginated, permission-scoped)', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
11
12
|
'create': { method: 'POST', path: '/v1/files', summary: 'Upload a file (streaming, memory-efficient)', pathParams: [], hasBody: false, isMultipart: true, isBinaryResponse: false, bodyArrayFields: [] },
|
|
12
13
|
'download-all': { method: 'GET', path: '/v1/files/download/*', summary: 'Download file directly by storage key', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
13
14
|
'download': { method: 'GET', path: '/v1/files/{id}/download', summary: 'Get a signed download URL for a file', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
15
|
+
'get': { method: 'GET', path: '/v1/files/{id}', summary: 'Get a file by id (permission-scoped)', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
14
16
|
'references': { method: 'POST', path: '/v1/files/references', summary: 'Register a file reference to an existing storage object', pathParams: [], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
15
|
-
'update': { method: 'PATCH', path: '/v1/files/{fileId}', summary: 'Update file metadata (type, parent, sortOrder)', pathParams: ['fileId'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
17
|
+
'update': { method: 'PATCH', path: '/v1/files/{fileId}', summary: 'Update file metadata (type, parent, sortOrder)', pathParams: ['fileId'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['tags', 'references'] },
|
|
18
|
+
'discard': { method: 'POST', path: '/v1/files/{fileId}/discard', summary: 'Discard a file (sets status DISCARDED; stays readable by id)', pathParams: ['fileId'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
16
19
|
'move': { method: 'POST', path: '/v1/files/{fileId}/move', summary: 'Move file between storage zones', pathParams: ['fileId'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
17
|
-
'renditions': { method: 'POST', path: '/v1/files/{fileId}/renditions', summary: 'Register a business-significant rendition', pathParams: ['fileId'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
18
20
|
'retention': { method: 'POST', path: '/v1/files/{fileId}/retention', summary: 'Set or override retention period on a file', pathParams: ['fileId'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
19
21
|
'hold': { method: 'POST', path: '/v1/files/{fileId}/hold', summary: 'Set or release legal hold on a file', pathParams: ['fileId'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
22
|
+
'reclassify': { method: 'POST', path: '/v1/files/{fileId}/reclassify', summary: 'Reclassify a file and reprocess it through the inbox pipeline', pathParams: ['fileId'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
20
23
|
};
|
|
21
|
-
export default class
|
|
22
|
-
static description = 'Manage files
|
|
24
|
+
export default class Files extends Command {
|
|
25
|
+
static description = 'Manage files';
|
|
23
26
|
static examples = [
|
|
24
|
-
'<%= config.bin %> files
|
|
25
|
-
'<%= config.bin %> files
|
|
26
|
-
'<%= config.bin %> files
|
|
27
|
+
'<%= config.bin %> files list',
|
|
28
|
+
'<%= config.bin %> files get <id>',
|
|
29
|
+
'<%= config.bin %> files create --data \'{...}\'',
|
|
30
|
+
'<%= config.bin %> files update <id> --set field=value',
|
|
31
|
+
'<%= config.bin %> files import --file data.json',
|
|
32
|
+
'<%= config.bin %> files export --csv > files.csv',
|
|
27
33
|
];
|
|
28
34
|
static args = {
|
|
29
35
|
action: Args.string({ description: 'Action: ' + SUBCOMMANDS.join(', '), required: true }),
|
|
30
36
|
id: Args.string({ description: 'Resource ID (for get, update, delete operations)', required: false }),
|
|
31
37
|
};
|
|
32
38
|
static flags = {
|
|
33
|
-
context: Flags.string({ char: 'c', description: 'Context to use' }),
|
|
39
|
+
context: Flags.string({ char: 'c', aliases: ['config'], env: 'ADERIS_CONTEXT', description: 'Context to use for this command, overriding the current context (alias: --config)' }),
|
|
34
40
|
output: Flags.string({ char: 'o', description: 'Output format (default: table for import, json for other commands)', options: ['json', 'table', 'csv'] }),
|
|
35
41
|
table: Flags.boolean({ char: 't', description: 'Output as table (shortcut for --output table)' }),
|
|
36
42
|
csv: Flags.boolean({ description: 'Output as CSV (shortcut for --output csv)' }),
|
|
@@ -49,7 +55,7 @@ export default class FilesInternal extends Command {
|
|
|
49
55
|
'show-http-request': Flags.boolean({ description: 'Show HTTP request details (method, URL, body)' }),
|
|
50
56
|
};
|
|
51
57
|
async run() {
|
|
52
|
-
const { args, flags } = await this.parse(
|
|
58
|
+
const { args, flags } = await this.parse(Files);
|
|
53
59
|
// Handle import action specially
|
|
54
60
|
if (args.action === 'import') {
|
|
55
61
|
if (!HAS_IMPORT)
|
|
@@ -90,7 +96,7 @@ export default class FilesInternal extends Command {
|
|
|
90
96
|
// First path param always comes from positional argument
|
|
91
97
|
value = args.id;
|
|
92
98
|
if (!value)
|
|
93
|
-
this.error('Missing required argument: id. Usage: aderis files
|
|
99
|
+
this.error('Missing required argument: id. Usage: aderis files <action> <id>');
|
|
94
100
|
}
|
|
95
101
|
else {
|
|
96
102
|
const flagName = param.replace(/\./g, '-').replace(/([A-Z])/g, '-$1').toLowerCase().replace(/^-/, '');
|
|
@@ -102,9 +108,9 @@ export default class FilesInternal extends Command {
|
|
|
102
108
|
}
|
|
103
109
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
104
110
|
if (!context)
|
|
105
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
106
|
-
if (!context
|
|
107
|
-
this.error(
|
|
111
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
112
|
+
if (!hasCredentials(context))
|
|
113
|
+
this.error(missingCredentialsMessage(context));
|
|
108
114
|
const queryParams = {};
|
|
109
115
|
if (flags.page)
|
|
110
116
|
queryParams.page = flags.page;
|
|
@@ -347,9 +353,9 @@ export default class FilesInternal extends Command {
|
|
|
347
353
|
async runImport(flags) {
|
|
348
354
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
349
355
|
if (!context)
|
|
350
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
351
|
-
if (!context
|
|
352
|
-
this.error(
|
|
356
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
357
|
+
if (!hasCredentials(context))
|
|
358
|
+
this.error(missingCredentialsMessage(context));
|
|
353
359
|
// Get data from file, --data, or --set flags
|
|
354
360
|
let items = [];
|
|
355
361
|
if (flags.file) {
|
|
@@ -559,9 +565,9 @@ export default class FilesInternal extends Command {
|
|
|
559
565
|
async runExport(flags) {
|
|
560
566
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
561
567
|
if (!context)
|
|
562
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
563
|
-
if (!context
|
|
564
|
-
this.error(
|
|
568
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
569
|
+
if (!hasCredentials(context))
|
|
570
|
+
this.error(missingCredentialsMessage(context));
|
|
565
571
|
const listEndpoint = ENDPOINTS['list'];
|
|
566
572
|
if (!listEndpoint)
|
|
567
573
|
this.error('Export requires a list endpoint');
|
|
@@ -653,9 +659,9 @@ export default class FilesInternal extends Command {
|
|
|
653
659
|
async runCamt053Import(flags) {
|
|
654
660
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
655
661
|
if (!context)
|
|
656
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
657
|
-
if (!context
|
|
658
|
-
this.error(
|
|
662
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
663
|
+
if (!hasCredentials(context))
|
|
664
|
+
this.error(missingCredentialsMessage(context));
|
|
659
665
|
if (!flags.file) {
|
|
660
666
|
this.error('CAMT.053 import requires --file (-f) flag with path to XML file');
|
|
661
667
|
}
|
|
@@ -739,13 +745,13 @@ export default class FilesInternal extends Command {
|
|
|
739
745
|
}
|
|
740
746
|
async runNestedImport(suffix, parentId, flags) {
|
|
741
747
|
if (!parentId) {
|
|
742
|
-
this.error(`Missing required argument: id. Usage: aderis files
|
|
748
|
+
this.error(`Missing required argument: id. Usage: aderis files import-${suffix} <parent-id> --file data.json`);
|
|
743
749
|
}
|
|
744
750
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
745
751
|
if (!context)
|
|
746
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
747
|
-
if (!context
|
|
748
|
-
this.error(
|
|
752
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
753
|
+
if (!hasCredentials(context))
|
|
754
|
+
this.error(missingCredentialsMessage(context));
|
|
749
755
|
// Get data from file, --data, or --set flags
|
|
750
756
|
let items = [];
|
|
751
757
|
if (flags.file) {
|
package/dist/commands/health.js
CHANGED
|
@@ -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 = false;
|
|
@@ -24,7 +24,7 @@ export default class Health extends Command {
|
|
|
24
24
|
id: Args.string({ description: 'Resource ID (for get, update, delete operations)', required: false }),
|
|
25
25
|
};
|
|
26
26
|
static flags = {
|
|
27
|
-
context: Flags.string({ char: 'c', description: 'Context to use' }),
|
|
27
|
+
context: Flags.string({ char: 'c', aliases: ['config'], env: 'ADERIS_CONTEXT', description: 'Context to use for this command, overriding the current context (alias: --config)' }),
|
|
28
28
|
output: Flags.string({ char: 'o', description: 'Output format (default: table for import, json for other commands)', options: ['json', 'table', 'csv'] }),
|
|
29
29
|
table: Flags.boolean({ char: 't', description: 'Output as table (shortcut for --output table)' }),
|
|
30
30
|
csv: Flags.boolean({ description: 'Output as CSV (shortcut for --output csv)' }),
|
|
@@ -96,9 +96,9 @@ export default class Health extends Command {
|
|
|
96
96
|
}
|
|
97
97
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
98
98
|
if (!context)
|
|
99
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
100
|
-
if (!context
|
|
101
|
-
this.error(
|
|
99
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
100
|
+
if (!hasCredentials(context))
|
|
101
|
+
this.error(missingCredentialsMessage(context));
|
|
102
102
|
const queryParams = {};
|
|
103
103
|
if (flags.page)
|
|
104
104
|
queryParams.page = flags.page;
|
|
@@ -341,9 +341,9 @@ export default class Health extends Command {
|
|
|
341
341
|
async runImport(flags) {
|
|
342
342
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
343
343
|
if (!context)
|
|
344
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
345
|
-
if (!context
|
|
346
|
-
this.error(
|
|
344
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
345
|
+
if (!hasCredentials(context))
|
|
346
|
+
this.error(missingCredentialsMessage(context));
|
|
347
347
|
// Get data from file, --data, or --set flags
|
|
348
348
|
let items = [];
|
|
349
349
|
if (flags.file) {
|
|
@@ -553,9 +553,9 @@ export default class Health extends Command {
|
|
|
553
553
|
async runExport(flags) {
|
|
554
554
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
555
555
|
if (!context)
|
|
556
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
557
|
-
if (!context
|
|
558
|
-
this.error(
|
|
556
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
557
|
+
if (!hasCredentials(context))
|
|
558
|
+
this.error(missingCredentialsMessage(context));
|
|
559
559
|
const listEndpoint = ENDPOINTS['list'];
|
|
560
560
|
if (!listEndpoint)
|
|
561
561
|
this.error('Export requires a list endpoint');
|
|
@@ -647,9 +647,9 @@ export default class Health extends Command {
|
|
|
647
647
|
async runCamt053Import(flags) {
|
|
648
648
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
649
649
|
if (!context)
|
|
650
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
651
|
-
if (!context
|
|
652
|
-
this.error(
|
|
650
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
651
|
+
if (!hasCredentials(context))
|
|
652
|
+
this.error(missingCredentialsMessage(context));
|
|
653
653
|
if (!flags.file) {
|
|
654
654
|
this.error('CAMT.053 import requires --file (-f) flag with path to XML file');
|
|
655
655
|
}
|
|
@@ -737,9 +737,9 @@ export default class Health extends Command {
|
|
|
737
737
|
}
|
|
738
738
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
739
739
|
if (!context)
|
|
740
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
741
|
-
if (!context
|
|
742
|
-
this.error(
|
|
740
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
741
|
+
if (!hasCredentials(context))
|
|
742
|
+
this.error(missingCredentialsMessage(context));
|
|
743
743
|
// Get data from file, --data, or --set flags
|
|
744
744
|
let items = [];
|
|
745
745
|
if (flags.file) {
|
package/dist/commands/inbox.js
CHANGED
|
@@ -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 = false;
|
|
@@ -23,7 +23,7 @@ export default class Inbox extends Command {
|
|
|
23
23
|
id: Args.string({ description: 'Resource ID (for get, update, delete operations)', required: false }),
|
|
24
24
|
};
|
|
25
25
|
static flags = {
|
|
26
|
-
context: Flags.string({ char: 'c', description: 'Context to use' }),
|
|
26
|
+
context: Flags.string({ char: 'c', aliases: ['config'], env: 'ADERIS_CONTEXT', description: 'Context to use for this command, overriding the current context (alias: --config)' }),
|
|
27
27
|
output: Flags.string({ char: 'o', description: 'Output format (default: table for import, json for other commands)', options: ['json', 'table', 'csv'] }),
|
|
28
28
|
table: Flags.boolean({ char: 't', description: 'Output as table (shortcut for --output table)' }),
|
|
29
29
|
csv: Flags.boolean({ description: 'Output as CSV (shortcut for --output csv)' }),
|
|
@@ -96,9 +96,9 @@ export default class Inbox extends Command {
|
|
|
96
96
|
}
|
|
97
97
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
98
98
|
if (!context)
|
|
99
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
100
|
-
if (!context
|
|
101
|
-
this.error(
|
|
99
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
100
|
+
if (!hasCredentials(context))
|
|
101
|
+
this.error(missingCredentialsMessage(context));
|
|
102
102
|
const queryParams = {};
|
|
103
103
|
if (flags.page)
|
|
104
104
|
queryParams.page = flags.page;
|
|
@@ -341,9 +341,9 @@ export default class Inbox extends Command {
|
|
|
341
341
|
async runImport(flags) {
|
|
342
342
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
343
343
|
if (!context)
|
|
344
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
345
|
-
if (!context
|
|
346
|
-
this.error(
|
|
344
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
345
|
+
if (!hasCredentials(context))
|
|
346
|
+
this.error(missingCredentialsMessage(context));
|
|
347
347
|
// Get data from file, --data, or --set flags
|
|
348
348
|
let items = [];
|
|
349
349
|
if (flags.file) {
|
|
@@ -553,9 +553,9 @@ export default class Inbox extends Command {
|
|
|
553
553
|
async runExport(flags) {
|
|
554
554
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
555
555
|
if (!context)
|
|
556
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
557
|
-
if (!context
|
|
558
|
-
this.error(
|
|
556
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
557
|
+
if (!hasCredentials(context))
|
|
558
|
+
this.error(missingCredentialsMessage(context));
|
|
559
559
|
const listEndpoint = ENDPOINTS['list'];
|
|
560
560
|
if (!listEndpoint)
|
|
561
561
|
this.error('Export requires a list endpoint');
|
|
@@ -647,9 +647,9 @@ export default class Inbox extends Command {
|
|
|
647
647
|
async runCamt053Import(flags) {
|
|
648
648
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
649
649
|
if (!context)
|
|
650
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
651
|
-
if (!context
|
|
652
|
-
this.error(
|
|
650
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
651
|
+
if (!hasCredentials(context))
|
|
652
|
+
this.error(missingCredentialsMessage(context));
|
|
653
653
|
if (!flags.file) {
|
|
654
654
|
this.error('CAMT.053 import requires --file (-f) flag with path to XML file');
|
|
655
655
|
}
|
|
@@ -737,9 +737,9 @@ export default class Inbox extends Command {
|
|
|
737
737
|
}
|
|
738
738
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
739
739
|
if (!context)
|
|
740
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
741
|
-
if (!context
|
|
742
|
-
this.error(
|
|
740
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
741
|
+
if (!hasCredentials(context))
|
|
742
|
+
this.error(missingCredentialsMessage(context));
|
|
743
743
|
// Get data from file, --data, or --set flags
|
|
744
744
|
let items = [];
|
|
745
745
|
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 = false;
|
|
@@ -23,7 +23,7 @@ export default class Integrations extends Command {
|
|
|
23
23
|
id: Args.string({ description: 'Resource ID (for get, update, delete operations)', required: false }),
|
|
24
24
|
};
|
|
25
25
|
static flags = {
|
|
26
|
-
context: Flags.string({ char: 'c', description: 'Context to use' }),
|
|
26
|
+
context: Flags.string({ char: 'c', aliases: ['config'], env: 'ADERIS_CONTEXT', description: 'Context to use for this command, overriding the current context (alias: --config)' }),
|
|
27
27
|
output: Flags.string({ char: 'o', description: 'Output format (default: table for import, json for other commands)', options: ['json', 'table', 'csv'] }),
|
|
28
28
|
table: Flags.boolean({ char: 't', description: 'Output as table (shortcut for --output table)' }),
|
|
29
29
|
csv: Flags.boolean({ description: 'Output as CSV (shortcut for --output csv)' }),
|
|
@@ -96,9 +96,9 @@ export default class Integrations extends Command {
|
|
|
96
96
|
}
|
|
97
97
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
98
98
|
if (!context)
|
|
99
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
100
|
-
if (!context
|
|
101
|
-
this.error(
|
|
99
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
100
|
+
if (!hasCredentials(context))
|
|
101
|
+
this.error(missingCredentialsMessage(context));
|
|
102
102
|
const queryParams = {};
|
|
103
103
|
if (flags.page)
|
|
104
104
|
queryParams.page = flags.page;
|
|
@@ -341,9 +341,9 @@ export default class Integrations extends Command {
|
|
|
341
341
|
async runImport(flags) {
|
|
342
342
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
343
343
|
if (!context)
|
|
344
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
345
|
-
if (!context
|
|
346
|
-
this.error(
|
|
344
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
345
|
+
if (!hasCredentials(context))
|
|
346
|
+
this.error(missingCredentialsMessage(context));
|
|
347
347
|
// Get data from file, --data, or --set flags
|
|
348
348
|
let items = [];
|
|
349
349
|
if (flags.file) {
|
|
@@ -553,9 +553,9 @@ export default class Integrations extends Command {
|
|
|
553
553
|
async runExport(flags) {
|
|
554
554
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
555
555
|
if (!context)
|
|
556
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
557
|
-
if (!context
|
|
558
|
-
this.error(
|
|
556
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
557
|
+
if (!hasCredentials(context))
|
|
558
|
+
this.error(missingCredentialsMessage(context));
|
|
559
559
|
const listEndpoint = ENDPOINTS['list'];
|
|
560
560
|
if (!listEndpoint)
|
|
561
561
|
this.error('Export requires a list endpoint');
|
|
@@ -647,9 +647,9 @@ export default class Integrations extends Command {
|
|
|
647
647
|
async runCamt053Import(flags) {
|
|
648
648
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
649
649
|
if (!context)
|
|
650
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
651
|
-
if (!context
|
|
652
|
-
this.error(
|
|
650
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
651
|
+
if (!hasCredentials(context))
|
|
652
|
+
this.error(missingCredentialsMessage(context));
|
|
653
653
|
if (!flags.file) {
|
|
654
654
|
this.error('CAMT.053 import requires --file (-f) flag with path to XML file');
|
|
655
655
|
}
|
|
@@ -737,9 +737,9 @@ export default class Integrations extends Command {
|
|
|
737
737
|
}
|
|
738
738
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
739
739
|
if (!context)
|
|
740
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
741
|
-
if (!context
|
|
742
|
-
this.error(
|
|
740
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
741
|
+
if (!hasCredentials(context))
|
|
742
|
+
this.error(missingCredentialsMessage(context));
|
|
743
743
|
// Get data from file, --data, or --set flags
|
|
744
744
|
let items = [];
|
|
745
745
|
if (flags.file) {
|