@aderis-erp/cli 1.0.12 → 1.0.13

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.
@@ -1,7 +1,7 @@
1
1
  import { Command } from '@oclif/core';
2
- export default class AgentRuns extends Command {
2
+ export default class AgentPlatform extends Command {
3
3
  static description: string;
4
- static examples: string[];
4
+ static examples: never[];
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>>;
@@ -3,27 +3,23 @@ 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 = true;
6
+ const HAS_EXPORT = false;
7
7
  const HAS_CAMT053 = false;
8
8
  const NESTED_IMPORTS = [];
9
- const SUBCOMMANDS = [...["inbox", "inbox-counts", "inbox-files", "list", "get", "retry", "restart", "discard"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
9
+ const SUBCOMMANDS = [...["get-runs", "get-runs-runId", "runs-retry", "runs-restart", "runs-discard", "uploads", "uploads-counts", "uploads-files"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
10
10
  const ENDPOINTS = {
11
- 'inbox': { method: 'GET', path: '/v1/agent-runs/inbox', summary: 'List uploaded documents with their root pipeline run status', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
12
- 'inbox-counts': { method: 'GET', path: '/v1/agent-runs/inbox/counts', summary: 'Get per-status upload counts for the inbox status chips', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
13
- 'inbox-files': { method: 'GET', path: '/v1/agent-runs/inbox/{processingId}/files/{fileId}', summary: 'Get one uploaded file with its file-scoped agent-run tree', pathParams: ['processingId', 'fileId'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
14
- 'list': { method: 'GET', path: '/v1/agent-runs', summary: 'List agent runs for the current tenant', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
15
- 'get': { method: 'GET', path: '/v1/agent-runs/{runId}', summary: 'Get an agent-run detail by id', pathParams: ['runId'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
16
- 'retry': { method: 'POST', path: '/v1/agent-runs/{runId}/retry', summary: 'Retry an agent run from NEEDS_REVIEW with a reviewer instruction', pathParams: ['runId'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
17
- 'restart': { method: 'POST', path: '/v1/agent-runs/{runId}/restart', summary: 'Restart a FAILED agent run from its existing state', pathParams: ['runId'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
18
- 'discard': { method: 'POST', path: '/v1/agent-runs/{runId}/discard', summary: 'Discard an agent run with an optional reviewer reason', pathParams: ['runId'], hasBody: true, 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, 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
19
  };
20
- export default class AgentRuns extends Command {
21
- static description = 'Manage agent runs';
22
- static examples = [
23
- '<%= config.bin %> agent-runs list',
24
- '<%= config.bin %> agent-runs get <id>',
25
- '<%= config.bin %> agent-runs export --csv > agent-runs.csv',
26
- ];
20
+ export default class AgentPlatform extends Command {
21
+ static description = 'Manage agent platform';
22
+ static examples = [];
27
23
  static args = {
28
24
  action: Args.string({ description: 'Action: ' + SUBCOMMANDS.join(', '), required: true }),
29
25
  id: Args.string({ description: 'Resource ID (for get, update, delete operations)', required: false }),
@@ -49,7 +45,7 @@ export default class AgentRuns extends Command {
49
45
  'show-http-request': Flags.boolean({ description: 'Show HTTP request details (method, URL, body)' }),
50
46
  };
51
47
  async run() {
52
- const { args, flags } = await this.parse(AgentRuns);
48
+ const { args, flags } = await this.parse(AgentPlatform);
53
49
  // Handle import action specially
54
50
  if (args.action === 'import') {
55
51
  if (!HAS_IMPORT)
@@ -90,7 +86,7 @@ export default class AgentRuns extends Command {
90
86
  // First path param always comes from positional argument
91
87
  value = args.id;
92
88
  if (!value)
93
- this.error('Missing required argument: id. Usage: aderis agent-runs <action> <id>');
89
+ this.error('Missing required argument: id. Usage: aderis agent-platform <action> <id>');
94
90
  }
95
91
  else {
96
92
  const flagName = param.replace(/\./g, '-').replace(/([A-Z])/g, '-$1').toLowerCase().replace(/^-/, '');
@@ -739,7 +735,7 @@ export default class AgentRuns extends Command {
739
735
  }
740
736
  async runNestedImport(suffix, parentId, flags) {
741
737
  if (!parentId) {
742
- this.error(`Missing required argument: id. Usage: aderis agent-runs import-${suffix} <parent-id> --file data.json`);
738
+ this.error(`Missing required argument: id. Usage: aderis agent-platform import-${suffix} <parent-id> --file data.json`);
743
739
  }
744
740
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
745
741
  if (!context)
@@ -20,8 +20,8 @@ export default class AuthLogin extends Command {
20
20
  }),
21
21
  environment: Flags.string({
22
22
  char: 'e',
23
- description: 'Environment (dev, test, staging, live)',
24
- options: ['dev', 'test', 'staging', 'live'],
23
+ description: 'Environment (dev, staging, live)',
24
+ options: ['dev', 'staging', 'live'],
25
25
  }),
26
26
  name: Flags.string({
27
27
  description: 'Name for the new context (required with --new)',
@@ -93,7 +93,6 @@ export default class AuthLogin extends Command {
93
93
  const environment = flags.environment ? flags.environment : (await select({
94
94
  choices: [
95
95
  { description: 'Development environment', name: 'dev', value: 'dev' },
96
- { description: 'Test environment', name: 'test', value: 'test' },
97
96
  { description: 'Staging environment', name: 'staging', value: 'staging' },
98
97
  { description: 'Production environment', name: 'live', value: 'live' },
99
98
  ],
@@ -9,9 +9,9 @@ const NESTED_IMPORTS = ["notes", "contacts", "contacts-notes"];
9
9
  const SUBCOMMANDS = [...["list", "create", "get", "update", "delete", "merge", "activate", "list-notes", "create-notes", "get-notes", "update-notes", "delete-notes", "list-contacts", "create-contacts", "get-contacts", "update-contacts", "delete-contacts", "list-contacts-notes", "create-contacts-notes", "get-contacts-notes", "update-contacts-notes", "delete-contacts-notes"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
10
10
  const ENDPOINTS = {
11
11
  'list': { method: 'GET', path: '/v1/business-partners', summary: 'Get all business partners with pagination', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
12
- 'create': { method: 'POST', path: '/v1/business-partners', summary: 'Create a new business partner', pathParams: [], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['invoiceEmailCc', 'contacts', 'tagIds', 'notes'] },
12
+ 'create': { method: 'POST', path: '/v1/business-partners', summary: 'Create a new business partner', pathParams: [], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['invoiceEmailCc', 'salesOrderRecipientCc', 'salesOrderRecipientBcc', 'salesInvoiceRecipientCc', 'salesInvoiceRecipientBcc', 'contacts', 'tagIds', 'salesEarlyPaymentDiscounts', 'purchaseEarlyPaymentDiscounts', 'notes'] },
13
13
  'get': { method: 'GET', path: '/v1/business-partners/{id}', summary: 'Get a business partner by ID', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
14
- 'update': { method: 'PATCH', path: '/v1/business-partners/{id}', summary: 'Update a business partner', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['invoiceEmailCc', 'contacts', 'tagIds', 'notes'] },
14
+ 'update': { method: 'PATCH', path: '/v1/business-partners/{id}', summary: 'Update a business partner', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['invoiceEmailCc', 'salesOrderRecipientCc', 'salesOrderRecipientBcc', 'salesInvoiceRecipientCc', 'salesInvoiceRecipientBcc', 'contacts', 'tagIds', 'salesEarlyPaymentDiscounts', 'purchaseEarlyPaymentDiscounts', 'notes'] },
15
15
  'delete': { method: 'DELETE', path: '/v1/business-partners/{id}', summary: 'Delete a business partner', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
16
16
  'merge': { method: 'POST', path: '/v1/business-partners/{id}/merge', summary: 'Merge a business partner into another', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
17
17
  'activate': { method: 'POST', path: '/v1/business-partners/{id}/activate', summary: 'Activate a business partner', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
@@ -2,22 +2,26 @@ import { Command, Args, Flags } from '@oclif/core';
2
2
  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
- const HAS_IMPORT = false;
5
+ const HAS_IMPORT = true;
6
6
  const HAS_EXPORT = false;
7
7
  const HAS_CAMT053 = false;
8
8
  const NESTED_IMPORTS = [];
9
- const SUBCOMMANDS = [...["create", "get", "get-all", "delete"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
9
+ const SUBCOMMANDS = [...["create", "get", "get-all", "update", "delete", "stream"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
10
10
  const ENDPOINTS = {
11
- 'create': { method: 'POST', path: '/v1/chat', summary: 'Send a chat message and stream the assistant reply (SSE).', pathParams: [], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
12
- 'get': { method: 'GET', path: '/v1/conversations', summary: 'List the caller\'s chat conversations.', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
11
+ 'create': { method: 'POST', path: '/v1/chat', summary: 'Send a chat message and stream the assistant reply (SSE).', pathParams: [], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['attachments'] },
12
+ 'get': { method: 'GET', path: '/v1/conversations', summary: 'List the caller\'s chat conversations, most recently updated first.', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
13
13
  'get-all': { method: 'GET', path: '/v1/conversations/{id}', summary: 'Fetch one conversation with its messages.', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
14
+ 'update': { method: 'PATCH', path: '/v1/conversations/{id}', summary: 'Store client-owned UI state on a conversation.', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
14
15
  'delete': { method: 'DELETE', path: '/v1/conversations/{id}', summary: 'Delete one conversation.', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
16
+ 'stream': { method: 'GET', path: '/v1/conversations/{id}/stream', summary: 'Reattach to a conversation\'s running turn (SSE replay + follow).', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
15
17
  };
16
18
  export default class Chat extends Command {
17
19
  static description = 'Manage chat';
18
20
  static examples = [
19
21
  '<%= config.bin %> chat get <id>',
20
22
  '<%= config.bin %> chat create --data \'{...}\'',
23
+ '<%= config.bin %> chat update <id> --set field=value',
24
+ '<%= config.bin %> chat import --file data.json',
21
25
  ];
22
26
  static args = {
23
27
  action: Args.string({ description: 'Action: ' + SUBCOMMANDS.join(', '), required: true }),
@@ -17,8 +17,8 @@ export default class ConfigAdd extends Command {
17
17
  }),
18
18
  environment: Flags.string({
19
19
  char: 'e',
20
- description: 'Environment (dev, test, staging, live)',
21
- options: ['dev', 'test', 'staging', 'live'],
20
+ description: 'Environment (dev, staging, live)',
21
+ options: ['dev', 'staging', 'live'],
22
22
  }),
23
23
  force: Flags.boolean({
24
24
  char: 'f',
@@ -66,7 +66,6 @@ export default class ConfigAdd extends Command {
66
66
  choices: [
67
67
  { name: 'live (production)', value: 'live' },
68
68
  { name: 'staging', value: 'staging' },
69
- { name: 'test', value: 'test' },
70
69
  { name: 'dev (development)', value: 'dev' },
71
70
  ],
72
71
  message: 'Environment:',
@@ -0,0 +1,10 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class ConfigRename extends Command {
3
+ static args: {
4
+ oldName: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
5
+ newName: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
6
+ };
7
+ static description: string;
8
+ static examples: string[];
9
+ run(): Promise<void>;
10
+ }
@@ -0,0 +1,68 @@
1
+ import { input, select } from '@inquirer/prompts';
2
+ import { Args, Command } from '@oclif/core';
3
+ import { getContext, getCurrentContext, listContexts, renameContext } from '../../lib/config.js';
4
+ export default class ConfigRename extends Command {
5
+ static args = {
6
+ oldName: Args.string({
7
+ description: 'Current name of the context to rename',
8
+ required: false,
9
+ }),
10
+ newName: Args.string({
11
+ description: 'New name for the context',
12
+ required: false,
13
+ }),
14
+ };
15
+ static description = 'Rename a configured context';
16
+ static examples = [
17
+ '<%= config.bin %> config rename aderis-erp aderis-erp-dev',
18
+ '<%= config.bin %> config rename',
19
+ ];
20
+ async run() {
21
+ const { args } = await this.parse(ConfigRename);
22
+ let { oldName } = args;
23
+ if (!oldName) {
24
+ const contexts = listContexts();
25
+ if (contexts.length === 0) {
26
+ this.error('No contexts configured. Create one with: aderis auth login --new');
27
+ }
28
+ oldName = await select({
29
+ choices: contexts.map((c) => ({
30
+ name: `${c.name} (${c.environment})`,
31
+ value: c.name,
32
+ })),
33
+ message: 'Select a context to rename:',
34
+ });
35
+ }
36
+ if (!getContext(oldName)) {
37
+ this.error(`Context "${oldName}" not found.`);
38
+ }
39
+ let { newName } = args;
40
+ if (!newName) {
41
+ newName = await input({
42
+ message: `New name for "${oldName}":`,
43
+ validate: (value) => {
44
+ const trimmed = value.trim();
45
+ if (!trimmed)
46
+ return 'Name cannot be empty';
47
+ if (trimmed === oldName)
48
+ return 'New name must be different from the current name';
49
+ if (getContext(trimmed))
50
+ return `Context "${trimmed}" already exists`;
51
+ return true;
52
+ },
53
+ });
54
+ }
55
+ newName = newName.trim();
56
+ const wasCurrent = getCurrentContext()?.name === oldName;
57
+ try {
58
+ renameContext(oldName, newName);
59
+ }
60
+ catch (error) {
61
+ this.error(error instanceof Error ? error.message : String(error));
62
+ }
63
+ this.log(`Context "${oldName}" renamed to "${newName}".`);
64
+ if (wasCurrent) {
65
+ this.log(`"${newName}" is now your current context.`);
66
+ }
67
+ }
68
+ }
@@ -0,0 +1,43 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class DeliveryNotes extends Command {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ action: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
7
+ id: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
8
+ };
9
+ static flags: {
10
+ context: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ output: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ table: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
+ csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
+ data: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
+ file: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
+ set: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
+ 'line-item-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
+ 'note-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
+ 'file-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
20
+ page: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
21
+ limit: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
22
+ include: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
23
+ search: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
24
+ 'sort-by': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
25
+ filter: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
26
+ query: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
27
+ fields: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
28
+ sanitize: import("@oclif/core/interfaces").BooleanFlag<boolean>;
29
+ 'show-http-request': import("@oclif/core/interfaces").BooleanFlag<boolean>;
30
+ };
31
+ run(): Promise<void>;
32
+ private runImport;
33
+ private runExport;
34
+ private runCamt053Import;
35
+ private runNestedImport;
36
+ private parseFilterValue;
37
+ private filterFields;
38
+ private sanitizeOutput;
39
+ private getColumns;
40
+ private getValue;
41
+ private printTable;
42
+ private printCsv;
43
+ }