@kolatts/pncli 6.0.0 → 6.1.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 +1 -0
- package/dist/{chunk-WDWAPTVC.js → chunk-GHZMFNSX.js} +12 -1
- package/dist/chunk-GHZMFNSX.js.map +1 -0
- package/dist/{chunk-4FR4WGNR.js → chunk-Y3PO2RTO.js} +35 -1
- package/dist/chunk-Y3PO2RTO.js.map +1 -0
- package/dist/cli.js +328 -57
- package/dist/cli.js.map +1 -1
- package/dist/{config-5LC7ZTEP.js → config-DYIXSPLA.js} +2 -2
- package/dist/{http-DJSGEGD6.js → http-3FAKF3X4.js} +2 -2
- package/package.json +1 -1
- package/skills/pncli/SKILL.md +2 -1
- package/skills/pncli/elasticsearch.md +53 -0
- package/skills/pncli/marketplace.md +1 -1
- package/skills/pncli/openshift.md +17 -0
- package/dist/chunk-4FR4WGNR.js.map +0 -1
- package/dist/chunk-WDWAPTVC.js.map +0 -1
- /package/dist/{config-5LC7ZTEP.js.map → config-DYIXSPLA.js.map} +0 -0
- /package/dist/{http-DJSGEGD6.js.map → http-3FAKF3X4.js.map} +0 -0
package/dist/cli.js
CHANGED
|
@@ -28,13 +28,13 @@ import {
|
|
|
28
28
|
windowsListCredentials,
|
|
29
29
|
writeGlobalConfig,
|
|
30
30
|
writeRepoConfig
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-GHZMFNSX.js";
|
|
32
32
|
import {
|
|
33
33
|
configureTls,
|
|
34
34
|
createHttpClient,
|
|
35
35
|
describeFetchError,
|
|
36
36
|
validateAlationAccessToken
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-Y3PO2RTO.js";
|
|
38
38
|
import {
|
|
39
39
|
ExitCode,
|
|
40
40
|
fail,
|
|
@@ -716,8 +716,8 @@ var BitbucketClient = class {
|
|
|
716
716
|
}
|
|
717
717
|
async resolveComment(project, repo, prId, commentId, version) {
|
|
718
718
|
await this.http.bitbucket(
|
|
719
|
-
`${API}/projects/${project}/repos/${repo}/pull-requests/${prId}/comments/${commentId}
|
|
720
|
-
{ method: "PUT",
|
|
719
|
+
`${API}/projects/${project}/repos/${repo}/pull-requests/${prId}/comments/${commentId}`,
|
|
720
|
+
{ method: "PUT", body: { version, threadResolved: true } }
|
|
721
721
|
);
|
|
722
722
|
}
|
|
723
723
|
async deleteComment(project, repo, prId, commentId, version) {
|
|
@@ -790,6 +790,12 @@ var BitbucketClient = class {
|
|
|
790
790
|
const pr = await this.getPR(project, repo, prId);
|
|
791
791
|
return pr.reviewers;
|
|
792
792
|
}
|
|
793
|
+
async listDefaultReviewers(project, repo) {
|
|
794
|
+
const result = await this.http.bitbucket(
|
|
795
|
+
`/rest/default-reviewers/1.0/projects/${encodeURIComponent(project)}/repos/${encodeURIComponent(repo)}/conditions`
|
|
796
|
+
);
|
|
797
|
+
return Array.isArray(result) ? result : [];
|
|
798
|
+
}
|
|
793
799
|
async addReviewer(project, repo, prId, username) {
|
|
794
800
|
return this.http.bitbucket(
|
|
795
801
|
`${API}/projects/${project}/repos/${repo}/pull-requests/${prId}/participants`,
|
|
@@ -3098,7 +3104,7 @@ function registerBitbucketCommands(program2) {
|
|
|
3098
3104
|
fail(err, "bitbucket", "reply-comment", start);
|
|
3099
3105
|
}
|
|
3100
3106
|
});
|
|
3101
|
-
bb.command("resolve-comment").description("Resolve a comment on a pull request").requiredOption("--pr <pr-id>", "Pull request ID").requiredOption("--comment-id <id>", "Comment ID").option("--comment-version <n>", "Comment version, as reported by list-comments", "0").action(async (opts) => {
|
|
3107
|
+
bb.command("resolve-comment").description("Resolve a comment thread on a pull request (use the root comment ID, not a reply)").requiredOption("--pr <pr-id>", "Pull request ID").requiredOption("--comment-id <id>", "Comment ID").option("--comment-version <n>", "Comment version, as reported by list-comments", "0").action(async (opts) => {
|
|
3102
3108
|
const start = Date.now();
|
|
3103
3109
|
try {
|
|
3104
3110
|
const { client, project, repo } = getClient2(bb);
|
|
@@ -3179,6 +3185,16 @@ function registerBitbucketCommands(program2) {
|
|
|
3179
3185
|
fail(err, "bitbucket", "list-reviewers", start);
|
|
3180
3186
|
}
|
|
3181
3187
|
});
|
|
3188
|
+
bb.command("list-default-reviewers").description("List the default-reviewer conditions configured for a repository").action(async () => {
|
|
3189
|
+
const start = Date.now();
|
|
3190
|
+
try {
|
|
3191
|
+
const { client, project, repo } = getClient2(bb);
|
|
3192
|
+
const data = await client.listDefaultReviewers(project, repo);
|
|
3193
|
+
success(data, "bitbucket", "list-default-reviewers", start);
|
|
3194
|
+
} catch (err) {
|
|
3195
|
+
fail(err, "bitbucket", "list-default-reviewers", start);
|
|
3196
|
+
}
|
|
3197
|
+
});
|
|
3182
3198
|
bb.command("add-reviewer").description("Add a reviewer to a pull request").requiredOption("--pr <pr-id>", "Pull request ID").requiredOption("--user <username>", "Username to add as a reviewer").action(async (opts) => {
|
|
3183
3199
|
const start = Date.now();
|
|
3184
3200
|
try {
|
|
@@ -7982,6 +7998,18 @@ async function runCredentialChecks(cfg, http) {
|
|
|
7982
7998
|
results.logscale = categorize(err);
|
|
7983
7999
|
}
|
|
7984
8000
|
}
|
|
8001
|
+
if (!cfg.elasticsearch.apiKey) {
|
|
8002
|
+
results.elasticsearch = { status: "blank", message: "not configured" };
|
|
8003
|
+
} else if (!cfg.elasticsearch.baseUrl) {
|
|
8004
|
+
results.elasticsearch = { status: "error", message: "baseUrl not configured" };
|
|
8005
|
+
} else {
|
|
8006
|
+
try {
|
|
8007
|
+
await http.elasticsearch("/_cluster/health", { timeoutMs: 1e4 });
|
|
8008
|
+
results.elasticsearch = { status: "valid", message: "ok" };
|
|
8009
|
+
} catch (err) {
|
|
8010
|
+
results.elasticsearch = categorize(err);
|
|
8011
|
+
}
|
|
8012
|
+
}
|
|
7985
8013
|
if (!cfg.splitio.adminApiKey) {
|
|
7986
8014
|
results.splitio = { status: "blank", message: "not configured" };
|
|
7987
8015
|
} else if (!cfg.splitio.baseUrl) {
|
|
@@ -9417,7 +9445,7 @@ function pullMarketplace(marketplacePath, m, marketplaceName) {
|
|
|
9417
9445
|
}
|
|
9418
9446
|
const updated = !pullOutput.includes("Already up to date");
|
|
9419
9447
|
if (pullOutput.trim() && updated) warn(pullOutput.trim());
|
|
9420
|
-
warn(updated ? `"${marketplaceName}" updated.` : `"${marketplaceName}" already up to date \u2014
|
|
9448
|
+
warn(updated ? `"${marketplaceName}" updated.` : `"${marketplaceName}" already up to date \u2014 refreshing installed plugins from the local clone.`);
|
|
9421
9449
|
return { updated };
|
|
9422
9450
|
}
|
|
9423
9451
|
function installPluginsForMarketplace(marketplacePath, marketplaceName, repoUrl, pluginNames, targetDir) {
|
|
@@ -9467,13 +9495,6 @@ function installMarketplaceToTarget(m, marketplacePath, pluginChoices, pluginFil
|
|
|
9467
9495
|
} else {
|
|
9468
9496
|
requested = [pluginFilter];
|
|
9469
9497
|
}
|
|
9470
|
-
const missing = requested.filter((name) => !installedHere.includes(name));
|
|
9471
|
-
if (!opts.updated && !opts.force) {
|
|
9472
|
-
if (missing.length === 0) {
|
|
9473
|
-
return { ...base, plugins: {}, total: 0, skipped: true, message: "No changes detected \u2014 skipping install. Use --force to reinstall anyway." };
|
|
9474
|
-
}
|
|
9475
|
-
requested = missing;
|
|
9476
|
-
}
|
|
9477
9498
|
const { results, totalInstalled } = installPluginsForMarketplace(marketplacePath, marketplaceName, m.repoUrl, requested, target.target);
|
|
9478
9499
|
return { ...base, plugins: results, total: totalInstalled };
|
|
9479
9500
|
}
|
|
@@ -10107,7 +10128,7 @@ Plugin skills always install at user scope. --agent picks the host (default: ${D
|
|
|
10107
10128
|
fail(err, "skills", "marketplace-remove", start);
|
|
10108
10129
|
}
|
|
10109
10130
|
});
|
|
10110
|
-
marketplace.command("sync").description("With no arguments, refreshes every already-installed plugin from every marketplace (same as --marketplace all --installed-only). Pass --force, a plugin, or --marketplace to get the interactive picker instead.").argument("[plugin]", 'Plugin name to install, or "all" to install every plugin (skips interactive selection)').option("--marketplace <name>", 'Marketplace name to sync, or "all" to sync every registered marketplace (skips interactive selection)').option("--agent <agent>", `Target agent host: ${AGENT_CHOICES} (default: ${DEFAULT_AGENT})`).option("--claude", "Shorthand for --agent claude-code").option("--all-agents", "Install to every supported agent host in one run").option("--force",
|
|
10131
|
+
marketplace.command("sync").description("With no arguments, refreshes every already-installed plugin from every marketplace (same as --marketplace all --installed-only). Pass --force, a plugin, or --marketplace to get the interactive picker instead.").argument("[plugin]", 'Plugin name to install, or "all" to install every plugin (skips interactive selection)').option("--marketplace <name>", 'Marketplace name to sync, or "all" to sync every registered marketplace (skips interactive selection)').option("--agent <agent>", `Target agent host: ${AGENT_CHOICES} (default: ${DEFAULT_AGENT})`).option("--claude", "Shorthand for --agent claude-code").option("--all-agents", "Install to every supported agent host in one run").option("--force", "Opt into the interactive picker instead of the installed-only shorthand (plugins are always refreshed from the local clone, with or without new upstream changes)").option("--installed-only", "Only sync plugins that are already installed \u2014 skip plugins newly added to the marketplace").option("--no-instructions", "Do not apply the shipped AGENTS.md / CLAUDE.md to user-level instructions files").action(async (plugin, opts) => {
|
|
10111
10132
|
const start = Date.now();
|
|
10112
10133
|
try {
|
|
10113
10134
|
const configPath = getGlobalConfigPath();
|
|
@@ -10600,19 +10621,31 @@ function copyPluginSkills(skillsSrc, targetDir, meta) {
|
|
|
10600
10621
|
(name) => fs6.statSync(path11.join(skillsSrc, name)).isDirectory()
|
|
10601
10622
|
);
|
|
10602
10623
|
const installed = [];
|
|
10624
|
+
const active = [];
|
|
10603
10625
|
const failed = [];
|
|
10626
|
+
const disabledHere = meta ? readInstalledMeta(targetDir).disabled ?? {} : {};
|
|
10604
10627
|
for (const skillName of skillNames) {
|
|
10605
10628
|
const dest = path11.resolve(targetDir, skillName);
|
|
10606
10629
|
if (!dest.startsWith(resolvedTarget + path11.sep)) {
|
|
10607
10630
|
failed.push(skillName);
|
|
10608
10631
|
continue;
|
|
10609
10632
|
}
|
|
10633
|
+
const stashed = disabledHere[skillName];
|
|
10634
|
+
if (meta && stashed && stashed.plugin === meta.plugin) {
|
|
10635
|
+
const stashDest = path11.join(targetDir, DISABLED_SUBDIR, skillName);
|
|
10636
|
+
fs6.mkdirSync(path11.dirname(stashDest), { recursive: true });
|
|
10637
|
+
fs6.rmSync(stashDest, { recursive: true, force: true });
|
|
10638
|
+
fs6.cpSync(path11.join(skillsSrc, skillName), stashDest, { recursive: true });
|
|
10639
|
+
installed.push(skillName);
|
|
10640
|
+
continue;
|
|
10641
|
+
}
|
|
10610
10642
|
fs6.rmSync(dest, { recursive: true, force: true });
|
|
10611
10643
|
fs6.cpSync(path11.join(skillsSrc, skillName), dest, { recursive: true });
|
|
10612
10644
|
installed.push(skillName);
|
|
10645
|
+
active.push(skillName);
|
|
10613
10646
|
}
|
|
10614
10647
|
if (meta) {
|
|
10615
|
-
recordInstalledSkills(targetDir,
|
|
10648
|
+
recordInstalledSkills(targetDir, active, {
|
|
10616
10649
|
source: "marketplace",
|
|
10617
10650
|
marketplace: meta.marketplace,
|
|
10618
10651
|
plugin: meta.plugin,
|
|
@@ -10911,6 +10944,16 @@ function registerConfigCommands(program2) {
|
|
|
10911
10944
|
} else {
|
|
10912
10945
|
results.logscale = { ok: null, message: "not configured" };
|
|
10913
10946
|
}
|
|
10947
|
+
if (cfg.elasticsearch.baseUrl && cfg.elasticsearch.apiKey) {
|
|
10948
|
+
try {
|
|
10949
|
+
await http.elasticsearch("/_cluster/health");
|
|
10950
|
+
results.elasticsearch = { ok: true, message: "connected" };
|
|
10951
|
+
} catch (err) {
|
|
10952
|
+
results.elasticsearch = { ok: false, message: err instanceof Error ? err.message : String(err) };
|
|
10953
|
+
}
|
|
10954
|
+
} else {
|
|
10955
|
+
results.elasticsearch = { ok: null, message: "not configured" };
|
|
10956
|
+
}
|
|
10914
10957
|
if (cfg.splitio.baseUrl && cfg.splitio.adminApiKey) {
|
|
10915
10958
|
try {
|
|
10916
10959
|
await http.splitio("/internal/api/v2/workspaces");
|
|
@@ -10995,6 +11038,7 @@ function registerConfigCommands(program2) {
|
|
|
10995
11038
|
"dynatrace_platform",
|
|
10996
11039
|
...dynamicEnvKeys,
|
|
10997
11040
|
"logscale",
|
|
11041
|
+
"elasticsearch",
|
|
10998
11042
|
"splitio",
|
|
10999
11043
|
"figma",
|
|
11000
11044
|
"alation",
|
|
@@ -11550,6 +11594,40 @@ async function initGlobalConfig(start) {
|
|
|
11550
11594
|
}
|
|
11551
11595
|
}
|
|
11552
11596
|
}
|
|
11597
|
+
process.stderr.write("\n\u2500\u2500 Elasticsearch \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n");
|
|
11598
|
+
const useElasticsearch = await confirm({
|
|
11599
|
+
message: "Configure Elasticsearch for log and document searches?",
|
|
11600
|
+
default: false
|
|
11601
|
+
});
|
|
11602
|
+
let elasticsearchBaseUrl = "";
|
|
11603
|
+
let elasticsearchApiKey = "";
|
|
11604
|
+
if (useElasticsearch) {
|
|
11605
|
+
elasticsearchBaseUrl = await input2({
|
|
11606
|
+
message: "Elasticsearch base URL (e.g. https://elasticsearch.imagile.dev:9200):",
|
|
11607
|
+
default: ""
|
|
11608
|
+
});
|
|
11609
|
+
elasticsearchApiKey = await password2({
|
|
11610
|
+
message: 'Elasticsearch API key (the base64 "encoded" value from Kibana \u2192 Stack Management \u2192 API keys):'
|
|
11611
|
+
});
|
|
11612
|
+
if (elasticsearchBaseUrl && elasticsearchApiKey) {
|
|
11613
|
+
process.stderr.write("\n Verifying connection...\n");
|
|
11614
|
+
try {
|
|
11615
|
+
const tempConfig = {
|
|
11616
|
+
...loadConfig(),
|
|
11617
|
+
elasticsearch: {
|
|
11618
|
+
baseUrl: normalizeBaseUrl(elasticsearchBaseUrl),
|
|
11619
|
+
apiKey: elasticsearchApiKey
|
|
11620
|
+
}
|
|
11621
|
+
};
|
|
11622
|
+
const tempHttp = createHttpClient(tempConfig);
|
|
11623
|
+
await tempHttp.elasticsearch("/_cluster/health");
|
|
11624
|
+
process.stderr.write(" Connected.\n");
|
|
11625
|
+
} catch (err) {
|
|
11626
|
+
warn(`Could not connect to Elasticsearch: ${err instanceof Error ? err.message : String(err)}`);
|
|
11627
|
+
warn("Config will be saved anyway. Check your URL and API key and re-run pncli config init or pncli config test.");
|
|
11628
|
+
}
|
|
11629
|
+
}
|
|
11630
|
+
}
|
|
11553
11631
|
process.stderr.write("\n\u2500\u2500 Split.IO \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n");
|
|
11554
11632
|
const useSplitio = await confirm({
|
|
11555
11633
|
message: "Configure Split.IO for feature flag administration?",
|
|
@@ -11847,6 +11925,12 @@ async function initGlobalConfig(start) {
|
|
|
11847
11925
|
token: logscaleToken || void 0
|
|
11848
11926
|
}
|
|
11849
11927
|
} : {},
|
|
11928
|
+
...useElasticsearch && elasticsearchBaseUrl ? {
|
|
11929
|
+
elasticsearch: {
|
|
11930
|
+
baseUrl: normalizeBaseUrl(elasticsearchBaseUrl),
|
|
11931
|
+
apiKey: elasticsearchApiKey || void 0
|
|
11932
|
+
}
|
|
11933
|
+
} : {},
|
|
11850
11934
|
...useSplitio && splitioBaseUrl ? {
|
|
11851
11935
|
splitio: {
|
|
11852
11936
|
baseUrl: normalizeBaseUrl(splitioBaseUrl),
|
|
@@ -12314,6 +12398,7 @@ function registerDoctorCommands(program2) {
|
|
|
12314
12398
|
|
|
12315
12399
|
// src/services/ado/client/git.ts
|
|
12316
12400
|
var API7 = "7.1";
|
|
12401
|
+
var REQUIRED_REVIEWERS_POLICY_TYPE = "fd2167ab-b0be-447a-8ec8-39368250530e";
|
|
12317
12402
|
var AdoGitClient = class {
|
|
12318
12403
|
constructor(http) {
|
|
12319
12404
|
this.http = http;
|
|
@@ -12409,6 +12494,20 @@ var AdoGitClient = class {
|
|
|
12409
12494
|
const pr = await this.getPR(collection, project, repo, prId);
|
|
12410
12495
|
return pr.reviewers;
|
|
12411
12496
|
}
|
|
12497
|
+
/**
|
|
12498
|
+
* Default reviewers in Azure DevOps are "Required reviewers" branch policies.
|
|
12499
|
+
* Returns the policy configurations of that type whose scope covers the repo
|
|
12500
|
+
* (a scope entry with a null repositoryId applies project-wide).
|
|
12501
|
+
*/
|
|
12502
|
+
async listDefaultReviewers(collection, project, repo) {
|
|
12503
|
+
const repoInfo = await this.getRepo(collection, project, repo);
|
|
12504
|
+
const result = await this.http.ado(
|
|
12505
|
+
`/${encodeURIComponent(collection)}/${encodeURIComponent(project)}/_apis/policy/configurations?api-version=${API7}`
|
|
12506
|
+
);
|
|
12507
|
+
return (result.value ?? []).filter(
|
|
12508
|
+
(c) => c.type?.id === REQUIRED_REVIEWERS_POLICY_TYPE && (c.settings?.scope ?? []).some((s) => !s.repositoryId || s.repositoryId === repoInfo.id)
|
|
12509
|
+
);
|
|
12510
|
+
}
|
|
12412
12511
|
// ── Threads / Comments ────────────────────────────────────────────
|
|
12413
12512
|
async listThreads(collection, project, repo, prId) {
|
|
12414
12513
|
const result = await this.http.ado(
|
|
@@ -13301,16 +13400,26 @@ function registerAdoRepoCommands(ado) {
|
|
|
13301
13400
|
fail(err, "ado", "repo-list-reviewers", start);
|
|
13302
13401
|
}
|
|
13303
13402
|
});
|
|
13403
|
+
repo.command("list-default-reviewers").description("List required-reviewer branch policies (default reviewers) that apply to the repository").action(async () => {
|
|
13404
|
+
const start = Date.now();
|
|
13405
|
+
try {
|
|
13406
|
+
const { collection, project, repo: repo2, gitClient } = getAdoContext(ado, true);
|
|
13407
|
+
const data = await gitClient.listDefaultReviewers(collection, project, repo2);
|
|
13408
|
+
success(data, "ado", "repo-list-default-reviewers", start);
|
|
13409
|
+
} catch (err) {
|
|
13410
|
+
fail(err, "ado", "repo-list-default-reviewers", start);
|
|
13411
|
+
}
|
|
13412
|
+
});
|
|
13304
13413
|
const voteCmd = (name, description, vote, action) => {
|
|
13305
13414
|
repo.command(name).description(description).requiredOption("--pr <n>", "Pull request ID").action(async (opts) => {
|
|
13306
13415
|
const start = Date.now();
|
|
13307
13416
|
try {
|
|
13308
13417
|
const globalOpts = ado.optsWithGlobals();
|
|
13309
|
-
const { loadConfig: lc } = await import("./config-
|
|
13418
|
+
const { loadConfig: lc } = await import("./config-DYIXSPLA.js");
|
|
13310
13419
|
const config = lc({ configPath: globalOpts.config });
|
|
13311
13420
|
const { collection, project, repo: repo2, gitClient } = getAdoContext(ado, true);
|
|
13312
13421
|
const { AdoCoreClient: AdoCoreClient2 } = await import("./core-SWYVXOQ4.js");
|
|
13313
|
-
const { createHttpClient: createHttpClient2 } = await import("./http-
|
|
13422
|
+
const { createHttpClient: createHttpClient2 } = await import("./http-3FAKF3X4.js");
|
|
13314
13423
|
const http = createHttpClient2(config, Boolean(globalOpts.dryRun));
|
|
13315
13424
|
const coreClient = new AdoCoreClient2(http);
|
|
13316
13425
|
const me = await coreClient.getConnectionData(collection);
|
|
@@ -14498,6 +14607,55 @@ function registerOpenShiftCommands(program2) {
|
|
|
14498
14607
|
fail(err, "openshift", "pods", start);
|
|
14499
14608
|
}
|
|
14500
14609
|
});
|
|
14610
|
+
oc.command("deployments").description("List Deployments (or OpenShift DeploymentConfigs with --deployment-configs) for a namespace, read-only. Use --raw to return the full unmodified objects.").requiredOption("--namespace <ns>", "Kubernetes namespace").option("--label-selector <selector>", "Label selector (e.g. app=my-app)").option("--deployment-configs", "Read OpenShift DeploymentConfigs (apps.openshift.io/v1) instead of Deployments (apps/v1)", false).option("--raw", "Return full objects without summarization (includes pod template, env vars, strategy, etc.)", false).action(async (opts) => {
|
|
14611
|
+
const start = Date.now();
|
|
14612
|
+
try {
|
|
14613
|
+
const http = getHttp2(oc);
|
|
14614
|
+
const params = {};
|
|
14615
|
+
if (opts.labelSelector) params["labelSelector"] = opts.labelSelector;
|
|
14616
|
+
const kind = opts.deploymentConfigs ? "DeploymentConfig" : "Deployment";
|
|
14617
|
+
const path14 = opts.deploymentConfigs ? `/apis/apps.openshift.io/v1/namespaces/${encodeURIComponent(opts.namespace)}/deploymentconfigs` : `/apis/apps/v1/namespaces/${encodeURIComponent(opts.namespace)}/deployments`;
|
|
14618
|
+
const list = await http.openshift(path14, { params });
|
|
14619
|
+
if (opts.raw) {
|
|
14620
|
+
success(
|
|
14621
|
+
{ namespace: opts.namespace, kind, count: list.items.length, deployments: list.items },
|
|
14622
|
+
"openshift",
|
|
14623
|
+
"deployments",
|
|
14624
|
+
start
|
|
14625
|
+
);
|
|
14626
|
+
return;
|
|
14627
|
+
}
|
|
14628
|
+
const deployments = list.items.map((d) => {
|
|
14629
|
+
const desired = d.spec.replicas ?? 0;
|
|
14630
|
+
const status = d.status ?? {};
|
|
14631
|
+
const entry = {
|
|
14632
|
+
name: d.metadata.name,
|
|
14633
|
+
ready: `${status.readyReplicas ?? 0}/${desired}`,
|
|
14634
|
+
desiredReplicas: desired,
|
|
14635
|
+
readyReplicas: status.readyReplicas ?? 0,
|
|
14636
|
+
updatedReplicas: status.updatedReplicas ?? 0,
|
|
14637
|
+
availableReplicas: status.availableReplicas ?? 0,
|
|
14638
|
+
unavailableReplicas: status.unavailableReplicas ?? 0,
|
|
14639
|
+
age: podAge(d.metadata.creationTimestamp),
|
|
14640
|
+
images: (d.spec.template?.spec?.containers ?? []).map((c) => ({ name: c.name, image: c.image }))
|
|
14641
|
+
};
|
|
14642
|
+
if (d.spec.strategy?.type) entry["strategy"] = d.spec.strategy.type;
|
|
14643
|
+
if (status.latestVersion !== void 0) entry["latestVersion"] = status.latestVersion;
|
|
14644
|
+
const problems = (status.conditions ?? []).filter(
|
|
14645
|
+
(c) => c.type === "Available" && c.status === "False" || c.type === "Progressing" && c.status === "False" || c.type === "ReplicaFailure"
|
|
14646
|
+
);
|
|
14647
|
+
if (problems.length > 0) {
|
|
14648
|
+
entry["conditions"] = problems.map((c) => ({ type: c.type, status: c.status, reason: c.reason, message: c.message }));
|
|
14649
|
+
}
|
|
14650
|
+
if (d.metadata.labels && Object.keys(d.metadata.labels).length > 0) entry["labels"] = d.metadata.labels;
|
|
14651
|
+
return entry;
|
|
14652
|
+
});
|
|
14653
|
+
deployments.sort((a, b) => (b["unavailableReplicas"] ?? 0) - (a["unavailableReplicas"] ?? 0));
|
|
14654
|
+
success({ namespace: opts.namespace, kind, count: deployments.length, deployments }, "openshift", "deployments", start);
|
|
14655
|
+
} catch (err) {
|
|
14656
|
+
fail(err, "openshift", "deployments", start);
|
|
14657
|
+
}
|
|
14658
|
+
});
|
|
14501
14659
|
oc.command("events").description("List Warning events for a namespace \u2014 pre-filtered for LLM analysis").requiredOption("--namespace <ns>", "Kubernetes namespace").option("--field-selector <selector>", "Additional field selector (e.g. involvedObject.name=my-pod)").option("--all", "Include Normal events in addition to Warning events", false).action(async (opts) => {
|
|
14502
14660
|
const start = Date.now();
|
|
14503
14661
|
try {
|
|
@@ -14922,10 +15080,121 @@ function registerLogscaleCommands(program2) {
|
|
|
14922
15080
|
});
|
|
14923
15081
|
}
|
|
14924
15082
|
|
|
15083
|
+
// src/services/elasticsearch/commands.ts
|
|
15084
|
+
function getHttp5(program2) {
|
|
15085
|
+
const opts = program2.optsWithGlobals();
|
|
15086
|
+
return createHttpClient(
|
|
15087
|
+
loadConfig({ configPath: opts.config }),
|
|
15088
|
+
Boolean(opts.dryRun)
|
|
15089
|
+
);
|
|
15090
|
+
}
|
|
15091
|
+
function parseJsonOption(raw, flag) {
|
|
15092
|
+
let parsed;
|
|
15093
|
+
try {
|
|
15094
|
+
parsed = JSON.parse(raw);
|
|
15095
|
+
} catch {
|
|
15096
|
+
throw new PncliError(`${flag} must be valid JSON. Example: ${flag} '{"match_all":{}}'`);
|
|
15097
|
+
}
|
|
15098
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
15099
|
+
throw new PncliError(`${flag} must be a JSON object.`);
|
|
15100
|
+
}
|
|
15101
|
+
return parsed;
|
|
15102
|
+
}
|
|
15103
|
+
function parsePositiveInt(raw, flag) {
|
|
15104
|
+
const n = Number(raw);
|
|
15105
|
+
if (!Number.isInteger(n) || n < 0) throw new PncliError(`${flag} must be a non-negative integer.`);
|
|
15106
|
+
return n;
|
|
15107
|
+
}
|
|
15108
|
+
function indexPath(index) {
|
|
15109
|
+
return index.split(",").map((s) => encodeURIComponent(s.trim())).join(",");
|
|
15110
|
+
}
|
|
15111
|
+
function buildQuery(opts) {
|
|
15112
|
+
if (opts.query && opts.q) throw new PncliError("Use either --query or --q, not both.");
|
|
15113
|
+
if (opts.query) return parseJsonOption(opts.query, "--query");
|
|
15114
|
+
if (opts.q) return { query_string: { query: opts.q } };
|
|
15115
|
+
return { match_all: {} };
|
|
15116
|
+
}
|
|
15117
|
+
function registerElasticsearchCommands(program2) {
|
|
15118
|
+
const es = program2.command("elasticsearch").description("Elasticsearch search operations");
|
|
15119
|
+
const cluster = es.command("cluster").description("Cluster operations");
|
|
15120
|
+
cluster.command("health").description("Show cluster health (status, node and shard counts)").action(async () => {
|
|
15121
|
+
const start = Date.now();
|
|
15122
|
+
try {
|
|
15123
|
+
const data = await getHttp5(program2).elasticsearch("/_cluster/health");
|
|
15124
|
+
success(data, "elasticsearch", "cluster health", start);
|
|
15125
|
+
} catch (err) {
|
|
15126
|
+
fail(err, "elasticsearch", "cluster health", start);
|
|
15127
|
+
}
|
|
15128
|
+
});
|
|
15129
|
+
const indices = es.command("indices").description("Index operations");
|
|
15130
|
+
indices.command("list").description("List indices with health, document count and size").option("--pattern <pattern>", 'Index name or wildcard pattern (e.g. "logs-*")').action(async (opts) => {
|
|
15131
|
+
const start = Date.now();
|
|
15132
|
+
try {
|
|
15133
|
+
const path14 = opts.pattern ? `/_cat/indices/${indexPath(opts.pattern)}` : "/_cat/indices";
|
|
15134
|
+
const data = await getHttp5(program2).elasticsearch(path14, {
|
|
15135
|
+
params: { format: "json", h: "index,health,status,docs.count,store.size,pri,rep" }
|
|
15136
|
+
});
|
|
15137
|
+
success({ count: data.length, indices: data }, "elasticsearch", "indices list", start);
|
|
15138
|
+
} catch (err) {
|
|
15139
|
+
fail(err, "elasticsearch", "indices list", start);
|
|
15140
|
+
}
|
|
15141
|
+
});
|
|
15142
|
+
es.command("search").description("Search one or more indices with Query DSL JSON or a query string").requiredOption("--index <name>", "Index, data stream, alias or wildcard pattern; comma-separate several").option("--query <json>", `Query DSL clause as JSON (e.g. '{"match":{"message":"error"}}')`).option("--q <query-string>", 'Lucene query string (e.g. "level:error AND service:api")').option("--sort <field:order>", 'Sort, e.g. "@timestamp:desc"').option("--source <fields>", "Comma-separated fields to return (_source filtering)").option("--size <n>", "Maximum number of hits to return", "100").option("--from <n>", "Offset of the first hit", "0").option("--timeout-ms <ms>", "Client-side HTTP timeout in milliseconds", "30000").action(async (opts) => {
|
|
15143
|
+
const ts = Date.now();
|
|
15144
|
+
try {
|
|
15145
|
+
const body = {
|
|
15146
|
+
query: buildQuery(opts),
|
|
15147
|
+
size: parsePositiveInt(opts.size, "--size"),
|
|
15148
|
+
from: parsePositiveInt(opts.from, "--from")
|
|
15149
|
+
};
|
|
15150
|
+
if (opts.sort) {
|
|
15151
|
+
const [field, order] = opts.sort.split(":");
|
|
15152
|
+
body.sort = [{ [field]: { order: order ?? "asc" } }];
|
|
15153
|
+
}
|
|
15154
|
+
if (opts.source) body._source = opts.source.split(",").map((s) => s.trim()).filter(Boolean);
|
|
15155
|
+
const data = await getHttp5(program2).elasticsearch(
|
|
15156
|
+
`/${indexPath(opts.index)}/_search`,
|
|
15157
|
+
{ method: "POST", body, timeoutMs: parsePositiveInt(opts.timeoutMs, "--timeout-ms") }
|
|
15158
|
+
);
|
|
15159
|
+
const total = data.hits?.total;
|
|
15160
|
+
const hits = data.hits?.hits ?? [];
|
|
15161
|
+
success(
|
|
15162
|
+
{
|
|
15163
|
+
index: opts.index,
|
|
15164
|
+
took: data.took,
|
|
15165
|
+
timedOut: data.timed_out ?? false,
|
|
15166
|
+
total: typeof total === "object" ? total?.value : total,
|
|
15167
|
+
totalRelation: typeof total === "object" ? total?.relation : void 0,
|
|
15168
|
+
hitCount: hits.length,
|
|
15169
|
+
hits,
|
|
15170
|
+
aggregations: data.aggregations
|
|
15171
|
+
},
|
|
15172
|
+
"elasticsearch",
|
|
15173
|
+
"search",
|
|
15174
|
+
ts
|
|
15175
|
+
);
|
|
15176
|
+
} catch (err) {
|
|
15177
|
+
fail(err, "elasticsearch", "search", ts);
|
|
15178
|
+
}
|
|
15179
|
+
});
|
|
15180
|
+
es.command("count").description("Count documents matching a query").requiredOption("--index <name>", "Index, data stream, alias or wildcard pattern; comma-separate several").option("--query <json>", "Query DSL clause as JSON").option("--q <query-string>", "Lucene query string").action(async (opts) => {
|
|
15181
|
+
const start = Date.now();
|
|
15182
|
+
try {
|
|
15183
|
+
const data = await getHttp5(program2).elasticsearch(
|
|
15184
|
+
`/${indexPath(opts.index)}/_count`,
|
|
15185
|
+
{ method: "POST", body: { query: buildQuery(opts) } }
|
|
15186
|
+
);
|
|
15187
|
+
success({ index: opts.index, count: data.count }, "elasticsearch", "count", start);
|
|
15188
|
+
} catch (err) {
|
|
15189
|
+
fail(err, "elasticsearch", "count", start);
|
|
15190
|
+
}
|
|
15191
|
+
});
|
|
15192
|
+
}
|
|
15193
|
+
|
|
14925
15194
|
// src/services/splitio/commands.ts
|
|
14926
15195
|
import fs11 from "fs";
|
|
14927
15196
|
import confirm2 from "@inquirer/confirm";
|
|
14928
|
-
function
|
|
15197
|
+
function getHttp6(program2) {
|
|
14929
15198
|
const opts = program2.optsWithGlobals();
|
|
14930
15199
|
return createHttpClient(
|
|
14931
15200
|
loadConfig({ configPath: opts.config }),
|
|
@@ -14970,7 +15239,7 @@ function registerSplitioCommands(program2) {
|
|
|
14970
15239
|
workspaces.command("list").description("List all Split.IO workspaces").action(async () => {
|
|
14971
15240
|
const start = Date.now();
|
|
14972
15241
|
try {
|
|
14973
|
-
const http =
|
|
15242
|
+
const http = getHttp6(program2);
|
|
14974
15243
|
const data = await http.splitio("/internal/api/v2/workspaces");
|
|
14975
15244
|
success(
|
|
14976
15245
|
{ count: data.objects.length, workspaces: data.objects },
|
|
@@ -14986,7 +15255,7 @@ function registerSplitioCommands(program2) {
|
|
|
14986
15255
|
environments.command("list").description("List environments in a workspace").requiredOption("--workspace <id>", "Workspace ID").action(async (opts) => {
|
|
14987
15256
|
const start = Date.now();
|
|
14988
15257
|
try {
|
|
14989
|
-
const http =
|
|
15258
|
+
const http = getHttp6(program2);
|
|
14990
15259
|
const data = await http.splitio(
|
|
14991
15260
|
`/internal/api/v2/environments/ws/${encodeURIComponent(opts.workspace)}`
|
|
14992
15261
|
);
|
|
@@ -15004,7 +15273,7 @@ function registerSplitioCommands(program2) {
|
|
|
15004
15273
|
flags.command("list").description("List feature flags in a workspace").requiredOption("--workspace <id>", "Workspace ID").option("--limit <n>", "Maximum number of flags to return", "50").option("--offset <n>", "Pagination offset", "0").option("--flag-set <name>", "Filter by flag set name").action(async (opts) => {
|
|
15005
15274
|
const start = Date.now();
|
|
15006
15275
|
try {
|
|
15007
|
-
const http =
|
|
15276
|
+
const http = getHttp6(program2);
|
|
15008
15277
|
const params = {
|
|
15009
15278
|
limit: parseInt(opts.limit, 10),
|
|
15010
15279
|
offset: parseInt(opts.offset, 10)
|
|
@@ -15027,7 +15296,7 @@ function registerSplitioCommands(program2) {
|
|
|
15027
15296
|
flags.command("get").description("Get a flag definition").requiredOption("--workspace <id>", "Workspace ID").requiredOption("--flag <name>", "Feature flag name").option("--environment <id>", "Environment ID \u2014 include targeting rules for this environment").action(async (opts) => {
|
|
15028
15297
|
const start = Date.now();
|
|
15029
15298
|
try {
|
|
15030
|
-
const http =
|
|
15299
|
+
const http = getHttp6(program2);
|
|
15031
15300
|
if (opts.environment) {
|
|
15032
15301
|
const data = await http.splitio(
|
|
15033
15302
|
`/internal/api/v2/splits/ws/${encodeURIComponent(opts.workspace)}/name/${encodeURIComponent(opts.flag)}/environment/${encodeURIComponent(opts.environment)}`
|
|
@@ -15049,7 +15318,7 @@ function registerSplitioCommands(program2) {
|
|
|
15049
15318
|
if (!opts.inputFile) throw new PncliError("--input-file is required for flags update");
|
|
15050
15319
|
const definition = loadInputFile(opts.inputFile);
|
|
15051
15320
|
await confirmWrite(opts, `UPDATE ${opts.flag} in ${opts.environment}`);
|
|
15052
|
-
const http =
|
|
15321
|
+
const http = getHttp6(program2);
|
|
15053
15322
|
const body = {
|
|
15054
15323
|
...buildCrBase(opts),
|
|
15055
15324
|
operationType: "UPDATE_SPLIT_DEFINITION",
|
|
@@ -15075,7 +15344,7 @@ function registerSplitioCommands(program2) {
|
|
|
15075
15344
|
if (!opts.treatment && !opts.weights) {
|
|
15076
15345
|
throw new PncliError("Either --treatment or --weights must be specified");
|
|
15077
15346
|
}
|
|
15078
|
-
const http =
|
|
15347
|
+
const http = getHttp6(program2);
|
|
15079
15348
|
const current = await http.splitio(
|
|
15080
15349
|
`/internal/api/v2/splits/ws/${encodeURIComponent(opts.workspace)}/name/${encodeURIComponent(opts.flag)}/environment/${encodeURIComponent(opts.environment)}`
|
|
15081
15350
|
);
|
|
@@ -15113,7 +15382,7 @@ function registerSplitioCommands(program2) {
|
|
|
15113
15382
|
flags.command("set-default").description("Update the fallback default rule for traffic matching no targeting rule").requiredOption("--workspace <id>", "Workspace ID").requiredOption("--flag <name>", "Feature flag name").requiredOption("--environment <id>", "Environment ID").requiredOption("--treatment <name>", "Treatment to assign as the default").requiredOption("--mnemonic <text>", "Short Change Request title (mnemonic)").requiredOption("--description <text>", "Change Request description").requiredOption("--change-number <CHG>", "Change request number (e.g. CHG0001234)").option("--approvers <ids>", "Comma-separated Split user IDs required to approve this CR").option("--yes", "Skip interactive confirmation prompt").action(async (opts) => {
|
|
15114
15383
|
const start = Date.now();
|
|
15115
15384
|
try {
|
|
15116
|
-
const http =
|
|
15385
|
+
const http = getHttp6(program2);
|
|
15117
15386
|
const current = await http.splitio(
|
|
15118
15387
|
`/internal/api/v2/splits/ws/${encodeURIComponent(opts.workspace)}/name/${encodeURIComponent(opts.flag)}/environment/${encodeURIComponent(opts.environment)}`
|
|
15119
15388
|
);
|
|
@@ -15146,7 +15415,7 @@ function registerSplitioCommands(program2) {
|
|
|
15146
15415
|
const enable = opts.enabled.toLowerCase() !== "false" && opts.enabled !== "0";
|
|
15147
15416
|
const opType = enable ? "RESTORE_SPLIT" : "KILL_SPLIT";
|
|
15148
15417
|
await confirmWrite(opts, `${opType} ${opts.flag} in ${opts.environment}`);
|
|
15149
|
-
const http =
|
|
15418
|
+
const http = getHttp6(program2);
|
|
15150
15419
|
const body = {
|
|
15151
15420
|
...buildCrBase(opts),
|
|
15152
15421
|
operationType: opType,
|
|
@@ -15169,7 +15438,7 @@ function registerSplitioCommands(program2) {
|
|
|
15169
15438
|
const entries = loadInputFile(opts.inputFile);
|
|
15170
15439
|
if (!Array.isArray(entries)) throw new PncliError("Input file must be a JSON array of {flag, enabled} objects");
|
|
15171
15440
|
await confirmWrite(opts, `BATCH_TOGGLE ${entries.length} flags in ${opts.environment}`);
|
|
15172
|
-
const http =
|
|
15441
|
+
const http = getHttp6(program2);
|
|
15173
15442
|
const results = [];
|
|
15174
15443
|
for (const entry of entries) {
|
|
15175
15444
|
try {
|
|
@@ -15203,7 +15472,7 @@ function registerSplitioCommands(program2) {
|
|
|
15203
15472
|
const start = Date.now();
|
|
15204
15473
|
try {
|
|
15205
15474
|
await confirmWrite(opts, `KILL ${opts.flag} in ${opts.environment}`);
|
|
15206
|
-
const http =
|
|
15475
|
+
const http = getHttp6(program2);
|
|
15207
15476
|
const body = {
|
|
15208
15477
|
...buildCrBase(opts),
|
|
15209
15478
|
operationType: "KILL_SPLIT",
|
|
@@ -15223,7 +15492,7 @@ function registerSplitioCommands(program2) {
|
|
|
15223
15492
|
const start = Date.now();
|
|
15224
15493
|
try {
|
|
15225
15494
|
await confirmWrite(opts, `RESTORE ${opts.flag} in ${opts.environment}`);
|
|
15226
|
-
const http =
|
|
15495
|
+
const http = getHttp6(program2);
|
|
15227
15496
|
const body = {
|
|
15228
15497
|
...buildCrBase(opts),
|
|
15229
15498
|
operationType: "RESTORE_SPLIT",
|
|
@@ -15243,7 +15512,7 @@ function registerSplitioCommands(program2) {
|
|
|
15243
15512
|
const start = Date.now();
|
|
15244
15513
|
try {
|
|
15245
15514
|
await confirmWrite(opts, `ARCHIVE ${opts.flag}`);
|
|
15246
|
-
const http =
|
|
15515
|
+
const http = getHttp6(program2);
|
|
15247
15516
|
const body = {
|
|
15248
15517
|
...buildCrBase(opts),
|
|
15249
15518
|
operationType: "ARCHIVE_SPLIT",
|
|
@@ -15263,7 +15532,7 @@ function registerSplitioCommands(program2) {
|
|
|
15263
15532
|
changeRequests.command("list").description("List Change Requests for a workspace").requiredOption("--workspace <id>", "Workspace ID").option("--environment <id>", "Filter by environment ID").option("--status <status>", "Filter by status (REQUESTED, APPROVED, REJECTED, PUBLISHED)").option("--limit <n>", "Maximum number of results", "25").option("--offset <n>", "Pagination offset", "0").action(async (opts) => {
|
|
15264
15533
|
const start = Date.now();
|
|
15265
15534
|
try {
|
|
15266
|
-
const http =
|
|
15535
|
+
const http = getHttp6(program2);
|
|
15267
15536
|
const params = {
|
|
15268
15537
|
limit: parseInt(opts.limit, 10),
|
|
15269
15538
|
offset: parseInt(opts.offset, 10)
|
|
@@ -15287,7 +15556,7 @@ function registerSplitioCommands(program2) {
|
|
|
15287
15556
|
changeRequests.command("get").description("Get a Change Request by ID").requiredOption("--id <id>", "Change Request ID").action(async (opts) => {
|
|
15288
15557
|
const start = Date.now();
|
|
15289
15558
|
try {
|
|
15290
|
-
const http =
|
|
15559
|
+
const http = getHttp6(program2);
|
|
15291
15560
|
const data = await http.splitio(
|
|
15292
15561
|
`/internal/api/v2/changeRequests/${encodeURIComponent(opts.id)}`
|
|
15293
15562
|
);
|
|
@@ -15339,7 +15608,7 @@ function findNodeIdInUrl(url) {
|
|
|
15339
15608
|
if (!new URL(url).searchParams.has("node-id")) return void 0;
|
|
15340
15609
|
return parseNodeId(url);
|
|
15341
15610
|
}
|
|
15342
|
-
function
|
|
15611
|
+
function getHttp7(program2) {
|
|
15343
15612
|
const opts = program2.optsWithGlobals();
|
|
15344
15613
|
return createHttpClient(
|
|
15345
15614
|
loadConfig({ configPath: opts.config }),
|
|
@@ -15355,7 +15624,7 @@ function registerFigmaCommands(program2) {
|
|
|
15355
15624
|
const fileKey = parseFileKey(fileKeyOrUrl);
|
|
15356
15625
|
const nodeId = opts.nodeId ? parseNodeId(opts.nodeId) : isUrl(fileKeyOrUrl) ? findNodeIdInUrl(fileKeyOrUrl) : void 0;
|
|
15357
15626
|
if (nodeId) {
|
|
15358
|
-
const data2 = await
|
|
15627
|
+
const data2 = await getHttp7(program2).figma(
|
|
15359
15628
|
`/v1/files/${encodeURIComponent(fileKey)}/nodes`,
|
|
15360
15629
|
{ params: { ids: nodeId } }
|
|
15361
15630
|
);
|
|
@@ -15384,7 +15653,7 @@ function registerFigmaCommands(program2) {
|
|
|
15384
15653
|
if (!opts.document) {
|
|
15385
15654
|
params["depth"] = 1;
|
|
15386
15655
|
}
|
|
15387
|
-
const data = await
|
|
15656
|
+
const data = await getHttp7(program2).figma(`/v1/files/${encodeURIComponent(fileKey)}`, { params });
|
|
15388
15657
|
success2(
|
|
15389
15658
|
{
|
|
15390
15659
|
fileKey,
|
|
@@ -15414,7 +15683,7 @@ function registerFigmaCommands(program2) {
|
|
|
15414
15683
|
const fileKey = parseFileKey(fileKeyOrUrl);
|
|
15415
15684
|
const params = {};
|
|
15416
15685
|
if (opts.asOf) params["as_of"] = opts.asOf;
|
|
15417
|
-
const data = await
|
|
15686
|
+
const data = await getHttp7(program2).figma(`/v1/files/${encodeURIComponent(fileKey)}/comments`, { params });
|
|
15418
15687
|
success2(
|
|
15419
15688
|
{ fileKey, count: data.comments.length, comments: data.comments },
|
|
15420
15689
|
"figma",
|
|
@@ -15430,7 +15699,7 @@ function registerFigmaCommands(program2) {
|
|
|
15430
15699
|
const { success: success2, fail: fail2 } = await import("./output-HDUIIXUI.js");
|
|
15431
15700
|
try {
|
|
15432
15701
|
const fileKey = parseFileKey(fileKeyOrUrl);
|
|
15433
|
-
const data = await
|
|
15702
|
+
const data = await getHttp7(program2).figma(`/v1/files/${encodeURIComponent(fileKey)}/versions`);
|
|
15434
15703
|
success2(
|
|
15435
15704
|
{ fileKey, count: data.versions.length, versions: data.versions },
|
|
15436
15705
|
"figma",
|
|
@@ -15445,7 +15714,7 @@ function registerFigmaCommands(program2) {
|
|
|
15445
15714
|
const start = Date.now();
|
|
15446
15715
|
const { success: success2, fail: fail2 } = await import("./output-HDUIIXUI.js");
|
|
15447
15716
|
try {
|
|
15448
|
-
const data = await
|
|
15717
|
+
const data = await getHttp7(program2).figma(`/v1/projects/${encodeURIComponent(projectId)}/files`);
|
|
15449
15718
|
success2(
|
|
15450
15719
|
{ projectId, count: data.files.length, files: data.files },
|
|
15451
15720
|
"figma",
|
|
@@ -15460,7 +15729,7 @@ function registerFigmaCommands(program2) {
|
|
|
15460
15729
|
const start = Date.now();
|
|
15461
15730
|
const { success: success2, fail: fail2 } = await import("./output-HDUIIXUI.js");
|
|
15462
15731
|
try {
|
|
15463
|
-
const data = await
|
|
15732
|
+
const data = await getHttp7(program2).figma("/v1/me");
|
|
15464
15733
|
success2(data, "figma", "me", start);
|
|
15465
15734
|
} catch (err) {
|
|
15466
15735
|
fail2(err, "figma", "me", start);
|
|
@@ -15575,7 +15844,7 @@ var ALATION_DOCUMENT_INPUT_FILE_EXAMPLE = {
|
|
|
15575
15844
|
template: 7,
|
|
15576
15845
|
fields: { "10001": "Team Data Platform" }
|
|
15577
15846
|
};
|
|
15578
|
-
function
|
|
15847
|
+
function getHttp8(program2) {
|
|
15579
15848
|
const opts = program2.optsWithGlobals();
|
|
15580
15849
|
return createHttpClient(
|
|
15581
15850
|
loadConfig({ configPath: opts.config }),
|
|
@@ -15651,7 +15920,7 @@ function registerAlationCommands(program2) {
|
|
|
15651
15920
|
const params = {};
|
|
15652
15921
|
if (opts.includeUndeployed) params.include_undeployed = true;
|
|
15653
15922
|
if (opts.includeHidden) params.include_hidden = true;
|
|
15654
|
-
const data = await
|
|
15923
|
+
const data = await getHttp8(program2).alation("integration/v1/datasource/", { params });
|
|
15655
15924
|
success({ count: data.length, datasources: data }, "alation", "datasource-list", start);
|
|
15656
15925
|
} catch (err) {
|
|
15657
15926
|
fail(err, "alation", "datasource-list", start);
|
|
@@ -15661,7 +15930,7 @@ function registerAlationCommands(program2) {
|
|
|
15661
15930
|
const start = Date.now();
|
|
15662
15931
|
try {
|
|
15663
15932
|
const dsId = parsePositiveId(id2, "data source ID");
|
|
15664
|
-
const data = await
|
|
15933
|
+
const data = await getHttp8(program2).alation(`integration/v1/datasource/${dsId}/`);
|
|
15665
15934
|
success(data, "alation", "datasource-get", start);
|
|
15666
15935
|
} catch (err) {
|
|
15667
15936
|
fail(err, "alation", "datasource-get", start);
|
|
@@ -15674,7 +15943,7 @@ function registerAlationCommands(program2) {
|
|
|
15674
15943
|
const params = { ...pageParams(opts) };
|
|
15675
15944
|
if (opts.ds) params.ds_id = parsePositiveId(opts.ds, "--ds");
|
|
15676
15945
|
if (opts.name) params.name = opts.name;
|
|
15677
|
-
const data = await
|
|
15946
|
+
const data = await getHttp8(program2).alation("integration/v2/schema/", { params });
|
|
15678
15947
|
success({ count: data.length, limit: params.limit, skip: params.skip, schemas: data }, "alation", "schema-list", start);
|
|
15679
15948
|
} catch (err) {
|
|
15680
15949
|
fail(err, "alation", "schema-list", start);
|
|
@@ -15683,7 +15952,7 @@ function registerAlationCommands(program2) {
|
|
|
15683
15952
|
schema.command("get").description("Get a schema by ID").argument("<id>", "Schema ID").action(async (id2) => {
|
|
15684
15953
|
const start = Date.now();
|
|
15685
15954
|
try {
|
|
15686
|
-
const data = await getOne(
|
|
15955
|
+
const data = await getOne(getHttp8(program2), "integration/v2/schema/", parsePositiveId(id2, "schema ID"), "Schema");
|
|
15687
15956
|
success(data, "alation", "schema-get", start);
|
|
15688
15957
|
} catch (err) {
|
|
15689
15958
|
fail(err, "alation", "schema-get", start);
|
|
@@ -15699,7 +15968,7 @@ function registerAlationCommands(program2) {
|
|
|
15699
15968
|
if (opts.schemaName) params.schema_name = opts.schemaName;
|
|
15700
15969
|
if (opts.name) params.name = opts.name;
|
|
15701
15970
|
if (opts.search) params.name__icontains = opts.search;
|
|
15702
|
-
const data = await
|
|
15971
|
+
const data = await getHttp8(program2).alation("integration/v2/table/", { params });
|
|
15703
15972
|
success({ count: data.length, limit: params.limit, skip: params.skip, tables: data }, "alation", "table-list", start);
|
|
15704
15973
|
} catch (err) {
|
|
15705
15974
|
fail(err, "alation", "table-list", start);
|
|
@@ -15708,7 +15977,7 @@ function registerAlationCommands(program2) {
|
|
|
15708
15977
|
table.command("get").description("Get a table by ID, optionally with its columns").argument("<id>", "Table ID").option("--columns", "Also fetch the table's columns (up to 1000)").action(async (id2, opts) => {
|
|
15709
15978
|
const start = Date.now();
|
|
15710
15979
|
try {
|
|
15711
|
-
const http =
|
|
15980
|
+
const http = getHttp8(program2);
|
|
15712
15981
|
const tableId = parsePositiveId(id2, "table ID");
|
|
15713
15982
|
const data = await getOne(http, "integration/v2/table/", tableId, "Table");
|
|
15714
15983
|
if (opts.columns) {
|
|
@@ -15737,7 +16006,7 @@ function registerAlationCommands(program2) {
|
|
|
15737
16006
|
if (opts.ds) params.ds_id = parsePositiveId(opts.ds, "--ds");
|
|
15738
16007
|
if (opts.name) params.name = opts.name;
|
|
15739
16008
|
if (opts.search) params.name__icontains = opts.search;
|
|
15740
|
-
const data = await
|
|
16009
|
+
const data = await getHttp8(program2).alation("integration/v2/column/", { params });
|
|
15741
16010
|
success({ count: data.length, limit: params.limit, skip: params.skip, columns: data }, "alation", "column-list", start);
|
|
15742
16011
|
} catch (err) {
|
|
15743
16012
|
fail(err, "alation", "column-list", start);
|
|
@@ -15746,7 +16015,7 @@ function registerAlationCommands(program2) {
|
|
|
15746
16015
|
column.command("get").description("Get a column by ID").argument("<id>", "Column ID").action(async (id2) => {
|
|
15747
16016
|
const start = Date.now();
|
|
15748
16017
|
try {
|
|
15749
|
-
const data = await getOne(
|
|
16018
|
+
const data = await getOne(getHttp8(program2), "integration/v2/column/", parsePositiveId(id2, "column ID"), "Column");
|
|
15750
16019
|
success(data, "alation", "column-get", start);
|
|
15751
16020
|
} catch (err) {
|
|
15752
16021
|
fail(err, "alation", "column-get", start);
|
|
@@ -15761,7 +16030,7 @@ function registerAlationCommands(program2) {
|
|
|
15761
16030
|
const params = { q: query, limit, offset };
|
|
15762
16031
|
const otypes = parseOtypes(opts.otype);
|
|
15763
16032
|
if (otypes) params.filters = JSON.stringify({ otypes });
|
|
15764
|
-
const data = await
|
|
16033
|
+
const data = await getHttp8(program2).alation("integration/v1/search/", { params });
|
|
15765
16034
|
success(
|
|
15766
16035
|
{ query, total: data.total, limit: data.limit, offset: data.offset, fullSearchUrl: data.full_search_url, results: data.results },
|
|
15767
16036
|
"alation",
|
|
@@ -15780,7 +16049,7 @@ function registerAlationCommands(program2) {
|
|
|
15780
16049
|
if (opts.hub) params.document_hub_id = parsePositiveId(opts.hub, "--hub");
|
|
15781
16050
|
if (opts.parent) params.parent_folder_id = parsePositiveId(opts.parent, "--parent");
|
|
15782
16051
|
if (opts.search) params.search = opts.search;
|
|
15783
|
-
const data = await
|
|
16052
|
+
const data = await getHttp8(program2).alation("integration/v2/folder/", { params });
|
|
15784
16053
|
success({ count: data.length, limit: params.limit, skip: params.skip, folders: data }, "alation", "folder-list", start);
|
|
15785
16054
|
} catch (err) {
|
|
15786
16055
|
fail(err, "alation", "folder-list", start);
|
|
@@ -15789,7 +16058,7 @@ function registerAlationCommands(program2) {
|
|
|
15789
16058
|
folder.command("get").description("Get a Document Hub folder by ID").argument("<id>", "Folder ID").action(async (id2) => {
|
|
15790
16059
|
const start = Date.now();
|
|
15791
16060
|
try {
|
|
15792
|
-
const data = await getOne(
|
|
16061
|
+
const data = await getOne(getHttp8(program2), "integration/v2/folder/", parsePositiveId(id2, "folder ID"), "Folder");
|
|
15793
16062
|
success(data, "alation", "folder-get", start);
|
|
15794
16063
|
} catch (err) {
|
|
15795
16064
|
fail(err, "alation", "folder-get", start);
|
|
@@ -15805,7 +16074,7 @@ function registerAlationCommands(program2) {
|
|
|
15805
16074
|
if (opts.parentDocument) params.parent_document_id = parsePositiveId(opts.parentDocument, "--parent-document");
|
|
15806
16075
|
if (opts.search) params.search = opts.search;
|
|
15807
16076
|
if (opts.deleted) params.deleted = true;
|
|
15808
|
-
const data = await
|
|
16077
|
+
const data = await getHttp8(program2).alation("integration/v2/document/", { params });
|
|
15809
16078
|
success({ count: data.length, limit: params.limit, skip: params.skip, documents: data }, "alation", "document-list", start);
|
|
15810
16079
|
} catch (err) {
|
|
15811
16080
|
fail(err, "alation", "document-list", start);
|
|
@@ -15814,7 +16083,7 @@ function registerAlationCommands(program2) {
|
|
|
15814
16083
|
document.command("get").description("Get a document by ID, including its custom field values").argument("<id>", "Document ID").action(async (id2) => {
|
|
15815
16084
|
const start = Date.now();
|
|
15816
16085
|
try {
|
|
15817
|
-
const data = await getOne(
|
|
16086
|
+
const data = await getOne(getHttp8(program2), "integration/v2/document/", parsePositiveId(id2, "document ID"), "Document");
|
|
15818
16087
|
success(data, "alation", "document-get", start);
|
|
15819
16088
|
} catch (err) {
|
|
15820
16089
|
fail(err, "alation", "document-get", start);
|
|
@@ -15835,7 +16104,7 @@ function registerAlationCommands(program2) {
|
|
|
15835
16104
|
for (const [key, flag] of [["title", "--title"], ["document_hub_id", "--hub"], ["parent_folder_id", "--folder"]]) {
|
|
15836
16105
|
if (payload[key] === void 0) throw new PncliError(`${flag} is required to create a document (or set it in --input-file)`, 1);
|
|
15837
16106
|
}
|
|
15838
|
-
const data = await
|
|
16107
|
+
const data = await getHttp8(program2).alation("integration/v2/document/", { method: "POST", body: [payload] });
|
|
15839
16108
|
success({ jobId: data.job_id, document: payload, ...overrides.length ? { overrides } : {} }, "alation", "document-create", start);
|
|
15840
16109
|
} catch (err) {
|
|
15841
16110
|
fail(err, "alation", "document-create", start);
|
|
@@ -15853,7 +16122,7 @@ function registerAlationCommands(program2) {
|
|
|
15853
16122
|
throw new PncliError("Nothing to update. Pass --title, --description, --folder, or --input-file.", 1);
|
|
15854
16123
|
}
|
|
15855
16124
|
const body = [{ id: documentId, ...payload }];
|
|
15856
|
-
const data = await
|
|
16125
|
+
const data = await getHttp8(program2).alation("integration/v2/document/", { method: "PUT", body });
|
|
15857
16126
|
success({ jobId: data.job_id, document: body[0], ...overrides.length ? { overrides } : {} }, "alation", "document-update", start);
|
|
15858
16127
|
} catch (err) {
|
|
15859
16128
|
fail(err, "alation", "document-update", start);
|
|
@@ -15864,7 +16133,7 @@ function registerAlationCommands(program2) {
|
|
|
15864
16133
|
const start = Date.now();
|
|
15865
16134
|
try {
|
|
15866
16135
|
const jobId = parsePositiveId(id2, "job ID");
|
|
15867
|
-
const data = await
|
|
16136
|
+
const data = await getHttp8(program2).alation("api/v1/bulk_metadata/job/", { params: { id: jobId } });
|
|
15868
16137
|
success({ jobId, ...data }, "alation", "job-get", start);
|
|
15869
16138
|
} catch (err) {
|
|
15870
16139
|
fail(err, "alation", "job-get", start);
|
|
@@ -15913,6 +16182,7 @@ registerJwtCommands(program);
|
|
|
15913
16182
|
registerOpenShiftCommands(program);
|
|
15914
16183
|
registerDynatraceCommands(program);
|
|
15915
16184
|
registerLogscaleCommands(program);
|
|
16185
|
+
registerElasticsearchCommands(program);
|
|
15916
16186
|
registerSplitioCommands(program);
|
|
15917
16187
|
registerFigmaCommands(program);
|
|
15918
16188
|
registerAlationCommands(program);
|
|
@@ -15933,9 +16203,10 @@ Services:
|
|
|
15933
16203
|
checkmarx Checkmarx One (projects, scans, scan statistics)
|
|
15934
16204
|
contrast Contrast IAST (applications, vulnerability findings, libraries)
|
|
15935
16205
|
sonatypeiq Sonatype IQ Server (applications, organizations, policies)
|
|
15936
|
-
openshift OpenShift / Kubernetes (pods, events, logs, metrics)
|
|
16206
|
+
openshift OpenShift / Kubernetes (pods, deployments, events, logs, metrics)
|
|
15937
16207
|
dynatrace Dynatrace (services, entities, problems, traces, Kubernetes workloads)
|
|
15938
16208
|
logscale LogScale (log query, repositories)
|
|
16209
|
+
elasticsearch Elasticsearch (search, count, indices, cluster health)
|
|
15939
16210
|
splitio Split.IO (feature flags, Change Requests)
|
|
15940
16211
|
figma Figma (files, comments, version history)
|
|
15941
16212
|
alation Alation (data sources, schemas, tables, columns, search, Document Hubs)
|