clever-tools 4.10.0 → 5.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/bin/clever.js +5 -10
- package/package.json +27 -27
- package/src/clever-client/drains.js +17 -0
- package/src/commands/accesslogs/accesslogs.command.js +35 -18
- package/src/commands/accesslogs/accesslogs.docs.md +1 -1
- package/src/commands/addon/addon.docs.md +2 -2
- package/src/commands/config-provider/config-provider.docs.md +5 -5
- package/src/commands/create/create.command.js +8 -1
- package/src/commands/database/database.docs.md +2 -2
- package/src/commands/deploy/deploy.docs.md +7 -6
- package/src/commands/drain/drain.args.js +6 -0
- package/src/commands/drain/drain.check.command.js +43 -0
- package/src/commands/drain/drain.create.betterstack.command.js +36 -0
- package/src/commands/drain/drain.create.command.js +0 -118
- package/src/commands/drain/drain.create.datadog.command.js +27 -0
- package/src/commands/drain/drain.create.elasticsearch.command.js +48 -0
- package/src/commands/drain/drain.create.newrelic.command.js +36 -0
- package/src/commands/drain/drain.create.ovh-tcp.command.js +29 -0
- package/src/commands/drain/drain.create.raw-http.command.js +30 -0
- package/src/commands/drain/drain.create.splunk.command.js +61 -0
- package/src/commands/drain/drain.create.syslog-tcp.command.js +29 -0
- package/src/commands/drain/drain.create.syslog-udp.command.js +29 -0
- package/src/commands/drain/drain.docs.md +296 -7
- package/src/commands/drain/drain.options.js +26 -0
- package/src/commands/features/features.list.command.js +6 -13
- package/src/commands/global.commands.js +25 -1
- package/src/commands/global.options.js +8 -0
- package/src/commands/k8s/k8s.docs.md +17 -17
- package/src/commands/keycloak/keycloak.docs.md +11 -11
- package/src/commands/kv/kv.docs.md +1 -1
- package/src/commands/link/link.docs.md +1 -1
- package/src/commands/login/login.command.js +11 -1
- package/src/commands/matomo/matomo.docs.md +6 -6
- package/src/commands/metabase/metabase.docs.md +9 -9
- package/src/commands/ng/ng.docs.md +10 -10
- package/src/commands/oauth-consumers/oauth-consumers.docs.md +4 -4
- package/src/commands/otoroshi/otoroshi.docs.md +13 -13
- package/src/commands/profile/profile.switch.command.js +5 -1
- package/src/commands/service/service.docs.md +4 -4
- package/src/commands/ssh/ssh.command.js +7 -1
- package/src/config/features.js +61 -29
- package/src/format-table.js +14 -10
- package/src/initial-setup.js +13 -0
- package/src/initial-update-notifier.js +2 -5
- package/src/lib/access-logs-clf.js +52 -0
- package/src/lib/access-logs-transport.js +29 -0
- package/src/lib/cliparse-patched.js +19 -1
- package/src/lib/define-command.types.d.ts +7 -2
- package/src/lib/k8s.js +1 -0
- package/src/lib/operator-commands.js +1 -0
- package/src/lib/profile.js +8 -1
- package/src/lib/prompts.js +30 -2
- package/src/models/drain.js +39 -12
- package/src/models/git-isomorphic.js +16 -1
- package/src/models/git-system.js +2 -2
- package/src/models/git.js +19 -1
- package/src/models/oauth-consumer.js +1 -1
- package/src/models/send-to-api.js +15 -0
package/src/models/git.js
CHANGED
|
@@ -30,7 +30,7 @@ export class Git {
|
|
|
30
30
|
*/
|
|
31
31
|
static async get() {
|
|
32
32
|
if (Git.#instance == null) {
|
|
33
|
-
const useSystemGit =
|
|
33
|
+
const useSystemGit = isFeatureEnabled('system-git');
|
|
34
34
|
if (useSystemGit) {
|
|
35
35
|
const { GitSystem } = await import('./git-system.js');
|
|
36
36
|
Git.#instance = new GitSystem();
|
|
@@ -66,6 +66,24 @@ export class Git {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
/**
|
|
70
|
+
* Check if the repository is a linked git worktree.
|
|
71
|
+
* In a linked worktree (created with `git worktree add`), the top-level `.git`
|
|
72
|
+
* is a file holding a `gitdir:` pointer instead of a directory.
|
|
73
|
+
* @protected
|
|
74
|
+
* @param {string} [dir] - Repository directory (resolved automatically when omitted)
|
|
75
|
+
* @returns {Promise<boolean>}
|
|
76
|
+
*/
|
|
77
|
+
async _isLinkedWorktree(dir) {
|
|
78
|
+
const repoDir = dir ?? (await this._getRepoDir());
|
|
79
|
+
try {
|
|
80
|
+
const stats = await fs.promises.stat(path.join(repoDir, '.git'));
|
|
81
|
+
return stats.isFile();
|
|
82
|
+
} catch {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
69
87
|
/**
|
|
70
88
|
* Add a remote to the repository
|
|
71
89
|
* @param {string} remoteName
|
|
@@ -47,7 +47,7 @@ export async function promptRights(existingRights) {
|
|
|
47
47
|
checked: existingRights?.[apiName] ?? false,
|
|
48
48
|
}));
|
|
49
49
|
|
|
50
|
-
const selected = await promptCheckbox('Select rights', choices);
|
|
50
|
+
const selected = await promptCheckbox('Select rights', choices, 'Use --rights <list> to set rights directly.');
|
|
51
51
|
|
|
52
52
|
return rightsFromList(selected);
|
|
53
53
|
}
|
|
@@ -75,6 +75,15 @@ async function executeRequest(requestParams, customConfig = {}) {
|
|
|
75
75
|
.catch(processError);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
// OpenSSL error codes raised when the server certificate chain isn't trusted
|
|
79
|
+
// (corporate TLS-intercepting proxy, private or self-signed CA…).
|
|
80
|
+
const TLS_ERROR_CODES = [
|
|
81
|
+
'SELF_SIGNED_CERT_IN_CHAIN',
|
|
82
|
+
'DEPTH_ZERO_SELF_SIGNED_CERT',
|
|
83
|
+
'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
|
|
84
|
+
'UNABLE_TO_GET_ISSUER_CERT_LOCALLY',
|
|
85
|
+
];
|
|
86
|
+
|
|
78
87
|
export function processError(error) {
|
|
79
88
|
const code = error.code ?? error?.cause?.code;
|
|
80
89
|
if (code === 'EAI_AGAIN') {
|
|
@@ -89,6 +98,12 @@ export function processError(error) {
|
|
|
89
98
|
{ cause: error },
|
|
90
99
|
);
|
|
91
100
|
}
|
|
101
|
+
if (TLS_ERROR_CODES.includes(code)) {
|
|
102
|
+
throw new Error(
|
|
103
|
+
`TLS certificate verification failed (${code}). If you're behind a corporate proxy or using a private/self-signed Certificate Authority, trust your CA and follow the "TLS certificates" section of the documentation.`,
|
|
104
|
+
{ cause: error },
|
|
105
|
+
);
|
|
106
|
+
}
|
|
92
107
|
throw error;
|
|
93
108
|
}
|
|
94
109
|
|