@aderis-erp/cli 1.0.8 → 1.0.10
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 +18 -6
- package/dist/commands/account-transaction-allocations.js +18 -6
- package/dist/commands/account-transactions.js +18 -6
- package/dist/commands/accounts.js +18 -6
- package/dist/commands/agent-runs.js +18 -6
- package/dist/commands/audit-log.js +21 -9
- package/dist/commands/bank-accounts.js +18 -6
- package/dist/commands/bank-integrations.js +18 -6
- package/dist/commands/business-partners.d.ts +1 -0
- package/dist/commands/business-partners.js +33 -8
- package/dist/commands/credit-card-accounts.js +18 -6
- package/dist/commands/documents.js +18 -6
- package/dist/commands/dunning-configs.js +18 -6
- package/dist/commands/dunning-reminders.js +18 -6
- package/dist/commands/dunning-runs.js +18 -6
- package/dist/commands/employees.js +18 -6
- package/dist/commands/event-processor-mappings.js +18 -6
- package/dist/commands/files-internal.js +18 -6
- package/dist/commands/health.js +18 -6
- package/dist/commands/inbox.js +18 -6
- package/dist/commands/integrations.js +18 -6
- package/dist/commands/item-categories.js +18 -6
- package/dist/commands/items.js +18 -6
- package/dist/commands/journal-lines.js +18 -6
- package/dist/commands/journals.js +18 -6
- package/dist/commands/ledgers.js +18 -6
- package/dist/commands/office-locations.js +18 -6
- package/dist/commands/payment-methods.d.ts +1 -0
- package/dist/commands/payment-methods.js +26 -8
- package/dist/commands/payment-runs.js +18 -6
- package/dist/commands/payment-terms.js +18 -6
- package/dist/commands/price-lists.js +18 -6
- package/dist/commands/processor-mappings.js +18 -6
- package/dist/commands/processors.js +18 -6
- package/dist/commands/reports.js +18 -6
- package/dist/commands/salary-types.js +18 -6
- package/dist/commands/sales-invoices.js +18 -6
- package/dist/commands/sales-orders.js +18 -6
- package/dist/commands/{payment-method-ledger-mappings.d.ts → saved-views.d.ts} +2 -3
- package/dist/commands/{payment-method-ledger-mappings.js → saved-views.js} +32 -20
- package/dist/commands/tags.js +18 -6
- package/dist/commands/tax-codes.js +18 -6
- package/dist/commands/tax-matrix.js +18 -6
- package/dist/commands/tenants.js +18 -6
- package/dist/commands/text-templates.js +18 -6
- package/dist/commands/tools.js +18 -6
- package/dist/commands/{vat-declaration.d.ts → vat-declarations.d.ts} +1 -1
- package/dist/commands/{vat-declaration.js → vat-declarations.js} +43 -30
- package/dist/commands/vendor-invoices.js +18 -6
- package/dist/commands/webhooks.js +18 -6
- package/dist/commands/workflows.js +18 -6
- package/oclif.manifest.json +177 -340
- package/package.json +1 -1
- package/dist/commands/business-partners---contacts.d.ts +0 -42
- package/dist/commands/business-partners---contacts.js +0 -1074
|
@@ -1045,12 +1045,24 @@ export default class SalesInvoices extends Command {
|
|
|
1045
1045
|
return { cols: flatten ? cols : cols.slice(0, 8), items: items };
|
|
1046
1046
|
}
|
|
1047
1047
|
getValue(row, col) {
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1048
|
+
if (!col.includes('.'))
|
|
1049
|
+
return String(row[col] ?? '');
|
|
1050
|
+
const parts = col.split('.');
|
|
1051
|
+
// Walk the dot-path; descending through an array branches into every
|
|
1052
|
+
// element so leaf values get collected from each one. Multiple leaves are
|
|
1053
|
+
// joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
|
|
1054
|
+
const walk = (o, idx) => {
|
|
1055
|
+
if (idx >= parts.length)
|
|
1056
|
+
return [o];
|
|
1057
|
+
if (o == null)
|
|
1058
|
+
return [];
|
|
1059
|
+
if (Array.isArray(o))
|
|
1060
|
+
return o.flatMap(item => walk(item, idx));
|
|
1061
|
+
if (typeof o === 'object')
|
|
1062
|
+
return walk(o[parts[idx]], idx + 1);
|
|
1063
|
+
return [];
|
|
1064
|
+
};
|
|
1065
|
+
return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
|
|
1054
1066
|
}
|
|
1055
1067
|
printTable(data, fields) {
|
|
1056
1068
|
const { cols, items } = this.getColumns(data, fields);
|
|
@@ -1043,12 +1043,24 @@ export default class SalesOrders extends Command {
|
|
|
1043
1043
|
return { cols: flatten ? cols : cols.slice(0, 8), items: items };
|
|
1044
1044
|
}
|
|
1045
1045
|
getValue(row, col) {
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1046
|
+
if (!col.includes('.'))
|
|
1047
|
+
return String(row[col] ?? '');
|
|
1048
|
+
const parts = col.split('.');
|
|
1049
|
+
// Walk the dot-path; descending through an array branches into every
|
|
1050
|
+
// element so leaf values get collected from each one. Multiple leaves are
|
|
1051
|
+
// joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
|
|
1052
|
+
const walk = (o, idx) => {
|
|
1053
|
+
if (idx >= parts.length)
|
|
1054
|
+
return [o];
|
|
1055
|
+
if (o == null)
|
|
1056
|
+
return [];
|
|
1057
|
+
if (Array.isArray(o))
|
|
1058
|
+
return o.flatMap(item => walk(item, idx));
|
|
1059
|
+
if (typeof o === 'object')
|
|
1060
|
+
return walk(o[parts[idx]], idx + 1);
|
|
1061
|
+
return [];
|
|
1062
|
+
};
|
|
1063
|
+
return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
|
|
1052
1064
|
}
|
|
1053
1065
|
printTable(data, fields) {
|
|
1054
1066
|
const { cols, items } = this.getColumns(data, fields);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
|
-
export default class
|
|
2
|
+
export default class SavedViews extends Command {
|
|
3
3
|
static description: string;
|
|
4
|
-
static examples:
|
|
4
|
+
static examples: string[];
|
|
5
5
|
static args: {
|
|
6
6
|
action: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
7
|
id: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
@@ -14,7 +14,6 @@ export default class PaymentMethodLedgerMappings 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
|
-
id: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
17
|
page: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
18
|
limit: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
19
|
include: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -5,18 +5,19 @@ import { getCurrentContext, getContext, getBaseUrls } from '../lib/config.js';
|
|
|
5
5
|
const HAS_IMPORT = false;
|
|
6
6
|
const HAS_EXPORT = false;
|
|
7
7
|
const HAS_CAMT053 = false;
|
|
8
|
-
const NESTED_IMPORTS = [
|
|
9
|
-
const SUBCOMMANDS = [...["
|
|
8
|
+
const NESTED_IMPORTS = [];
|
|
9
|
+
const SUBCOMMANDS = [...["get", "create", "delete"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
|
|
10
10
|
const ENDPOINTS = {
|
|
11
|
-
'
|
|
12
|
-
'create
|
|
13
|
-
'
|
|
14
|
-
'update-ledger-mappings': { method: 'PATCH', path: '/v1/payment-methods/{paymentMethodId}/ledger-mappings/{id}', summary: 'Update payment method ledger mapping', pathParams: ['paymentMethodId', 'id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
15
|
-
'delete-ledger-mappings': { method: 'DELETE', path: '/v1/payment-methods/{paymentMethodId}/ledger-mappings/{id}', summary: 'Delete payment method ledger mapping', pathParams: ['paymentMethodId', 'id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
11
|
+
'get': { method: 'GET', path: '/v1/saved-views', summary: 'List saved views for a page', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
12
|
+
'create': { method: 'POST', path: '/v1/saved-views', summary: 'Create a saved view', pathParams: [], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
13
|
+
'delete': { method: 'DELETE', path: '/v1/saved-views/{id}', summary: 'Delete a saved view (creator only)', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
16
14
|
};
|
|
17
|
-
export default class
|
|
18
|
-
static description = 'Manage
|
|
19
|
-
static examples = [
|
|
15
|
+
export default class SavedViews extends Command {
|
|
16
|
+
static description = 'Manage saved views';
|
|
17
|
+
static examples = [
|
|
18
|
+
'<%= config.bin %> saved-views get <id>',
|
|
19
|
+
'<%= config.bin %> saved-views create --data \'{...}\'',
|
|
20
|
+
];
|
|
20
21
|
static args = {
|
|
21
22
|
action: Args.string({ description: 'Action: ' + SUBCOMMANDS.join(', '), required: true }),
|
|
22
23
|
id: Args.string({ description: 'Resource ID (for get, update, delete operations)', required: false }),
|
|
@@ -29,7 +30,6 @@ export default class PaymentMethodLedgerMappings extends Command {
|
|
|
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 }),
|
|
32
|
-
'id': Flags.string({ description: 'Path param: id' }),
|
|
33
33
|
page: Flags.string({ description: 'Page number' }),
|
|
34
34
|
limit: Flags.string({ description: 'Items per page' }),
|
|
35
35
|
include: Flags.string({ description: 'Relations to include' }),
|
|
@@ -42,7 +42,7 @@ export default class PaymentMethodLedgerMappings extends Command {
|
|
|
42
42
|
'show-http-request': Flags.boolean({ description: 'Show HTTP request details (method, URL, body)' }),
|
|
43
43
|
};
|
|
44
44
|
async run() {
|
|
45
|
-
const { args, flags } = await this.parse(
|
|
45
|
+
const { args, flags } = await this.parse(SavedViews);
|
|
46
46
|
// Handle import action specially
|
|
47
47
|
if (args.action === 'import') {
|
|
48
48
|
if (!HAS_IMPORT)
|
|
@@ -83,7 +83,7 @@ export default class PaymentMethodLedgerMappings extends Command {
|
|
|
83
83
|
// First path param always comes from positional argument
|
|
84
84
|
value = args.id;
|
|
85
85
|
if (!value)
|
|
86
|
-
this.error('Missing required argument: id. Usage: aderis
|
|
86
|
+
this.error('Missing required argument: id. Usage: aderis saved-views <action> <id>');
|
|
87
87
|
}
|
|
88
88
|
else {
|
|
89
89
|
const flagName = param.replace(/\./g, '-').replace(/([A-Z])/g, '-$1').toLowerCase().replace(/^-/, '');
|
|
@@ -682,7 +682,7 @@ export default class PaymentMethodLedgerMappings extends Command {
|
|
|
682
682
|
}
|
|
683
683
|
async runNestedImport(suffix, parentId, flags) {
|
|
684
684
|
if (!parentId) {
|
|
685
|
-
this.error(`Missing required argument: id. Usage: aderis
|
|
685
|
+
this.error(`Missing required argument: id. Usage: aderis saved-views import-${suffix} <parent-id> --file data.json`);
|
|
686
686
|
}
|
|
687
687
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
688
688
|
if (!context)
|
|
@@ -1011,12 +1011,24 @@ export default class PaymentMethodLedgerMappings extends Command {
|
|
|
1011
1011
|
return { cols: flatten ? cols : cols.slice(0, 8), items: items };
|
|
1012
1012
|
}
|
|
1013
1013
|
getValue(row, col) {
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1014
|
+
if (!col.includes('.'))
|
|
1015
|
+
return String(row[col] ?? '');
|
|
1016
|
+
const parts = col.split('.');
|
|
1017
|
+
// Walk the dot-path; descending through an array branches into every
|
|
1018
|
+
// element so leaf values get collected from each one. Multiple leaves are
|
|
1019
|
+
// joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
|
|
1020
|
+
const walk = (o, idx) => {
|
|
1021
|
+
if (idx >= parts.length)
|
|
1022
|
+
return [o];
|
|
1023
|
+
if (o == null)
|
|
1024
|
+
return [];
|
|
1025
|
+
if (Array.isArray(o))
|
|
1026
|
+
return o.flatMap(item => walk(item, idx));
|
|
1027
|
+
if (typeof o === 'object')
|
|
1028
|
+
return walk(o[parts[idx]], idx + 1);
|
|
1029
|
+
return [];
|
|
1030
|
+
};
|
|
1031
|
+
return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
|
|
1020
1032
|
}
|
|
1021
1033
|
printTable(data, fields) {
|
|
1022
1034
|
const { cols, items } = this.getColumns(data, fields);
|
package/dist/commands/tags.js
CHANGED
|
@@ -1017,12 +1017,24 @@ export default class Tags extends Command {
|
|
|
1017
1017
|
return { cols: flatten ? cols : cols.slice(0, 8), items: items };
|
|
1018
1018
|
}
|
|
1019
1019
|
getValue(row, col) {
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1020
|
+
if (!col.includes('.'))
|
|
1021
|
+
return String(row[col] ?? '');
|
|
1022
|
+
const parts = col.split('.');
|
|
1023
|
+
// Walk the dot-path; descending through an array branches into every
|
|
1024
|
+
// element so leaf values get collected from each one. Multiple leaves are
|
|
1025
|
+
// joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
|
|
1026
|
+
const walk = (o, idx) => {
|
|
1027
|
+
if (idx >= parts.length)
|
|
1028
|
+
return [o];
|
|
1029
|
+
if (o == null)
|
|
1030
|
+
return [];
|
|
1031
|
+
if (Array.isArray(o))
|
|
1032
|
+
return o.flatMap(item => walk(item, idx));
|
|
1033
|
+
if (typeof o === 'object')
|
|
1034
|
+
return walk(o[parts[idx]], idx + 1);
|
|
1035
|
+
return [];
|
|
1036
|
+
};
|
|
1037
|
+
return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
|
|
1026
1038
|
}
|
|
1027
1039
|
printTable(data, fields) {
|
|
1028
1040
|
const { cols, items } = this.getColumns(data, fields);
|
|
@@ -1020,12 +1020,24 @@ export default class TaxCodes extends Command {
|
|
|
1020
1020
|
return { cols: flatten ? cols : cols.slice(0, 8), items: items };
|
|
1021
1021
|
}
|
|
1022
1022
|
getValue(row, col) {
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1023
|
+
if (!col.includes('.'))
|
|
1024
|
+
return String(row[col] ?? '');
|
|
1025
|
+
const parts = col.split('.');
|
|
1026
|
+
// Walk the dot-path; descending through an array branches into every
|
|
1027
|
+
// element so leaf values get collected from each one. Multiple leaves are
|
|
1028
|
+
// joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
|
|
1029
|
+
const walk = (o, idx) => {
|
|
1030
|
+
if (idx >= parts.length)
|
|
1031
|
+
return [o];
|
|
1032
|
+
if (o == null)
|
|
1033
|
+
return [];
|
|
1034
|
+
if (Array.isArray(o))
|
|
1035
|
+
return o.flatMap(item => walk(item, idx));
|
|
1036
|
+
if (typeof o === 'object')
|
|
1037
|
+
return walk(o[parts[idx]], idx + 1);
|
|
1038
|
+
return [];
|
|
1039
|
+
};
|
|
1040
|
+
return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
|
|
1029
1041
|
}
|
|
1030
1042
|
printTable(data, fields) {
|
|
1031
1043
|
const { cols, items } = this.getColumns(data, fields);
|
|
@@ -1017,12 +1017,24 @@ export default class TaxMatrix extends Command {
|
|
|
1017
1017
|
return { cols: flatten ? cols : cols.slice(0, 8), items: items };
|
|
1018
1018
|
}
|
|
1019
1019
|
getValue(row, col) {
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1020
|
+
if (!col.includes('.'))
|
|
1021
|
+
return String(row[col] ?? '');
|
|
1022
|
+
const parts = col.split('.');
|
|
1023
|
+
// Walk the dot-path; descending through an array branches into every
|
|
1024
|
+
// element so leaf values get collected from each one. Multiple leaves are
|
|
1025
|
+
// joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
|
|
1026
|
+
const walk = (o, idx) => {
|
|
1027
|
+
if (idx >= parts.length)
|
|
1028
|
+
return [o];
|
|
1029
|
+
if (o == null)
|
|
1030
|
+
return [];
|
|
1031
|
+
if (Array.isArray(o))
|
|
1032
|
+
return o.flatMap(item => walk(item, idx));
|
|
1033
|
+
if (typeof o === 'object')
|
|
1034
|
+
return walk(o[parts[idx]], idx + 1);
|
|
1035
|
+
return [];
|
|
1036
|
+
};
|
|
1037
|
+
return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
|
|
1026
1038
|
}
|
|
1027
1039
|
printTable(data, fields) {
|
|
1028
1040
|
const { cols, items } = this.getColumns(data, fields);
|
package/dist/commands/tenants.js
CHANGED
|
@@ -1017,12 +1017,24 @@ export default class Tenants extends Command {
|
|
|
1017
1017
|
return { cols: flatten ? cols : cols.slice(0, 8), items: items };
|
|
1018
1018
|
}
|
|
1019
1019
|
getValue(row, col) {
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1020
|
+
if (!col.includes('.'))
|
|
1021
|
+
return String(row[col] ?? '');
|
|
1022
|
+
const parts = col.split('.');
|
|
1023
|
+
// Walk the dot-path; descending through an array branches into every
|
|
1024
|
+
// element so leaf values get collected from each one. Multiple leaves are
|
|
1025
|
+
// joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
|
|
1026
|
+
const walk = (o, idx) => {
|
|
1027
|
+
if (idx >= parts.length)
|
|
1028
|
+
return [o];
|
|
1029
|
+
if (o == null)
|
|
1030
|
+
return [];
|
|
1031
|
+
if (Array.isArray(o))
|
|
1032
|
+
return o.flatMap(item => walk(item, idx));
|
|
1033
|
+
if (typeof o === 'object')
|
|
1034
|
+
return walk(o[parts[idx]], idx + 1);
|
|
1035
|
+
return [];
|
|
1036
|
+
};
|
|
1037
|
+
return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
|
|
1026
1038
|
}
|
|
1027
1039
|
printTable(data, fields) {
|
|
1028
1040
|
const { cols, items } = this.getColumns(data, fields);
|
|
@@ -1017,12 +1017,24 @@ export default class TextTemplates extends Command {
|
|
|
1017
1017
|
return { cols: flatten ? cols : cols.slice(0, 8), items: items };
|
|
1018
1018
|
}
|
|
1019
1019
|
getValue(row, col) {
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1020
|
+
if (!col.includes('.'))
|
|
1021
|
+
return String(row[col] ?? '');
|
|
1022
|
+
const parts = col.split('.');
|
|
1023
|
+
// Walk the dot-path; descending through an array branches into every
|
|
1024
|
+
// element so leaf values get collected from each one. Multiple leaves are
|
|
1025
|
+
// joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
|
|
1026
|
+
const walk = (o, idx) => {
|
|
1027
|
+
if (idx >= parts.length)
|
|
1028
|
+
return [o];
|
|
1029
|
+
if (o == null)
|
|
1030
|
+
return [];
|
|
1031
|
+
if (Array.isArray(o))
|
|
1032
|
+
return o.flatMap(item => walk(item, idx));
|
|
1033
|
+
if (typeof o === 'object')
|
|
1034
|
+
return walk(o[parts[idx]], idx + 1);
|
|
1035
|
+
return [];
|
|
1036
|
+
};
|
|
1037
|
+
return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
|
|
1026
1038
|
}
|
|
1027
1039
|
printTable(data, fields) {
|
|
1028
1040
|
const { cols, items } = this.getColumns(data, fields);
|
package/dist/commands/tools.js
CHANGED
|
@@ -1010,12 +1010,24 @@ export default class Tools extends Command {
|
|
|
1010
1010
|
return { cols: flatten ? cols : cols.slice(0, 8), items: items };
|
|
1011
1011
|
}
|
|
1012
1012
|
getValue(row, col) {
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1013
|
+
if (!col.includes('.'))
|
|
1014
|
+
return String(row[col] ?? '');
|
|
1015
|
+
const parts = col.split('.');
|
|
1016
|
+
// Walk the dot-path; descending through an array branches into every
|
|
1017
|
+
// element so leaf values get collected from each one. Multiple leaves are
|
|
1018
|
+
// joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
|
|
1019
|
+
const walk = (o, idx) => {
|
|
1020
|
+
if (idx >= parts.length)
|
|
1021
|
+
return [o];
|
|
1022
|
+
if (o == null)
|
|
1023
|
+
return [];
|
|
1024
|
+
if (Array.isArray(o))
|
|
1025
|
+
return o.flatMap(item => walk(item, idx));
|
|
1026
|
+
if (typeof o === 'object')
|
|
1027
|
+
return walk(o[parts[idx]], idx + 1);
|
|
1028
|
+
return [];
|
|
1029
|
+
};
|
|
1030
|
+
return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
|
|
1019
1031
|
}
|
|
1020
1032
|
printTable(data, fields) {
|
|
1021
1033
|
const { cols, items } = this.getColumns(data, fields);
|
|
@@ -6,30 +6,31 @@ const HAS_IMPORT = true;
|
|
|
6
6
|
const HAS_EXPORT = true;
|
|
7
7
|
const HAS_CAMT053 = false;
|
|
8
8
|
const NESTED_IMPORTS = [];
|
|
9
|
-
const SUBCOMMANDS = [...["list", "create", "preview", "get", "update", "regenerate", "replace", "fields-contributions", "fields-contributions-export", "approve", "mark-as-filed", "xml"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
|
|
9
|
+
const SUBCOMMANDS = [...["list", "create", "preview", "get", "update", "delete", "regenerate", "replace", "fields-contributions", "fields-contributions-export", "approve", "mark-as-filed", "xml"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
|
|
10
10
|
const ENDPOINTS = {
|
|
11
|
-
'list': { method: 'GET', path: '/v1/vat-
|
|
12
|
-
'create': { method: 'POST', path: '/v1/vat-
|
|
13
|
-
'preview': { method: 'GET', path: '/v1/vat-
|
|
14
|
-
'get': { method: 'GET', path: '/v1/vat-
|
|
15
|
-
'update': { method: 'PATCH', path: '/v1/vat-
|
|
16
|
-
'
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
'fields-contributions
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
'
|
|
11
|
+
'list': { method: 'GET', path: '/v1/vat-declarations', summary: 'List VAT reports (paginated)', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
12
|
+
'create': { method: 'POST', path: '/v1/vat-declarations', summary: 'Create a VAT declaration report (always async-accepted)', pathParams: [], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
13
|
+
'preview': { method: 'GET', path: '/v1/vat-declarations/preview', summary: 'Preview the in-scope counts and late entries for a candidate period', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
14
|
+
'get': { method: 'GET', path: '/v1/vat-declarations/{id}', summary: 'Get a VAT report by id (this is the polling endpoint for async generation)', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
15
|
+
'update': { method: 'PATCH', path: '/v1/vat-declarations/{id}', summary: 'Update manualAdjustments, submission type, or amount basis on a DRAFT report', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['manualAdjustments'] },
|
|
16
|
+
'delete': { method: 'DELETE', path: '/v1/vat-declarations/{id}', summary: 'Delete a VAT declaration that is still in DRAFT status', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
17
|
+
'regenerate': { method: 'POST', path: '/v1/vat-declarations/{id}/regenerate', summary: 'Re-run the full generation pipeline on a DRAFT report', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
18
|
+
'replace': { method: 'POST', path: '/v1/vat-declarations/{id}/replace', summary: 'Create a corrective DRAFT (Berichtigungsabrechnung) from a FILED report', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
19
|
+
'fields-contributions': { method: 'GET', path: '/v1/vat-declarations/{id}/fields/{fieldId}/contributions', summary: 'Drill into the contributions for a single Ziffer', pathParams: ['id', 'fieldId'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
20
|
+
'fields-contributions-export': { method: 'GET', path: '/v1/vat-declarations/{id}/fields/{fieldId}/contributions/export', summary: 'Export the drill-down result set as an Excel workbook', pathParams: ['id', 'fieldId'], hasBody: false, isMultipart: false, isBinaryResponse: true, bodyArrayFields: [] },
|
|
21
|
+
'approve': { method: 'POST', path: '/v1/vat-declarations/{id}/approve', summary: 'Approve a VAT report and produce the eCH-0217 XML submission file.', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
22
|
+
'mark-as-filed': { method: 'POST', path: '/v1/vat-declarations/{id}/mark-as-filed', summary: 'Record the ESTV filing reference for a FINALIZED VAT report.', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
23
|
+
'xml': { method: 'GET', path: '/v1/vat-declarations/{id}/xml', summary: 'Download the eCH-0217 XML submission file for a FINALIZED or FILED VAT report.', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: true, bodyArrayFields: [] },
|
|
23
24
|
};
|
|
24
|
-
export default class
|
|
25
|
-
static description = 'Manage vat
|
|
25
|
+
export default class VatDeclarations extends Command {
|
|
26
|
+
static description = 'Manage vat declarations';
|
|
26
27
|
static examples = [
|
|
27
|
-
'<%= config.bin %> vat-
|
|
28
|
-
'<%= config.bin %> vat-
|
|
29
|
-
'<%= config.bin %> vat-
|
|
30
|
-
'<%= config.bin %> vat-
|
|
31
|
-
'<%= config.bin %> vat-
|
|
32
|
-
'<%= config.bin %> vat-
|
|
28
|
+
'<%= config.bin %> vat-declarations list',
|
|
29
|
+
'<%= config.bin %> vat-declarations get <id>',
|
|
30
|
+
'<%= config.bin %> vat-declarations create --data \'{...}\'',
|
|
31
|
+
'<%= config.bin %> vat-declarations update <id> --set field=value',
|
|
32
|
+
'<%= config.bin %> vat-declarations import --file data.json',
|
|
33
|
+
'<%= config.bin %> vat-declarations export --csv > vat-declarations.csv',
|
|
33
34
|
];
|
|
34
35
|
static args = {
|
|
35
36
|
action: Args.string({ description: 'Action: ' + SUBCOMMANDS.join(', '), required: true }),
|
|
@@ -56,7 +57,7 @@ export default class VatDeclaration extends Command {
|
|
|
56
57
|
'show-http-request': Flags.boolean({ description: 'Show HTTP request details (method, URL, body)' }),
|
|
57
58
|
};
|
|
58
59
|
async run() {
|
|
59
|
-
const { args, flags } = await this.parse(
|
|
60
|
+
const { args, flags } = await this.parse(VatDeclarations);
|
|
60
61
|
// Handle import action specially
|
|
61
62
|
if (args.action === 'import') {
|
|
62
63
|
if (!HAS_IMPORT)
|
|
@@ -97,7 +98,7 @@ export default class VatDeclaration extends Command {
|
|
|
97
98
|
// First path param always comes from positional argument
|
|
98
99
|
value = args.id;
|
|
99
100
|
if (!value)
|
|
100
|
-
this.error('Missing required argument: id. Usage: aderis vat-
|
|
101
|
+
this.error('Missing required argument: id. Usage: aderis vat-declarations <action> <id>');
|
|
101
102
|
}
|
|
102
103
|
else {
|
|
103
104
|
const flagName = param.replace(/\./g, '-').replace(/([A-Z])/g, '-$1').toLowerCase().replace(/^-/, '');
|
|
@@ -696,7 +697,7 @@ export default class VatDeclaration extends Command {
|
|
|
696
697
|
}
|
|
697
698
|
async runNestedImport(suffix, parentId, flags) {
|
|
698
699
|
if (!parentId) {
|
|
699
|
-
this.error(`Missing required argument: id. Usage: aderis vat-
|
|
700
|
+
this.error(`Missing required argument: id. Usage: aderis vat-declarations import-${suffix} <parent-id> --file data.json`);
|
|
700
701
|
}
|
|
701
702
|
const context = flags.context ? getContext(flags.context) : getCurrentContext();
|
|
702
703
|
if (!context)
|
|
@@ -1025,12 +1026,24 @@ export default class VatDeclaration extends Command {
|
|
|
1025
1026
|
return { cols: flatten ? cols : cols.slice(0, 8), items: items };
|
|
1026
1027
|
}
|
|
1027
1028
|
getValue(row, col) {
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1029
|
+
if (!col.includes('.'))
|
|
1030
|
+
return String(row[col] ?? '');
|
|
1031
|
+
const parts = col.split('.');
|
|
1032
|
+
// Walk the dot-path; descending through an array branches into every
|
|
1033
|
+
// element so leaf values get collected from each one. Multiple leaves are
|
|
1034
|
+
// joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
|
|
1035
|
+
const walk = (o, idx) => {
|
|
1036
|
+
if (idx >= parts.length)
|
|
1037
|
+
return [o];
|
|
1038
|
+
if (o == null)
|
|
1039
|
+
return [];
|
|
1040
|
+
if (Array.isArray(o))
|
|
1041
|
+
return o.flatMap(item => walk(item, idx));
|
|
1042
|
+
if (typeof o === 'object')
|
|
1043
|
+
return walk(o[parts[idx]], idx + 1);
|
|
1044
|
+
return [];
|
|
1045
|
+
};
|
|
1046
|
+
return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
|
|
1034
1047
|
}
|
|
1035
1048
|
printTable(data, fields) {
|
|
1036
1049
|
const { cols, items } = this.getColumns(data, fields);
|
|
@@ -1050,12 +1050,24 @@ export default class VendorInvoices extends Command {
|
|
|
1050
1050
|
return { cols: flatten ? cols : cols.slice(0, 8), items: items };
|
|
1051
1051
|
}
|
|
1052
1052
|
getValue(row, col) {
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1053
|
+
if (!col.includes('.'))
|
|
1054
|
+
return String(row[col] ?? '');
|
|
1055
|
+
const parts = col.split('.');
|
|
1056
|
+
// Walk the dot-path; descending through an array branches into every
|
|
1057
|
+
// element so leaf values get collected from each one. Multiple leaves are
|
|
1058
|
+
// joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
|
|
1059
|
+
const walk = (o, idx) => {
|
|
1060
|
+
if (idx >= parts.length)
|
|
1061
|
+
return [o];
|
|
1062
|
+
if (o == null)
|
|
1063
|
+
return [];
|
|
1064
|
+
if (Array.isArray(o))
|
|
1065
|
+
return o.flatMap(item => walk(item, idx));
|
|
1066
|
+
if (typeof o === 'object')
|
|
1067
|
+
return walk(o[parts[idx]], idx + 1);
|
|
1068
|
+
return [];
|
|
1069
|
+
};
|
|
1070
|
+
return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
|
|
1059
1071
|
}
|
|
1060
1072
|
printTable(data, fields) {
|
|
1061
1073
|
const { cols, items } = this.getColumns(data, fields);
|
|
@@ -1019,12 +1019,24 @@ export default class Webhooks extends Command {
|
|
|
1019
1019
|
return { cols: flatten ? cols : cols.slice(0, 8), items: items };
|
|
1020
1020
|
}
|
|
1021
1021
|
getValue(row, col) {
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1022
|
+
if (!col.includes('.'))
|
|
1023
|
+
return String(row[col] ?? '');
|
|
1024
|
+
const parts = col.split('.');
|
|
1025
|
+
// Walk the dot-path; descending through an array branches into every
|
|
1026
|
+
// element so leaf values get collected from each one. Multiple leaves are
|
|
1027
|
+
// joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
|
|
1028
|
+
const walk = (o, idx) => {
|
|
1029
|
+
if (idx >= parts.length)
|
|
1030
|
+
return [o];
|
|
1031
|
+
if (o == null)
|
|
1032
|
+
return [];
|
|
1033
|
+
if (Array.isArray(o))
|
|
1034
|
+
return o.flatMap(item => walk(item, idx));
|
|
1035
|
+
if (typeof o === 'object')
|
|
1036
|
+
return walk(o[parts[idx]], idx + 1);
|
|
1037
|
+
return [];
|
|
1038
|
+
};
|
|
1039
|
+
return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
|
|
1028
1040
|
}
|
|
1029
1041
|
printTable(data, fields) {
|
|
1030
1042
|
const { cols, items } = this.getColumns(data, fields);
|
|
@@ -1011,12 +1011,24 @@ export default class Workflows extends Command {
|
|
|
1011
1011
|
return { cols: flatten ? cols : cols.slice(0, 8), items: items };
|
|
1012
1012
|
}
|
|
1013
1013
|
getValue(row, col) {
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1014
|
+
if (!col.includes('.'))
|
|
1015
|
+
return String(row[col] ?? '');
|
|
1016
|
+
const parts = col.split('.');
|
|
1017
|
+
// Walk the dot-path; descending through an array branches into every
|
|
1018
|
+
// element so leaf values get collected from each one. Multiple leaves are
|
|
1019
|
+
// joined with ';' (e.g. dunningReminders.id -> "uuid1;uuid2").
|
|
1020
|
+
const walk = (o, idx) => {
|
|
1021
|
+
if (idx >= parts.length)
|
|
1022
|
+
return [o];
|
|
1023
|
+
if (o == null)
|
|
1024
|
+
return [];
|
|
1025
|
+
if (Array.isArray(o))
|
|
1026
|
+
return o.flatMap(item => walk(item, idx));
|
|
1027
|
+
if (typeof o === 'object')
|
|
1028
|
+
return walk(o[parts[idx]], idx + 1);
|
|
1029
|
+
return [];
|
|
1030
|
+
};
|
|
1031
|
+
return walk(row, 0).filter(v => v !== undefined && v !== null).map(v => String(v)).join(';');
|
|
1020
1032
|
}
|
|
1021
1033
|
printTable(data, fields) {
|
|
1022
1034
|
const { cols, items } = this.getColumns(data, fields);
|