@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
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class ConfigAdd extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
'client-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
'client-secret': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
environment: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { confirm, input, select } from '@inquirer/prompts';
|
|
2
|
+
import { Command, Flags } from '@oclif/core';
|
|
3
|
+
import { addContext, DEFAULT_CLIENT_IDS, getContext } from '../../lib/config.js';
|
|
4
|
+
export default class ConfigAdd extends Command {
|
|
5
|
+
static description = 'Add a new context configuration';
|
|
6
|
+
static examples = [
|
|
7
|
+
'<%= config.bin %> config add',
|
|
8
|
+
'<%= config.bin %> config add --name my-client --environment live',
|
|
9
|
+
'<%= config.bin %> config add --name dev-context --environment dev --client-id abc123',
|
|
10
|
+
];
|
|
11
|
+
static flags = {
|
|
12
|
+
'client-id': Flags.string({
|
|
13
|
+
description: 'OAuth client ID (uses default if not specified)',
|
|
14
|
+
}),
|
|
15
|
+
'client-secret': Flags.string({
|
|
16
|
+
description: 'OAuth client secret (optional, for confidential clients)',
|
|
17
|
+
}),
|
|
18
|
+
environment: Flags.string({
|
|
19
|
+
char: 'e',
|
|
20
|
+
description: 'Environment (dev, test, live)',
|
|
21
|
+
options: ['dev', 'test', 'live'],
|
|
22
|
+
}),
|
|
23
|
+
force: Flags.boolean({
|
|
24
|
+
char: 'f',
|
|
25
|
+
default: false,
|
|
26
|
+
description: 'Overwrite existing context without prompting',
|
|
27
|
+
}),
|
|
28
|
+
name: Flags.string({
|
|
29
|
+
char: 'n',
|
|
30
|
+
description: 'Context name',
|
|
31
|
+
}),
|
|
32
|
+
};
|
|
33
|
+
async run() {
|
|
34
|
+
const { flags } = await this.parse(ConfigAdd);
|
|
35
|
+
// Get context name
|
|
36
|
+
let { name } = flags;
|
|
37
|
+
if (!name) {
|
|
38
|
+
name = await input({
|
|
39
|
+
message: 'Context name:',
|
|
40
|
+
validate(value) {
|
|
41
|
+
if (!value.trim())
|
|
42
|
+
return 'Context name is required';
|
|
43
|
+
if (!/^[a-zA-Z0-9_-]+$/.test(value)) {
|
|
44
|
+
return 'Context name can only contain letters, numbers, hyphens, and underscores';
|
|
45
|
+
}
|
|
46
|
+
return true;
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
// Check if context already exists
|
|
51
|
+
const existing = getContext(name);
|
|
52
|
+
if (existing && !flags.force) {
|
|
53
|
+
const overwrite = await confirm({
|
|
54
|
+
default: false,
|
|
55
|
+
message: `Context "${name}" already exists. Overwrite?`,
|
|
56
|
+
});
|
|
57
|
+
if (!overwrite) {
|
|
58
|
+
this.log('Aborted.');
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// Get environment
|
|
63
|
+
let environment = flags.environment;
|
|
64
|
+
if (!environment) {
|
|
65
|
+
environment = (await select({
|
|
66
|
+
choices: [
|
|
67
|
+
{ name: 'live (production)', value: 'live' },
|
|
68
|
+
{ name: 'test (staging)', value: 'test' },
|
|
69
|
+
{ name: 'dev (development)', value: 'dev' },
|
|
70
|
+
],
|
|
71
|
+
message: 'Environment:',
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
// Get client ID
|
|
75
|
+
let clientId = flags['client-id'];
|
|
76
|
+
if (!clientId) {
|
|
77
|
+
const defaultClientId = DEFAULT_CLIENT_IDS[environment];
|
|
78
|
+
if (defaultClientId) {
|
|
79
|
+
const useDefault = await confirm({
|
|
80
|
+
default: true,
|
|
81
|
+
message: `Use default client ID for ${environment}?`,
|
|
82
|
+
});
|
|
83
|
+
if (useDefault) {
|
|
84
|
+
clientId = defaultClientId;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (!clientId) {
|
|
88
|
+
clientId = await input({
|
|
89
|
+
message: 'OAuth client ID:',
|
|
90
|
+
validate: (value) => (value.trim() ? true : 'Client ID is required'),
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// Get client secret (optional)
|
|
95
|
+
let clientSecret = flags['client-secret'];
|
|
96
|
+
if (!clientSecret && !flags.name) {
|
|
97
|
+
// Only prompt for secret in interactive mode
|
|
98
|
+
const hasSecret = await confirm({
|
|
99
|
+
default: false,
|
|
100
|
+
message: 'Do you have a client secret? (for confidential clients)',
|
|
101
|
+
});
|
|
102
|
+
if (hasSecret) {
|
|
103
|
+
clientSecret = await input({
|
|
104
|
+
message: 'OAuth client secret:',
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
// Create the context
|
|
109
|
+
addContext({
|
|
110
|
+
client_id: clientId,
|
|
111
|
+
client_secret: clientSecret,
|
|
112
|
+
environment,
|
|
113
|
+
name,
|
|
114
|
+
});
|
|
115
|
+
this.log(`\nContext "${name}" created successfully.`);
|
|
116
|
+
this.log(`Environment: ${environment}`);
|
|
117
|
+
this.log(`Client ID: ${clientId}`);
|
|
118
|
+
this.log(`\nTo authenticate, run: aderis auth login`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class ConfigCurrent extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import { getCurrentContext } from '../../lib/config.js';
|
|
3
|
+
export default class ConfigCurrent extends Command {
|
|
4
|
+
static description = 'Show the current context';
|
|
5
|
+
static examples = ['<%= config.bin %> config current', '<%= config.bin %> config current --json'];
|
|
6
|
+
static flags = {
|
|
7
|
+
json: Flags.boolean({
|
|
8
|
+
default: false,
|
|
9
|
+
description: 'Output as JSON',
|
|
10
|
+
}),
|
|
11
|
+
};
|
|
12
|
+
async run() {
|
|
13
|
+
const { flags } = await this.parse(ConfigCurrent);
|
|
14
|
+
const context = getCurrentContext();
|
|
15
|
+
if (!context) {
|
|
16
|
+
if (flags.json) {
|
|
17
|
+
this.log(JSON.stringify({ current: null }, null, 2));
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
this.log('No current context configured.');
|
|
21
|
+
this.log('Create one with: aderis auth login --new');
|
|
22
|
+
}
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (flags.json) {
|
|
26
|
+
this.log(JSON.stringify({
|
|
27
|
+
authenticated: Boolean(context.tokens),
|
|
28
|
+
client_id: context.client_id,
|
|
29
|
+
environment: context.environment,
|
|
30
|
+
name: context.name,
|
|
31
|
+
tenant_id: context.tenant_id,
|
|
32
|
+
}, null, 2));
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
this.log(`Current context: ${context.name}`);
|
|
36
|
+
this.log(`Environment: ${context.environment}`);
|
|
37
|
+
this.log(`Client ID: ${context.client_id}`);
|
|
38
|
+
if (context.tenant_id) {
|
|
39
|
+
this.log(`Tenant ID: ${context.tenant_id}`);
|
|
40
|
+
}
|
|
41
|
+
this.log(`Authenticated: ${context.tokens ? 'Yes' : 'No'}`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class ConfigDelete extends Command {
|
|
3
|
+
static args: {
|
|
4
|
+
name: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { confirm, select } from '@inquirer/prompts';
|
|
2
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
3
|
+
import { deleteContext, getContext, getCurrentContext, listContexts } from '../../lib/config.js';
|
|
4
|
+
export default class ConfigDelete extends Command {
|
|
5
|
+
static args = {
|
|
6
|
+
name: Args.string({
|
|
7
|
+
description: 'Context name to delete',
|
|
8
|
+
required: false,
|
|
9
|
+
}),
|
|
10
|
+
};
|
|
11
|
+
static description = 'Delete a configured context';
|
|
12
|
+
static examples = [
|
|
13
|
+
'<%= config.bin %> config delete my-client',
|
|
14
|
+
'<%= config.bin %> config delete my-client --force',
|
|
15
|
+
];
|
|
16
|
+
static flags = {
|
|
17
|
+
force: Flags.boolean({
|
|
18
|
+
char: 'f',
|
|
19
|
+
default: false,
|
|
20
|
+
description: 'Skip confirmation prompt',
|
|
21
|
+
}),
|
|
22
|
+
};
|
|
23
|
+
async run() {
|
|
24
|
+
const { args, flags } = await this.parse(ConfigDelete);
|
|
25
|
+
let contextName = args.name;
|
|
26
|
+
if (!contextName) {
|
|
27
|
+
const contexts = listContexts();
|
|
28
|
+
if (contexts.length === 0) {
|
|
29
|
+
this.error('No contexts configured.');
|
|
30
|
+
}
|
|
31
|
+
contextName = await select({
|
|
32
|
+
choices: contexts.map((c) => ({
|
|
33
|
+
name: `${c.name} (${c.environment})`,
|
|
34
|
+
value: c.name,
|
|
35
|
+
})),
|
|
36
|
+
message: 'Select a context to delete:',
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
const context = getContext(contextName);
|
|
40
|
+
if (!context) {
|
|
41
|
+
this.error(`Context "${contextName}" not found.`);
|
|
42
|
+
}
|
|
43
|
+
const current = getCurrentContext();
|
|
44
|
+
const isCurrent = current?.name === contextName;
|
|
45
|
+
if (!flags.force) {
|
|
46
|
+
const confirmed = await confirm({
|
|
47
|
+
default: false,
|
|
48
|
+
message: `Are you sure you want to delete context "${contextName}"?${isCurrent ? ' (This is your current context)' : ''}`,
|
|
49
|
+
});
|
|
50
|
+
if (!confirmed) {
|
|
51
|
+
this.log('Cancelled.');
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
deleteContext(contextName);
|
|
56
|
+
this.log(`Context "${contextName}" deleted.`);
|
|
57
|
+
if (isCurrent) {
|
|
58
|
+
const newCurrent = getCurrentContext();
|
|
59
|
+
if (newCurrent) {
|
|
60
|
+
this.log(`Switched to context "${newCurrent.name}"`);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
this.log('\nNo contexts remaining. Create one with: aderis auth login --new');
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import { getCurrentContext, listContexts } from '../../lib/config.js';
|
|
3
|
+
export default class ConfigList extends Command {
|
|
4
|
+
static description = 'List all configured contexts';
|
|
5
|
+
static examples = ['<%= config.bin %> config list', '<%= config.bin %> config list --json'];
|
|
6
|
+
static flags = {
|
|
7
|
+
json: Flags.boolean({
|
|
8
|
+
default: false,
|
|
9
|
+
description: 'Output as JSON',
|
|
10
|
+
}),
|
|
11
|
+
};
|
|
12
|
+
async run() {
|
|
13
|
+
const { flags } = await this.parse(ConfigList);
|
|
14
|
+
const contexts = listContexts();
|
|
15
|
+
const current = getCurrentContext();
|
|
16
|
+
if (flags.json) {
|
|
17
|
+
this.log(JSON.stringify({
|
|
18
|
+
contexts: contexts.map((c) => ({
|
|
19
|
+
authenticated: Boolean(c.tokens),
|
|
20
|
+
client_id: c.client_id,
|
|
21
|
+
environment: c.environment,
|
|
22
|
+
name: c.name,
|
|
23
|
+
tenant_id: c.tenant_id,
|
|
24
|
+
})),
|
|
25
|
+
current: current?.name || null,
|
|
26
|
+
}, null, 2));
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (contexts.length === 0) {
|
|
30
|
+
this.log('No contexts configured.');
|
|
31
|
+
this.log('\nCreate a new context with: aderis auth login --new');
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
this.log('Configured contexts:\n');
|
|
35
|
+
for (const ctx of contexts) {
|
|
36
|
+
const isCurrent = current?.name === ctx.name;
|
|
37
|
+
const marker = isCurrent ? '*' : ' ';
|
|
38
|
+
const auth = ctx.tokens ? '✓' : '✗';
|
|
39
|
+
this.log(`${marker} ${ctx.name}`);
|
|
40
|
+
this.log(` Environment: ${ctx.environment}`);
|
|
41
|
+
this.log(` Client ID: ${ctx.client_id}`);
|
|
42
|
+
this.log(` Authenticated: ${auth}`);
|
|
43
|
+
if (ctx.tenant_id) {
|
|
44
|
+
this.log(` Tenant ID: ${ctx.tenant_id}`);
|
|
45
|
+
}
|
|
46
|
+
this.log('');
|
|
47
|
+
}
|
|
48
|
+
this.log('* = current context');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class ConfigUse extends Command {
|
|
3
|
+
static args: {
|
|
4
|
+
name: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { select } from '@inquirer/prompts';
|
|
2
|
+
import { Args, Command } from '@oclif/core';
|
|
3
|
+
import { getContext, listContexts, setCurrentContext } from '../../lib/config.js';
|
|
4
|
+
export default class ConfigUse extends Command {
|
|
5
|
+
static args = {
|
|
6
|
+
name: Args.string({
|
|
7
|
+
description: 'Context name to switch to',
|
|
8
|
+
required: false,
|
|
9
|
+
}),
|
|
10
|
+
};
|
|
11
|
+
static description = 'Switch to a different context';
|
|
12
|
+
static examples = ['<%= config.bin %> config use my-client', '<%= config.bin %> config use'];
|
|
13
|
+
async run() {
|
|
14
|
+
const { args } = await this.parse(ConfigUse);
|
|
15
|
+
let contextName = args.name;
|
|
16
|
+
if (!contextName) {
|
|
17
|
+
const contexts = listContexts();
|
|
18
|
+
if (contexts.length === 0) {
|
|
19
|
+
this.error('No contexts configured. Create one with: aderis auth login --new');
|
|
20
|
+
}
|
|
21
|
+
contextName = await select({
|
|
22
|
+
choices: contexts.map((c) => ({
|
|
23
|
+
name: `${c.name} (${c.environment})${c.tokens ? ' ✓' : ''}`,
|
|
24
|
+
value: c.name,
|
|
25
|
+
})),
|
|
26
|
+
message: 'Select a context:',
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
const context = getContext(contextName);
|
|
30
|
+
if (!context) {
|
|
31
|
+
this.error(`Context "${contextName}" not found.`);
|
|
32
|
+
}
|
|
33
|
+
setCurrentContext(contextName);
|
|
34
|
+
this.log(`Switched to context "${contextName}" (${context.environment})`);
|
|
35
|
+
if (!context.tokens) {
|
|
36
|
+
this.log(`\nNote: You are not logged in to this context.`);
|
|
37
|
+
this.log(`Run: aderis auth login`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class CreditCardAccounts 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
|
+
'mapping-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
|
+
page: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
|
+
limit: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
|
+
include: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
|
+
search: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
'sort-by': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
24
|
+
filter: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
25
|
+
query: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
26
|
+
fields: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
27
|
+
sanitize: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
28
|
+
'show-http-request': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
29
|
+
};
|
|
30
|
+
run(): Promise<void>;
|
|
31
|
+
private runImport;
|
|
32
|
+
private runExport;
|
|
33
|
+
private runCamt053Import;
|
|
34
|
+
private runNestedImport;
|
|
35
|
+
private filterFields;
|
|
36
|
+
private sanitizeOutput;
|
|
37
|
+
private getColumns;
|
|
38
|
+
private getValue;
|
|
39
|
+
private printTable;
|
|
40
|
+
private printCsv;
|
|
41
|
+
}
|