@aderis-erp/cli 1.0.17 → 1.1.0
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 +49 -17
- package/dist/commands/account-transaction-allocations.js +46 -14
- package/dist/commands/account-transactions.js +75 -35
- package/dist/commands/accounts.js +54 -22
- package/dist/commands/agent-platform.js +53 -21
- package/dist/commands/{nango-integrations.d.ts → agent-runs.d.ts} +1 -1
- package/dist/commands/agent-runs.js +1155 -0
- package/dist/commands/analytics.js +47 -15
- package/dist/commands/api-keys.js +49 -16
- package/dist/commands/{text-templates.d.ts → async-jobs.d.ts} +1 -1
- package/dist/commands/async-jobs.js +1158 -0
- package/dist/commands/audit-log.js +46 -14
- package/dist/commands/bank-accounts.js +63 -30
- package/dist/commands/bank-integrations.d.ts +1 -0
- package/dist/commands/bank-integrations.js +66 -31
- package/dist/commands/business-partners.js +77 -44
- package/dist/commands/chat.js +52 -19
- package/dist/commands/credit-card-accounts.d.ts +1 -0
- package/dist/commands/credit-card-accounts.js +67 -29
- package/dist/commands/delivery-notes.js +78 -44
- package/dist/commands/dunning-configs.js +49 -17
- package/dist/commands/dunning-reminders.js +52 -20
- package/dist/commands/dunning-runs.js +45 -13
- package/dist/commands/email-transactions.js +47 -15
- package/dist/commands/employees.js +76 -44
- package/dist/commands/entity-configurations.js +47 -15
- package/dist/commands/event-processor-mappings.js +49 -17
- package/dist/commands/files.js +56 -24
- package/dist/commands/health.js +49 -17
- package/dist/commands/imports.d.ts +39 -0
- package/dist/commands/{nango-integrations.js → imports.js} +61 -25
- package/dist/commands/inbox.js +52 -19
- package/dist/commands/integration-identities.d.ts +40 -0
- package/dist/commands/integration-identities.js +1151 -0
- package/dist/commands/integrations.js +47 -15
- package/dist/commands/item-categories.js +49 -17
- package/dist/commands/items.js +49 -17
- package/dist/commands/journal-lines.js +45 -13
- package/dist/commands/journals.js +68 -36
- package/dist/commands/ledgers.d.ts +3 -1
- package/dist/commands/ledgers.js +95 -34
- package/dist/commands/my-account.d.ts +39 -0
- package/dist/commands/my-account.js +1160 -0
- package/dist/commands/office-locations.js +49 -17
- package/dist/commands/payment-methods.js +54 -22
- package/dist/commands/payment-runs.js +61 -29
- package/dist/commands/payment-terms.js +50 -18
- package/dist/commands/payments.js +51 -19
- package/dist/commands/payroll-runs.d.ts +43 -0
- package/dist/commands/payroll-runs.js +1188 -0
- package/dist/commands/permissions.d.ts +39 -0
- package/dist/commands/{text-templates.js → permissions.js} +54 -30
- package/dist/commands/price-lists.js +54 -22
- package/dist/commands/processor-mappings.js +48 -16
- package/dist/commands/processors.js +55 -24
- package/dist/commands/purchase-order-types.js +49 -17
- package/dist/commands/purchase-orders.js +69 -36
- package/dist/commands/reports.js +49 -17
- package/dist/commands/roles.d.ts +39 -0
- package/dist/commands/roles.js +1152 -0
- package/dist/commands/salary-types.js +49 -17
- package/dist/commands/sales-invoices.js +84 -51
- package/dist/commands/sales-orders.js +78 -44
- package/dist/commands/saved-views.js +47 -15
- package/dist/commands/scheduled-processor-mappings.js +49 -17
- package/dist/commands/schedules.js +53 -21
- package/dist/commands/tag-configurations.js +50 -18
- package/dist/commands/tags.js +49 -17
- package/dist/commands/tax-codes.js +52 -20
- package/dist/commands/tax-matrix.js +49 -17
- package/dist/commands/templates.d.ts +39 -0
- package/dist/commands/templates.js +1157 -0
- package/dist/commands/tenants.js +52 -20
- package/dist/commands/tools.js +46 -14
- package/dist/commands/users.d.ts +42 -0
- package/dist/commands/users.js +1174 -0
- package/dist/commands/vat-declarations.d.ts +2 -0
- package/dist/commands/vat-declarations.js +72 -36
- package/dist/commands/vendor-invoices.js +81 -49
- package/dist/commands/webhooks.js +51 -19
- package/dist/commands/workflows.js +47 -15
- package/dist/lib/api-client.d.ts +6 -0
- package/dist/lib/api-client.js +13 -0
- package/dist/lib/auth/index.js +15 -4
- package/dist/lib/auth/jwks.d.ts +19 -0
- package/dist/lib/auth/jwks.js +112 -0
- package/dist/lib/auth/keycloak-provider.d.ts +23 -7
- package/dist/lib/auth/keycloak-provider.js +53 -24
- package/dist/lib/auth/tokens.d.ts +8 -3
- package/dist/lib/auth/tokens.js +8 -7
- package/dist/lib/auth/types.d.ts +5 -1
- package/oclif.manifest.json +2152 -715
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command, Args, Flags } from '@oclif/core';
|
|
2
|
-
import { apiRequest, ApiError, normalizeSortBy } from '../lib/api-client.js';
|
|
2
|
+
import { apiRequest, ApiError, isTextualMediaType, normalizeSortBy } from '../lib/api-client.js';
|
|
3
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;
|
|
@@ -8,15 +8,15 @@ const HAS_CAMT053 = false;
|
|
|
8
8
|
const NESTED_IMPORTS = [];
|
|
9
9
|
const SUBCOMMANDS = [...["get-runs", "get-runs-runId", "runs-retry", "runs-restart", "runs-discard", "uploads", "uploads-counts", "uploads-files", "usage"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
|
|
10
10
|
const ENDPOINTS = {
|
|
11
|
-
'get-runs': { method: 'GET', path: '/v1/agent-platform/runs', summary: 'List agent runs (agents-platform pass-through).', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
12
|
-
'get-runs-runId': { method: 'GET', path: '/v1/agent-platform/runs/{runId}', summary: 'Fetch one agent run (agents-platform pass-through).', pathParams: ['runId'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
13
|
-
'runs-retry': { method: 'POST', path: '/v1/agent-platform/runs/{runId}/retry', summary: 'Retry a run awaiting review (agents-platform pass-through).', pathParams: ['runId'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
14
|
-
'runs-restart': { method: 'POST', path: '/v1/agent-platform/runs/{runId}/restart', summary: 'Restart a failed run (agents-platform pass-through).', pathParams: ['runId'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
15
|
-
'runs-discard': { method: 'POST', path: '/v1/agent-platform/runs/{runId}/discard', summary: 'Discard a run (agents-platform pass-through).', pathParams: ['runId'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
16
|
-
'uploads': { method: 'GET', path: '/v1/agent-platform/uploads', summary: 'List uploads (agents-platform pass-through).', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
17
|
-
'uploads-counts': { method: 'GET', path: '/v1/agent-platform/uploads/counts', summary: 'Fetch upload counts (agents-platform pass-through).', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
18
|
-
'uploads-files': { method: 'GET', path: '/v1/agent-platform/uploads/{processingId}/files/{fileId}', summary: 'Fetch one of an upload\'s files (agents-platform pass-through).', pathParams: ['processingId', 'fileId'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
19
|
-
'usage': { method: 'GET', path: '/v1/agent-platform/usage', summary: 'Fetch tenant LLM usage report (agents-platform pass-through).', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
|
|
11
|
+
'get-runs': { method: 'GET', path: '/v1/agent-platform/runs', summary: 'List agent runs (agents-platform pass-through).', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, hasBinaryVariant: false, bodyArrayFields: [] },
|
|
12
|
+
'get-runs-runId': { method: 'GET', path: '/v1/agent-platform/runs/{runId}', summary: 'Fetch one agent run (agents-platform pass-through).', pathParams: ['runId'], hasBody: false, isMultipart: false, isBinaryResponse: false, hasBinaryVariant: false, bodyArrayFields: [] },
|
|
13
|
+
'runs-retry': { method: 'POST', path: '/v1/agent-platform/runs/{runId}/retry', summary: 'Retry a run awaiting review (agents-platform pass-through).', pathParams: ['runId'], hasBody: true, isMultipart: false, isBinaryResponse: false, hasBinaryVariant: false, bodyArrayFields: [] },
|
|
14
|
+
'runs-restart': { method: 'POST', path: '/v1/agent-platform/runs/{runId}/restart', summary: 'Restart a failed run (agents-platform pass-through).', pathParams: ['runId'], hasBody: false, isMultipart: false, isBinaryResponse: false, hasBinaryVariant: false, bodyArrayFields: [] },
|
|
15
|
+
'runs-discard': { method: 'POST', path: '/v1/agent-platform/runs/{runId}/discard', summary: 'Discard a run (agents-platform pass-through).', pathParams: ['runId'], hasBody: true, isMultipart: false, isBinaryResponse: false, hasBinaryVariant: false, bodyArrayFields: [] },
|
|
16
|
+
'uploads': { method: 'GET', path: '/v1/agent-platform/uploads', summary: 'List uploads (agents-platform pass-through).', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, hasBinaryVariant: false, bodyArrayFields: [] },
|
|
17
|
+
'uploads-counts': { method: 'GET', path: '/v1/agent-platform/uploads/counts', summary: 'Fetch upload counts (agents-platform pass-through).', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, hasBinaryVariant: false, bodyArrayFields: [] },
|
|
18
|
+
'uploads-files': { method: 'GET', path: '/v1/agent-platform/uploads/{processingId}/files/{fileId}', summary: 'Fetch one of an upload\'s files (agents-platform pass-through).', pathParams: ['processingId', 'fileId'], hasBody: false, isMultipart: false, isBinaryResponse: false, hasBinaryVariant: false, bodyArrayFields: [] },
|
|
19
|
+
'usage': { method: 'GET', path: '/v1/agent-platform/usage', summary: 'Fetch tenant LLM usage report (agents-platform pass-through).', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, hasBinaryVariant: false, bodyArrayFields: [] },
|
|
20
20
|
};
|
|
21
21
|
export default class AgentPlatform extends Command {
|
|
22
22
|
static description = 'Manage agent platform';
|
|
@@ -262,10 +262,11 @@ export default class AgentPlatform extends Command {
|
|
|
262
262
|
process.stderr.write('\n');
|
|
263
263
|
}
|
|
264
264
|
try {
|
|
265
|
-
// Binary response:
|
|
265
|
+
// Binary response: to -f / --file, or to stdout when it is redirected.
|
|
266
266
|
if (endpoint.isBinaryResponse) {
|
|
267
|
-
|
|
268
|
-
|
|
267
|
+
const toStdout = !flags.file;
|
|
268
|
+
if (toStdout && process.stdout.isTTY) {
|
|
269
|
+
this.error(`Endpoint returns a binary file. Specify the output path with -f / --file (e.g. -f report.xlsx), or redirect stdout to a file.`);
|
|
269
270
|
}
|
|
270
271
|
const binResponse = await apiRequest(endpoint.method, apiPath, {
|
|
271
272
|
params: Object.keys(queryParams).length > 0 ? queryParams : undefined,
|
|
@@ -273,24 +274,55 @@ export default class AgentPlatform extends Command {
|
|
|
273
274
|
contextName: flags.context,
|
|
274
275
|
binary: true,
|
|
275
276
|
});
|
|
276
|
-
const fsModule = await import('node:fs');
|
|
277
277
|
const binData = binResponse.data;
|
|
278
278
|
const buffer = Buffer.isBuffer(binData)
|
|
279
279
|
? binData
|
|
280
280
|
: Buffer.from(binData);
|
|
281
|
+
if (toStdout) {
|
|
282
|
+
// Nothing else may reach stdout here — it is the file.
|
|
283
|
+
process.stdout.write(buffer);
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
const fsModule = await import('node:fs');
|
|
281
287
|
fsModule.writeFileSync(flags.file, buffer);
|
|
282
288
|
this.log(`Saved ${buffer.length} bytes to ${flags.file}`);
|
|
283
289
|
return;
|
|
284
290
|
}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
+
let response;
|
|
292
|
+
if (endpoint.hasBinaryVariant) {
|
|
293
|
+
// This route answers JSON or a file depending on the request body, so the
|
|
294
|
+
// bytes are read first and the response's own content-type decides. Asking
|
|
295
|
+
// for text here would corrupt an xlsx/pdf before anything could inspect it.
|
|
296
|
+
const raw = await apiRequest(endpoint.method, apiPath, {
|
|
297
|
+
params: Object.keys(queryParams).length > 0 ? queryParams : undefined,
|
|
298
|
+
data,
|
|
299
|
+
contextName: flags.context,
|
|
300
|
+
binary: true,
|
|
301
|
+
});
|
|
302
|
+
const rawType = String(raw.headers['content-type'] || '').toLowerCase();
|
|
303
|
+
const rawData = raw.data;
|
|
304
|
+
const buffer = Buffer.isBuffer(rawData) ? rawData : Buffer.from(rawData);
|
|
305
|
+
if (!isTextualMediaType(rawType)) {
|
|
306
|
+
if (process.stdout.isTTY) {
|
|
307
|
+
this.error(`The API returned ${rawType || 'binary data'}. Redirect stdout to a file, e.g. ... > report.xlsx`);
|
|
308
|
+
}
|
|
309
|
+
// Nothing else may reach stdout here — it is the file.
|
|
310
|
+
process.stdout.write(buffer);
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
response = { data: buffer.toString('utf8'), headers: raw.headers, status: raw.status };
|
|
314
|
+
}
|
|
315
|
+
else {
|
|
316
|
+
response = await apiRequest(endpoint.method, apiPath, {
|
|
317
|
+
params: Object.keys(queryParams).length > 0 ? queryParams : undefined,
|
|
318
|
+
data,
|
|
319
|
+
contextName: flags.context,
|
|
320
|
+
acceptAny: true,
|
|
321
|
+
});
|
|
322
|
+
}
|
|
291
323
|
// Check content-type for non-JSON responses (XML, text, etc.)
|
|
292
324
|
const contentType = (response.headers['content-type'] || '').toLowerCase();
|
|
293
|
-
if (contentType
|
|
325
|
+
if (isTextualMediaType(contentType) && !contentType.startsWith('application/json')) {
|
|
294
326
|
// Output raw content for XML/text responses (CSV, plain, HTML, etc.)
|
|
295
327
|
this.log(String(response.data));
|
|
296
328
|
return;
|