clever-tools
Version:
Command Line Interface for Clever Cloud.
16 lines (12 loc) • 600 B
JavaScript
import { getNamespaces as getTcpRedirNamespaces } from '@clevercloud/client/esm/api/v2/organisation.js';
import cliparse from 'cliparse';
import * as Application from './application.js';
import { sendToApi } from './send-to-api.js';
export async function getNamespaces(ownerId) {
return getTcpRedirNamespaces({ id: ownerId }).then(sendToApi);
}
export async function completeNamespaces() {
// Sadly we do not have access to current params in complete as of now
const { ownerId } = await Application.resolveId(null, null);
return getNamespaces(ownerId).then(cliparse.autocomplete.words);
}