@aderis-erp/cli 1.0.4 → 1.0.8
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 +5 -5
- package/dist/commands/{access-groups 3.d.ts → account-transaction-allocations.d.ts} +1 -1
- package/dist/commands/{async-endpoints-internal.js → account-transaction-allocations.js} +19 -15
- package/dist/commands/account-transactions.js +7 -7
- package/dist/commands/accounts.js +5 -5
- package/dist/commands/agent-runs.js +5 -5
- package/dist/commands/audit-log.js +5 -5
- package/dist/commands/auth/login.js +1 -2
- package/dist/commands/auth/tenant.d.ts +1 -1
- package/dist/commands/auth/tenant.js +11 -11
- package/dist/commands/auth.js +1 -1
- package/dist/commands/bank-accounts.js +5 -5
- package/dist/commands/bank-integrations.js +5 -5
- package/dist/commands/business-partners---contacts.js +5 -5
- package/dist/commands/business-partners.js +5 -5
- package/dist/commands/credit-card-accounts.js +5 -5
- package/dist/commands/documents.js +5 -5
- package/dist/commands/dunning-configs.js +5 -5
- package/dist/commands/dunning-reminders.js +5 -5
- package/dist/commands/dunning-runs.js +5 -5
- package/dist/commands/employees.js +5 -5
- package/dist/commands/event-processor-mappings.js +5 -5
- package/dist/commands/files-internal.js +5 -5
- package/dist/commands/health.js +5 -5
- package/dist/commands/inbox.js +5 -5
- package/dist/commands/integrations.js +5 -5
- package/dist/commands/item-categories.js +5 -5
- package/dist/commands/items.js +5 -5
- package/dist/commands/journal-lines.js +5 -5
- package/dist/commands/journals.js +5 -5
- package/dist/commands/ledgers.js +5 -5
- package/dist/commands/office-locations.js +5 -5
- package/dist/commands/payment-method-ledger-mappings.js +5 -5
- package/dist/commands/payment-methods.js +5 -5
- package/dist/commands/payment-runs.js +5 -5
- package/dist/commands/payment-terms.js +5 -5
- package/dist/commands/price-lists.js +5 -5
- package/dist/commands/processor-mappings.js +5 -5
- package/dist/commands/processors.js +5 -5
- package/dist/commands/reports.js +5 -5
- package/dist/commands/salary-types.js +5 -5
- package/dist/commands/sales-invoices.js +5 -5
- package/dist/commands/sales-orders.js +5 -5
- package/dist/commands/tags.js +5 -5
- package/dist/commands/tax-codes.js +5 -5
- package/dist/commands/tax-matrix.js +5 -5
- package/dist/commands/tenants.js +5 -5
- package/dist/commands/text-templates.js +5 -5
- package/dist/commands/tools.js +5 -5
- package/dist/commands/{price-lists 3.d.ts → vat-declaration.d.ts} +2 -2
- package/dist/commands/{webhooks 3.js → vat-declaration.js} +33 -25
- package/dist/commands/vendor-invoices.js +5 -5
- package/dist/commands/webhooks.js +5 -5
- package/dist/commands/workflows.js +5 -5
- package/dist/lib/api-client.d.ts +3 -2
- package/dist/lib/api-client.js +4 -0
- package/dist/lib/auth.js +1 -0
- package/oclif.manifest.json +696 -6069
- package/package.json +15 -13
- package/dist/commands/access-groups 3.js +0 -1072
- package/dist/commands/accounts 2.d.ts +0 -41
- package/dist/commands/accounts 2.js +0 -1078
- package/dist/commands/async-endpoints-internal 3.d.ts +0 -40
- package/dist/commands/async-endpoints-internal 3.js +0 -1062
- package/dist/commands/async-endpoints-internal.d.ts +0 -40
- package/dist/commands/audit-log 3.d.ts +0 -40
- package/dist/commands/audit-log 3.js +0 -1066
- package/dist/commands/business-partners 3.d.ts +0 -41
- package/dist/commands/business-partners 3.js +0 -1078
- package/dist/commands/business-partners---contacts 3.d.ts +0 -42
- package/dist/commands/business-partners---contacts 3.js +0 -1072
- package/dist/commands/credit-card-accounts 3.d.ts +0 -42
- package/dist/commands/credit-card-accounts 3.js +0 -1084
- package/dist/commands/dunning-configs 3.d.ts +0 -40
- package/dist/commands/dunning-configs 3.js +0 -1072
- package/dist/commands/dunning-runs 3.d.ts +0 -40
- package/dist/commands/dunning-runs 3.js +0 -1061
- package/dist/commands/event-processor-mappings 3.d.ts +0 -40
- package/dist/commands/event-processor-mappings 3.js +0 -1071
- package/dist/commands/files-internal 3.d.ts +0 -40
- package/dist/commands/files-internal 3.js +0 -1073
- package/dist/commands/health 3.d.ts +0 -40
- package/dist/commands/health 3.js +0 -1067
- package/dist/commands/inbox 3.d.ts +0 -40
- package/dist/commands/inbox 3.js +0 -1065
- package/dist/commands/integrations 3.d.ts +0 -41
- package/dist/commands/integrations 3.js +0 -1067
- package/dist/commands/item-categories 3.d.ts +0 -40
- package/dist/commands/item-categories 3.js +0 -1072
- package/dist/commands/items 3.d.ts +0 -40
- package/dist/commands/items 3.js +0 -1072
- package/dist/commands/journals 3.d.ts +0 -42
- package/dist/commands/journals 3.js +0 -1088
- package/dist/commands/office-locations 3.d.ts +0 -40
- package/dist/commands/office-locations 3.js +0 -1072
- package/dist/commands/payment-method-ledger-mappings 3.d.ts +0 -41
- package/dist/commands/payment-method-ledger-mappings 3.js +0 -1066
- package/dist/commands/payment-methods 3.d.ts +0 -40
- package/dist/commands/payment-methods 3.js +0 -1072
- package/dist/commands/payment-runs 3.d.ts +0 -42
- package/dist/commands/payment-runs 3.js +0 -1087
- package/dist/commands/payment-terms 3.d.ts +0 -40
- package/dist/commands/payment-terms 3.js +0 -1073
- package/dist/commands/price-lists 3.js +0 -1078
- package/dist/commands/processor-mappings 2.d.ts +0 -40
- package/dist/commands/processor-mappings 2.js +0 -1070
- package/dist/commands/reconciliation 3.d.ts +0 -40
- package/dist/commands/reconciliation 3.js +0 -1069
- package/dist/commands/reconciliation.d.ts +0 -40
- package/dist/commands/reconciliation.js +0 -1071
- package/dist/commands/salary-types 3.d.ts +0 -40
- package/dist/commands/salary-types 3.js +0 -1072
- package/dist/commands/sales-invoices 3.d.ts +0 -43
- package/dist/commands/sales-invoices 3.js +0 -1100
- package/dist/commands/sales-orders 3.d.ts +0 -43
- package/dist/commands/sales-orders 3.js +0 -1098
- package/dist/commands/tags 3.d.ts +0 -40
- package/dist/commands/tags 3.js +0 -1072
- package/dist/commands/tax-codes 3.d.ts +0 -40
- package/dist/commands/tax-codes 3.js +0 -1075
- package/dist/commands/text-templates 3.d.ts +0 -40
- package/dist/commands/text-templates 3.js +0 -1072
- package/dist/commands/webhooks 3.d.ts +0 -40
|
@@ -81,11 +81,6 @@ export default class AccessGroups extends Command {
|
|
|
81
81
|
const endpoint = ENDPOINTS[args.action];
|
|
82
82
|
if (!endpoint)
|
|
83
83
|
this.error(`Unknown action: ${args.action}. Available: ${SUBCOMMANDS.join(', ')}`);
|
|
84
|
-
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
85
|
-
if (!context)
|
|
86
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
87
|
-
if (!context.tokens)
|
|
88
|
-
this.error('Not logged in. Run: aderis auth login');
|
|
89
84
|
let apiPath = endpoint.path;
|
|
90
85
|
for (let i = 0; i < endpoint.pathParams.length; i++) {
|
|
91
86
|
const param = endpoint.pathParams[i];
|
|
@@ -104,6 +99,11 @@ export default class AccessGroups extends Command {
|
|
|
104
99
|
}
|
|
105
100
|
apiPath = apiPath.replace(`{${param}}`, String(value));
|
|
106
101
|
}
|
|
102
|
+
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
103
|
+
if (!context)
|
|
104
|
+
this.error('No context configured. Run: aderis auth login --new');
|
|
105
|
+
if (!context.tokens)
|
|
106
|
+
this.error('Not logged in. Run: aderis auth login');
|
|
107
107
|
const queryParams = {};
|
|
108
108
|
if (flags.page)
|
|
109
109
|
queryParams.page = flags.page;
|
|
@@ -3,17 +3,21 @@ import { apiRequest, ApiError } from '../lib/api-client.js';
|
|
|
3
3
|
import { getCurrentContext, getContext, getBaseUrls } from '../lib/config.js';
|
|
4
4
|
// Add 'import' action if both create and update exist
|
|
5
5
|
const HAS_IMPORT = false;
|
|
6
|
-
const HAS_EXPORT =
|
|
6
|
+
const HAS_EXPORT = true;
|
|
7
7
|
const HAS_CAMT053 = false;
|
|
8
8
|
const NESTED_IMPORTS = [];
|
|
9
|
-
const SUBCOMMANDS = [...["
|
|
9
|
+
const SUBCOMMANDS = [...["list", "get"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
|
|
10
10
|
const ENDPOINTS = {
|
|
11
|
-
'
|
|
12
|
-
'
|
|
11
|
+
'list': { method: 'GET', path: '/v1/account-transaction-allocations', summary: 'List account transaction allocations with pagination', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
12
|
+
'get': { method: 'GET', path: '/v1/account-transaction-allocations/{id}', summary: 'Get an account transaction allocation by ID', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
13
13
|
};
|
|
14
|
-
export default class
|
|
15
|
-
static description = 'Manage
|
|
16
|
-
static examples = [
|
|
14
|
+
export default class AccountTransactionAllocations extends Command {
|
|
15
|
+
static description = 'Manage account transaction allocations';
|
|
16
|
+
static examples = [
|
|
17
|
+
'<%= config.bin %> account-transaction-allocations list',
|
|
18
|
+
'<%= config.bin %> account-transaction-allocations get <id>',
|
|
19
|
+
'<%= config.bin %> account-transaction-allocations export --csv > account-transaction-allocations.csv',
|
|
20
|
+
];
|
|
17
21
|
static args = {
|
|
18
22
|
action: Args.string({ description: 'Action: ' + SUBCOMMANDS.join(', '), required: true }),
|
|
19
23
|
id: Args.string({ description: 'Resource ID (for get, update, delete operations)', required: false }),
|
|
@@ -38,7 +42,7 @@ export default class AsyncEndpointsInternal extends Command {
|
|
|
38
42
|
'show-http-request': Flags.boolean({ description: 'Show HTTP request details (method, URL, body)' }),
|
|
39
43
|
};
|
|
40
44
|
async run() {
|
|
41
|
-
const { args, flags } = await this.parse(
|
|
45
|
+
const { args, flags } = await this.parse(AccountTransactionAllocations);
|
|
42
46
|
// Handle import action specially
|
|
43
47
|
if (args.action === 'import') {
|
|
44
48
|
if (!HAS_IMPORT)
|
|
@@ -71,11 +75,6 @@ export default class AsyncEndpointsInternal extends Command {
|
|
|
71
75
|
const endpoint = ENDPOINTS[args.action];
|
|
72
76
|
if (!endpoint)
|
|
73
77
|
this.error(`Unknown action: ${args.action}. Available: ${SUBCOMMANDS.join(', ')}`);
|
|
74
|
-
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
75
|
-
if (!context)
|
|
76
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
77
|
-
if (!context.tokens)
|
|
78
|
-
this.error('Not logged in. Run: aderis auth login');
|
|
79
78
|
let apiPath = endpoint.path;
|
|
80
79
|
for (let i = 0; i < endpoint.pathParams.length; i++) {
|
|
81
80
|
const param = endpoint.pathParams[i];
|
|
@@ -84,7 +83,7 @@ export default class AsyncEndpointsInternal extends Command {
|
|
|
84
83
|
// First path param always comes from positional argument
|
|
85
84
|
value = args.id;
|
|
86
85
|
if (!value)
|
|
87
|
-
this.error('Missing required argument: id. Usage: aderis
|
|
86
|
+
this.error('Missing required argument: id. Usage: aderis account-transaction-allocations <action> <id>');
|
|
88
87
|
}
|
|
89
88
|
else {
|
|
90
89
|
const flagName = param.replace(/\./g, '-').replace(/([A-Z])/g, '-$1').toLowerCase().replace(/^-/, '');
|
|
@@ -94,6 +93,11 @@ export default class AsyncEndpointsInternal extends Command {
|
|
|
94
93
|
}
|
|
95
94
|
apiPath = apiPath.replace(`{${param}}`, String(value));
|
|
96
95
|
}
|
|
96
|
+
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
97
|
+
if (!context)
|
|
98
|
+
this.error('No context configured. Run: aderis auth login --new');
|
|
99
|
+
if (!context.tokens)
|
|
100
|
+
this.error('Not logged in. Run: aderis auth login');
|
|
97
101
|
const queryParams = {};
|
|
98
102
|
if (flags.page)
|
|
99
103
|
queryParams.page = flags.page;
|
|
@@ -678,7 +682,7 @@ export default class AsyncEndpointsInternal extends Command {
|
|
|
678
682
|
}
|
|
679
683
|
async runNestedImport(suffix, parentId, flags) {
|
|
680
684
|
if (!parentId) {
|
|
681
|
-
this.error(`Missing required argument: id. Usage: aderis
|
|
685
|
+
this.error(`Missing required argument: id. Usage: aderis account-transaction-allocations import-${suffix} <parent-id> --file data.json`);
|
|
682
686
|
}
|
|
683
687
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
684
688
|
if (!context)
|
|
@@ -9,9 +9,9 @@ const NESTED_IMPORTS = ["allocations", "allocations-notes"];
|
|
|
9
9
|
const SUBCOMMANDS = [...["list", "create", "get", "update", "delete", "list-allocations", "create-allocations", "get-allocations", "update-allocations", "delete-allocations", "allocations-confirm", "import-camt053", "list-allocations-notes", "create-allocations-notes", "get-allocations-notes", "update-allocations-notes", "delete-allocations-notes"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
|
|
10
10
|
const ENDPOINTS = {
|
|
11
11
|
'list': { method: 'GET', path: '/v1/account-transactions', summary: 'Get all account transactions with pagination', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
12
|
-
'create': { method: 'POST', path: '/v1/account-transactions', summary: 'Create a new account transaction', pathParams: [], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
12
|
+
'create': { method: 'POST', path: '/v1/account-transactions', summary: 'Create a new account transaction', pathParams: [], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['allocations'] },
|
|
13
13
|
'get': { method: 'GET', path: '/v1/account-transactions/{id}', summary: 'Get an account transaction by ID', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
14
|
-
'update': { method: 'PATCH', path: '/v1/account-transactions/{id}', summary: 'Update an account transaction', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
14
|
+
'update': { method: 'PATCH', path: '/v1/account-transactions/{id}', summary: 'Update an account transaction', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['allocations'] },
|
|
15
15
|
'delete': { method: 'DELETE', path: '/v1/account-transactions/{id}', summary: 'Delete an account transaction', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
16
16
|
'list-allocations': { method: 'GET', path: '/v1/account-transactions/{transactionId}/allocations', summary: 'Get all allocations for an account transaction', pathParams: ['transactionId'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
17
17
|
'create-allocations': { method: 'POST', path: '/v1/account-transactions/{transactionId}/allocations', summary: 'Create an allocation for an account transaction', pathParams: ['transactionId'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['notes'] },
|
|
@@ -95,11 +95,6 @@ export default class AccountTransactions extends Command {
|
|
|
95
95
|
const endpoint = ENDPOINTS[args.action];
|
|
96
96
|
if (!endpoint)
|
|
97
97
|
this.error(`Unknown action: ${args.action}. Available: ${SUBCOMMANDS.join(', ')}`);
|
|
98
|
-
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
99
|
-
if (!context)
|
|
100
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
101
|
-
if (!context.tokens)
|
|
102
|
-
this.error('Not logged in. Run: aderis auth login');
|
|
103
98
|
let apiPath = endpoint.path;
|
|
104
99
|
for (let i = 0; i < endpoint.pathParams.length; i++) {
|
|
105
100
|
const param = endpoint.pathParams[i];
|
|
@@ -118,6 +113,11 @@ export default class AccountTransactions extends Command {
|
|
|
118
113
|
}
|
|
119
114
|
apiPath = apiPath.replace(`{${param}}`, String(value));
|
|
120
115
|
}
|
|
116
|
+
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
117
|
+
if (!context)
|
|
118
|
+
this.error('No context configured. Run: aderis auth login --new');
|
|
119
|
+
if (!context.tokens)
|
|
120
|
+
this.error('Not logged in. Run: aderis auth login');
|
|
121
121
|
const queryParams = {};
|
|
122
122
|
if (flags.page)
|
|
123
123
|
queryParams.page = flags.page;
|
|
@@ -87,11 +87,6 @@ export default class Accounts extends Command {
|
|
|
87
87
|
const endpoint = ENDPOINTS[args.action];
|
|
88
88
|
if (!endpoint)
|
|
89
89
|
this.error(`Unknown action: ${args.action}. Available: ${SUBCOMMANDS.join(', ')}`);
|
|
90
|
-
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
91
|
-
if (!context)
|
|
92
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
93
|
-
if (!context.tokens)
|
|
94
|
-
this.error('Not logged in. Run: aderis auth login');
|
|
95
90
|
let apiPath = endpoint.path;
|
|
96
91
|
for (let i = 0; i < endpoint.pathParams.length; i++) {
|
|
97
92
|
const param = endpoint.pathParams[i];
|
|
@@ -110,6 +105,11 @@ export default class Accounts extends Command {
|
|
|
110
105
|
}
|
|
111
106
|
apiPath = apiPath.replace(`{${param}}`, String(value));
|
|
112
107
|
}
|
|
108
|
+
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
109
|
+
if (!context)
|
|
110
|
+
this.error('No context configured. Run: aderis auth login --new');
|
|
111
|
+
if (!context.tokens)
|
|
112
|
+
this.error('Not logged in. Run: aderis auth login');
|
|
113
113
|
const queryParams = {};
|
|
114
114
|
if (flags.page)
|
|
115
115
|
queryParams.page = flags.page;
|
|
@@ -78,11 +78,6 @@ export default class AgentRuns extends Command {
|
|
|
78
78
|
const endpoint = ENDPOINTS[args.action];
|
|
79
79
|
if (!endpoint)
|
|
80
80
|
this.error(`Unknown action: ${args.action}. Available: ${SUBCOMMANDS.join(', ')}`);
|
|
81
|
-
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
82
|
-
if (!context)
|
|
83
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
84
|
-
if (!context.tokens)
|
|
85
|
-
this.error('Not logged in. Run: aderis auth login');
|
|
86
81
|
let apiPath = endpoint.path;
|
|
87
82
|
for (let i = 0; i < endpoint.pathParams.length; i++) {
|
|
88
83
|
const param = endpoint.pathParams[i];
|
|
@@ -101,6 +96,11 @@ export default class AgentRuns extends Command {
|
|
|
101
96
|
}
|
|
102
97
|
apiPath = apiPath.replace(`{${param}}`, String(value));
|
|
103
98
|
}
|
|
99
|
+
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
100
|
+
if (!context)
|
|
101
|
+
this.error('No context configured. Run: aderis auth login --new');
|
|
102
|
+
if (!context.tokens)
|
|
103
|
+
this.error('Not logged in. Run: aderis auth login');
|
|
104
104
|
const queryParams = {};
|
|
105
105
|
if (flags.page)
|
|
106
106
|
queryParams.page = flags.page;
|
|
@@ -75,11 +75,6 @@ export default class AuditLog extends Command {
|
|
|
75
75
|
const endpoint = ENDPOINTS[args.action];
|
|
76
76
|
if (!endpoint)
|
|
77
77
|
this.error(`Unknown action: ${args.action}. Available: ${SUBCOMMANDS.join(', ')}`);
|
|
78
|
-
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
79
|
-
if (!context)
|
|
80
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
81
|
-
if (!context.tokens)
|
|
82
|
-
this.error('Not logged in. Run: aderis auth login');
|
|
83
78
|
let apiPath = endpoint.path;
|
|
84
79
|
for (let i = 0; i < endpoint.pathParams.length; i++) {
|
|
85
80
|
const param = endpoint.pathParams[i];
|
|
@@ -98,6 +93,11 @@ export default class AuditLog extends Command {
|
|
|
98
93
|
}
|
|
99
94
|
apiPath = apiPath.replace(`{${param}}`, String(value));
|
|
100
95
|
}
|
|
96
|
+
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
97
|
+
if (!context)
|
|
98
|
+
this.error('No context configured. Run: aderis auth login --new');
|
|
99
|
+
if (!context.tokens)
|
|
100
|
+
this.error('Not logged in. Run: aderis auth login');
|
|
101
101
|
const queryParams = {};
|
|
102
102
|
if (flags.page)
|
|
103
103
|
queryParams.page = flags.page;
|
|
@@ -90,8 +90,7 @@ export default class AuthLogin extends Command {
|
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
92
|
// Get environment
|
|
93
|
-
|
|
94
|
-
environment = flags.environment ? flags.environment : (await select({
|
|
93
|
+
const environment = flags.environment ? flags.environment : (await select({
|
|
95
94
|
choices: [
|
|
96
95
|
{ description: 'Development environment', name: 'dev', value: 'dev' },
|
|
97
96
|
{ description: 'Test/staging environment', name: 'test', value: 'test' },
|
|
@@ -135,6 +135,17 @@ export default class AuthTenant extends Command {
|
|
|
135
135
|
}
|
|
136
136
|
this.log('\n* = current tenant');
|
|
137
137
|
}
|
|
138
|
+
async resolveTenantName(contextName, tenantId) {
|
|
139
|
+
if (!tenantId)
|
|
140
|
+
return undefined;
|
|
141
|
+
try {
|
|
142
|
+
const tenants = await listTenants(contextName);
|
|
143
|
+
return tenants.find((t) => t.tenantId === tenantId)?.name;
|
|
144
|
+
}
|
|
145
|
+
catch {
|
|
146
|
+
return undefined;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
138
149
|
async showCurrentTenant(contextName, asJson) {
|
|
139
150
|
const current = await getCurrentTenant(contextName);
|
|
140
151
|
if (!current) {
|
|
@@ -170,15 +181,4 @@ export default class AuthTenant extends Command {
|
|
|
170
181
|
throw error;
|
|
171
182
|
}
|
|
172
183
|
}
|
|
173
|
-
async resolveTenantName(contextName, tenantId) {
|
|
174
|
-
if (!tenantId)
|
|
175
|
-
return undefined;
|
|
176
|
-
try {
|
|
177
|
-
const tenants = await listTenants(contextName);
|
|
178
|
-
return tenants.find((t) => t.tenantId === tenantId)?.name;
|
|
179
|
-
}
|
|
180
|
-
catch {
|
|
181
|
-
return undefined;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
184
|
}
|
package/dist/commands/auth.js
CHANGED
|
@@ -841,7 +841,7 @@ export default class Auth extends Command {
|
|
|
841
841
|
const result = {};
|
|
842
842
|
// Collect UUIDs from this level to pass to children
|
|
843
843
|
const currentUuids = new Set(parentUuids);
|
|
844
|
-
for (const [
|
|
844
|
+
for (const [, value] of Object.entries(input)) {
|
|
845
845
|
if (typeof value === 'string' && uuidRegex.test(value)) {
|
|
846
846
|
currentUuids.add(value);
|
|
847
847
|
}
|
|
@@ -95,11 +95,6 @@ export default class BankAccounts extends Command {
|
|
|
95
95
|
const endpoint = ENDPOINTS[args.action];
|
|
96
96
|
if (!endpoint)
|
|
97
97
|
this.error(`Unknown action: ${args.action}. Available: ${SUBCOMMANDS.join(', ')}`);
|
|
98
|
-
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
99
|
-
if (!context)
|
|
100
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
101
|
-
if (!context.tokens)
|
|
102
|
-
this.error('Not logged in. Run: aderis auth login');
|
|
103
98
|
let apiPath = endpoint.path;
|
|
104
99
|
for (let i = 0; i < endpoint.pathParams.length; i++) {
|
|
105
100
|
const param = endpoint.pathParams[i];
|
|
@@ -118,6 +113,11 @@ export default class BankAccounts extends Command {
|
|
|
118
113
|
}
|
|
119
114
|
apiPath = apiPath.replace(`{${param}}`, String(value));
|
|
120
115
|
}
|
|
116
|
+
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
117
|
+
if (!context)
|
|
118
|
+
this.error('No context configured. Run: aderis auth login --new');
|
|
119
|
+
if (!context.tokens)
|
|
120
|
+
this.error('Not logged in. Run: aderis auth login');
|
|
121
121
|
const queryParams = {};
|
|
122
122
|
if (flags.page)
|
|
123
123
|
queryParams.page = flags.page;
|
|
@@ -96,11 +96,6 @@ export default class BankIntegrations extends Command {
|
|
|
96
96
|
const endpoint = ENDPOINTS[args.action];
|
|
97
97
|
if (!endpoint)
|
|
98
98
|
this.error(`Unknown action: ${args.action}. Available: ${SUBCOMMANDS.join(', ')}`);
|
|
99
|
-
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
100
|
-
if (!context)
|
|
101
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
102
|
-
if (!context.tokens)
|
|
103
|
-
this.error('Not logged in. Run: aderis auth login');
|
|
104
99
|
let apiPath = endpoint.path;
|
|
105
100
|
for (let i = 0; i < endpoint.pathParams.length; i++) {
|
|
106
101
|
const param = endpoint.pathParams[i];
|
|
@@ -119,6 +114,11 @@ export default class BankIntegrations extends Command {
|
|
|
119
114
|
}
|
|
120
115
|
apiPath = apiPath.replace(`{${param}}`, String(value));
|
|
121
116
|
}
|
|
117
|
+
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
118
|
+
if (!context)
|
|
119
|
+
this.error('No context configured. Run: aderis auth login --new');
|
|
120
|
+
if (!context.tokens)
|
|
121
|
+
this.error('Not logged in. Run: aderis auth login');
|
|
122
122
|
const queryParams = {};
|
|
123
123
|
if (flags.page)
|
|
124
124
|
queryParams.page = flags.page;
|
|
@@ -81,11 +81,6 @@ export default class BusinessPartnersContacts extends Command {
|
|
|
81
81
|
const endpoint = ENDPOINTS[args.action];
|
|
82
82
|
if (!endpoint)
|
|
83
83
|
this.error(`Unknown action: ${args.action}. Available: ${SUBCOMMANDS.join(', ')}`);
|
|
84
|
-
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
85
|
-
if (!context)
|
|
86
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
87
|
-
if (!context.tokens)
|
|
88
|
-
this.error('Not logged in. Run: aderis auth login');
|
|
89
84
|
let apiPath = endpoint.path;
|
|
90
85
|
for (let i = 0; i < endpoint.pathParams.length; i++) {
|
|
91
86
|
const param = endpoint.pathParams[i];
|
|
@@ -104,6 +99,11 @@ export default class BusinessPartnersContacts extends Command {
|
|
|
104
99
|
}
|
|
105
100
|
apiPath = apiPath.replace(`{${param}}`, String(value));
|
|
106
101
|
}
|
|
102
|
+
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
103
|
+
if (!context)
|
|
104
|
+
this.error('No context configured. Run: aderis auth login --new');
|
|
105
|
+
if (!context.tokens)
|
|
106
|
+
this.error('Not logged in. Run: aderis auth login');
|
|
107
107
|
const queryParams = {};
|
|
108
108
|
if (flags.page)
|
|
109
109
|
queryParams.page = flags.page;
|
|
@@ -87,11 +87,6 @@ export default class BusinessPartners extends Command {
|
|
|
87
87
|
const endpoint = ENDPOINTS[args.action];
|
|
88
88
|
if (!endpoint)
|
|
89
89
|
this.error(`Unknown action: ${args.action}. Available: ${SUBCOMMANDS.join(', ')}`);
|
|
90
|
-
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
91
|
-
if (!context)
|
|
92
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
93
|
-
if (!context.tokens)
|
|
94
|
-
this.error('Not logged in. Run: aderis auth login');
|
|
95
90
|
let apiPath = endpoint.path;
|
|
96
91
|
for (let i = 0; i < endpoint.pathParams.length; i++) {
|
|
97
92
|
const param = endpoint.pathParams[i];
|
|
@@ -110,6 +105,11 @@ export default class BusinessPartners extends Command {
|
|
|
110
105
|
}
|
|
111
106
|
apiPath = apiPath.replace(`{${param}}`, String(value));
|
|
112
107
|
}
|
|
108
|
+
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
109
|
+
if (!context)
|
|
110
|
+
this.error('No context configured. Run: aderis auth login --new');
|
|
111
|
+
if (!context.tokens)
|
|
112
|
+
this.error('Not logged in. Run: aderis auth login');
|
|
113
113
|
const queryParams = {};
|
|
114
114
|
if (flags.page)
|
|
115
115
|
queryParams.page = flags.page;
|
|
@@ -93,11 +93,6 @@ export default class CreditCardAccounts extends Command {
|
|
|
93
93
|
const endpoint = ENDPOINTS[args.action];
|
|
94
94
|
if (!endpoint)
|
|
95
95
|
this.error(`Unknown action: ${args.action}. Available: ${SUBCOMMANDS.join(', ')}`);
|
|
96
|
-
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
97
|
-
if (!context)
|
|
98
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
99
|
-
if (!context.tokens)
|
|
100
|
-
this.error('Not logged in. Run: aderis auth login');
|
|
101
96
|
let apiPath = endpoint.path;
|
|
102
97
|
for (let i = 0; i < endpoint.pathParams.length; i++) {
|
|
103
98
|
const param = endpoint.pathParams[i];
|
|
@@ -116,6 +111,11 @@ export default class CreditCardAccounts extends Command {
|
|
|
116
111
|
}
|
|
117
112
|
apiPath = apiPath.replace(`{${param}}`, String(value));
|
|
118
113
|
}
|
|
114
|
+
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
115
|
+
if (!context)
|
|
116
|
+
this.error('No context configured. Run: aderis auth login --new');
|
|
117
|
+
if (!context.tokens)
|
|
118
|
+
this.error('Not logged in. Run: aderis auth login');
|
|
119
119
|
const queryParams = {};
|
|
120
120
|
if (flags.page)
|
|
121
121
|
queryParams.page = flags.page;
|
|
@@ -82,11 +82,6 @@ export default class Documents extends Command {
|
|
|
82
82
|
const endpoint = ENDPOINTS[args.action];
|
|
83
83
|
if (!endpoint)
|
|
84
84
|
this.error(`Unknown action: ${args.action}. Available: ${SUBCOMMANDS.join(', ')}`);
|
|
85
|
-
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
86
|
-
if (!context)
|
|
87
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
88
|
-
if (!context.tokens)
|
|
89
|
-
this.error('Not logged in. Run: aderis auth login');
|
|
90
85
|
let apiPath = endpoint.path;
|
|
91
86
|
for (let i = 0; i < endpoint.pathParams.length; i++) {
|
|
92
87
|
const param = endpoint.pathParams[i];
|
|
@@ -105,6 +100,11 @@ export default class Documents extends Command {
|
|
|
105
100
|
}
|
|
106
101
|
apiPath = apiPath.replace(`{${param}}`, String(value));
|
|
107
102
|
}
|
|
103
|
+
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
104
|
+
if (!context)
|
|
105
|
+
this.error('No context configured. Run: aderis auth login --new');
|
|
106
|
+
if (!context.tokens)
|
|
107
|
+
this.error('Not logged in. Run: aderis auth login');
|
|
108
108
|
const queryParams = {};
|
|
109
109
|
if (flags.page)
|
|
110
110
|
queryParams.page = flags.page;
|
|
@@ -81,11 +81,6 @@ export default class DunningConfigs extends Command {
|
|
|
81
81
|
const endpoint = ENDPOINTS[args.action];
|
|
82
82
|
if (!endpoint)
|
|
83
83
|
this.error(`Unknown action: ${args.action}. Available: ${SUBCOMMANDS.join(', ')}`);
|
|
84
|
-
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
85
|
-
if (!context)
|
|
86
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
87
|
-
if (!context.tokens)
|
|
88
|
-
this.error('Not logged in. Run: aderis auth login');
|
|
89
84
|
let apiPath = endpoint.path;
|
|
90
85
|
for (let i = 0; i < endpoint.pathParams.length; i++) {
|
|
91
86
|
const param = endpoint.pathParams[i];
|
|
@@ -104,6 +99,11 @@ export default class DunningConfigs extends Command {
|
|
|
104
99
|
}
|
|
105
100
|
apiPath = apiPath.replace(`{${param}}`, String(value));
|
|
106
101
|
}
|
|
102
|
+
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
103
|
+
if (!context)
|
|
104
|
+
this.error('No context configured. Run: aderis auth login --new');
|
|
105
|
+
if (!context.tokens)
|
|
106
|
+
this.error('Not logged in. Run: aderis auth login');
|
|
107
107
|
const queryParams = {};
|
|
108
108
|
if (flags.page)
|
|
109
109
|
queryParams.page = flags.page;
|
|
@@ -82,11 +82,6 @@ export default class DunningReminders extends Command {
|
|
|
82
82
|
const endpoint = ENDPOINTS[args.action];
|
|
83
83
|
if (!endpoint)
|
|
84
84
|
this.error(`Unknown action: ${args.action}. Available: ${SUBCOMMANDS.join(', ')}`);
|
|
85
|
-
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
86
|
-
if (!context)
|
|
87
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
88
|
-
if (!context.tokens)
|
|
89
|
-
this.error('Not logged in. Run: aderis auth login');
|
|
90
85
|
let apiPath = endpoint.path;
|
|
91
86
|
for (let i = 0; i < endpoint.pathParams.length; i++) {
|
|
92
87
|
const param = endpoint.pathParams[i];
|
|
@@ -105,6 +100,11 @@ export default class DunningReminders extends Command {
|
|
|
105
100
|
}
|
|
106
101
|
apiPath = apiPath.replace(`{${param}}`, String(value));
|
|
107
102
|
}
|
|
103
|
+
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
104
|
+
if (!context)
|
|
105
|
+
this.error('No context configured. Run: aderis auth login --new');
|
|
106
|
+
if (!context.tokens)
|
|
107
|
+
this.error('Not logged in. Run: aderis auth login');
|
|
108
108
|
const queryParams = {};
|
|
109
109
|
if (flags.page)
|
|
110
110
|
queryParams.page = flags.page;
|
|
@@ -70,11 +70,6 @@ export default class DunningRuns extends Command {
|
|
|
70
70
|
const endpoint = ENDPOINTS[args.action];
|
|
71
71
|
if (!endpoint)
|
|
72
72
|
this.error(`Unknown action: ${args.action}. Available: ${SUBCOMMANDS.join(', ')}`);
|
|
73
|
-
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
74
|
-
if (!context)
|
|
75
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
76
|
-
if (!context.tokens)
|
|
77
|
-
this.error('Not logged in. Run: aderis auth login');
|
|
78
73
|
let apiPath = endpoint.path;
|
|
79
74
|
for (let i = 0; i < endpoint.pathParams.length; i++) {
|
|
80
75
|
const param = endpoint.pathParams[i];
|
|
@@ -93,6 +88,11 @@ export default class DunningRuns extends Command {
|
|
|
93
88
|
}
|
|
94
89
|
apiPath = apiPath.replace(`{${param}}`, String(value));
|
|
95
90
|
}
|
|
91
|
+
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
92
|
+
if (!context)
|
|
93
|
+
this.error('No context configured. Run: aderis auth login --new');
|
|
94
|
+
if (!context.tokens)
|
|
95
|
+
this.error('Not logged in. Run: aderis auth login');
|
|
96
96
|
const queryParams = {};
|
|
97
97
|
if (flags.page)
|
|
98
98
|
queryParams.page = flags.page;
|
|
@@ -112,11 +112,6 @@ export default class Employees extends Command {
|
|
|
112
112
|
const endpoint = ENDPOINTS[args.action];
|
|
113
113
|
if (!endpoint)
|
|
114
114
|
this.error(`Unknown action: ${args.action}. Available: ${SUBCOMMANDS.join(', ')}`);
|
|
115
|
-
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
116
|
-
if (!context)
|
|
117
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
118
|
-
if (!context.tokens)
|
|
119
|
-
this.error('Not logged in. Run: aderis auth login');
|
|
120
115
|
let apiPath = endpoint.path;
|
|
121
116
|
for (let i = 0; i < endpoint.pathParams.length; i++) {
|
|
122
117
|
const param = endpoint.pathParams[i];
|
|
@@ -135,6 +130,11 @@ export default class Employees extends Command {
|
|
|
135
130
|
}
|
|
136
131
|
apiPath = apiPath.replace(`{${param}}`, String(value));
|
|
137
132
|
}
|
|
133
|
+
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
134
|
+
if (!context)
|
|
135
|
+
this.error('No context configured. Run: aderis auth login --new');
|
|
136
|
+
if (!context.tokens)
|
|
137
|
+
this.error('Not logged in. Run: aderis auth login');
|
|
138
138
|
const queryParams = {};
|
|
139
139
|
if (flags.page)
|
|
140
140
|
queryParams.page = flags.page;
|
|
@@ -80,11 +80,6 @@ export default class EventProcessorMappings extends Command {
|
|
|
80
80
|
const endpoint = ENDPOINTS[args.action];
|
|
81
81
|
if (!endpoint)
|
|
82
82
|
this.error(`Unknown action: ${args.action}. Available: ${SUBCOMMANDS.join(', ')}`);
|
|
83
|
-
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
84
|
-
if (!context)
|
|
85
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
86
|
-
if (!context.tokens)
|
|
87
|
-
this.error('Not logged in. Run: aderis auth login');
|
|
88
83
|
let apiPath = endpoint.path;
|
|
89
84
|
for (let i = 0; i < endpoint.pathParams.length; i++) {
|
|
90
85
|
const param = endpoint.pathParams[i];
|
|
@@ -103,6 +98,11 @@ export default class EventProcessorMappings extends Command {
|
|
|
103
98
|
}
|
|
104
99
|
apiPath = apiPath.replace(`{${param}}`, String(value));
|
|
105
100
|
}
|
|
101
|
+
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
102
|
+
if (!context)
|
|
103
|
+
this.error('No context configured. Run: aderis auth login --new');
|
|
104
|
+
if (!context.tokens)
|
|
105
|
+
this.error('Not logged in. Run: aderis auth login');
|
|
106
106
|
const queryParams = {};
|
|
107
107
|
if (flags.page)
|
|
108
108
|
queryParams.page = flags.page;
|
|
@@ -82,11 +82,6 @@ export default class FilesInternal extends Command {
|
|
|
82
82
|
const endpoint = ENDPOINTS[args.action];
|
|
83
83
|
if (!endpoint)
|
|
84
84
|
this.error(`Unknown action: ${args.action}. Available: ${SUBCOMMANDS.join(', ')}`);
|
|
85
|
-
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
86
|
-
if (!context)
|
|
87
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
88
|
-
if (!context.tokens)
|
|
89
|
-
this.error('Not logged in. Run: aderis auth login');
|
|
90
85
|
let apiPath = endpoint.path;
|
|
91
86
|
for (let i = 0; i < endpoint.pathParams.length; i++) {
|
|
92
87
|
const param = endpoint.pathParams[i];
|
|
@@ -105,6 +100,11 @@ export default class FilesInternal extends Command {
|
|
|
105
100
|
}
|
|
106
101
|
apiPath = apiPath.replace(`{${param}}`, String(value));
|
|
107
102
|
}
|
|
103
|
+
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
104
|
+
if (!context)
|
|
105
|
+
this.error('No context configured. Run: aderis auth login --new');
|
|
106
|
+
if (!context.tokens)
|
|
107
|
+
this.error('Not logged in. Run: aderis auth login');
|
|
108
108
|
const queryParams = {};
|
|
109
109
|
if (flags.page)
|
|
110
110
|
queryParams.page = flags.page;
|
package/dist/commands/health.js
CHANGED
|
@@ -76,11 +76,6 @@ export default class Health extends Command {
|
|
|
76
76
|
const endpoint = ENDPOINTS[args.action];
|
|
77
77
|
if (!endpoint)
|
|
78
78
|
this.error(`Unknown action: ${args.action}. Available: ${SUBCOMMANDS.join(', ')}`);
|
|
79
|
-
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
80
|
-
if (!context)
|
|
81
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
82
|
-
if (!context.tokens)
|
|
83
|
-
this.error('Not logged in. Run: aderis auth login');
|
|
84
79
|
let apiPath = endpoint.path;
|
|
85
80
|
for (let i = 0; i < endpoint.pathParams.length; i++) {
|
|
86
81
|
const param = endpoint.pathParams[i];
|
|
@@ -99,6 +94,11 @@ export default class Health extends Command {
|
|
|
99
94
|
}
|
|
100
95
|
apiPath = apiPath.replace(`{${param}}`, String(value));
|
|
101
96
|
}
|
|
97
|
+
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
98
|
+
if (!context)
|
|
99
|
+
this.error('No context configured. Run: aderis auth login --new');
|
|
100
|
+
if (!context.tokens)
|
|
101
|
+
this.error('Not logged in. Run: aderis auth login');
|
|
102
102
|
const queryParams = {};
|
|
103
103
|
if (flags.page)
|
|
104
104
|
queryParams.page = flags.page;
|
package/dist/commands/inbox.js
CHANGED
|
@@ -74,11 +74,6 @@ export default class Inbox extends Command {
|
|
|
74
74
|
const endpoint = ENDPOINTS[args.action];
|
|
75
75
|
if (!endpoint)
|
|
76
76
|
this.error(`Unknown action: ${args.action}. Available: ${SUBCOMMANDS.join(', ')}`);
|
|
77
|
-
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
78
|
-
if (!context)
|
|
79
|
-
this.error('No context configured. Run: aderis auth login --new');
|
|
80
|
-
if (!context.tokens)
|
|
81
|
-
this.error('Not logged in. Run: aderis auth login');
|
|
82
77
|
let apiPath = endpoint.path;
|
|
83
78
|
for (let i = 0; i < endpoint.pathParams.length; i++) {
|
|
84
79
|
const param = endpoint.pathParams[i];
|
|
@@ -97,6 +92,11 @@ export default class Inbox extends Command {
|
|
|
97
92
|
}
|
|
98
93
|
apiPath = apiPath.replace(`{${param}}`, String(value));
|
|
99
94
|
}
|
|
95
|
+
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
96
|
+
if (!context)
|
|
97
|
+
this.error('No context configured. Run: aderis auth login --new');
|
|
98
|
+
if (!context.tokens)
|
|
99
|
+
this.error('Not logged in. Run: aderis auth login');
|
|
100
100
|
const queryParams = {};
|
|
101
101
|
if (flags.page)
|
|
102
102
|
queryParams.page = flags.page;
|