@aderis-erp/cli 1.0.13 → 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 +21 -21
- package/dist/commands/account-transaction-allocations.js +21 -21
- package/dist/commands/account-transactions.js +23 -23
- package/dist/commands/accounts.js +23 -23
- package/dist/commands/agent-platform.js +23 -22
- package/dist/commands/analytics.d.ts +40 -0
- package/dist/commands/{documents.js → analytics.js} +33 -43
- package/dist/commands/audit-log.js +24 -24
- 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 +21 -21
- package/dist/commands/bank-integrations.js +21 -21
- package/dist/commands/business-partners.js +29 -26
- package/dist/commands/chat.js +21 -21
- 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 +21 -21
- package/dist/commands/delivery-notes.js +28 -25
- package/dist/commands/dunning-configs.js +21 -21
- package/dist/commands/dunning-reminders.js +21 -21
- package/dist/commands/dunning-runs.js +21 -21
- package/dist/commands/email-transactions.js +21 -21
- package/dist/commands/employees.js +23 -23
- package/dist/commands/entity-configurations.js +21 -21
- package/dist/commands/event-processor-mappings.js +21 -21
- package/dist/commands/{documents.d.ts → files.d.ts} +1 -1
- package/dist/commands/{files-internal.js → files.js} +39 -33
- package/dist/commands/health.js +21 -21
- package/dist/commands/inbox.d.ts +1 -0
- package/dist/commands/inbox.js +25 -23
- package/dist/commands/integrations.js +21 -21
- package/dist/commands/item-categories.js +21 -21
- package/dist/commands/items.js +23 -23
- package/dist/commands/journal-lines.js +21 -21
- package/dist/commands/journals.js +27 -24
- package/dist/commands/ledgers.js +25 -22
- package/dist/commands/office-locations.js +21 -21
- package/dist/commands/payment-methods.js +21 -21
- package/dist/commands/payment-runs.js +23 -22
- package/dist/commands/payment-terms.js +21 -21
- package/dist/commands/payments.js +21 -21
- package/dist/commands/price-lists.js +21 -21
- package/dist/commands/processor-mappings.js +21 -21
- package/dist/commands/processors.js +21 -21
- package/dist/commands/purchase-order-types.js +21 -21
- package/dist/commands/purchase-orders.d.ts +1 -0
- package/dist/commands/purchase-orders.js +32 -25
- package/dist/commands/reports.js +21 -21
- package/dist/commands/salary-types.js +21 -21
- package/dist/commands/sales-invoices.js +33 -31
- package/dist/commands/sales-orders.js +23 -23
- package/dist/commands/saved-views.js +21 -21
- package/dist/commands/scheduled-processor-mappings.d.ts +40 -0
- package/dist/commands/scheduled-processor-mappings.js +1178 -0
- package/dist/commands/schedules.js +21 -21
- 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 +21 -21
- package/dist/commands/tax-codes.js +21 -21
- package/dist/commands/tax-matrix.js +21 -21
- package/dist/commands/tenants.js +23 -23
- package/dist/commands/text-templates.js +21 -21
- package/dist/commands/tools.js +21 -21
- package/dist/commands/vat-declarations.js +21 -21
- package/dist/commands/vendor-invoices.js +25 -25
- package/dist/commands/webhooks.js +21 -21
- package/dist/commands/workflows.js +21 -21
- package/dist/lib/api-client.d.ts +8 -0
- package/dist/lib/api-client.js +31 -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 +1099 -443
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command, Args, Flags } from '@oclif/core';
|
|
2
|
-
import { apiRequest, ApiError } from '../lib/api-client.js';
|
|
3
|
-
import { getCurrentContext, getContext, getBaseUrls } from '../lib/config.js';
|
|
2
|
+
import { apiRequest, ApiError, normalizeSortBy } from '../lib/api-client.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)' }),
|
|
@@ -39,7 +39,7 @@ export default class EventProcessorMappings extends Command {
|
|
|
39
39
|
limit: Flags.string({ description: 'Items per page' }),
|
|
40
40
|
include: Flags.string({ description: 'Relations to include' }),
|
|
41
41
|
search: Flags.string({ description: 'Search term' }),
|
|
42
|
-
'sort-by': Flags.string({ description: 'Sort field' }),
|
|
42
|
+
'sort-by': Flags.string({ description: 'Sort field(s), comma-separated. Direction (:ASC/:DESC) is optional; date-like fields default to DESC, others to ASC.' }),
|
|
43
43
|
filter: Flags.string({ description: 'Filter (e.g. --filter status=ACTIVE). Operators: in:A,B, like:%, gt:, lt:, null:', multiple: true }),
|
|
44
44
|
query: Flags.string({ description: 'Additional query params as JSON' }),
|
|
45
45
|
fields: Flags.string({ description: 'Comma-separated list of fields to show (e.g. --fields=id,name,status)' }),
|
|
@@ -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;
|
|
@@ -113,7 +113,7 @@ export default class EventProcessorMappings extends Command {
|
|
|
113
113
|
if (flags.search)
|
|
114
114
|
queryParams.search = flags.search;
|
|
115
115
|
if (flags['sort-by'])
|
|
116
|
-
queryParams.sortBy = flags['sort-by'];
|
|
116
|
+
queryParams.sortBy = normalizeSortBy(flags['sort-by']);
|
|
117
117
|
if (flags.query) {
|
|
118
118
|
try {
|
|
119
119
|
Object.assign(queryParams, JSON.parse(flags.query));
|
|
@@ -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');
|
|
@@ -572,7 +572,7 @@ export default class EventProcessorMappings extends Command {
|
|
|
572
572
|
if (flags.search)
|
|
573
573
|
baseParams.search = flags.search;
|
|
574
574
|
if (flags['sort-by'])
|
|
575
|
-
baseParams.sortBy = flags['sort-by'];
|
|
575
|
+
baseParams.sortBy = normalizeSortBy(flags['sort-by']);
|
|
576
576
|
if (flags.include)
|
|
577
577
|
baseParams.include = flags.include;
|
|
578
578
|
if (flags.query) {
|
|
@@ -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
|
-
import { apiRequest, ApiError } from '../lib/api-client.js';
|
|
3
|
-
import { getCurrentContext, getContext, getBaseUrls } from '../lib/config.js';
|
|
2
|
+
import { apiRequest, ApiError, normalizeSortBy } from '../lib/api-client.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)' }),
|
|
@@ -41,7 +47,7 @@ export default class FilesInternal extends Command {
|
|
|
41
47
|
limit: Flags.string({ description: 'Items per page' }),
|
|
42
48
|
include: Flags.string({ description: 'Relations to include' }),
|
|
43
49
|
search: Flags.string({ description: 'Search term' }),
|
|
44
|
-
'sort-by': Flags.string({ description: 'Sort field' }),
|
|
50
|
+
'sort-by': Flags.string({ description: 'Sort field(s), comma-separated. Direction (:ASC/:DESC) is optional; date-like fields default to DESC, others to ASC.' }),
|
|
45
51
|
filter: Flags.string({ description: 'Filter (e.g. --filter status=ACTIVE). Operators: in:A,B, like:%, gt:, lt:, null:', multiple: true }),
|
|
46
52
|
query: Flags.string({ description: 'Additional query params as JSON' }),
|
|
47
53
|
fields: Flags.string({ description: 'Comma-separated list of fields to show (e.g. --fields=id,name,status)' }),
|
|
@@ -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;
|
|
@@ -115,7 +121,7 @@ export default class FilesInternal extends Command {
|
|
|
115
121
|
if (flags.search)
|
|
116
122
|
queryParams.search = flags.search;
|
|
117
123
|
if (flags['sort-by'])
|
|
118
|
-
queryParams.sortBy = flags['sort-by'];
|
|
124
|
+
queryParams.sortBy = normalizeSortBy(flags['sort-by']);
|
|
119
125
|
if (flags.query) {
|
|
120
126
|
try {
|
|
121
127
|
Object.assign(queryParams, JSON.parse(flags.query));
|
|
@@ -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');
|
|
@@ -574,7 +580,7 @@ export default class FilesInternal extends Command {
|
|
|
574
580
|
if (flags.search)
|
|
575
581
|
baseParams.search = flags.search;
|
|
576
582
|
if (flags['sort-by'])
|
|
577
|
-
baseParams.sortBy = flags['sort-by'];
|
|
583
|
+
baseParams.sortBy = normalizeSortBy(flags['sort-by']);
|
|
578
584
|
if (flags.include)
|
|
579
585
|
baseParams.include = flags.include;
|
|
580
586
|
if (flags.query) {
|
|
@@ -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
|
-
import { apiRequest, ApiError } from '../lib/api-client.js';
|
|
3
|
-
import { getCurrentContext, getContext, getBaseUrls } from '../lib/config.js';
|
|
2
|
+
import { apiRequest, ApiError, normalizeSortBy } from '../lib/api-client.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)' }),
|
|
@@ -35,7 +35,7 @@ export default class Health extends Command {
|
|
|
35
35
|
limit: Flags.string({ description: 'Items per page' }),
|
|
36
36
|
include: Flags.string({ description: 'Relations to include' }),
|
|
37
37
|
search: Flags.string({ description: 'Search term' }),
|
|
38
|
-
'sort-by': Flags.string({ description: 'Sort field' }),
|
|
38
|
+
'sort-by': Flags.string({ description: 'Sort field(s), comma-separated. Direction (:ASC/:DESC) is optional; date-like fields default to DESC, others to ASC.' }),
|
|
39
39
|
filter: Flags.string({ description: 'Filter (e.g. --filter status=ACTIVE). Operators: in:A,B, like:%, gt:, lt:, null:', multiple: true }),
|
|
40
40
|
query: Flags.string({ description: 'Additional query params as JSON' }),
|
|
41
41
|
fields: Flags.string({ description: 'Comma-separated list of fields to show (e.g. --fields=id,name,status)' }),
|
|
@@ -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;
|
|
@@ -109,7 +109,7 @@ export default class Health extends Command {
|
|
|
109
109
|
if (flags.search)
|
|
110
110
|
queryParams.search = flags.search;
|
|
111
111
|
if (flags['sort-by'])
|
|
112
|
-
queryParams.sortBy = flags['sort-by'];
|
|
112
|
+
queryParams.sortBy = normalizeSortBy(flags['sort-by']);
|
|
113
113
|
if (flags.query) {
|
|
114
114
|
try {
|
|
115
115
|
Object.assign(queryParams, JSON.parse(flags.query));
|
|
@@ -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');
|
|
@@ -568,7 +568,7 @@ export default class Health extends Command {
|
|
|
568
568
|
if (flags.search)
|
|
569
569
|
baseParams.search = flags.search;
|
|
570
570
|
if (flags['sort-by'])
|
|
571
|
-
baseParams.sortBy = flags['sort-by'];
|
|
571
|
+
baseParams.sortBy = normalizeSortBy(flags['sort-by']);
|
|
572
572
|
if (flags.include)
|
|
573
573
|
baseParams.include = flags.include;
|
|
574
574
|
if (flags.query) {
|
|
@@ -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.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export default class Inbox extends Command {
|
|
|
14
14
|
data: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
15
|
file: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
16
|
set: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
'processing-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
18
|
page: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
19
|
limit: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
20
|
include: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
package/dist/commands/inbox.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { Command, Args, Flags } from '@oclif/core';
|
|
2
|
-
import { apiRequest, ApiError } from '../lib/api-client.js';
|
|
3
|
-
import { getCurrentContext, getContext, getBaseUrls } from '../lib/config.js';
|
|
2
|
+
import { apiRequest, ApiError, normalizeSortBy } from '../lib/api-client.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;
|
|
7
7
|
const HAS_CAMT053 = false;
|
|
8
8
|
const NESTED_IMPORTS = [];
|
|
9
|
-
const SUBCOMMANDS = [...["upload", "email-webhook", "document-types", "list-processing-logs", "processing-logs"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
|
|
9
|
+
const SUBCOMMANDS = [...["create-upload", "email-webhook", "document-types", "uploads-files-content", "list-processing-logs", "processing-logs"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
|
|
10
10
|
const ENDPOINTS = {
|
|
11
|
-
'upload': { method: 'POST', path: '/v1/inbox/upload', summary: 'Upload document(s) to inbox for processing', pathParams: [], hasBody: false, isMultipart: true, isBinaryResponse: false, bodyArrayFields: [] },
|
|
11
|
+
'create-upload': { method: 'POST', path: '/v1/inbox/upload', summary: 'Upload document(s) to inbox for processing', pathParams: [], hasBody: false, isMultipart: true, isBinaryResponse: false, bodyArrayFields: [] },
|
|
12
12
|
'email-webhook': { method: 'POST', path: '/v1/inbox/email-webhook/{secret}', summary: 'Email webhook for document ingestion (SendGrid inbound-parse)', pathParams: ['secret'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
13
13
|
'document-types': { method: 'GET', path: '/v1/inbox/document-types', summary: 'Get available document types and per-parent allowed types', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
14
|
+
'uploads-files-content': { method: 'GET', path: '/v1/inbox/uploads/{processingId}/files/{fileId}/content', summary: 'Stream the original bytes of an uploaded inbox file', pathParams: ['fileId', 'processingId'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
14
15
|
'list-processing-logs': { method: 'GET', path: '/v1/inbox/processing-logs', summary: 'List recent inbox processing logs (newest first)', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
15
16
|
'processing-logs': { method: 'GET', path: '/v1/inbox/processing-logs/{processingId}', summary: 'Get a processing run by its processing identifier', pathParams: ['processingId'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
16
17
|
};
|
|
@@ -22,18 +23,19 @@ export default class Inbox extends Command {
|
|
|
22
23
|
id: Args.string({ description: 'Resource ID (for get, update, delete operations)', required: false }),
|
|
23
24
|
};
|
|
24
25
|
static flags = {
|
|
25
|
-
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)' }),
|
|
26
27
|
output: Flags.string({ char: 'o', description: 'Output format (default: table for import, json for other commands)', options: ['json', 'table', 'csv'] }),
|
|
27
28
|
table: Flags.boolean({ char: 't', description: 'Output as table (shortcut for --output table)' }),
|
|
28
29
|
csv: Flags.boolean({ description: 'Output as CSV (shortcut for --output csv)' }),
|
|
29
30
|
data: Flags.string({ char: 'd', description: 'JSON data for request body' }),
|
|
30
31
|
file: Flags.string({ char: 'f', description: 'Read request body from file' }),
|
|
31
32
|
set: Flags.string({ char: 's', description: 'Set individual field (e.g. --set firstName=John)', multiple: true }),
|
|
33
|
+
'processing-id': Flags.string({ description: 'Path param: processingId' }),
|
|
32
34
|
page: Flags.string({ description: 'Page number' }),
|
|
33
35
|
limit: Flags.string({ description: 'Items per page' }),
|
|
34
36
|
include: Flags.string({ description: 'Relations to include' }),
|
|
35
37
|
search: Flags.string({ description: 'Search term' }),
|
|
36
|
-
'sort-by': Flags.string({ description: 'Sort field' }),
|
|
38
|
+
'sort-by': Flags.string({ description: 'Sort field(s), comma-separated. Direction (:ASC/:DESC) is optional; date-like fields default to DESC, others to ASC.' }),
|
|
37
39
|
filter: Flags.string({ description: 'Filter (e.g. --filter status=ACTIVE). Operators: in:A,B, like:%, gt:, lt:, null:', multiple: true }),
|
|
38
40
|
query: Flags.string({ description: 'Additional query params as JSON' }),
|
|
39
41
|
fields: Flags.string({ description: 'Comma-separated list of fields to show (e.g. --fields=id,name,status)' }),
|
|
@@ -94,9 +96,9 @@ export default class Inbox extends Command {
|
|
|
94
96
|
}
|
|
95
97
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
96
98
|
if (!context)
|
|
97
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
98
|
-
if (!context
|
|
99
|
-
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));
|
|
100
102
|
const queryParams = {};
|
|
101
103
|
if (flags.page)
|
|
102
104
|
queryParams.page = flags.page;
|
|
@@ -107,7 +109,7 @@ export default class Inbox extends Command {
|
|
|
107
109
|
if (flags.search)
|
|
108
110
|
queryParams.search = flags.search;
|
|
109
111
|
if (flags['sort-by'])
|
|
110
|
-
queryParams.sortBy = flags['sort-by'];
|
|
112
|
+
queryParams.sortBy = normalizeSortBy(flags['sort-by']);
|
|
111
113
|
if (flags.query) {
|
|
112
114
|
try {
|
|
113
115
|
Object.assign(queryParams, JSON.parse(flags.query));
|
|
@@ -339,9 +341,9 @@ export default class Inbox extends Command {
|
|
|
339
341
|
async runImport(flags) {
|
|
340
342
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
341
343
|
if (!context)
|
|
342
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
343
|
-
if (!context
|
|
344
|
-
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));
|
|
345
347
|
// Get data from file, --data, or --set flags
|
|
346
348
|
let items = [];
|
|
347
349
|
if (flags.file) {
|
|
@@ -551,9 +553,9 @@ export default class Inbox extends Command {
|
|
|
551
553
|
async runExport(flags) {
|
|
552
554
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
553
555
|
if (!context)
|
|
554
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
555
|
-
if (!context
|
|
556
|
-
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));
|
|
557
559
|
const listEndpoint = ENDPOINTS['list'];
|
|
558
560
|
if (!listEndpoint)
|
|
559
561
|
this.error('Export requires a list endpoint');
|
|
@@ -566,7 +568,7 @@ export default class Inbox extends Command {
|
|
|
566
568
|
if (flags.search)
|
|
567
569
|
baseParams.search = flags.search;
|
|
568
570
|
if (flags['sort-by'])
|
|
569
|
-
baseParams.sortBy = flags['sort-by'];
|
|
571
|
+
baseParams.sortBy = normalizeSortBy(flags['sort-by']);
|
|
570
572
|
if (flags.include)
|
|
571
573
|
baseParams.include = flags.include;
|
|
572
574
|
if (flags.query) {
|
|
@@ -645,9 +647,9 @@ export default class Inbox extends Command {
|
|
|
645
647
|
async runCamt053Import(flags) {
|
|
646
648
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
647
649
|
if (!context)
|
|
648
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
649
|
-
if (!context
|
|
650
|
-
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));
|
|
651
653
|
if (!flags.file) {
|
|
652
654
|
this.error('CAMT.053 import requires --file (-f) flag with path to XML file');
|
|
653
655
|
}
|
|
@@ -735,9 +737,9 @@ export default class Inbox extends Command {
|
|
|
735
737
|
}
|
|
736
738
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
737
739
|
if (!context)
|
|
738
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
739
|
-
if (!context
|
|
740
|
-
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));
|
|
741
743
|
// Get data from file, --data, or --set flags
|
|
742
744
|
let items = [];
|
|
743
745
|
if (flags.file) {
|