@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.
Files changed (143) hide show
  1. package/README.md +244 -0
  2. package/bin/dev.cmd +3 -0
  3. package/bin/dev.js +5 -0
  4. package/bin/run.cmd +3 -0
  5. package/bin/run.js +5 -0
  6. package/dist/commands/access-groups.d.ts +39 -0
  7. package/dist/commands/access-groups.js +1004 -0
  8. package/dist/commands/account-statement-runs.d.ts +40 -0
  9. package/dist/commands/account-statement-runs.js +1004 -0
  10. package/dist/commands/account-transactions.d.ts +41 -0
  11. package/dist/commands/account-transactions.js +1020 -0
  12. package/dist/commands/accounts.d.ts +40 -0
  13. package/dist/commands/accounts.js +1012 -0
  14. package/dist/commands/agent-runs.d.ts +39 -0
  15. package/dist/commands/agent-runs.js +1001 -0
  16. package/dist/commands/audit-log.d.ts +39 -0
  17. package/dist/commands/audit-log.js +1000 -0
  18. package/dist/commands/auth/login.d.ts +14 -0
  19. package/dist/commands/auth/login.js +116 -0
  20. package/dist/commands/auth/logout.d.ts +10 -0
  21. package/dist/commands/auth/logout.js +58 -0
  22. package/dist/commands/auth/status.d.ts +12 -0
  23. package/dist/commands/auth/status.js +101 -0
  24. package/dist/commands/auth/tenant.d.ts +18 -0
  25. package/dist/commands/auth/tenant.js +168 -0
  26. package/dist/commands/auth.d.ts +37 -0
  27. package/dist/commands/auth.js +871 -0
  28. package/dist/commands/bank-accounts.d.ts +41 -0
  29. package/dist/commands/bank-accounts.js +1020 -0
  30. package/dist/commands/bank-integrations.d.ts +39 -0
  31. package/dist/commands/bank-integrations.js +1011 -0
  32. package/dist/commands/bank-statements.d.ts +40 -0
  33. package/dist/commands/bank-statements.js +998 -0
  34. package/dist/commands/business-partners---contacts.d.ts +41 -0
  35. package/dist/commands/business-partners---contacts.js +1006 -0
  36. package/dist/commands/business-partners.d.ts +40 -0
  37. package/dist/commands/business-partners.js +1012 -0
  38. package/dist/commands/config/add.d.ts +13 -0
  39. package/dist/commands/config/add.js +120 -0
  40. package/dist/commands/config/current.d.ts +9 -0
  41. package/dist/commands/config/current.js +43 -0
  42. package/dist/commands/config/delete.d.ts +12 -0
  43. package/dist/commands/config/delete.js +67 -0
  44. package/dist/commands/config/list.d.ts +9 -0
  45. package/dist/commands/config/list.js +50 -0
  46. package/dist/commands/config/use.d.ts +9 -0
  47. package/dist/commands/config/use.js +40 -0
  48. package/dist/commands/credit-card-accounts.d.ts +41 -0
  49. package/dist/commands/credit-card-accounts.js +1018 -0
  50. package/dist/commands/documents.d.ts +39 -0
  51. package/dist/commands/documents.js +1005 -0
  52. package/dist/commands/dunning-configs.d.ts +39 -0
  53. package/dist/commands/dunning-configs.js +1006 -0
  54. package/dist/commands/dunning-reminders.d.ts +39 -0
  55. package/dist/commands/dunning-reminders.js +1007 -0
  56. package/dist/commands/dunning-runs.d.ts +39 -0
  57. package/dist/commands/dunning-runs.js +995 -0
  58. package/dist/commands/employees.d.ts +43 -0
  59. package/dist/commands/employees.js +1037 -0
  60. package/dist/commands/event-processor-mappings.d.ts +39 -0
  61. package/dist/commands/event-processor-mappings.js +1005 -0
  62. package/dist/commands/files-internal.d.ts +39 -0
  63. package/dist/commands/files-internal.js +1007 -0
  64. package/dist/commands/health.d.ts +39 -0
  65. package/dist/commands/health.js +1001 -0
  66. package/dist/commands/inbox.d.ts +39 -0
  67. package/dist/commands/inbox.js +997 -0
  68. package/dist/commands/integrations.d.ts +40 -0
  69. package/dist/commands/integrations.js +1001 -0
  70. package/dist/commands/item-categories.d.ts +39 -0
  71. package/dist/commands/item-categories.js +1006 -0
  72. package/dist/commands/items.d.ts +39 -0
  73. package/dist/commands/items.js +1006 -0
  74. package/dist/commands/journal-lines.d.ts +39 -0
  75. package/dist/commands/journal-lines.js +998 -0
  76. package/dist/commands/journals.d.ts +41 -0
  77. package/dist/commands/journals.js +1022 -0
  78. package/dist/commands/ledgers.d.ts +41 -0
  79. package/dist/commands/ledgers.js +1019 -0
  80. package/dist/commands/office-locations.d.ts +39 -0
  81. package/dist/commands/office-locations.js +1006 -0
  82. package/dist/commands/payment-method-ledger-mappings.d.ts +40 -0
  83. package/dist/commands/payment-method-ledger-mappings.js +1000 -0
  84. package/dist/commands/payment-methods.d.ts +39 -0
  85. package/dist/commands/payment-methods.js +1006 -0
  86. package/dist/commands/payment-runs.d.ts +41 -0
  87. package/dist/commands/payment-runs.js +1021 -0
  88. package/dist/commands/payment-terms.d.ts +39 -0
  89. package/dist/commands/payment-terms.js +1007 -0
  90. package/dist/commands/price-lists.d.ts +40 -0
  91. package/dist/commands/price-lists.js +1012 -0
  92. package/dist/commands/processing-logs.d.ts +39 -0
  93. package/dist/commands/processing-logs.js +997 -0
  94. package/dist/commands/processor-mappings.d.ts +39 -0
  95. package/dist/commands/processor-mappings.js +1004 -0
  96. package/dist/commands/processors.d.ts +39 -0
  97. package/dist/commands/processors.js +1010 -0
  98. package/dist/commands/reconciliation.d.ts +39 -0
  99. package/dist/commands/reconciliation.js +1003 -0
  100. package/dist/commands/reports.d.ts +39 -0
  101. package/dist/commands/reports.js +996 -0
  102. package/dist/commands/salary-types.d.ts +39 -0
  103. package/dist/commands/salary-types.js +1006 -0
  104. package/dist/commands/sales-invoices.d.ts +42 -0
  105. package/dist/commands/sales-invoices.js +1033 -0
  106. package/dist/commands/sales-orders.d.ts +42 -0
  107. package/dist/commands/sales-orders.js +1030 -0
  108. package/dist/commands/switch.d.ts +6 -0
  109. package/dist/commands/switch.js +41 -0
  110. package/dist/commands/tags.d.ts +39 -0
  111. package/dist/commands/tags.js +1006 -0
  112. package/dist/commands/tax-codes.d.ts +39 -0
  113. package/dist/commands/tax-codes.js +1009 -0
  114. package/dist/commands/tax-matrix.d.ts +39 -0
  115. package/dist/commands/tax-matrix.js +1006 -0
  116. package/dist/commands/tenants.d.ts +39 -0
  117. package/dist/commands/tenants.js +1006 -0
  118. package/dist/commands/text-templates.d.ts +39 -0
  119. package/dist/commands/text-templates.js +1006 -0
  120. package/dist/commands/tools.d.ts +39 -0
  121. package/dist/commands/tools.js +999 -0
  122. package/dist/commands/vendor-invoices.d.ts +43 -0
  123. package/dist/commands/vendor-invoices.js +1037 -0
  124. package/dist/commands/webhooks.d.ts +39 -0
  125. package/dist/commands/webhooks.js +1008 -0
  126. package/dist/commands/workflows.d.ts +39 -0
  127. package/dist/commands/workflows.js +1000 -0
  128. package/dist/hooks/command-not-found.d.ts +3 -0
  129. package/dist/hooks/command-not-found.js +57 -0
  130. package/dist/index.d.ts +1 -0
  131. package/dist/index.js +1 -0
  132. package/dist/lib/api-client.d.ts +40 -0
  133. package/dist/lib/api-client.js +120 -0
  134. package/dist/lib/auth.d.ts +20 -0
  135. package/dist/lib/auth.js +431 -0
  136. package/dist/lib/base-api-command.d.ts +19 -0
  137. package/dist/lib/base-api-command.js +173 -0
  138. package/dist/lib/config.d.ts +40 -0
  139. package/dist/lib/config.js +113 -0
  140. package/dist/lib/openapi.d.ts +82 -0
  141. package/dist/lib/openapi.js +100 -0
  142. package/oclif.manifest.json +9040 -0
  143. 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
@@ -0,0 +1,3 @@
1
+ @echo off
2
+
3
+ node --loader ts-node/esm --no-warnings=ExperimentalWarning "%~dp0\dev" %*
package/bin/dev.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env -S node --loader ts-node/esm --disable-warning=ExperimentalWarning
2
+
3
+ import {execute} from '@oclif/core'
4
+
5
+ await execute({development: true, dir: import.meta.url})
package/bin/run.cmd ADDED
@@ -0,0 +1,3 @@
1
+ @echo off
2
+
3
+ node "%~dp0\run" %*
package/bin/run.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+
3
+ import {execute} from '@oclif/core'
4
+
5
+ await execute({dir: import.meta.url})
@@ -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
+ }