@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;
|
|
@@ -39,7 +39,7 @@ export default class CreditCardAccounts extends Command {
|
|
|
39
39
|
id: Args.string({ description: 'Resource ID (for get, update, delete operations)', required: false }),
|
|
40
40
|
};
|
|
41
41
|
static flags = {
|
|
42
|
-
context: Flags.string({ char: 'c', description: 'Context to use' }),
|
|
42
|
+
context: Flags.string({ char: 'c', aliases: ['config'], env: 'ADERIS_CONTEXT', description: 'Context to use for this command, overriding the current context (alias: --config)' }),
|
|
43
43
|
output: Flags.string({ char: 'o', description: 'Output format (default: table for import, json for other commands)', options: ['json', 'table', 'csv'] }),
|
|
44
44
|
table: Flags.boolean({ char: 't', description: 'Output as table (shortcut for --output table)' }),
|
|
45
45
|
csv: Flags.boolean({ description: 'Output as CSV (shortcut for --output csv)' }),
|
|
@@ -113,9 +113,9 @@ export default class CreditCardAccounts extends Command {
|
|
|
113
113
|
}
|
|
114
114
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
115
115
|
if (!context)
|
|
116
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
117
|
-
if (!context
|
|
118
|
-
this.error(
|
|
116
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
117
|
+
if (!hasCredentials(context))
|
|
118
|
+
this.error(missingCredentialsMessage(context));
|
|
119
119
|
const queryParams = {};
|
|
120
120
|
if (flags.page)
|
|
121
121
|
queryParams.page = flags.page;
|
|
@@ -358,9 +358,9 @@ export default class CreditCardAccounts extends Command {
|
|
|
358
358
|
async runImport(flags) {
|
|
359
359
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
360
360
|
if (!context)
|
|
361
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
362
|
-
if (!context
|
|
363
|
-
this.error(
|
|
361
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
362
|
+
if (!hasCredentials(context))
|
|
363
|
+
this.error(missingCredentialsMessage(context));
|
|
364
364
|
// Get data from file, --data, or --set flags
|
|
365
365
|
let items = [];
|
|
366
366
|
if (flags.file) {
|
|
@@ -570,9 +570,9 @@ export default class CreditCardAccounts extends Command {
|
|
|
570
570
|
async runExport(flags) {
|
|
571
571
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
572
572
|
if (!context)
|
|
573
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
574
|
-
if (!context
|
|
575
|
-
this.error(
|
|
573
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
574
|
+
if (!hasCredentials(context))
|
|
575
|
+
this.error(missingCredentialsMessage(context));
|
|
576
576
|
const listEndpoint = ENDPOINTS['list'];
|
|
577
577
|
if (!listEndpoint)
|
|
578
578
|
this.error('Export requires a list endpoint');
|
|
@@ -664,9 +664,9 @@ export default class CreditCardAccounts extends Command {
|
|
|
664
664
|
async runCamt053Import(flags) {
|
|
665
665
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
666
666
|
if (!context)
|
|
667
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
668
|
-
if (!context
|
|
669
|
-
this.error(
|
|
667
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
668
|
+
if (!hasCredentials(context))
|
|
669
|
+
this.error(missingCredentialsMessage(context));
|
|
670
670
|
if (!flags.file) {
|
|
671
671
|
this.error('CAMT.053 import requires --file (-f) flag with path to XML file');
|
|
672
672
|
}
|
|
@@ -754,9 +754,9 @@ export default class CreditCardAccounts extends Command {
|
|
|
754
754
|
}
|
|
755
755
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
756
756
|
if (!context)
|
|
757
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
758
|
-
if (!context
|
|
759
|
-
this.error(
|
|
757
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
758
|
+
if (!hasCredentials(context))
|
|
759
|
+
this.error(missingCredentialsMessage(context));
|
|
760
760
|
// Get data from file, --data, or --set flags
|
|
761
761
|
let items = [];
|
|
762
762
|
if (flags.file) {
|
|
@@ -1,25 +1,26 @@
|
|
|
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 = ["line-items", "notes", "files"];
|
|
9
|
-
const SUBCOMMANDS = [...["list", "create", "create-from-orders", "create-from-invoice", "create-invoice", "get", "update", "delete", "pdf", "submit", "approve", "cancel", "deliver", "ship", "send", "create-line-items", "update-line-items-reorder", "update-line-items", "delete-line-items", "list-notes", "create-notes", "get-notes", "update-notes", "delete-notes", "list-files", "create-files", "get-files", "update-files", "delete-files", "files-download"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
|
|
9
|
+
const SUBCOMMANDS = [...["list", "create", "create-from-orders", "create-from-invoice", "create-invoice", "get", "update", "delete", "pdf", "submit", "approve", "cancel", "replace", "deliver", "ship", "send", "create-line-items", "update-line-items-reorder", "update-line-items", "delete-line-items", "list-notes", "create-notes", "get-notes", "update-notes", "delete-notes", "list-files", "create-files", "get-files", "update-files", "delete-files", "files-download"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
|
|
10
10
|
const ENDPOINTS = {
|
|
11
11
|
'list': { method: 'GET', path: '/v1/delivery-notes', summary: 'Get all delivery notes with pagination', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
12
|
-
'create': { method: 'POST', path: '/v1/delivery-notes', summary: 'Create a new delivery note', pathParams: [], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['files', 'notes', 'tagIds', 'lineItems'] },
|
|
12
|
+
'create': { method: 'POST', path: '/v1/delivery-notes', summary: 'Create a new delivery note', pathParams: [], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['files', 'notes', 'tagIds', 'tagCodes', 'lineItems'] },
|
|
13
13
|
'create-from-orders': { method: 'POST', path: '/v1/delivery-notes/create-from-orders', summary: 'Create a DRAFT delivery note from several sales orders', pathParams: [], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['salesOrderIds'] },
|
|
14
14
|
'create-from-invoice': { method: 'POST', path: '/v1/delivery-notes/create-from-invoice', summary: 'Create a DRAFT delivery note from a sales invoice', pathParams: [], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
15
15
|
'create-invoice': { method: 'POST', path: '/v1/delivery-notes/create-invoice', summary: 'Create ONE draft sales invoice from several delivery notes (same customer)', pathParams: [], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['deliveryNoteIds'] },
|
|
16
16
|
'get': { method: 'GET', path: '/v1/delivery-notes/{id}', summary: 'Get a delivery note by ID', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
17
|
-
'update': { method: 'PATCH', path: '/v1/delivery-notes/{id}', summary: 'Update a delivery note', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['files', 'notes', 'tagIds', 'removeFileIds'] },
|
|
17
|
+
'update': { method: 'PATCH', path: '/v1/delivery-notes/{id}', summary: 'Update a delivery note', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['files', 'notes', 'tagIds', 'tagCodes', 'removeFileIds'] },
|
|
18
18
|
'delete': { method: 'DELETE', path: '/v1/delivery-notes/{id}', summary: 'Delete a delivery note', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
19
19
|
'pdf': { method: 'GET', path: '/v1/delivery-notes/{id}/pdf', summary: 'Render a delivery note PDF using the configured PDF processor', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
20
20
|
'submit': { method: 'POST', path: '/v1/delivery-notes/{id}/submit', summary: 'Submit a delivery note for approval (DRAFT → PENDING_APPROVAL)', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
21
21
|
'approve': { method: 'POST', path: '/v1/delivery-notes/{id}/approve', summary: 'Approve a delivery note (DRAFT or PENDING_APPROVAL → APPROVED)', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
22
|
-
'cancel': { method: 'POST', path: '/v1/delivery-notes/{id}/cancel', summary: 'Cancel a delivery note (DRAFT / PENDING_APPROVAL / APPROVED → CANCELLED)', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
22
|
+
'cancel': { method: 'POST', path: '/v1/delivery-notes/{id}/cancel', summary: 'Cancel a delivery note (DRAFT / PENDING_APPROVAL / APPROVED / SHIPPED / DELIVERED → CANCELLED)', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
23
|
+
'replace': { method: 'POST', path: '/v1/delivery-notes/{id}/replace', summary: 'Replace a delivery note (APPROVED / SHIPPED / DELIVERED / CANCELLED → REPLACED)', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
23
24
|
'deliver': { method: 'POST', path: '/v1/delivery-notes/{id}/deliver', summary: 'Mark a delivery note as delivered (SHIPPED → DELIVERED)', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
24
25
|
'ship': { method: 'POST', path: '/v1/delivery-notes/{id}/ship', summary: 'Ship a delivery note (APPROVED → SHIPPED)', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['lineItems'] },
|
|
25
26
|
'send': { method: 'POST', path: '/v1/delivery-notes/{id}/send', summary: 'Send a delivery note to its recipient by email', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['emailCc', 'emailBcc'] },
|
|
@@ -54,7 +55,7 @@ export default class DeliveryNotes extends Command {
|
|
|
54
55
|
id: Args.string({ description: 'Resource ID (for get, update, delete operations)', required: false }),
|
|
55
56
|
};
|
|
56
57
|
static flags = {
|
|
57
|
-
context: Flags.string({ char: 'c', description: 'Context to use' }),
|
|
58
|
+
context: Flags.string({ char: 'c', aliases: ['config'], env: 'ADERIS_CONTEXT', description: 'Context to use for this command, overriding the current context (alias: --config)' }),
|
|
58
59
|
output: Flags.string({ char: 'o', description: 'Output format (default: table for import, json for other commands)', options: ['json', 'table', 'csv'] }),
|
|
59
60
|
table: Flags.boolean({ char: 't', description: 'Output as table (shortcut for --output table)' }),
|
|
60
61
|
csv: Flags.boolean({ description: 'Output as CSV (shortcut for --output csv)' }),
|
|
@@ -129,9 +130,9 @@ export default class DeliveryNotes extends Command {
|
|
|
129
130
|
}
|
|
130
131
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
131
132
|
if (!context)
|
|
132
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
133
|
-
if (!context
|
|
134
|
-
this.error(
|
|
133
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
134
|
+
if (!hasCredentials(context))
|
|
135
|
+
this.error(missingCredentialsMessage(context));
|
|
135
136
|
const queryParams = {};
|
|
136
137
|
if (flags.page)
|
|
137
138
|
queryParams.page = flags.page;
|
|
@@ -374,9 +375,9 @@ export default class DeliveryNotes extends Command {
|
|
|
374
375
|
async runImport(flags) {
|
|
375
376
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
376
377
|
if (!context)
|
|
377
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
378
|
-
if (!context
|
|
379
|
-
this.error(
|
|
378
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
379
|
+
if (!hasCredentials(context))
|
|
380
|
+
this.error(missingCredentialsMessage(context));
|
|
380
381
|
// Get data from file, --data, or --set flags
|
|
381
382
|
let items = [];
|
|
382
383
|
if (flags.file) {
|
|
@@ -586,9 +587,9 @@ export default class DeliveryNotes extends Command {
|
|
|
586
587
|
async runExport(flags) {
|
|
587
588
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
588
589
|
if (!context)
|
|
589
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
590
|
-
if (!context
|
|
591
|
-
this.error(
|
|
590
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
591
|
+
if (!hasCredentials(context))
|
|
592
|
+
this.error(missingCredentialsMessage(context));
|
|
592
593
|
const listEndpoint = ENDPOINTS['list'];
|
|
593
594
|
if (!listEndpoint)
|
|
594
595
|
this.error('Export requires a list endpoint');
|
|
@@ -680,9 +681,9 @@ export default class DeliveryNotes extends Command {
|
|
|
680
681
|
async runCamt053Import(flags) {
|
|
681
682
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
682
683
|
if (!context)
|
|
683
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
684
|
-
if (!context
|
|
685
|
-
this.error(
|
|
684
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
685
|
+
if (!hasCredentials(context))
|
|
686
|
+
this.error(missingCredentialsMessage(context));
|
|
686
687
|
if (!flags.file) {
|
|
687
688
|
this.error('CAMT.053 import requires --file (-f) flag with path to XML file');
|
|
688
689
|
}
|
|
@@ -770,9 +771,9 @@ export default class DeliveryNotes extends Command {
|
|
|
770
771
|
}
|
|
771
772
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
772
773
|
if (!context)
|
|
773
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
774
|
-
if (!context
|
|
775
|
-
this.error(
|
|
774
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
775
|
+
if (!hasCredentials(context))
|
|
776
|
+
this.error(missingCredentialsMessage(context));
|
|
776
777
|
// Get data from file, --data, or --set flags
|
|
777
778
|
let items = [];
|
|
778
779
|
if (flags.file) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command, Args, Flags } from '@oclif/core';
|
|
2
2
|
import { apiRequest, ApiError, normalizeSortBy } from '../lib/api-client.js';
|
|
3
|
-
import { getCurrentContext, getContext, getBaseUrls } from '../lib/config.js';
|
|
3
|
+
import { getCurrentContext, getContext, getBaseUrls, hasCredentials, missingCredentialsMessage } from '../lib/config.js';
|
|
4
4
|
// Add 'import' action if both create and update exist
|
|
5
5
|
const HAS_IMPORT = true;
|
|
6
6
|
const HAS_EXPORT = true;
|
|
@@ -29,7 +29,7 @@ export default class DunningConfigs extends Command {
|
|
|
29
29
|
id: Args.string({ description: 'Resource ID (for get, update, delete operations)', required: false }),
|
|
30
30
|
};
|
|
31
31
|
static flags = {
|
|
32
|
-
context: Flags.string({ char: 'c', description: 'Context to use' }),
|
|
32
|
+
context: Flags.string({ char: 'c', aliases: ['config'], env: 'ADERIS_CONTEXT', description: 'Context to use for this command, overriding the current context (alias: --config)' }),
|
|
33
33
|
output: Flags.string({ char: 'o', description: 'Output format (default: table for import, json for other commands)', options: ['json', 'table', 'csv'] }),
|
|
34
34
|
table: Flags.boolean({ char: 't', description: 'Output as table (shortcut for --output table)' }),
|
|
35
35
|
csv: Flags.boolean({ description: 'Output as CSV (shortcut for --output csv)' }),
|
|
@@ -101,9 +101,9 @@ export default class DunningConfigs extends Command {
|
|
|
101
101
|
}
|
|
102
102
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
103
103
|
if (!context)
|
|
104
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
105
|
-
if (!context
|
|
106
|
-
this.error(
|
|
104
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
105
|
+
if (!hasCredentials(context))
|
|
106
|
+
this.error(missingCredentialsMessage(context));
|
|
107
107
|
const queryParams = {};
|
|
108
108
|
if (flags.page)
|
|
109
109
|
queryParams.page = flags.page;
|
|
@@ -346,9 +346,9 @@ export default class DunningConfigs extends Command {
|
|
|
346
346
|
async runImport(flags) {
|
|
347
347
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
348
348
|
if (!context)
|
|
349
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
350
|
-
if (!context
|
|
351
|
-
this.error(
|
|
349
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
350
|
+
if (!hasCredentials(context))
|
|
351
|
+
this.error(missingCredentialsMessage(context));
|
|
352
352
|
// Get data from file, --data, or --set flags
|
|
353
353
|
let items = [];
|
|
354
354
|
if (flags.file) {
|
|
@@ -558,9 +558,9 @@ export default class DunningConfigs extends Command {
|
|
|
558
558
|
async runExport(flags) {
|
|
559
559
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
560
560
|
if (!context)
|
|
561
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
562
|
-
if (!context
|
|
563
|
-
this.error(
|
|
561
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
562
|
+
if (!hasCredentials(context))
|
|
563
|
+
this.error(missingCredentialsMessage(context));
|
|
564
564
|
const listEndpoint = ENDPOINTS['list'];
|
|
565
565
|
if (!listEndpoint)
|
|
566
566
|
this.error('Export requires a list endpoint');
|
|
@@ -652,9 +652,9 @@ export default class DunningConfigs extends Command {
|
|
|
652
652
|
async runCamt053Import(flags) {
|
|
653
653
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
654
654
|
if (!context)
|
|
655
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
656
|
-
if (!context
|
|
657
|
-
this.error(
|
|
655
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
656
|
+
if (!hasCredentials(context))
|
|
657
|
+
this.error(missingCredentialsMessage(context));
|
|
658
658
|
if (!flags.file) {
|
|
659
659
|
this.error('CAMT.053 import requires --file (-f) flag with path to XML file');
|
|
660
660
|
}
|
|
@@ -742,9 +742,9 @@ export default class DunningConfigs extends Command {
|
|
|
742
742
|
}
|
|
743
743
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
744
744
|
if (!context)
|
|
745
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
746
|
-
if (!context
|
|
747
|
-
this.error(
|
|
745
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
746
|
+
if (!hasCredentials(context))
|
|
747
|
+
this.error(missingCredentialsMessage(context));
|
|
748
748
|
// Get data from file, --data, or --set flags
|
|
749
749
|
let items = [];
|
|
750
750
|
if (flags.file) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command, Args, Flags } from '@oclif/core';
|
|
2
2
|
import { apiRequest, ApiError, normalizeSortBy } from '../lib/api-client.js';
|
|
3
|
-
import { getCurrentContext, getContext, getBaseUrls } from '../lib/config.js';
|
|
3
|
+
import { getCurrentContext, getContext, getBaseUrls, hasCredentials, missingCredentialsMessage } from '../lib/config.js';
|
|
4
4
|
// Add 'import' action if both create and update exist
|
|
5
5
|
const HAS_IMPORT = false;
|
|
6
6
|
const HAS_EXPORT = true;
|
|
@@ -30,7 +30,7 @@ export default class DunningReminders 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 DunningReminders 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 DunningReminders 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 DunningReminders 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 DunningReminders 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 DunningReminders 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 = false;
|
|
6
6
|
const HAS_EXPORT = false;
|
|
@@ -18,7 +18,7 @@ export default class DunningRuns extends Command {
|
|
|
18
18
|
id: Args.string({ description: 'Resource ID (for get, update, delete operations)', required: false }),
|
|
19
19
|
};
|
|
20
20
|
static flags = {
|
|
21
|
-
context: Flags.string({ char: 'c', description: 'Context to use' }),
|
|
21
|
+
context: Flags.string({ char: 'c', aliases: ['config'], env: 'ADERIS_CONTEXT', description: 'Context to use for this command, overriding the current context (alias: --config)' }),
|
|
22
22
|
output: Flags.string({ char: 'o', description: 'Output format (default: table for import, json for other commands)', options: ['json', 'table', 'csv'] }),
|
|
23
23
|
table: Flags.boolean({ char: 't', description: 'Output as table (shortcut for --output table)' }),
|
|
24
24
|
csv: Flags.boolean({ description: 'Output as CSV (shortcut for --output csv)' }),
|
|
@@ -90,9 +90,9 @@ export default class DunningRuns extends Command {
|
|
|
90
90
|
}
|
|
91
91
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
92
92
|
if (!context)
|
|
93
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
94
|
-
if (!context
|
|
95
|
-
this.error(
|
|
93
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
94
|
+
if (!hasCredentials(context))
|
|
95
|
+
this.error(missingCredentialsMessage(context));
|
|
96
96
|
const queryParams = {};
|
|
97
97
|
if (flags.page)
|
|
98
98
|
queryParams.page = flags.page;
|
|
@@ -335,9 +335,9 @@ export default class DunningRuns extends Command {
|
|
|
335
335
|
async runImport(flags) {
|
|
336
336
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
337
337
|
if (!context)
|
|
338
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
339
|
-
if (!context
|
|
340
|
-
this.error(
|
|
338
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
339
|
+
if (!hasCredentials(context))
|
|
340
|
+
this.error(missingCredentialsMessage(context));
|
|
341
341
|
// Get data from file, --data, or --set flags
|
|
342
342
|
let items = [];
|
|
343
343
|
if (flags.file) {
|
|
@@ -547,9 +547,9 @@ export default class DunningRuns extends Command {
|
|
|
547
547
|
async runExport(flags) {
|
|
548
548
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
549
549
|
if (!context)
|
|
550
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
551
|
-
if (!context
|
|
552
|
-
this.error(
|
|
550
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
551
|
+
if (!hasCredentials(context))
|
|
552
|
+
this.error(missingCredentialsMessage(context));
|
|
553
553
|
const listEndpoint = ENDPOINTS['list'];
|
|
554
554
|
if (!listEndpoint)
|
|
555
555
|
this.error('Export requires a list endpoint');
|
|
@@ -641,9 +641,9 @@ export default class DunningRuns extends Command {
|
|
|
641
641
|
async runCamt053Import(flags) {
|
|
642
642
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
643
643
|
if (!context)
|
|
644
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
645
|
-
if (!context
|
|
646
|
-
this.error(
|
|
644
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
645
|
+
if (!hasCredentials(context))
|
|
646
|
+
this.error(missingCredentialsMessage(context));
|
|
647
647
|
if (!flags.file) {
|
|
648
648
|
this.error('CAMT.053 import requires --file (-f) flag with path to XML file');
|
|
649
649
|
}
|
|
@@ -731,9 +731,9 @@ export default class DunningRuns extends Command {
|
|
|
731
731
|
}
|
|
732
732
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
733
733
|
if (!context)
|
|
734
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
735
|
-
if (!context
|
|
736
|
-
this.error(
|
|
734
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
735
|
+
if (!hasCredentials(context))
|
|
736
|
+
this.error(missingCredentialsMessage(context));
|
|
737
737
|
// Get data from file, --data, or --set flags
|
|
738
738
|
let items = [];
|
|
739
739
|
if (flags.file) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command, Args, Flags } from '@oclif/core';
|
|
2
2
|
import { apiRequest, ApiError, normalizeSortBy } from '../lib/api-client.js';
|
|
3
|
-
import { getCurrentContext, getContext, getBaseUrls } from '../lib/config.js';
|
|
3
|
+
import { getCurrentContext, getContext, getBaseUrls, hasCredentials, missingCredentialsMessage } from '../lib/config.js';
|
|
4
4
|
// Add 'import' action if both create and update exist
|
|
5
5
|
const HAS_IMPORT = false;
|
|
6
6
|
const HAS_EXPORT = true;
|
|
@@ -24,7 +24,7 @@ export default class EmailTransactions 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 EmailTransactions 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 EmailTransactions 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 EmailTransactions 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 EmailTransactions 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 EmailTransactions 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 = true;
|
|
6
6
|
const HAS_EXPORT = true;
|
|
@@ -9,9 +9,9 @@ const NESTED_IMPORTS = ["salaries", "payments", "notes", "files", "salary-paymen
|
|
|
9
9
|
const SUBCOMMANDS = [...["list", "create", "get", "update", "delete", "get-salaries", "create-salaries", "get-salaries-salaryId", "update-salaries", "delete-salaries", "get-payments", "create-payments", "get-payments-paymentId", "update-payments", "delete-payments", "list-notes", "create-notes", "get-notes", "update-notes", "delete-notes", "list-files", "create-files", "get-files", "update-files", "delete-files", "files-download", "list-salary-payment-files", "create-salary-payment-files", "get-salary-payment-files", "update-salary-payment-files", "delete-salary-payment-files", "download-salary-payment-files"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
|
|
10
10
|
const ENDPOINTS = {
|
|
11
11
|
'list': { method: 'GET', path: '/v1/employees', summary: 'Get all employees with pagination', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
12
|
-
'create': { method: 'POST', path: '/v1/employees', summary: 'Create a new employee', pathParams: [], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['beneficiaries', 'children', 'salaries', 'files', 'notes'] },
|
|
12
|
+
'create': { method: 'POST', path: '/v1/employees', summary: 'Create a new employee', pathParams: [], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['beneficiaries', 'children', 'salaries', 'files', 'notes', 'tagIds', 'tagCodes'] },
|
|
13
13
|
'get': { method: 'GET', path: '/v1/employees/{id}', summary: 'Get an employee by ID', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
14
|
-
'update': { method: 'PATCH', path: '/v1/employees/{id}', summary: 'Update an employee', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['beneficiaries', 'children', 'salaries', 'files', 'notes'] },
|
|
14
|
+
'update': { method: 'PATCH', path: '/v1/employees/{id}', summary: 'Update an employee', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['beneficiaries', 'children', 'salaries', 'files', 'notes', 'tagIds', 'tagCodes'] },
|
|
15
15
|
'delete': { method: 'DELETE', path: '/v1/employees/{id}', summary: 'Delete an employee', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
16
16
|
'get-salaries': { method: 'GET', path: '/v1/employees/{id}/salaries', summary: 'Get all salaries for an employee', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
17
17
|
'create-salaries': { method: 'POST', path: '/v1/employees/{id}/salaries', summary: 'Add a salary configuration to an employee', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
@@ -56,7 +56,7 @@ export default class Employees extends Command {
|
|
|
56
56
|
id: Args.string({ description: 'Resource ID (for get, update, delete operations)', required: false }),
|
|
57
57
|
};
|
|
58
58
|
static flags = {
|
|
59
|
-
context: Flags.string({ char: 'c', description: 'Context to use' }),
|
|
59
|
+
context: Flags.string({ char: 'c', aliases: ['config'], env: 'ADERIS_CONTEXT', description: 'Context to use for this command, overriding the current context (alias: --config)' }),
|
|
60
60
|
output: Flags.string({ char: 'o', description: 'Output format (default: table for import, json for other commands)', options: ['json', 'table', 'csv'] }),
|
|
61
61
|
table: Flags.boolean({ char: 't', description: 'Output as table (shortcut for --output table)' }),
|
|
62
62
|
csv: Flags.boolean({ description: 'Output as CSV (shortcut for --output csv)' }),
|
|
@@ -132,9 +132,9 @@ export default class Employees extends Command {
|
|
|
132
132
|
}
|
|
133
133
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
134
134
|
if (!context)
|
|
135
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
136
|
-
if (!context
|
|
137
|
-
this.error(
|
|
135
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
136
|
+
if (!hasCredentials(context))
|
|
137
|
+
this.error(missingCredentialsMessage(context));
|
|
138
138
|
const queryParams = {};
|
|
139
139
|
if (flags.page)
|
|
140
140
|
queryParams.page = flags.page;
|
|
@@ -377,9 +377,9 @@ export default class Employees extends Command {
|
|
|
377
377
|
async runImport(flags) {
|
|
378
378
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
379
379
|
if (!context)
|
|
380
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
381
|
-
if (!context
|
|
382
|
-
this.error(
|
|
380
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
381
|
+
if (!hasCredentials(context))
|
|
382
|
+
this.error(missingCredentialsMessage(context));
|
|
383
383
|
// Get data from file, --data, or --set flags
|
|
384
384
|
let items = [];
|
|
385
385
|
if (flags.file) {
|
|
@@ -589,9 +589,9 @@ export default class Employees extends Command {
|
|
|
589
589
|
async runExport(flags) {
|
|
590
590
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
591
591
|
if (!context)
|
|
592
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
593
|
-
if (!context
|
|
594
|
-
this.error(
|
|
592
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
593
|
+
if (!hasCredentials(context))
|
|
594
|
+
this.error(missingCredentialsMessage(context));
|
|
595
595
|
const listEndpoint = ENDPOINTS['list'];
|
|
596
596
|
if (!listEndpoint)
|
|
597
597
|
this.error('Export requires a list endpoint');
|
|
@@ -683,9 +683,9 @@ export default class Employees extends Command {
|
|
|
683
683
|
async runCamt053Import(flags) {
|
|
684
684
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
685
685
|
if (!context)
|
|
686
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
687
|
-
if (!context
|
|
688
|
-
this.error(
|
|
686
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
687
|
+
if (!hasCredentials(context))
|
|
688
|
+
this.error(missingCredentialsMessage(context));
|
|
689
689
|
if (!flags.file) {
|
|
690
690
|
this.error('CAMT.053 import requires --file (-f) flag with path to XML file');
|
|
691
691
|
}
|
|
@@ -773,9 +773,9 @@ export default class Employees extends Command {
|
|
|
773
773
|
}
|
|
774
774
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
775
775
|
if (!context)
|
|
776
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
777
|
-
if (!context
|
|
778
|
-
this.error(
|
|
776
|
+
this.error(flags.context ? `Context "${flags.context}" not found. List contexts with: aderis config list` : 'No context configured. Run: aderis auth login --new');
|
|
777
|
+
if (!hasCredentials(context))
|
|
778
|
+
this.error(missingCredentialsMessage(context));
|
|
779
779
|
// Get data from file, --data, or --set flags
|
|
780
780
|
let items = [];
|
|
781
781
|
if (flags.file) {
|