@aderis-erp/cli 1.0.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/README.md +244 -0
- package/bin/dev.cmd +3 -0
- package/bin/dev.js +5 -0
- package/bin/run.cmd +3 -0
- package/bin/run.js +5 -0
- package/dist/commands/access-groups.d.ts +39 -0
- package/dist/commands/access-groups.js +1004 -0
- package/dist/commands/account-statement-runs.d.ts +40 -0
- package/dist/commands/account-statement-runs.js +1004 -0
- package/dist/commands/account-transactions.d.ts +41 -0
- package/dist/commands/account-transactions.js +1020 -0
- package/dist/commands/accounts.d.ts +40 -0
- package/dist/commands/accounts.js +1012 -0
- package/dist/commands/agent-runs.d.ts +39 -0
- package/dist/commands/agent-runs.js +1001 -0
- package/dist/commands/audit-log.d.ts +39 -0
- package/dist/commands/audit-log.js +1000 -0
- package/dist/commands/auth/login.d.ts +14 -0
- package/dist/commands/auth/login.js +116 -0
- package/dist/commands/auth/logout.d.ts +10 -0
- package/dist/commands/auth/logout.js +58 -0
- package/dist/commands/auth/status.d.ts +12 -0
- package/dist/commands/auth/status.js +101 -0
- package/dist/commands/auth/tenant.d.ts +18 -0
- package/dist/commands/auth/tenant.js +168 -0
- package/dist/commands/auth.d.ts +37 -0
- package/dist/commands/auth.js +871 -0
- package/dist/commands/bank-accounts.d.ts +41 -0
- package/dist/commands/bank-accounts.js +1020 -0
- package/dist/commands/bank-integrations.d.ts +39 -0
- package/dist/commands/bank-integrations.js +1011 -0
- package/dist/commands/bank-statements.d.ts +40 -0
- package/dist/commands/bank-statements.js +998 -0
- package/dist/commands/business-partners---contacts.d.ts +41 -0
- package/dist/commands/business-partners---contacts.js +1006 -0
- package/dist/commands/business-partners.d.ts +40 -0
- package/dist/commands/business-partners.js +1012 -0
- package/dist/commands/config/add.d.ts +13 -0
- package/dist/commands/config/add.js +120 -0
- package/dist/commands/config/current.d.ts +9 -0
- package/dist/commands/config/current.js +43 -0
- package/dist/commands/config/delete.d.ts +12 -0
- package/dist/commands/config/delete.js +67 -0
- package/dist/commands/config/list.d.ts +9 -0
- package/dist/commands/config/list.js +50 -0
- package/dist/commands/config/use.d.ts +9 -0
- package/dist/commands/config/use.js +40 -0
- package/dist/commands/credit-card-accounts.d.ts +41 -0
- package/dist/commands/credit-card-accounts.js +1018 -0
- package/dist/commands/documents.d.ts +39 -0
- package/dist/commands/documents.js +1005 -0
- package/dist/commands/dunning-configs.d.ts +39 -0
- package/dist/commands/dunning-configs.js +1006 -0
- package/dist/commands/dunning-reminders.d.ts +39 -0
- package/dist/commands/dunning-reminders.js +1007 -0
- package/dist/commands/dunning-runs.d.ts +39 -0
- package/dist/commands/dunning-runs.js +995 -0
- package/dist/commands/employees.d.ts +43 -0
- package/dist/commands/employees.js +1037 -0
- package/dist/commands/event-processor-mappings.d.ts +39 -0
- package/dist/commands/event-processor-mappings.js +1005 -0
- package/dist/commands/files-internal.d.ts +39 -0
- package/dist/commands/files-internal.js +1007 -0
- package/dist/commands/health.d.ts +39 -0
- package/dist/commands/health.js +1001 -0
- package/dist/commands/inbox.d.ts +39 -0
- package/dist/commands/inbox.js +997 -0
- package/dist/commands/integrations.d.ts +40 -0
- package/dist/commands/integrations.js +1001 -0
- package/dist/commands/item-categories.d.ts +39 -0
- package/dist/commands/item-categories.js +1006 -0
- package/dist/commands/items.d.ts +39 -0
- package/dist/commands/items.js +1006 -0
- package/dist/commands/journal-lines.d.ts +39 -0
- package/dist/commands/journal-lines.js +998 -0
- package/dist/commands/journals.d.ts +41 -0
- package/dist/commands/journals.js +1022 -0
- package/dist/commands/ledgers.d.ts +41 -0
- package/dist/commands/ledgers.js +1019 -0
- package/dist/commands/office-locations.d.ts +39 -0
- package/dist/commands/office-locations.js +1006 -0
- package/dist/commands/payment-method-ledger-mappings.d.ts +40 -0
- package/dist/commands/payment-method-ledger-mappings.js +1000 -0
- package/dist/commands/payment-methods.d.ts +39 -0
- package/dist/commands/payment-methods.js +1006 -0
- package/dist/commands/payment-runs.d.ts +41 -0
- package/dist/commands/payment-runs.js +1021 -0
- package/dist/commands/payment-terms.d.ts +39 -0
- package/dist/commands/payment-terms.js +1007 -0
- package/dist/commands/price-lists.d.ts +40 -0
- package/dist/commands/price-lists.js +1012 -0
- package/dist/commands/processing-logs.d.ts +39 -0
- package/dist/commands/processing-logs.js +997 -0
- package/dist/commands/processor-mappings.d.ts +39 -0
- package/dist/commands/processor-mappings.js +1004 -0
- package/dist/commands/processors.d.ts +39 -0
- package/dist/commands/processors.js +1010 -0
- package/dist/commands/reconciliation.d.ts +39 -0
- package/dist/commands/reconciliation.js +1003 -0
- package/dist/commands/reports.d.ts +39 -0
- package/dist/commands/reports.js +996 -0
- package/dist/commands/salary-types.d.ts +39 -0
- package/dist/commands/salary-types.js +1006 -0
- package/dist/commands/sales-invoices.d.ts +42 -0
- package/dist/commands/sales-invoices.js +1033 -0
- package/dist/commands/sales-orders.d.ts +42 -0
- package/dist/commands/sales-orders.js +1030 -0
- package/dist/commands/switch.d.ts +6 -0
- package/dist/commands/switch.js +41 -0
- package/dist/commands/tags.d.ts +39 -0
- package/dist/commands/tags.js +1006 -0
- package/dist/commands/tax-codes.d.ts +39 -0
- package/dist/commands/tax-codes.js +1009 -0
- package/dist/commands/tax-matrix.d.ts +39 -0
- package/dist/commands/tax-matrix.js +1006 -0
- package/dist/commands/tenants.d.ts +39 -0
- package/dist/commands/tenants.js +1006 -0
- package/dist/commands/text-templates.d.ts +39 -0
- package/dist/commands/text-templates.js +1006 -0
- package/dist/commands/tools.d.ts +39 -0
- package/dist/commands/tools.js +999 -0
- package/dist/commands/vendor-invoices.d.ts +43 -0
- package/dist/commands/vendor-invoices.js +1037 -0
- package/dist/commands/webhooks.d.ts +39 -0
- package/dist/commands/webhooks.js +1008 -0
- package/dist/commands/workflows.d.ts +39 -0
- package/dist/commands/workflows.js +1000 -0
- package/dist/hooks/command-not-found.d.ts +3 -0
- package/dist/hooks/command-not-found.js +57 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/lib/api-client.d.ts +40 -0
- package/dist/lib/api-client.js +120 -0
- package/dist/lib/auth.d.ts +20 -0
- package/dist/lib/auth.js +431 -0
- package/dist/lib/base-api-command.d.ts +19 -0
- package/dist/lib/base-api-command.js +173 -0
- package/dist/lib/config.d.ts +40 -0
- package/dist/lib/config.js +113 -0
- package/dist/lib/openapi.d.ts +82 -0
- package/dist/lib/openapi.js +100 -0
- package/oclif.manifest.json +9040 -0
- package/package.json +91 -0
package/README.md
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
# Aderis CLI
|
|
2
|
+
|
|
3
|
+
Command-line interface for Aderis Finance ERP. Manage your Aderis account, execute API operations, and automate workflows from the terminal.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **OAuth Authentication** - Secure login with PKCE flow
|
|
8
|
+
- **Multi-Environment Support** - Switch between dev, test, and production environments
|
|
9
|
+
- **Multi-Client Support** - Manage multiple clients with named contexts
|
|
10
|
+
- **Multi-Tenant Support** - Switch between tenants within a single login
|
|
11
|
+
- **Full API Access** - Execute all Aderis API endpoints from the command line
|
|
12
|
+
- **Auto-Generated Commands** - Commands generated directly from OpenAPI spec
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install -g aderis-cli
|
|
18
|
+
aderis --help
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Or link locally for development:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm link
|
|
25
|
+
aderis --help
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
### 1. Login to Aderis
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# Create a new context and login
|
|
34
|
+
aderis auth login --new
|
|
35
|
+
|
|
36
|
+
# Follow the prompts to:
|
|
37
|
+
# - Name your context (e.g., "acme-prod")
|
|
38
|
+
# - Select environment (dev, test, live)
|
|
39
|
+
# - Enter your OAuth client ID
|
|
40
|
+
# - Complete authentication in browser
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### 2. Check Authentication Status
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
aderis auth status
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### 3. Make API Calls
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# List accounts
|
|
53
|
+
aderis accounts list
|
|
54
|
+
|
|
55
|
+
# Get a specific account
|
|
56
|
+
aderis accounts get --id <account-id>
|
|
57
|
+
|
|
58
|
+
# Create a new business partner
|
|
59
|
+
aderis business-partners create --data '{"name": "Acme Corp", "type": "customer"}'
|
|
60
|
+
|
|
61
|
+
# List invoices with pagination
|
|
62
|
+
aderis sales-invoices list --page 1 --limit 20
|
|
63
|
+
|
|
64
|
+
# Use table output for better readability
|
|
65
|
+
aderis accounts list --output table
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Managing Contexts
|
|
69
|
+
|
|
70
|
+
Contexts allow you to manage multiple Aderis clients and environments.
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# List all contexts
|
|
74
|
+
aderis config list
|
|
75
|
+
|
|
76
|
+
# Switch to a different context
|
|
77
|
+
aderis config use my-other-client
|
|
78
|
+
|
|
79
|
+
# Show current context
|
|
80
|
+
aderis config current
|
|
81
|
+
|
|
82
|
+
# Delete a context
|
|
83
|
+
aderis config delete old-context
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Authentication
|
|
87
|
+
|
|
88
|
+
### Login
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Login with current context
|
|
92
|
+
aderis auth login
|
|
93
|
+
|
|
94
|
+
# Login with a specific context
|
|
95
|
+
aderis auth login --context my-client
|
|
96
|
+
|
|
97
|
+
# Create a new context and login
|
|
98
|
+
aderis auth login --new --name my-client --environment dev --client-id YOUR_CLIENT_ID
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Logout
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# Logout from current context
|
|
105
|
+
aderis auth logout
|
|
106
|
+
|
|
107
|
+
# Logout from all contexts
|
|
108
|
+
aderis auth logout --all
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Tenant Management
|
|
112
|
+
|
|
113
|
+
If your account has access to multiple tenants, you can switch between them:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
# Show current tenant
|
|
117
|
+
aderis auth tenant show
|
|
118
|
+
|
|
119
|
+
# List all available tenants
|
|
120
|
+
aderis auth tenant list
|
|
121
|
+
|
|
122
|
+
# Interactive tenant selection
|
|
123
|
+
aderis auth tenant
|
|
124
|
+
|
|
125
|
+
# Switch to a specific tenant
|
|
126
|
+
aderis auth tenant switch <tenant-id>
|
|
127
|
+
|
|
128
|
+
# Output as JSON
|
|
129
|
+
aderis auth tenant list --json
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## API Commands
|
|
133
|
+
|
|
134
|
+
All API endpoints from the Aderis OpenAPI spec are available as CLI commands.
|
|
135
|
+
|
|
136
|
+
### Command Structure
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
aderis <resource> <action> [flags]
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Available Resources
|
|
143
|
+
|
|
144
|
+
- `accounts` - Chart of accounts
|
|
145
|
+
- `account-transactions` - Account transactions
|
|
146
|
+
- `bank-accounts` - Bank account management
|
|
147
|
+
- `business-partners` - Customers and vendors
|
|
148
|
+
- `credit-card-accounts` - Credit card accounts
|
|
149
|
+
- `employees` - Employee management
|
|
150
|
+
- `files` - File uploads and downloads
|
|
151
|
+
- `items` - Product/service items
|
|
152
|
+
- `item-categories` - Item categorization
|
|
153
|
+
- `journals` - Journal entries
|
|
154
|
+
- `ledgers` - General ledger
|
|
155
|
+
- `office-locations` - Office locations
|
|
156
|
+
- `payment-methods` - Payment methods
|
|
157
|
+
- `payment-runs` - Payment batches
|
|
158
|
+
- `payment-terms` - Payment terms
|
|
159
|
+
- `price-lists` - Pricing
|
|
160
|
+
- `sales-invoices` - Sales invoices
|
|
161
|
+
- `sales-orders` - Sales orders
|
|
162
|
+
- `tags` - Tagging system
|
|
163
|
+
- `tax-codes` - Tax codes
|
|
164
|
+
- `tax-matrix` - Tax matrix
|
|
165
|
+
- `tenants` - Tenant management
|
|
166
|
+
- `vendor-invoices` - Vendor invoices
|
|
167
|
+
- `webhooks` - Webhook configuration
|
|
168
|
+
- `workflows` - Workflow management
|
|
169
|
+
|
|
170
|
+
### Common Flags
|
|
171
|
+
|
|
172
|
+
| Flag | Description |
|
|
173
|
+
|------|-------------|
|
|
174
|
+
| `-c, --context` | Use a specific context |
|
|
175
|
+
| `-o, --output` | Output format: `json` (default) or `table` |
|
|
176
|
+
| `-d, --data` | JSON data for request body |
|
|
177
|
+
| `-f, --file` | Read request body from file |
|
|
178
|
+
| `--page` | Page number for pagination |
|
|
179
|
+
| `--limit` | Items per page |
|
|
180
|
+
| `--include` | Relations to include |
|
|
181
|
+
| `--search` | Search term |
|
|
182
|
+
| `--sort-by` | Sort field and direction |
|
|
183
|
+
| `--query` | Additional query params as JSON |
|
|
184
|
+
|
|
185
|
+
### Examples
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
# List sales invoices with filters
|
|
189
|
+
aderis sales-invoices list --search "ACME" --limit 50
|
|
190
|
+
|
|
191
|
+
# Create an invoice from a file
|
|
192
|
+
aderis sales-invoices create --file invoice.json
|
|
193
|
+
|
|
194
|
+
# Approve a sales invoice
|
|
195
|
+
aderis sales-invoices approve --id INV-001
|
|
196
|
+
|
|
197
|
+
# Get invoice with related data
|
|
198
|
+
aderis sales-invoices get --id INV-001 --include "customer,lineItems"
|
|
199
|
+
|
|
200
|
+
# Delete an item
|
|
201
|
+
aderis items delete --id ITEM-123
|
|
202
|
+
|
|
203
|
+
# Use advanced query filters
|
|
204
|
+
aderis accounts list --query '{"filter.type": "$eq:asset"}'
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Configuration
|
|
208
|
+
|
|
209
|
+
Configuration is stored in `~/.aderis/config.json`.
|
|
210
|
+
|
|
211
|
+
### Environments
|
|
212
|
+
|
|
213
|
+
| Environment | Auth URL | API URL |
|
|
214
|
+
|-------------|----------|---------|
|
|
215
|
+
| dev | https://auth-dev.aderis.com | https://api-dev.aderis.com |
|
|
216
|
+
| test | https://auth-test.aderis.com | https://api-test.aderis.com |
|
|
217
|
+
| live | https://auth.aderis.com | https://api.aderis.com |
|
|
218
|
+
|
|
219
|
+
## Development
|
|
220
|
+
|
|
221
|
+
### Generate API Commands
|
|
222
|
+
|
|
223
|
+
When the OpenAPI spec is updated, regenerate commands:
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
npm run generate
|
|
227
|
+
npm run build
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### Build
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
npm run build
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Run Locally
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
./bin/dev.js --help
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## License
|
|
243
|
+
|
|
244
|
+
MIT
|
package/bin/dev.cmd
ADDED
package/bin/dev.js
ADDED
package/bin/run.cmd
ADDED
package/bin/run.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class AccessGroups 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
|
+
page: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
limit: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
include: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
|
+
search: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
|
+
'sort-by': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
|
+
filter: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
query: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
24
|
+
fields: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
25
|
+
sanitize: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
26
|
+
'show-http-request': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
27
|
+
};
|
|
28
|
+
run(): Promise<void>;
|
|
29
|
+
private runImport;
|
|
30
|
+
private runExport;
|
|
31
|
+
private runCamt053Import;
|
|
32
|
+
private runNestedImport;
|
|
33
|
+
private filterFields;
|
|
34
|
+
private sanitizeOutput;
|
|
35
|
+
private getColumns;
|
|
36
|
+
private getValue;
|
|
37
|
+
private printTable;
|
|
38
|
+
private printCsv;
|
|
39
|
+
}
|