ardent-cli-beta 0.0.10 → 0.0.12
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 +12 -5
- package/dist/auth/browser.js +1 -1
- package/dist/auth/credentials.js +1 -1
- package/dist/commands/connector/create.d.ts +19 -0
- package/dist/commands/connector/create.js +56 -0
- package/dist/commands/connector/list.d.ts +9 -0
- package/dist/commands/connector/list.js +25 -0
- package/dist/commands/member/delete.js +1 -1
- package/dist/commands/member/invite.js +1 -1
- package/dist/commands/member/list.js +1 -1
- package/dist/commands/project/create.js +2 -2
- package/dist/commands/project/delete.js +1 -1
- package/dist/commands/project/list.js +2 -2
- package/dist/commands/project/switch.js +2 -2
- package/dist/connectors/client.d.ts +25 -0
- package/dist/connectors/client.js +76 -0
- package/dist/help.js +5 -5
- package/dist/members/client.js +2 -2
- package/dist/projects/client.js +1 -1
- package/oclif.manifest.json +87 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -4,17 +4,22 @@
|
|
|
4
4
|
|
|
5
5
|
The Ardent CLI is the customer command-line client for the control-plane API.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Install the beta with `npm install --global ardent-cli-beta`, then run
|
|
8
|
+
`ardent-beta <command>`. The package registers only the `ardent-beta` executable,
|
|
9
|
+
so it can be installed alongside an existing `ardent` command.
|
|
10
|
+
|
|
11
|
+
The Oclif foundation and authentication are implemented. `ardent-beta login` opens
|
|
8
12
|
the Ardent frontend and returns the approved API key through a loopback callback
|
|
9
|
-
bound with PKCE. `ardent login --token <token>` validates and stores an existing
|
|
13
|
+
bound with PKCE. `ardent-beta login --token <token>` validates and stores an existing
|
|
10
14
|
API token for CI and automation; `ARDENT_TOKEN` supplies the same flag
|
|
11
|
-
non-interactively. `ardent status` and `ardent logout` inspect and remove that
|
|
15
|
+
non-interactively. `ardent-beta status` and `ardent-beta logout` inspect and remove that
|
|
12
16
|
local session. The CLI always talks to Ardent's production control plane. Oclif
|
|
13
17
|
provides help, version, autocomplete, and native JSON command behavior. Resource
|
|
14
18
|
context is retained from login. Project listing, creation, deletion, and local
|
|
15
19
|
context switching are implemented. Organization member listing, invitation,
|
|
16
|
-
removal, and pending-invitation cancellation are implemented
|
|
17
|
-
|
|
20
|
+
removal, and pending-invitation cancellation are implemented. Connector listing
|
|
21
|
+
and registration are implemented; registration follows connector status, while
|
|
22
|
+
credential delivery and replication readiness remain owed.
|
|
18
23
|
|
|
19
24
|
Set `ARDENT_API_URL` to point the CLI at a development control plane. Without
|
|
20
25
|
it, the CLI uses `https://production.tryardent.com`.
|
|
@@ -33,6 +38,8 @@ npm run build
|
|
|
33
38
|
./bin/run.js member invite teammate@example.com
|
|
34
39
|
./bin/run.js member invite administrator@example.com --role admin
|
|
35
40
|
./bin/run.js member delete teammate@example.com
|
|
41
|
+
./bin/run.js connector list
|
|
42
|
+
./bin/run.js connector create postgresql 'postgresql://user:password@database.example.com/app'
|
|
36
43
|
ARDENT_API_URL=http://localhost:8080 ./bin/run.js login --token <token>
|
|
37
44
|
```
|
|
38
45
|
|
package/dist/auth/browser.js
CHANGED
|
@@ -73,7 +73,7 @@ export async function loginWithBrowser(directory, options = {}) {
|
|
|
73
73
|
options.onAuthorizationURL?.(authorizationURL.toString(), opened);
|
|
74
74
|
const timeout = setTimeout(() => {
|
|
75
75
|
deadline.abort();
|
|
76
|
-
rejectLogin(new Error('Ardent CLI login timed out. Run ardent login to try again.'));
|
|
76
|
+
rejectLogin(new Error('Ardent CLI login timed out. Run ardent-beta login to try again.'));
|
|
77
77
|
}, options.timeoutMs ?? LOGIN_TIMEOUT_MS);
|
|
78
78
|
try {
|
|
79
79
|
return await completion;
|
package/dist/auth/credentials.js
CHANGED
|
@@ -55,7 +55,7 @@ export async function loadSession(directory) {
|
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
catch {
|
|
58
|
-
throw new Error(`Ardent configuration at ${configPath(directory)} is invalid. Run ardent logout, then log in again.`);
|
|
58
|
+
throw new Error(`Ardent configuration at ${configPath(directory)} is invalid. Run ardent-beta logout, then log in again.`);
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
function isProjectIdentity(value) {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ArdentCommand } from '../../command.js';
|
|
2
|
+
interface ConnectorCreation {
|
|
3
|
+
connector_id: string;
|
|
4
|
+
status: 'registered' | 'registering';
|
|
5
|
+
}
|
|
6
|
+
export default class ConnectorCreate extends ArdentCommand {
|
|
7
|
+
static args: {
|
|
8
|
+
type: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
9
|
+
url: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
10
|
+
};
|
|
11
|
+
static description: string;
|
|
12
|
+
static helpGroup: string;
|
|
13
|
+
static flags: {
|
|
14
|
+
environment: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
};
|
|
17
|
+
run(): Promise<ConnectorCreation>;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { Args, Flags, ux } from '@oclif/core';
|
|
3
|
+
import { loadSession } from '../../auth/credentials.js';
|
|
4
|
+
import { ArdentCommand } from '../../command.js';
|
|
5
|
+
import { createConnector, waitForConnectorRegistration } from '../../connectors/client.js';
|
|
6
|
+
import { terminalText } from '../../terminal.js';
|
|
7
|
+
export default class ConnectorCreate extends ArdentCommand {
|
|
8
|
+
static args = {
|
|
9
|
+
type: Args.string({ description: 'Connector type', required: true }),
|
|
10
|
+
url: Args.string({ description: 'PostgreSQL connection URL', required: true }),
|
|
11
|
+
};
|
|
12
|
+
static description = 'Register a PostgreSQL connector in the selected project';
|
|
13
|
+
static helpGroup = 'Connectors';
|
|
14
|
+
static flags = {
|
|
15
|
+
environment: Flags.string({ description: 'Environment ID (defaults to Ardent Cloud)' }),
|
|
16
|
+
name: Flags.string({ char: 'n', description: 'Connector name' }),
|
|
17
|
+
};
|
|
18
|
+
async run() {
|
|
19
|
+
const { args, flags } = await this.parse(ConnectorCreate);
|
|
20
|
+
if (!['postgres', 'postgresql'].includes(args.type.toLowerCase())) {
|
|
21
|
+
this.error(`Unsupported connector type ${JSON.stringify(args.type)}. Supported: postgresql.`);
|
|
22
|
+
}
|
|
23
|
+
const session = await loadSession(this.config.configDir);
|
|
24
|
+
if (!session?.organization)
|
|
25
|
+
this.error('You must be logged in to run this command. Run ardent-beta login.');
|
|
26
|
+
if (!session.selectedProject)
|
|
27
|
+
this.error('No project selected. Run ardent-beta project list, then ardent-beta project switch <name>.');
|
|
28
|
+
const providedName = flags.name?.trim();
|
|
29
|
+
if (flags.name !== undefined && !providedName)
|
|
30
|
+
this.error('Connector name cannot be empty.');
|
|
31
|
+
const name = providedName ?? `${session.selectedProject.name}-${randomUUID().slice(0, 8)}`;
|
|
32
|
+
const environmentID = flags.environment?.trim();
|
|
33
|
+
if (flags.environment !== undefined && !environmentID)
|
|
34
|
+
this.error('Environment ID cannot be empty.');
|
|
35
|
+
const interactive = !this.jsonEnabled() && ux.action.type === 'spinner';
|
|
36
|
+
if (interactive) {
|
|
37
|
+
ux.action.start(`${terminalText(name)} in ${terminalText(session.selectedProject.name)}`, 'registering');
|
|
38
|
+
}
|
|
39
|
+
else if (!this.jsonEnabled()) {
|
|
40
|
+
this.log(`Registering connector ${terminalText(name)} for project ${terminalText(session.selectedProject.name)}...`);
|
|
41
|
+
}
|
|
42
|
+
const registration = await createConnector(session.token, session.organization.id, session.selectedProject.id, environmentID, name, args.url);
|
|
43
|
+
if (!interactive) {
|
|
44
|
+
if (!this.jsonEnabled()) {
|
|
45
|
+
this.log(`Connector registration started (${terminalText(registration.connector_id)}).`);
|
|
46
|
+
}
|
|
47
|
+
return { connector_id: registration.connector_id, status: 'registering' };
|
|
48
|
+
}
|
|
49
|
+
await waitForConnectorRegistration(session.token, registration.connector_id, (status) => {
|
|
50
|
+
ux.action.status = status;
|
|
51
|
+
});
|
|
52
|
+
ux.action.stop(ux.colorize('green', '✓ registered'));
|
|
53
|
+
this.log('Credential delivery and replication readiness are still pending.');
|
|
54
|
+
return { connector_id: registration.connector_id, status: 'registered' };
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ArdentCommand } from '../../command.js';
|
|
2
|
+
import { type Connector } from '../../connectors/client.js';
|
|
3
|
+
export default class ConnectorList extends ArdentCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static helpGroup: string;
|
|
6
|
+
run(): Promise<{
|
|
7
|
+
connectors: Connector[];
|
|
8
|
+
}>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { loadSession } from '../../auth/credentials.js';
|
|
2
|
+
import { ArdentCommand } from '../../command.js';
|
|
3
|
+
import { listConnectors } from '../../connectors/client.js';
|
|
4
|
+
import { terminalText } from '../../terminal.js';
|
|
5
|
+
export default class ConnectorList extends ArdentCommand {
|
|
6
|
+
static description = 'List connectors in the selected project';
|
|
7
|
+
static helpGroup = 'Connectors';
|
|
8
|
+
async run() {
|
|
9
|
+
const session = await loadSession(this.config.configDir);
|
|
10
|
+
if (!session?.organization)
|
|
11
|
+
this.error('You must be logged in to run this command. Run ardent-beta login.');
|
|
12
|
+
if (!session.selectedProject)
|
|
13
|
+
this.error('No project selected. Run ardent-beta project list, then ardent-beta project switch <name>.');
|
|
14
|
+
const connectors = await listConnectors(session.token, session.organization.id, session.selectedProject.id);
|
|
15
|
+
if (!this.jsonEnabled()) {
|
|
16
|
+
if (connectors.length === 0)
|
|
17
|
+
this.log('No connectors found.');
|
|
18
|
+
const nameWidth = Math.max(0, ...connectors.map(({ name }) => terminalText(name).length));
|
|
19
|
+
for (const connector of connectors) {
|
|
20
|
+
this.log(`${terminalText(connector.name).padEnd(nameWidth)} ${terminalText(connector.status)}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return { connectors };
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -16,7 +16,7 @@ export default class MemberDelete extends ArdentCommand {
|
|
|
16
16
|
this.error('Email cannot be empty.');
|
|
17
17
|
const session = await loadSession(this.config.configDir);
|
|
18
18
|
if (!session?.organization)
|
|
19
|
-
this.error('You must be logged in to run this command. Run ardent login.');
|
|
19
|
+
this.error('You must be logged in to run this command. Run ardent-beta login.');
|
|
20
20
|
const [memberships, invitations] = await Promise.all([
|
|
21
21
|
listMemberships(session.token, session.organization.id),
|
|
22
22
|
listInvitations(session.token, session.organization.id),
|
|
@@ -25,7 +25,7 @@ export default class MemberInvite extends ArdentCommand {
|
|
|
25
25
|
this.error('Email cannot be empty.');
|
|
26
26
|
const session = await loadSession(this.config.configDir);
|
|
27
27
|
if (!session?.organization)
|
|
28
|
-
this.error('You must be logged in to run this command. Run ardent login.');
|
|
28
|
+
this.error('You must be logged in to run this command. Run ardent-beta login.');
|
|
29
29
|
const role = roles[flags.role];
|
|
30
30
|
const invitation = await inviteMember(session.token, session.organization.id, email, role);
|
|
31
31
|
if (!this.jsonEnabled())
|
|
@@ -8,7 +8,7 @@ export default class MemberList extends ArdentCommand {
|
|
|
8
8
|
async run() {
|
|
9
9
|
const session = await loadSession(this.config.configDir);
|
|
10
10
|
if (!session?.organization)
|
|
11
|
-
this.error('You must be logged in to run this command. Run ardent login.');
|
|
11
|
+
this.error('You must be logged in to run this command. Run ardent-beta login.');
|
|
12
12
|
const [memberships, invitations] = await Promise.all([
|
|
13
13
|
listMemberships(session.token, session.organization.id),
|
|
14
14
|
listReadableInvitations(session.token, session.organization.id),
|
|
@@ -17,9 +17,9 @@ export default class ProjectCreate extends ArdentCommand {
|
|
|
17
17
|
this.error('Project name cannot be empty.');
|
|
18
18
|
const session = await loadSession(this.config.configDir);
|
|
19
19
|
if (!session)
|
|
20
|
-
this.error('Not logged in to Ardent. Run ardent login.');
|
|
20
|
+
this.error('Not logged in to Ardent. Run ardent-beta login.');
|
|
21
21
|
if (!session.organization)
|
|
22
|
-
this.error('You must be logged in to run this command. Run ardent login.');
|
|
22
|
+
this.error('You must be logged in to run this command. Run ardent-beta login.');
|
|
23
23
|
const project = await createProject(session.token, session.organization.id, name);
|
|
24
24
|
await selectProject(this.config.configDir, session, project);
|
|
25
25
|
if (!this.jsonEnabled())
|
|
@@ -17,7 +17,7 @@ export default class ProjectDelete extends ArdentCommand {
|
|
|
17
17
|
this.error('Project name cannot be empty.');
|
|
18
18
|
const session = await loadSession(this.config.configDir);
|
|
19
19
|
if (!session?.organization)
|
|
20
|
-
this.error('You must be logged in to run this command. Run ardent login.');
|
|
20
|
+
this.error('You must be logged in to run this command. Run ardent-beta login.');
|
|
21
21
|
const projects = await listProjects(session.token, session.organization.id);
|
|
22
22
|
const project = projects.find((candidate) => candidate.name === name);
|
|
23
23
|
if (!project)
|
|
@@ -10,9 +10,9 @@ export default class ProjectList extends ArdentCommand {
|
|
|
10
10
|
async run() {
|
|
11
11
|
const session = await loadSession(this.config.configDir);
|
|
12
12
|
if (!session)
|
|
13
|
-
this.error('Not logged in to Ardent. Run ardent login.');
|
|
13
|
+
this.error('Not logged in to Ardent. Run ardent-beta login.');
|
|
14
14
|
if (!session.organization)
|
|
15
|
-
this.error('You must be logged in to run this command. Run ardent login.');
|
|
15
|
+
this.error('You must be logged in to run this command. Run ardent-beta login.');
|
|
16
16
|
const projects = await listProjects(session.token, session.organization.id);
|
|
17
17
|
const refreshedSession = await replaceProjectCache(this.config.configDir, session, projects);
|
|
18
18
|
if (!this.jsonEnabled()) {
|
|
@@ -16,10 +16,10 @@ export default class ProjectSwitch extends ArdentCommand {
|
|
|
16
16
|
this.error('Project name cannot be empty.');
|
|
17
17
|
const session = await loadSession(this.config.configDir);
|
|
18
18
|
if (!session?.organization)
|
|
19
|
-
this.error('You must be logged in to run this command. Run ardent login.');
|
|
19
|
+
this.error('You must be logged in to run this command. Run ardent-beta login.');
|
|
20
20
|
const project = cachedProjectNamed(session, name);
|
|
21
21
|
if (!project)
|
|
22
|
-
this.error(`Project ${JSON.stringify(name)} not found. Run ardent project list.`);
|
|
22
|
+
this.error(`Project ${JSON.stringify(name)} not found. Run ardent-beta project list.`);
|
|
23
23
|
await selectProject(this.config.configDir, session, project);
|
|
24
24
|
if (!this.jsonEnabled())
|
|
25
25
|
this.log(`✓ Switched to project ${terminalText(project.name)}`);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface Connector {
|
|
2
|
+
created_at: string;
|
|
3
|
+
environment_id: string;
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
project_id: string;
|
|
7
|
+
source: {
|
|
8
|
+
database: string;
|
|
9
|
+
host: string;
|
|
10
|
+
port: number;
|
|
11
|
+
};
|
|
12
|
+
status: string;
|
|
13
|
+
updated_at: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ConnectorRegistration {
|
|
16
|
+
connector_id: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ConnectorRegistrationStatus {
|
|
19
|
+
connector_id: string;
|
|
20
|
+
failure?: string;
|
|
21
|
+
status: 'failed' | 'registered' | 'registering';
|
|
22
|
+
}
|
|
23
|
+
export declare function listConnectors(token: string, organizationID: string, projectID: string): Promise<Connector[]>;
|
|
24
|
+
export declare function createConnector(token: string, organizationID: string, projectID: string, environmentID: string | undefined, name: string, url: string): Promise<ConnectorRegistration>;
|
|
25
|
+
export declare function waitForConnectorRegistration(token: string, connectorID: string, onStatus?: (status: ConnectorRegistrationStatus['status']) => void): Promise<ConnectorRegistrationStatus>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { request } from '../api/client.js';
|
|
3
|
+
export async function listConnectors(token, organizationID, projectID) {
|
|
4
|
+
const query = new URLSearchParams({ organization_id: organizationID, project_id: projectID });
|
|
5
|
+
const connectors = await request(token, `/connectors?${query}`);
|
|
6
|
+
if (!Array.isArray(connectors) || connectors.some((connector) => !isConnector(connector, projectID))) {
|
|
7
|
+
throw new Error('Ardent API returned an invalid connectors response.');
|
|
8
|
+
}
|
|
9
|
+
return connectors;
|
|
10
|
+
}
|
|
11
|
+
export async function createConnector(token, organizationID, projectID, environmentID, name, url) {
|
|
12
|
+
const requestID = randomUUID();
|
|
13
|
+
const registration = await request(token, '/connectors', {
|
|
14
|
+
body: JSON.stringify({
|
|
15
|
+
...(environmentID ? { environment_id: environmentID } : {}),
|
|
16
|
+
name,
|
|
17
|
+
organization_id: organizationID,
|
|
18
|
+
project_id: projectID,
|
|
19
|
+
request_id: requestID,
|
|
20
|
+
url,
|
|
21
|
+
}),
|
|
22
|
+
method: 'POST',
|
|
23
|
+
});
|
|
24
|
+
if (!isConnectorRegistration(registration))
|
|
25
|
+
throw new Error('Ardent API returned an invalid connector registration response.');
|
|
26
|
+
return registration;
|
|
27
|
+
}
|
|
28
|
+
export async function waitForConnectorRegistration(token, connectorID, onStatus) {
|
|
29
|
+
for (;;) {
|
|
30
|
+
const status = await request(token, `/connectors/${encodeURIComponent(connectorID)}`);
|
|
31
|
+
if (!isConnectorRegistrationStatus(status, connectorID)) {
|
|
32
|
+
throw new Error('Ardent API returned an invalid connector registration status.');
|
|
33
|
+
}
|
|
34
|
+
onStatus?.(status.status);
|
|
35
|
+
if (status.status === 'registered')
|
|
36
|
+
return status;
|
|
37
|
+
if (status.status === 'failed')
|
|
38
|
+
throw new Error(status.failure || 'Connector registration failed.');
|
|
39
|
+
await new Promise((resolve) => setTimeout(resolve, 2000));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function isConnector(value, projectID) {
|
|
43
|
+
if (typeof value !== 'object' || value === null)
|
|
44
|
+
return false;
|
|
45
|
+
const connector = value;
|
|
46
|
+
const source = connector.source;
|
|
47
|
+
return (typeof connector.id === 'string' &&
|
|
48
|
+
connector.id.length > 0 &&
|
|
49
|
+
connector.project_id === projectID &&
|
|
50
|
+
typeof connector.environment_id === 'string' &&
|
|
51
|
+
connector.environment_id.length > 0 &&
|
|
52
|
+
typeof connector.name === 'string' &&
|
|
53
|
+
typeof connector.status === 'string' &&
|
|
54
|
+
connector.status.length > 0 &&
|
|
55
|
+
typeof source === 'object' &&
|
|
56
|
+
source !== null &&
|
|
57
|
+
typeof source.host === 'string' &&
|
|
58
|
+
Number.isInteger(source.port) &&
|
|
59
|
+
typeof source.database === 'string' &&
|
|
60
|
+
typeof connector.created_at === 'string' &&
|
|
61
|
+
typeof connector.updated_at === 'string');
|
|
62
|
+
}
|
|
63
|
+
function isConnectorRegistration(value) {
|
|
64
|
+
if (typeof value !== 'object' || value === null)
|
|
65
|
+
return false;
|
|
66
|
+
const registration = value;
|
|
67
|
+
return typeof registration.connector_id === 'string' && registration.connector_id.length > 0;
|
|
68
|
+
}
|
|
69
|
+
function isConnectorRegistrationStatus(value, connectorID) {
|
|
70
|
+
if (typeof value !== 'object' || value === null)
|
|
71
|
+
return false;
|
|
72
|
+
const status = value;
|
|
73
|
+
return (status.connector_id === connectorID &&
|
|
74
|
+
(status.status === 'registering' || status.status === 'registered' || status.status === 'failed') &&
|
|
75
|
+
(status.failure === undefined || typeof status.failure === 'string'));
|
|
76
|
+
}
|
package/dist/help.js
CHANGED
|
@@ -13,12 +13,12 @@ export default class ArdentHelp extends Help {
|
|
|
13
13
|
}
|
|
14
14
|
this.log('Get started:');
|
|
15
15
|
this.log('');
|
|
16
|
-
this.log(ux.colorize('green', ' ardent login Standard CLI login'));
|
|
17
|
-
this.log(' ardent login --token <token> Non-interactive login (CI and automation)');
|
|
16
|
+
this.log(ux.colorize('green', ' ardent-beta login Standard CLI login'));
|
|
17
|
+
this.log(' ardent-beta login --token <token> Non-interactive login (CI and automation)');
|
|
18
18
|
this.log('');
|
|
19
19
|
this.log('For all commands:');
|
|
20
20
|
this.log('');
|
|
21
|
-
this.log(' ardent --help');
|
|
21
|
+
this.log(' ardent-beta --help');
|
|
22
22
|
}
|
|
23
23
|
async authenticated() {
|
|
24
24
|
try {
|
|
@@ -31,7 +31,7 @@ export default class ArdentHelp extends Help {
|
|
|
31
31
|
showArdentHelp(authenticated) {
|
|
32
32
|
this.log(`Ardent CLI ${ux.colorize('dim', `v${this.config.version}`)}`);
|
|
33
33
|
this.log('');
|
|
34
|
-
this.log(this.section('USAGE', '$ ardent <command>'));
|
|
34
|
+
this.log(this.section('USAGE', '$ ardent-beta <command>'));
|
|
35
35
|
const groups = new Map();
|
|
36
36
|
for (const command of this.sortedCommands) {
|
|
37
37
|
if (command.hidden || command.pluginName !== this.config.name || typeof command.helpGroup !== 'string')
|
|
@@ -42,7 +42,7 @@ export default class ArdentHelp extends Help {
|
|
|
42
42
|
}
|
|
43
43
|
for (const [group, commands] of groups) {
|
|
44
44
|
const rows = commands.map((command) => {
|
|
45
|
-
const name = `ardent ${command.id.replaceAll(':', ' ')}`;
|
|
45
|
+
const name = `ardent-beta ${command.id.replaceAll(':', ' ')}`;
|
|
46
46
|
return [!authenticated && command.id === 'login' ? ux.colorize('green', name) : name, this.summary(command)];
|
|
47
47
|
});
|
|
48
48
|
this.log('');
|
package/dist/members/client.js
CHANGED
|
@@ -72,12 +72,12 @@ export async function inviteMember(token, organizationID, email, role) {
|
|
|
72
72
|
export async function deleteMembership(token, organizationID, userID) {
|
|
73
73
|
const response = await request(token, `/organizations/${encodeURIComponent(organizationID)}/memberships/${encodeURIComponent(userID)}`, { method: 'DELETE' });
|
|
74
74
|
if (response !== undefined)
|
|
75
|
-
throw new Error('Ardent API did not confirm member deletion. Run ardent member list before retrying.');
|
|
75
|
+
throw new Error('Ardent API did not confirm member deletion. Run ardent-beta member list before retrying.');
|
|
76
76
|
}
|
|
77
77
|
export async function deleteInvitation(token, organizationID, invitationID) {
|
|
78
78
|
const response = await request(token, `/organizations/${encodeURIComponent(organizationID)}/invitations/${encodeURIComponent(invitationID)}`, { method: 'DELETE' });
|
|
79
79
|
if (response !== undefined)
|
|
80
|
-
throw new Error('Ardent API did not confirm invitation cancellation. Run ardent member list before retrying.');
|
|
80
|
+
throw new Error('Ardent API did not confirm invitation cancellation. Run ardent-beta member list before retrying.');
|
|
81
81
|
}
|
|
82
82
|
function isMembership(value, organizationID) {
|
|
83
83
|
if (typeof value !== 'object' || value === null)
|
package/dist/projects/client.js
CHANGED
|
@@ -20,7 +20,7 @@ export async function createProject(token, organizationID, name) {
|
|
|
20
20
|
export async function deleteProject(token, organizationID, projectID) {
|
|
21
21
|
const response = await request(token, `/projects/${encodeURIComponent(projectID)}?organization_id=${encodeURIComponent(organizationID)}`, { method: 'DELETE' });
|
|
22
22
|
if (response !== undefined) {
|
|
23
|
-
throw new Error('Ardent API did not confirm project deletion. Run ardent project list before retrying.');
|
|
23
|
+
throw new Error('Ardent API did not confirm project deletion. Run ardent-beta project list before retrying.');
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
function isProject(value, organizationID) {
|
package/oclif.manifest.json
CHANGED
|
@@ -95,6 +95,92 @@
|
|
|
95
95
|
"status.js"
|
|
96
96
|
]
|
|
97
97
|
},
|
|
98
|
+
"connector:create": {
|
|
99
|
+
"aliases": [],
|
|
100
|
+
"args": {
|
|
101
|
+
"type": {
|
|
102
|
+
"description": "Connector type",
|
|
103
|
+
"name": "type",
|
|
104
|
+
"required": true
|
|
105
|
+
},
|
|
106
|
+
"url": {
|
|
107
|
+
"description": "PostgreSQL connection URL",
|
|
108
|
+
"name": "url",
|
|
109
|
+
"required": true
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"description": "Register a PostgreSQL connector in the selected project",
|
|
113
|
+
"flags": {
|
|
114
|
+
"json": {
|
|
115
|
+
"description": "Format output as json.",
|
|
116
|
+
"helpGroup": "GLOBAL",
|
|
117
|
+
"name": "json",
|
|
118
|
+
"allowNo": false,
|
|
119
|
+
"type": "boolean"
|
|
120
|
+
},
|
|
121
|
+
"environment": {
|
|
122
|
+
"description": "Environment ID (defaults to Ardent Cloud)",
|
|
123
|
+
"name": "environment",
|
|
124
|
+
"hasDynamicHelp": false,
|
|
125
|
+
"multiple": false,
|
|
126
|
+
"type": "option"
|
|
127
|
+
},
|
|
128
|
+
"name": {
|
|
129
|
+
"char": "n",
|
|
130
|
+
"description": "Connector name",
|
|
131
|
+
"name": "name",
|
|
132
|
+
"hasDynamicHelp": false,
|
|
133
|
+
"multiple": false,
|
|
134
|
+
"type": "option"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"hasDynamicHelp": false,
|
|
138
|
+
"hiddenAliases": [],
|
|
139
|
+
"id": "connector:create",
|
|
140
|
+
"pluginAlias": "ardent-cli-beta",
|
|
141
|
+
"pluginName": "ardent-cli-beta",
|
|
142
|
+
"pluginType": "core",
|
|
143
|
+
"strict": true,
|
|
144
|
+
"enableJsonFlag": true,
|
|
145
|
+
"helpGroup": "Connectors",
|
|
146
|
+
"isESM": true,
|
|
147
|
+
"relativePath": [
|
|
148
|
+
"dist",
|
|
149
|
+
"commands",
|
|
150
|
+
"connector",
|
|
151
|
+
"create.js"
|
|
152
|
+
]
|
|
153
|
+
},
|
|
154
|
+
"connector:list": {
|
|
155
|
+
"aliases": [],
|
|
156
|
+
"args": {},
|
|
157
|
+
"description": "List connectors in the selected project",
|
|
158
|
+
"flags": {
|
|
159
|
+
"json": {
|
|
160
|
+
"description": "Format output as json.",
|
|
161
|
+
"helpGroup": "GLOBAL",
|
|
162
|
+
"name": "json",
|
|
163
|
+
"allowNo": false,
|
|
164
|
+
"type": "boolean"
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
"hasDynamicHelp": false,
|
|
168
|
+
"hiddenAliases": [],
|
|
169
|
+
"id": "connector:list",
|
|
170
|
+
"pluginAlias": "ardent-cli-beta",
|
|
171
|
+
"pluginName": "ardent-cli-beta",
|
|
172
|
+
"pluginType": "core",
|
|
173
|
+
"strict": true,
|
|
174
|
+
"enableJsonFlag": true,
|
|
175
|
+
"helpGroup": "Connectors",
|
|
176
|
+
"isESM": true,
|
|
177
|
+
"relativePath": [
|
|
178
|
+
"dist",
|
|
179
|
+
"commands",
|
|
180
|
+
"connector",
|
|
181
|
+
"list.js"
|
|
182
|
+
]
|
|
183
|
+
},
|
|
98
184
|
"member:delete": {
|
|
99
185
|
"aliases": [],
|
|
100
186
|
"args": {
|
|
@@ -350,5 +436,5 @@
|
|
|
350
436
|
]
|
|
351
437
|
}
|
|
352
438
|
},
|
|
353
|
-
"version": "0.0.
|
|
439
|
+
"version": "0.0.12"
|
|
354
440
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ardent-cli-beta",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"description": "The Ardent command-line interface",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
8
|
-
"ardent": "./bin/run.js"
|
|
8
|
+
"ardent-beta": "./bin/run.js"
|
|
9
9
|
},
|
|
10
10
|
"main": "./dist/index.js",
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"registry": "https://registry.npmjs.org/"
|
|
23
23
|
},
|
|
24
24
|
"oclif": {
|
|
25
|
-
"bin": "ardent",
|
|
25
|
+
"bin": "ardent-beta",
|
|
26
26
|
"dirname": "ardent",
|
|
27
27
|
"commands": "./dist/commands",
|
|
28
28
|
"helpClass": "./dist/help",
|