clever-tools 4.0.0 → 4.0.2
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 +1 -1
- package/bin/clever.js +1 -1
- package/package.json +1 -1
- package/src/commands/accesslogs.js +1 -1
- package/src/commands/activity.js +1 -1
- package/src/commands/addon.js +1 -1
- package/src/commands/applications.js +1 -1
- package/src/commands/cancel-deploy.js +1 -1
- package/src/commands/config.js +1 -1
- package/src/commands/create.js +1 -1
- package/src/commands/curl.js +1 -1
- package/src/commands/delete.js +1 -1
- package/src/commands/deploy.js +1 -1
- package/src/commands/diag.js +1 -1
- package/src/commands/domain.js +1 -1
- package/src/commands/emails.js +1 -1
- package/src/commands/env.js +1 -1
- package/src/commands/kv.js +1 -1
- package/src/commands/link.js +1 -1
- package/src/commands/login.js +1 -1
- package/src/commands/logs.js +1 -1
- package/src/commands/makeDefault.js +1 -1
- package/src/commands/ng.js +1 -1
- package/src/commands/notify-email.js +1 -1
- package/src/commands/profile.js +1 -1
- package/src/commands/restart.js +1 -1
- package/src/commands/service.js +1 -1
- package/src/commands/ssh-keys.js +1 -1
- package/src/commands/status.js +1 -1
- package/src/commands/tcp-redirs.js +1 -1
- package/src/commands/tokens.js +1 -1
- package/src/commands/unlink.js +1 -1
- package/src/commands/webhooks.js +1 -1
- package/src/lib/ng-print.js +1 -1
- package/src/lib/operator-commands.js +1 -1
- package/src/lib/style-text.js +15 -0
- package/src/logger.js +2 -1
- package/src/models/application.js +1 -1
- package/src/models/exit-strategy-option.js +1 -1
- package/src/models/log-v4.js +1 -1
- package/src/models/log.js +1 -1
- package/src/models/ng-resources.js +1 -1
- package/src/models/ng.js +1 -1
- package/src/models/operator.js +1 -1
- package/src/models/send-to-api.js +1 -1
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ For Node.js users, npm is the fastest way. For other installation methods includ
|
|
|
39
39
|
- Docker images
|
|
40
40
|
- Binary downloads
|
|
41
41
|
- Native packages (RPM, DEB)
|
|
42
|
-
- Package managers (Homebrew,
|
|
42
|
+
- Package managers (Homebrew, WinGet, AUR)
|
|
43
43
|
|
|
44
44
|
See our complete [setup guide](docs/setup-systems.md).
|
|
45
45
|
|
package/bin/clever.js
CHANGED
|
@@ -7,7 +7,6 @@ import '../src/initial-update-notifier.js';
|
|
|
7
7
|
import cliparse from 'cliparse';
|
|
8
8
|
import cliparseCommands from 'cliparse/src/command.js';
|
|
9
9
|
import _sortBy from 'lodash/sortBy.js';
|
|
10
|
-
import { styleText } from 'node:util';
|
|
11
10
|
import pkg from '../package.json' with { type: 'json' };
|
|
12
11
|
import { getExitOnOption, getOutputFormatOption, getSameCommitPolicyOption } from '../src/command-options.js';
|
|
13
12
|
import { handleCommandPromise } from '../src/command-promise-handler.js';
|
|
@@ -57,6 +56,7 @@ import * as unlink from '../src/commands/unlink.js';
|
|
|
57
56
|
import * as version from '../src/commands/version.js';
|
|
58
57
|
import * as webhooks from '../src/commands/webhooks.js';
|
|
59
58
|
import { EXPERIMENTAL_FEATURES } from '../src/experimental-features.js';
|
|
59
|
+
import { styleText } from '../src/lib/style-text.js';
|
|
60
60
|
import * as Addon from '../src/models/addon.js';
|
|
61
61
|
import * as Application from '../src/models/application.js';
|
|
62
62
|
import { AVAILABLE_ZONES } from '../src/models/application.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApplicationAccessLogStream } from '@clevercloud/client/esm/streams/access-logs.js';
|
|
2
|
-
import { styleText } from 'node:util';
|
|
3
2
|
import { formatTable } from '../format-table.js';
|
|
3
|
+
import { styleText } from '../lib/style-text.js';
|
|
4
4
|
import { Logger } from '../logger.js';
|
|
5
5
|
import * as Application from '../models/application.js';
|
|
6
6
|
import { JsonArray } from '../models/json-array.js';
|
package/src/commands/activity.js
CHANGED
package/src/commands/addon.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cancelDeployment, getAllDeployments } from '@clevercloud/client/esm/api/v2/application.js';
|
|
2
|
-
import { styleText } from '
|
|
2
|
+
import { styleText } from '../lib/style-text.js';
|
|
3
3
|
import { Logger } from '../logger.js';
|
|
4
4
|
import * as Application from '../models/application.js';
|
|
5
5
|
import { sendToApi } from '../models/send-to-api.js';
|
package/src/commands/config.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { styleText } from '
|
|
1
|
+
import { styleText } from '../lib/style-text.js';
|
|
2
2
|
import { Logger } from '../logger.js';
|
|
3
3
|
import * as Application from '../models/application.js';
|
|
4
4
|
import * as ApplicationConfiguration from '../models/application_configuration.js';
|
package/src/commands/create.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
-
import { styleText } from '
|
|
2
|
+
import { styleText } from '../lib/style-text.js';
|
|
3
3
|
import { Logger } from '../logger.js';
|
|
4
4
|
import * as AppConfig from '../models/app_configuration.js';
|
|
5
5
|
import * as Application from '../models/application.js';
|
package/src/commands/curl.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { addOauthHeader } from '@clevercloud/client/esm/oauth.js';
|
|
2
2
|
import dedent from 'dedent';
|
|
3
3
|
import { spawn } from 'node:child_process';
|
|
4
|
-
import { styleText } from '
|
|
4
|
+
import { styleText } from '../lib/style-text.js';
|
|
5
5
|
import { Logger } from '../logger.js';
|
|
6
6
|
import { conf, loadOAuthConf } from '../models/configuration.js';
|
|
7
7
|
|
package/src/commands/delete.js
CHANGED
package/src/commands/deploy.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getAllDeployments } from '@clevercloud/client/esm/api/v2/application.js';
|
|
2
2
|
import dedent from 'dedent';
|
|
3
|
-
import { styleText } from '
|
|
3
|
+
import { styleText } from '../lib/style-text.js';
|
|
4
4
|
import { Logger } from '../logger.js';
|
|
5
5
|
import * as AppConfig from '../models/app_configuration.js';
|
|
6
6
|
import * as Application from '../models/application.js';
|
package/src/commands/diag.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { releaseInfo as getLinuxInfos } from 'linux-release-info';
|
|
2
2
|
import os from 'node:os';
|
|
3
|
-
import { styleText } from 'node:util';
|
|
4
3
|
import pkg from '../../package.json' with { type: 'json' };
|
|
4
|
+
import { styleText } from '../lib/style-text.js';
|
|
5
5
|
import { Logger } from '../logger.js';
|
|
6
6
|
import { conf, loadOAuthConf } from '../models/configuration.js';
|
|
7
7
|
import * as User from '../models/user.js';
|
package/src/commands/domain.js
CHANGED
|
@@ -12,8 +12,8 @@ import { getDefaultLoadBalancersDnsInfo } from '@clevercloud/client/esm/api/v4/l
|
|
|
12
12
|
import { diagDomainConfig } from '@clevercloud/client/esm/utils/diag-domain-config.js';
|
|
13
13
|
import { sortDomains } from '@clevercloud/client/esm/utils/domains.js';
|
|
14
14
|
import _ from 'lodash';
|
|
15
|
-
import { styleText } from 'node:util';
|
|
16
15
|
import { parse as parseDomain } from 'tldts';
|
|
16
|
+
import { styleText } from '../lib/style-text.js';
|
|
17
17
|
import { Logger } from '../logger.js';
|
|
18
18
|
import * as Application from '../models/application.js';
|
|
19
19
|
import { DnsResolver } from '../models/node-dns-resolver.js';
|
package/src/commands/emails.js
CHANGED
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
todo_getEmailAddresses as getEmailAddresses,
|
|
4
4
|
todo_removeEmailAddress as removeEmailAddress,
|
|
5
5
|
} from '@clevercloud/client/esm/api/v2/user.js';
|
|
6
|
-
import { styleText } from 'node:util';
|
|
7
6
|
import { confirm } from '../lib/prompts.js';
|
|
7
|
+
import { styleText } from '../lib/style-text.js';
|
|
8
8
|
import { Logger } from '../logger.js';
|
|
9
9
|
import { sendToApi } from '../models/send-to-api.js';
|
|
10
10
|
import * as User from '../models/user.js';
|
package/src/commands/env.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
updateEnvVar,
|
|
8
8
|
} from '@clevercloud/client/esm/api/v2/application.js';
|
|
9
9
|
import { toNameEqualsValueString, validateName } from '@clevercloud/client/esm/utils/env-vars.js';
|
|
10
|
-
import { styleText } from '
|
|
10
|
+
import { styleText } from '../lib/style-text.js';
|
|
11
11
|
import { Logger } from '../logger.js';
|
|
12
12
|
import * as Application from '../models/application.js';
|
|
13
13
|
import { sendToApi } from '../models/send-to-api.js';
|
package/src/commands/kv.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getAllEnvVars } from '@clevercloud/client/esm/api/v2/addon.js';
|
|
2
2
|
import Redis from 'ioredis';
|
|
3
|
-
import { styleText } from '
|
|
3
|
+
import { styleText } from '../lib/style-text.js';
|
|
4
4
|
import { Logger } from '../logger.js';
|
|
5
5
|
import { findAddonsByNameOrId } from '../models/ids-resolver.js';
|
|
6
6
|
import { sendToApi } from '../models/send-to-api.js';
|
package/src/commands/link.js
CHANGED
package/src/commands/login.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import crypto from 'node:crypto';
|
|
2
2
|
import { setTimeout as delay } from 'node:timers/promises';
|
|
3
|
-
import { styleText } from 'node:util';
|
|
4
3
|
import open from 'open';
|
|
5
4
|
import pkg from '../../package.json' with { type: 'json' };
|
|
5
|
+
import { styleText } from '../lib/style-text.js';
|
|
6
6
|
import { Logger } from '../logger.js';
|
|
7
7
|
import { conf, writeOAuthConf } from '../models/configuration.js';
|
|
8
8
|
import * as User from '../models/user.js';
|
package/src/commands/logs.js
CHANGED
package/src/commands/ng.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { styleText } from 'node:util';
|
|
2
1
|
import { printResults } from '../lib/ng-print.js';
|
|
2
|
+
import { styleText } from '../lib/style-text.js';
|
|
3
3
|
import { Logger } from '../logger.js';
|
|
4
4
|
import * as networkGroupResources from '../models/ng-resources.js';
|
|
5
5
|
import * as networkGroup from '../models/ng.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createEmailhook, deleteEmailhook, getEmailhooks } from '@clevercloud/client/esm/api/v2/notification.js';
|
|
2
|
-
import { styleText } from '
|
|
2
|
+
import { styleText } from '../lib/style-text.js';
|
|
3
3
|
import { Logger } from '../logger.js';
|
|
4
4
|
import { getOrgaIdOrUserId, getOwnerAndApp } from '../models/notification.js';
|
|
5
5
|
import { sendToApi } from '../models/send-to-api.js';
|
package/src/commands/profile.js
CHANGED
package/src/commands/restart.js
CHANGED
package/src/commands/service.js
CHANGED
package/src/commands/ssh-keys.js
CHANGED
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
} from '@clevercloud/client/esm/api/v2/user.js';
|
|
6
6
|
import dedent from 'dedent';
|
|
7
7
|
import fs from 'node:fs';
|
|
8
|
-
import { styleText } from 'node:util';
|
|
9
8
|
import { confirm } from '../lib/prompts.js';
|
|
9
|
+
import { styleText } from '../lib/style-text.js';
|
|
10
10
|
import { Logger } from '../logger.js';
|
|
11
11
|
import { sendToApi } from '../models/send-to-api.js';
|
|
12
12
|
import { openBrowser } from '../models/utils.js';
|
package/src/commands/status.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getAllInstances, get as getApplication } from '@clevercloud/client/esm/api/v2/application.js';
|
|
2
2
|
import _ from 'lodash';
|
|
3
|
-
import { styleText } from '
|
|
3
|
+
import { styleText } from '../lib/style-text.js';
|
|
4
4
|
import { Logger } from '../logger.js';
|
|
5
5
|
import * as Application from '../models/application.js';
|
|
6
6
|
import { sendToApi } from '../models/send-to-api.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { addTcpRedir, getTcpRedirs, removeTcpRedir } from '@clevercloud/client/esm/api/v2/application.js';
|
|
2
|
-
import { styleText } from 'node:util';
|
|
3
2
|
import { confirm } from '../lib/prompts.js';
|
|
3
|
+
import { styleText } from '../lib/style-text.js';
|
|
4
4
|
import { Logger } from '../logger.js';
|
|
5
5
|
import * as Application from '../models/application.js';
|
|
6
6
|
import * as Namespaces from '../models/namespaces.js';
|
package/src/commands/tokens.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import dedent from 'dedent';
|
|
2
|
-
import { styleText } from 'node:util';
|
|
3
2
|
import { createApiToken, deleteApiToken, listApiTokens } from '../clever-client/auth-bridge.js';
|
|
4
3
|
import { promptSecret } from '../lib/prompts.js';
|
|
4
|
+
import { styleText } from '../lib/style-text.js';
|
|
5
5
|
import { Logger } from '../logger.js';
|
|
6
6
|
import { conf } from '../models/configuration.js';
|
|
7
7
|
import { sendToAuthBridge } from '../models/send-to-api.js';
|
package/src/commands/unlink.js
CHANGED
package/src/commands/webhooks.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createWebhook, deleteWebhook, getWebhooks } from '@clevercloud/client/esm/api/v2/notification.js';
|
|
2
|
-
import { styleText } from '
|
|
2
|
+
import { styleText } from '../lib/style-text.js';
|
|
3
3
|
import { Logger } from '../logger.js';
|
|
4
4
|
import { getOrgaIdOrUserId, getOwnerAndApp } from '../models/notification.js';
|
|
5
5
|
import { sendToApi } from '../models/send-to-api.js';
|
package/src/lib/ng-print.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import dedent from 'dedent';
|
|
2
2
|
import _ from 'lodash';
|
|
3
|
-
import { styleText } from 'node:util';
|
|
4
3
|
import {
|
|
5
4
|
ngDisableOperator,
|
|
6
5
|
ngEnableOperator,
|
|
@@ -16,6 +15,7 @@ import * as Operator from '../models/operator.js';
|
|
|
16
15
|
import { sendToApi } from '../models/send-to-api.js';
|
|
17
16
|
import { openBrowser } from '../models/utils.js';
|
|
18
17
|
import { confirm, selectAnswer } from './prompts.js';
|
|
18
|
+
import { styleText } from './style-text.js';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Check the version of an operator
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { styleText as nativeStyleText } from 'node:util';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @param {Parameters<typeof nativeStyleText>[0]} format
|
|
5
|
+
* @param {any} value
|
|
6
|
+
*/
|
|
7
|
+
export function styleText(format, value) {
|
|
8
|
+
if (typeof value === 'string') {
|
|
9
|
+
return nativeStyleText(format, value);
|
|
10
|
+
}
|
|
11
|
+
if (typeof value === 'number' || typeof value === 'boolean') {
|
|
12
|
+
return nativeStyleText(format, String(value));
|
|
13
|
+
}
|
|
14
|
+
return '';
|
|
15
|
+
}
|
package/src/logger.js
CHANGED
|
@@ -13,8 +13,8 @@ import { getAvailableInstances } from '@clevercloud/client/esm/api/v2/product.js
|
|
|
13
13
|
import { getSummary } from '@clevercloud/client/esm/api/v2/user.js';
|
|
14
14
|
import cliparse from 'cliparse';
|
|
15
15
|
import _ from 'lodash';
|
|
16
|
-
import { styleText } from 'node:util';
|
|
17
16
|
import { confirmAnswer } from '../lib/prompts.js';
|
|
17
|
+
import { styleText } from '../lib/style-text.js';
|
|
18
18
|
import { Logger } from '../logger.js';
|
|
19
19
|
import * as AppConfiguration from './app_configuration.js';
|
|
20
20
|
import { resolveOwnerId } from './ids-resolver.js';
|
package/src/models/log-v4.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApplicationLogStream } from '@clevercloud/client/esm/streams/application-logs.js';
|
|
2
|
-
import { styleText } from '
|
|
2
|
+
import { styleText } from '../lib/style-text.js';
|
|
3
3
|
import { Logger } from '../logger.js';
|
|
4
4
|
import { conf } from './configuration.js';
|
|
5
5
|
import { waitForDeploymentEnd, waitForDeploymentStart } from './deployments.js';
|
package/src/models/log.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getOldLogs } from '@clevercloud/client/esm/api/v2/log.js';
|
|
2
2
|
import { LogsStream } from '@clevercloud/client/esm/streams/logs.node.js';
|
|
3
3
|
import _ from 'lodash';
|
|
4
|
-
import { styleText } from '
|
|
4
|
+
import { styleText } from '../lib/style-text.js';
|
|
5
5
|
import { Logger } from '../logger.js';
|
|
6
6
|
import { waitForDeploymentEnd, waitForDeploymentStart } from './deployments.js';
|
|
7
7
|
import * as ExitStrategy from './exit-strategy-option.js';
|
|
@@ -2,7 +2,7 @@ import { getSummary } from '@clevercloud/client/esm/api/v2/user.js';
|
|
|
2
2
|
import * as networkGroupApi from '@clevercloud/client/esm/api/v4/network-group.js';
|
|
3
3
|
import crypto from 'node:crypto';
|
|
4
4
|
import { setTimeout } from 'node:timers/promises';
|
|
5
|
-
import { styleText } from '
|
|
5
|
+
import { styleText } from '../lib/style-text.js';
|
|
6
6
|
import { Logger } from '../logger.js';
|
|
7
7
|
import * as networkGroup from './ng.js';
|
|
8
8
|
import { sendToApi } from './send-to-api.js';
|
package/src/models/ng.js
CHANGED
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
listNetworkGroups,
|
|
7
7
|
} from '@clevercloud/client/esm/api/v4/network-group.js';
|
|
8
8
|
import crypto from 'node:crypto';
|
|
9
|
-
import { styleText } from 'node:util';
|
|
10
9
|
import { searchNetworkGroupOrResource } from '../clever-client/ng.js';
|
|
10
|
+
import { styleText } from '../lib/style-text.js';
|
|
11
11
|
import { Logger } from '../logger.js';
|
|
12
12
|
import { checkMembersToLink } from './ng-resources.js';
|
|
13
13
|
import * as Organisation from './organisation.js';
|
package/src/models/operator.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import dedent from 'dedent';
|
|
2
|
-
import { styleText } from 'node:util';
|
|
3
2
|
import { getOperator } from '../clever-client/operators.js';
|
|
3
|
+
import { styleText } from '../lib/style-text.js';
|
|
4
4
|
import { findAddonsByNameOrId } from './ids-resolver.js';
|
|
5
5
|
import { sendToApi } from './send-to-api.js';
|
|
6
6
|
|
|
@@ -2,8 +2,8 @@ import { addOauthHeader } from '@clevercloud/client/esm/oauth.js';
|
|
|
2
2
|
import { prefixUrl } from '@clevercloud/client/esm/prefix-url.js';
|
|
3
3
|
import { request } from '@clevercloud/client/esm/request.fetch.js';
|
|
4
4
|
import { subtle as cryptoSuble } from 'node:crypto';
|
|
5
|
-
import { styleText } from 'node:util';
|
|
6
5
|
import { addOauthHeaderPlaintext } from '../clever-client/auth-bridge.js';
|
|
6
|
+
import { styleText } from '../lib/style-text.js';
|
|
7
7
|
import { Logger } from '../logger.js';
|
|
8
8
|
import { conf, loadOAuthConf } from './configuration.js';
|
|
9
9
|
|