@kolatts/pncli 4.1.1 → 5.0.1
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 +2 -3
- package/dist/{chunk-LH7WBP7W.js → chunk-3JICA4FZ.js} +1 -16
- package/dist/chunk-3JICA4FZ.js.map +1 -0
- package/dist/{chunk-HZF6WQPU.js → chunk-BHZORLOF.js} +6 -3
- package/dist/chunk-BHZORLOF.js.map +1 -0
- package/dist/{chunk-7MFRRV5V.js → chunk-VCECVN3F.js} +25 -44
- package/dist/chunk-VCECVN3F.js.map +1 -0
- package/dist/cli.js +57 -261
- package/dist/cli.js.map +1 -1
- package/dist/{config-JGBUUXQX.js → config-7FK4MAQC.js} +2 -2
- package/dist/{http-44W5CSDF.js → http-73CNKAH6.js} +3 -3
- package/dist/{output-XT3WT5L5.js → output-3G3WZVZA.js} +2 -2
- package/package.json +1 -2
- package/skills/pncli/SKILL.md +2 -3
- package/skills/pncli/splitio.md +1 -1
- package/dist/chunk-7MFRRV5V.js.map +0 -1
- package/dist/chunk-HZF6WQPU.js.map +0 -1
- package/dist/chunk-LH7WBP7W.js.map +0 -1
- package/skills/pncli/servicenow.md +0 -33
- /package/dist/{config-JGBUUXQX.js.map → config-7FK4MAQC.js.map} +0 -0
- /package/dist/{http-44W5CSDF.js.map → http-73CNKAH6.js.map} +0 -0
- /package/dist/{output-XT3WT5L5.js.map → output-3G3WZVZA.js.map} +0 -0
package/dist/cli.js
CHANGED
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
setRepoConfigValue,
|
|
10
10
|
writeGlobalConfig,
|
|
11
11
|
writeRepoConfig
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-3JICA4FZ.js";
|
|
13
13
|
import {
|
|
14
14
|
createHttpClient
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-VCECVN3F.js";
|
|
16
16
|
import {
|
|
17
17
|
ExitCode,
|
|
18
18
|
PncliError,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
success,
|
|
24
24
|
warn,
|
|
25
25
|
writeRawOutput
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-BHZORLOF.js";
|
|
27
27
|
import {
|
|
28
28
|
AdoCoreClient
|
|
29
29
|
} from "./chunk-VDL32PSG.js";
|
|
@@ -6308,19 +6308,6 @@ async function runCredentialChecks(cfg, http) {
|
|
|
6308
6308
|
results.checkmarx = categorize(err);
|
|
6309
6309
|
}
|
|
6310
6310
|
}
|
|
6311
|
-
const snCreds = cfg.servicenow.username && (cfg.servicenow.password || cfg.servicenow.apiToken);
|
|
6312
|
-
if (!snCreds) {
|
|
6313
|
-
results.servicenow = { status: "blank", message: "not configured" };
|
|
6314
|
-
} else if (!cfg.servicenow.baseUrl) {
|
|
6315
|
-
results.servicenow = { status: "error", message: "baseUrl not configured" };
|
|
6316
|
-
} else {
|
|
6317
|
-
try {
|
|
6318
|
-
await http.servicenow("/api/now/table/change_request", { params: { sysparm_limit: 1 }, timeoutMs: 1e4 });
|
|
6319
|
-
results.servicenow = { status: "valid", message: "ok" };
|
|
6320
|
-
} catch (err) {
|
|
6321
|
-
results.servicenow = categorize(err);
|
|
6322
|
-
}
|
|
6323
|
-
}
|
|
6324
6311
|
if (!cfg.contrast.apiKey || !cfg.contrast.serviceKey || !cfg.contrast.username) {
|
|
6325
6312
|
results.contrast = { status: "blank", message: "not configured" };
|
|
6326
6313
|
} else if (!cfg.contrast.orgUuid) {
|
|
@@ -8168,17 +8155,6 @@ function registerConfigCommands(program2) {
|
|
|
8168
8155
|
} else {
|
|
8169
8156
|
results.checkmarx = { ok: null, message: "not configured" };
|
|
8170
8157
|
}
|
|
8171
|
-
const snConfigured = cfg.servicenow.baseUrl && cfg.servicenow.username && (cfg.servicenow.password || cfg.servicenow.apiToken);
|
|
8172
|
-
if (snConfigured) {
|
|
8173
|
-
try {
|
|
8174
|
-
await http.servicenow("/api/now/table/change_request", { params: { sysparm_limit: 1 } });
|
|
8175
|
-
results.servicenow = { ok: true, message: "connected" };
|
|
8176
|
-
} catch (err) {
|
|
8177
|
-
results.servicenow = { ok: false, message: err instanceof Error ? err.message : String(err) };
|
|
8178
|
-
}
|
|
8179
|
-
} else {
|
|
8180
|
-
results.servicenow = { ok: null, message: "not configured" };
|
|
8181
|
-
}
|
|
8182
8158
|
if (cfg.contrast.apiKey && cfg.contrast.serviceKey && cfg.contrast.username && cfg.contrast.orgUuid) {
|
|
8183
8159
|
try {
|
|
8184
8160
|
await http.contrast(`/Contrast/api/ng/${cfg.contrast.orgUuid}/applications`, { params: { limit: 1 } });
|
|
@@ -8363,7 +8339,6 @@ function registerConfigCommands(program2) {
|
|
|
8363
8339
|
"jenkins",
|
|
8364
8340
|
"artifactory",
|
|
8365
8341
|
"checkmarx",
|
|
8366
|
-
"servicenow",
|
|
8367
8342
|
"contrast",
|
|
8368
8343
|
"sonatypeiq",
|
|
8369
8344
|
"openshift",
|
|
@@ -8708,61 +8683,6 @@ async function initGlobalConfig(start) {
|
|
|
8708
8683
|
}
|
|
8709
8684
|
}
|
|
8710
8685
|
}
|
|
8711
|
-
process.stderr.write("\n\u2500\u2500 ServiceNow \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");
|
|
8712
|
-
const useServiceNow = await confirm({
|
|
8713
|
-
message: "Configure ServiceNow for change management?",
|
|
8714
|
-
default: false
|
|
8715
|
-
});
|
|
8716
|
-
let servicenowBaseUrl = "";
|
|
8717
|
-
let servicenowUsername = "";
|
|
8718
|
-
let servicenowPassword = "";
|
|
8719
|
-
let servicenowApiToken = "";
|
|
8720
|
-
if (useServiceNow) {
|
|
8721
|
-
servicenowBaseUrl = await input2({
|
|
8722
|
-
message: "ServiceNow instance URL (e.g. imagile.service-now.com):",
|
|
8723
|
-
default: ""
|
|
8724
|
-
});
|
|
8725
|
-
servicenowUsername = await input2({
|
|
8726
|
-
message: "ServiceNow username:",
|
|
8727
|
-
default: ""
|
|
8728
|
-
});
|
|
8729
|
-
const snUseToken = await confirm({
|
|
8730
|
-
message: "Authenticate with an API token instead of a password?",
|
|
8731
|
-
default: false
|
|
8732
|
-
});
|
|
8733
|
-
if (snUseToken) {
|
|
8734
|
-
servicenowApiToken = await password({
|
|
8735
|
-
message: "ServiceNow API token:",
|
|
8736
|
-
validate: (v) => v.length > 0 || "Token cannot be blank"
|
|
8737
|
-
});
|
|
8738
|
-
} else {
|
|
8739
|
-
servicenowPassword = await password({
|
|
8740
|
-
message: "ServiceNow password:",
|
|
8741
|
-
validate: (v) => v.length > 0 || "Password cannot be blank"
|
|
8742
|
-
});
|
|
8743
|
-
}
|
|
8744
|
-
const snHasCreds = servicenowBaseUrl && servicenowUsername && (servicenowPassword || servicenowApiToken);
|
|
8745
|
-
if (snHasCreds) {
|
|
8746
|
-
process.stderr.write("\n Verifying connection...\n");
|
|
8747
|
-
try {
|
|
8748
|
-
const tempConfig = {
|
|
8749
|
-
...loadConfig(),
|
|
8750
|
-
servicenow: {
|
|
8751
|
-
baseUrl: normalizeBaseUrl(servicenowBaseUrl),
|
|
8752
|
-
username: servicenowUsername,
|
|
8753
|
-
password: servicenowPassword || void 0,
|
|
8754
|
-
apiToken: servicenowApiToken || void 0
|
|
8755
|
-
}
|
|
8756
|
-
};
|
|
8757
|
-
const tempHttp = createHttpClient(tempConfig);
|
|
8758
|
-
await tempHttp.servicenow("/api/now/table/change_request", { params: { sysparm_limit: 1 } });
|
|
8759
|
-
process.stderr.write(" Connected.\n");
|
|
8760
|
-
} catch (err) {
|
|
8761
|
-
warn(`Could not connect to ServiceNow: ${err instanceof Error ? err.message : String(err)}`);
|
|
8762
|
-
warn("Config will be saved anyway. Check your URL and credentials and re-run pncli config init or pncli config test.");
|
|
8763
|
-
}
|
|
8764
|
-
}
|
|
8765
|
-
}
|
|
8766
8686
|
process.stderr.write("\n\u2500\u2500 Sonatype IQ Server \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");
|
|
8767
8687
|
const useSonatypeIq = await confirm({
|
|
8768
8688
|
message: "Configure Sonatype IQ Server for dependency vulnerability scanning?",
|
|
@@ -9143,14 +9063,6 @@ async function initGlobalConfig(start) {
|
|
|
9143
9063
|
clientSecret: checkmarxClientSecret || void 0
|
|
9144
9064
|
}
|
|
9145
9065
|
} : {},
|
|
9146
|
-
...useServiceNow && servicenowBaseUrl ? {
|
|
9147
|
-
servicenow: {
|
|
9148
|
-
baseUrl: normalizeBaseUrl(servicenowBaseUrl),
|
|
9149
|
-
username: servicenowUsername || void 0,
|
|
9150
|
-
...servicenowApiToken ? { apiToken: servicenowApiToken } : {},
|
|
9151
|
-
...servicenowPassword ? { password: servicenowPassword } : {}
|
|
9152
|
-
}
|
|
9153
|
-
} : {},
|
|
9154
9066
|
...useContrast && contrastOrgUuid ? {
|
|
9155
9067
|
contrast: {
|
|
9156
9068
|
...contrastBaseUrl ? { baseUrl: normalizeBaseUrl(contrastBaseUrl) } : {},
|
|
@@ -10430,11 +10342,11 @@ function registerAdoRepoCommands(ado) {
|
|
|
10430
10342
|
const start = Date.now();
|
|
10431
10343
|
try {
|
|
10432
10344
|
const globalOpts = ado.optsWithGlobals();
|
|
10433
|
-
const { loadConfig: lc } = await import("./config-
|
|
10345
|
+
const { loadConfig: lc } = await import("./config-7FK4MAQC.js");
|
|
10434
10346
|
const config = lc({ configPath: globalOpts.config });
|
|
10435
10347
|
const { collection, project, repo: repo2, gitClient } = getAdoContext(ado, true);
|
|
10436
10348
|
const { AdoCoreClient: AdoCoreClient2 } = await import("./core-SWYVXOQ4.js");
|
|
10437
|
-
const { createHttpClient: createHttpClient2 } = await import("./http-
|
|
10349
|
+
const { createHttpClient: createHttpClient2 } = await import("./http-73CNKAH6.js");
|
|
10438
10350
|
const http = createHttpClient2(config, Boolean(globalOpts.dryRun));
|
|
10439
10351
|
const coreClient = new AdoCoreClient2(http);
|
|
10440
10352
|
const me = await coreClient.getConnectionData(collection);
|
|
@@ -11190,119 +11102,6 @@ function registerCheckmarxCommands(program2) {
|
|
|
11190
11102
|
});
|
|
11191
11103
|
}
|
|
11192
11104
|
|
|
11193
|
-
// src/services/servicenow/commands.ts
|
|
11194
|
-
function getHttp(program2) {
|
|
11195
|
-
const opts = program2.optsWithGlobals();
|
|
11196
|
-
const config = loadConfig({ configPath: opts.config });
|
|
11197
|
-
if (!config.servicenow.baseUrl) throw new PncliError("ServiceNow not configured. Run: pncli config init");
|
|
11198
|
-
return createHttpClient(config, Boolean(opts.dryRun));
|
|
11199
|
-
}
|
|
11200
|
-
function registerServiceNowCommands(program2) {
|
|
11201
|
-
const sn = program2.command("servicenow").description("ServiceNow operations");
|
|
11202
|
-
const change = sn.command("change").description("Change request operations");
|
|
11203
|
-
change.command("list").description("List change requests").option("--state <state>", "Filter by state (e.g. -1=Pending, 1=Open, 2=Work in Progress, 3=Closed Complete)").option("--assigned-to <user>", "Filter by assigned user sys_id or display name").option("--limit <n>", "Maximum number of results", "25").option("--fields <fields>", "Comma-separated field names to return").action(async (opts) => {
|
|
11204
|
-
const start = Date.now();
|
|
11205
|
-
try {
|
|
11206
|
-
const http = getHttp(program2);
|
|
11207
|
-
const params = {
|
|
11208
|
-
sysparm_limit: opts.limit ? parseInt(opts.limit, 10) : 25,
|
|
11209
|
-
sysparm_display_value: "true"
|
|
11210
|
-
};
|
|
11211
|
-
const sanitize = (v) => v.replace(/\^/g, "");
|
|
11212
|
-
const queries = [];
|
|
11213
|
-
if (opts.state !== void 0) queries.push(`state=${sanitize(opts.state)}`);
|
|
11214
|
-
if (opts.assignedTo) queries.push(`assigned_to=${sanitize(opts.assignedTo)}`);
|
|
11215
|
-
if (queries.length) params["sysparm_query"] = queries.join("^");
|
|
11216
|
-
if (opts.fields) params["sysparm_fields"] = opts.fields;
|
|
11217
|
-
const data = await http.servicenow("/api/now/table/change_request", { params });
|
|
11218
|
-
success(data.result, "servicenow", "change list", start);
|
|
11219
|
-
} catch (err) {
|
|
11220
|
-
fail(err, "servicenow", "change list", start);
|
|
11221
|
-
}
|
|
11222
|
-
});
|
|
11223
|
-
change.command("get").description("Get a change request by sys_id or number").requiredOption("--id <id>", "Change request sys_id or number (e.g. CHG0001234)").action(async (opts) => {
|
|
11224
|
-
const start = Date.now();
|
|
11225
|
-
try {
|
|
11226
|
-
const http = getHttp(program2);
|
|
11227
|
-
if (opts.id.toUpperCase().startsWith("CHG")) {
|
|
11228
|
-
const list = await http.servicenow("/api/now/table/change_request", {
|
|
11229
|
-
params: { sysparm_query: `number=${opts.id}`, sysparm_display_value: "true", sysparm_limit: 1 }
|
|
11230
|
-
});
|
|
11231
|
-
if (!list.result.length) throw new PncliError(`Change request not found: ${opts.id}`, 1);
|
|
11232
|
-
success(list.result[0], "servicenow", "change get", start);
|
|
11233
|
-
return;
|
|
11234
|
-
}
|
|
11235
|
-
const data = await http.servicenow(`/api/now/table/change_request/${opts.id}`, {
|
|
11236
|
-
params: { sysparm_display_value: "true" }
|
|
11237
|
-
});
|
|
11238
|
-
success(data.result, "servicenow", "change get", start);
|
|
11239
|
-
} catch (err) {
|
|
11240
|
-
fail(err, "servicenow", "change get", start);
|
|
11241
|
-
}
|
|
11242
|
-
});
|
|
11243
|
-
change.command("create").description("Create a change request").requiredOption("--short-description <text>", "Short description (title)").option("--description <text>", "Full description").option("--type <type>", "Change type: normal, standard, or emergency", "normal").option("--priority <n>", "Priority: 1=Critical, 2=High, 3=Moderate, 4=Low").option("--assigned-to <user>", "Assigned user sys_id").option("--assignment-group <group>", "Assignment group sys_id").option("--start-date <datetime>", "Planned start date (yyyy-MM-dd HH:mm:ss)").option("--end-date <datetime>", "Planned end date (yyyy-MM-dd HH:mm:ss)").action(async (opts) => {
|
|
11244
|
-
const start = Date.now();
|
|
11245
|
-
try {
|
|
11246
|
-
const http = getHttp(program2);
|
|
11247
|
-
const body = {
|
|
11248
|
-
short_description: opts.shortDescription,
|
|
11249
|
-
type: opts.type ?? "normal"
|
|
11250
|
-
};
|
|
11251
|
-
if (opts.description) body["description"] = opts.description;
|
|
11252
|
-
if (opts.priority) body["priority"] = opts.priority;
|
|
11253
|
-
if (opts.assignedTo) body["assigned_to"] = opts.assignedTo;
|
|
11254
|
-
if (opts.assignmentGroup) body["assignment_group"] = opts.assignmentGroup;
|
|
11255
|
-
if (opts.startDate) body["start_date"] = opts.startDate;
|
|
11256
|
-
if (opts.endDate) body["end_date"] = opts.endDate;
|
|
11257
|
-
const data = await http.servicenow("/api/now/table/change_request", {
|
|
11258
|
-
method: "POST",
|
|
11259
|
-
body
|
|
11260
|
-
});
|
|
11261
|
-
success(data.result, "servicenow", "change create", start);
|
|
11262
|
-
} catch (err) {
|
|
11263
|
-
fail(err, "servicenow", "change create", start);
|
|
11264
|
-
}
|
|
11265
|
-
});
|
|
11266
|
-
change.command("update").description("Update a change request").requiredOption("--id <sys_id>", "Change request sys_id").option("--short-description <text>", "New short description").option("--description <text>", "New description").option("--state <state>", "New state value").option("--priority <n>", "New priority").option("--assigned-to <user>", "New assigned user sys_id").option("--start-date <datetime>", "New planned start date").option("--end-date <datetime>", "New planned end date").action(async (opts) => {
|
|
11267
|
-
const start = Date.now();
|
|
11268
|
-
try {
|
|
11269
|
-
const http = getHttp(program2);
|
|
11270
|
-
const body = {};
|
|
11271
|
-
if (opts.shortDescription) body["short_description"] = opts.shortDescription;
|
|
11272
|
-
if (opts.description) body["description"] = opts.description;
|
|
11273
|
-
if (opts.state !== void 0) body["state"] = opts.state;
|
|
11274
|
-
if (opts.priority) body["priority"] = opts.priority;
|
|
11275
|
-
if (opts.assignedTo) body["assigned_to"] = opts.assignedTo;
|
|
11276
|
-
if (opts.startDate) body["start_date"] = opts.startDate;
|
|
11277
|
-
if (opts.endDate) body["end_date"] = opts.endDate;
|
|
11278
|
-
if (Object.keys(body).length === 0) throw new PncliError("No fields to update. Provide at least one option besides --id.", 1);
|
|
11279
|
-
const data = await http.servicenow(`/api/now/table/change_request/${opts.id}`, {
|
|
11280
|
-
method: "PATCH",
|
|
11281
|
-
body
|
|
11282
|
-
});
|
|
11283
|
-
success(data.result, "servicenow", "change update", start);
|
|
11284
|
-
} catch (err) {
|
|
11285
|
-
fail(err, "servicenow", "change update", start);
|
|
11286
|
-
}
|
|
11287
|
-
});
|
|
11288
|
-
change.command("close").description("Close a change request (state=3)").requiredOption("--id <sys_id>", "Change request sys_id").option("--close-notes <text>", "Closure notes").option("--close-code <code>", "Close code (e.g. successful, unsuccessful)").action(async (opts) => {
|
|
11289
|
-
const start = Date.now();
|
|
11290
|
-
try {
|
|
11291
|
-
const http = getHttp(program2);
|
|
11292
|
-
const body = { state: 3 };
|
|
11293
|
-
if (opts.closeNotes) body["close_notes"] = opts.closeNotes;
|
|
11294
|
-
if (opts.closeCode) body["close_code"] = opts.closeCode;
|
|
11295
|
-
const data = await http.servicenow(`/api/now/table/change_request/${opts.id}`, {
|
|
11296
|
-
method: "PATCH",
|
|
11297
|
-
body
|
|
11298
|
-
});
|
|
11299
|
-
success(data.result, "servicenow", "change close", start);
|
|
11300
|
-
} catch (err) {
|
|
11301
|
-
fail(err, "servicenow", "change close", start);
|
|
11302
|
-
}
|
|
11303
|
-
});
|
|
11304
|
-
}
|
|
11305
|
-
|
|
11306
11105
|
// src/services/contrast/commands.ts
|
|
11307
11106
|
function getHttpAndOrg(program2) {
|
|
11308
11107
|
const opts = program2.optsWithGlobals();
|
|
@@ -11549,7 +11348,7 @@ function resolveCluster(config, env, instance) {
|
|
|
11549
11348
|
}
|
|
11550
11349
|
return { baseUrl: config.openshift.baseUrl, token: config.openshift.token };
|
|
11551
11350
|
}
|
|
11552
|
-
function
|
|
11351
|
+
function getHttp(oc) {
|
|
11553
11352
|
const opts = oc.optsWithGlobals();
|
|
11554
11353
|
const config = loadConfig({ configPath: opts.config });
|
|
11555
11354
|
const cluster = resolveCluster(config, opts.env, opts.instance);
|
|
@@ -11625,7 +11424,7 @@ function registerOpenShiftCommands(program2) {
|
|
|
11625
11424
|
oc.command("pods").description("List pod health summary for a namespace \u2014 pre-processed for LLM analysis. Use --raw to return the full unmodified Kubernetes pod objects.").requiredOption("--namespace <ns>", "Kubernetes namespace").option("--label-selector <selector>", "Label selector (e.g. app=my-app)").option("--raw", "Return full Kubernetes pod objects without summarization (includes env vars, images, node name, annotations, resources, etc.)", false).action(async (opts) => {
|
|
11626
11425
|
const start = Date.now();
|
|
11627
11426
|
try {
|
|
11628
|
-
const http =
|
|
11427
|
+
const http = getHttp(oc);
|
|
11629
11428
|
const params = {};
|
|
11630
11429
|
if (opts.labelSelector) params["labelSelector"] = opts.labelSelector;
|
|
11631
11430
|
const podList = await http.openshift(
|
|
@@ -11734,7 +11533,7 @@ function registerOpenShiftCommands(program2) {
|
|
|
11734
11533
|
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) => {
|
|
11735
11534
|
const start = Date.now();
|
|
11736
11535
|
try {
|
|
11737
|
-
const http =
|
|
11536
|
+
const http = getHttp(oc);
|
|
11738
11537
|
const params = {};
|
|
11739
11538
|
const selectors = [];
|
|
11740
11539
|
if (!opts.all) selectors.push("type=Warning");
|
|
@@ -11768,7 +11567,7 @@ function registerOpenShiftCommands(program2) {
|
|
|
11768
11567
|
oc.command("logs").description("Get recent log lines from a pod container").requiredOption("--namespace <ns>", "Kubernetes namespace").requiredOption("--pod <name>", "Pod name").option("--container <name>", "Container name (defaults to first container)").option("--lines <n>", "Number of most-recent lines to return", "100").option("--previous", "Return logs from the previous container instance", false).action(async (opts) => {
|
|
11769
11568
|
const start = Date.now();
|
|
11770
11569
|
try {
|
|
11771
|
-
const http =
|
|
11570
|
+
const http = getHttp(oc);
|
|
11772
11571
|
const lines = opts.lines ? parseInt(opts.lines, 10) : 100;
|
|
11773
11572
|
const logText = await http.openshiftText(
|
|
11774
11573
|
`/api/v1/namespaces/${encodeURIComponent(opts.namespace)}/pods/${encodeURIComponent(opts.pod)}/log`,
|
|
@@ -11800,7 +11599,7 @@ function registerOpenShiftCommands(program2) {
|
|
|
11800
11599
|
oc.command("pod-metrics").description("Get CPU and memory usage for pods in a namespace (requires metrics-server)").requiredOption("--namespace <ns>", "Kubernetes namespace").action(async (opts) => {
|
|
11801
11600
|
const start = Date.now();
|
|
11802
11601
|
try {
|
|
11803
|
-
const http =
|
|
11602
|
+
const http = getHttp(oc);
|
|
11804
11603
|
const metricsList = await http.openshift(
|
|
11805
11604
|
`/apis/metrics.k8s.io/v1beta1/namespaces/${encodeURIComponent(opts.namespace)}/pods`
|
|
11806
11605
|
);
|
|
@@ -11820,7 +11619,7 @@ function registerOpenShiftCommands(program2) {
|
|
|
11820
11619
|
oc.command("resource-usage").description("Combined CPU/memory usage, limits, and requests for all pods in a namespace \u2014 all values normalized to millicores (m) and mebibytes (Mi). Requires metrics-server. Use --csv to emit a spreadsheet-friendly CSV.").requiredOption("--namespace <ns>", "Kubernetes namespace").option("--label-selector <selector>", "Label selector (e.g. app=my-app)").option("--csv", "Output as CSV instead of JSON (suitable for Excel)", false).action(async (opts) => {
|
|
11821
11620
|
const start = Date.now();
|
|
11822
11621
|
try {
|
|
11823
|
-
const http =
|
|
11622
|
+
const http = getHttp(oc);
|
|
11824
11623
|
const nsEncoded = encodeURIComponent(opts.namespace);
|
|
11825
11624
|
const podParams = {};
|
|
11826
11625
|
if (opts.labelSelector) podParams["labelSelector"] = opts.labelSelector;
|
|
@@ -11885,7 +11684,7 @@ function registerOpenShiftCommands(program2) {
|
|
|
11885
11684
|
}
|
|
11886
11685
|
|
|
11887
11686
|
// src/services/dynatrace/commands.ts
|
|
11888
|
-
function
|
|
11687
|
+
function getHttp2(program2, envName) {
|
|
11889
11688
|
const opts = program2.optsWithGlobals();
|
|
11890
11689
|
const cfg = loadConfig({ configPath: opts.config });
|
|
11891
11690
|
if (envName) {
|
|
@@ -12009,7 +11808,7 @@ function registerDynatraceCommands(program2) {
|
|
|
12009
11808
|
const start = Date.now();
|
|
12010
11809
|
try {
|
|
12011
11810
|
const envName = dynatrace.opts().env;
|
|
12012
|
-
const data = await listEntities(
|
|
11811
|
+
const data = await listEntities(getHttp2(program2, envName), opts.selector, opts);
|
|
12013
11812
|
success({ totalCount: data.totalCount, entities: data.items }, "dynatrace", "entities list", start);
|
|
12014
11813
|
} catch (err) {
|
|
12015
11814
|
fail(err, "dynatrace", "entities list", start);
|
|
@@ -12019,7 +11818,7 @@ function registerDynatraceCommands(program2) {
|
|
|
12019
11818
|
const start = Date.now();
|
|
12020
11819
|
try {
|
|
12021
11820
|
const envName = dynatrace.opts().env;
|
|
12022
|
-
const data = await
|
|
11821
|
+
const data = await getHttp2(program2, envName).dynatrace(
|
|
12023
11822
|
`/api/v2/entities/${encodeURIComponent(opts.id)}`,
|
|
12024
11823
|
{ params: { from: opts.from, to: opts.to, fields: opts.fields } }
|
|
12025
11824
|
);
|
|
@@ -12032,7 +11831,7 @@ function registerDynatraceCommands(program2) {
|
|
|
12032
11831
|
const start = Date.now();
|
|
12033
11832
|
try {
|
|
12034
11833
|
const envName = dynatrace.opts().env;
|
|
12035
|
-
const data = await listEntities(
|
|
11834
|
+
const data = await listEntities(getHttp2(program2, envName), 'type("SERVICE")', opts);
|
|
12036
11835
|
success({ totalCount: data.totalCount, services: data.items }, "dynatrace", "services", start);
|
|
12037
11836
|
} catch (err) {
|
|
12038
11837
|
fail(err, "dynatrace", "services", start);
|
|
@@ -12043,7 +11842,7 @@ function registerDynatraceCommands(program2) {
|
|
|
12043
11842
|
try {
|
|
12044
11843
|
const envName = dynatrace.opts().env;
|
|
12045
11844
|
const selector = 'type("CLOUD_APPLICATION")';
|
|
12046
|
-
const data = await listEntities(
|
|
11845
|
+
const data = await listEntities(getHttp2(program2, envName), selector, opts);
|
|
12047
11846
|
success({ totalCount: data.totalCount, workloads: data.items }, "dynatrace", "workloads", start);
|
|
12048
11847
|
} catch (err) {
|
|
12049
11848
|
fail(err, "dynatrace", "workloads", start);
|
|
@@ -12055,7 +11854,7 @@ function registerDynatraceCommands(program2) {
|
|
|
12055
11854
|
try {
|
|
12056
11855
|
const envName = dynatrace.opts().env;
|
|
12057
11856
|
const data = await allPages(async (nextPageKey) => {
|
|
12058
|
-
const page = await
|
|
11857
|
+
const page = await getHttp2(program2, envName).dynatrace("/api/v2/problems", {
|
|
12059
11858
|
params: nextPageKey ? { nextPageKey } : {
|
|
12060
11859
|
from: opts.from ?? "now-2h",
|
|
12061
11860
|
to: opts.to ?? "now",
|
|
@@ -12075,7 +11874,7 @@ function registerDynatraceCommands(program2) {
|
|
|
12075
11874
|
const start = Date.now();
|
|
12076
11875
|
try {
|
|
12077
11876
|
const envName = dynatrace.opts().env;
|
|
12078
|
-
const data = await
|
|
11877
|
+
const data = await getHttp2(program2, envName).dynatrace(
|
|
12079
11878
|
`/api/v2/problems/${encodeURIComponent(opts.id)}`,
|
|
12080
11879
|
{ params: { fields: opts.fields } }
|
|
12081
11880
|
);
|
|
@@ -12088,7 +11887,7 @@ function registerDynatraceCommands(program2) {
|
|
|
12088
11887
|
const start = Date.now();
|
|
12089
11888
|
try {
|
|
12090
11889
|
const envName = dynatrace.opts().env;
|
|
12091
|
-
const result = await runTraceQuery(
|
|
11890
|
+
const result = await runTraceQuery(getHttp2(program2, envName), opts.id);
|
|
12092
11891
|
success(result, "dynatrace", "trace", start);
|
|
12093
11892
|
} catch (err) {
|
|
12094
11893
|
fail(err, "dynatrace", "trace", start);
|
|
@@ -12097,7 +11896,7 @@ function registerDynatraceCommands(program2) {
|
|
|
12097
11896
|
}
|
|
12098
11897
|
|
|
12099
11898
|
// src/services/logscale/commands.ts
|
|
12100
|
-
function
|
|
11899
|
+
function getHttp3(program2) {
|
|
12101
11900
|
const opts = program2.optsWithGlobals();
|
|
12102
11901
|
return createHttpClient(
|
|
12103
11902
|
loadConfig({ configPath: opts.config }),
|
|
@@ -12110,7 +11909,7 @@ function registerLogscaleCommands(program2) {
|
|
|
12110
11909
|
repositories.command("list").description("List available repositories").action(async () => {
|
|
12111
11910
|
const start = Date.now();
|
|
12112
11911
|
try {
|
|
12113
|
-
const data = await
|
|
11912
|
+
const data = await getHttp3(program2).logscale("/api/v1/repositories");
|
|
12114
11913
|
success({ count: data.length, repositories: data }, "logscale", "repositories list", start);
|
|
12115
11914
|
} catch (err) {
|
|
12116
11915
|
fail(err, "logscale", "repositories list", start);
|
|
@@ -12127,7 +11926,7 @@ function registerLogscaleCommands(program2) {
|
|
|
12127
11926
|
showQueryEventDistribution: false,
|
|
12128
11927
|
isLive: false
|
|
12129
11928
|
};
|
|
12130
|
-
const data = await
|
|
11929
|
+
const data = await getHttp3(program2).logscale(
|
|
12131
11930
|
`/api/v1/repositories/${encodeURIComponent(opts.repository)}/query`,
|
|
12132
11931
|
{
|
|
12133
11932
|
method: "POST",
|
|
@@ -12158,7 +11957,7 @@ function registerLogscaleCommands(program2) {
|
|
|
12158
11957
|
// src/services/splitio/commands.ts
|
|
12159
11958
|
import fs6 from "fs";
|
|
12160
11959
|
import confirm2 from "@inquirer/confirm";
|
|
12161
|
-
function
|
|
11960
|
+
function getHttp4(program2) {
|
|
12162
11961
|
const opts = program2.optsWithGlobals();
|
|
12163
11962
|
return createHttpClient(
|
|
12164
11963
|
loadConfig({ configPath: opts.config }),
|
|
@@ -12203,7 +12002,7 @@ function registerSplitioCommands(program2) {
|
|
|
12203
12002
|
workspaces.command("list").description("List all Split.IO workspaces").action(async () => {
|
|
12204
12003
|
const start = Date.now();
|
|
12205
12004
|
try {
|
|
12206
|
-
const http =
|
|
12005
|
+
const http = getHttp4(program2);
|
|
12207
12006
|
const data = await http.splitio("/internal/api/v2/workspaces");
|
|
12208
12007
|
success(
|
|
12209
12008
|
{ count: data.objects.length, workspaces: data.objects },
|
|
@@ -12219,7 +12018,7 @@ function registerSplitioCommands(program2) {
|
|
|
12219
12018
|
environments.command("list").description("List environments in a workspace").requiredOption("--workspace <id>", "Workspace ID").action(async (opts) => {
|
|
12220
12019
|
const start = Date.now();
|
|
12221
12020
|
try {
|
|
12222
|
-
const http =
|
|
12021
|
+
const http = getHttp4(program2);
|
|
12223
12022
|
const data = await http.splitio(
|
|
12224
12023
|
`/internal/api/v2/workspaces/${encodeURIComponent(opts.workspace)}/environments`
|
|
12225
12024
|
);
|
|
@@ -12237,7 +12036,7 @@ function registerSplitioCommands(program2) {
|
|
|
12237
12036
|
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) => {
|
|
12238
12037
|
const start = Date.now();
|
|
12239
12038
|
try {
|
|
12240
|
-
const http =
|
|
12039
|
+
const http = getHttp4(program2);
|
|
12241
12040
|
const params = {
|
|
12242
12041
|
wsId: opts.workspace,
|
|
12243
12042
|
limit: parseInt(opts.limit, 10),
|
|
@@ -12258,7 +12057,7 @@ function registerSplitioCommands(program2) {
|
|
|
12258
12057
|
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) => {
|
|
12259
12058
|
const start = Date.now();
|
|
12260
12059
|
try {
|
|
12261
|
-
const http =
|
|
12060
|
+
const http = getHttp4(program2);
|
|
12262
12061
|
if (opts.environment) {
|
|
12263
12062
|
const data = await http.splitio(
|
|
12264
12063
|
`/internal/api/v2/splits/${encodeURIComponent(opts.flag)}/environments/${encodeURIComponent(opts.environment)}`,
|
|
@@ -12276,13 +12075,13 @@ function registerSplitioCommands(program2) {
|
|
|
12276
12075
|
fail(err, "splitio", "flags get", start);
|
|
12277
12076
|
}
|
|
12278
12077
|
});
|
|
12279
|
-
flags.command("update").description("Submit a Change Request to replace a flag's full definition in an environment").requiredOption("--workspace <id>", "Workspace ID").requiredOption("--flag <name>", "Feature flag name").requiredOption("--environment <id>", "Environment ID").requiredOption("--mnemonic <text>", "Short Change Request title (mnemonic)").requiredOption("--description <text>", "Change Request description").requiredOption("--change-number <CHG>", "
|
|
12078
|
+
flags.command("update").description("Submit a Change Request to replace a flag's full definition in an environment").requiredOption("--workspace <id>", "Workspace ID").requiredOption("--flag <name>", "Feature flag name").requiredOption("--environment <id>", "Environment ID").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("--input-file <path>", "JSON file with the complete flag definition body (use - for stdin)").option("--yes", "Skip interactive confirmation prompt").action(async (opts) => {
|
|
12280
12079
|
const start = Date.now();
|
|
12281
12080
|
try {
|
|
12282
12081
|
if (!opts.inputFile) throw new PncliError("--input-file is required for flags update");
|
|
12283
12082
|
const definition = loadInputFile(opts.inputFile);
|
|
12284
12083
|
await confirmWrite(opts, `UPDATE ${opts.flag} in ${opts.environment}`);
|
|
12285
|
-
const http =
|
|
12084
|
+
const http = getHttp4(program2);
|
|
12286
12085
|
const body = {
|
|
12287
12086
|
...buildCrBase(opts),
|
|
12288
12087
|
operationType: "UPDATE_SPLIT_DEFINITION",
|
|
@@ -12302,13 +12101,13 @@ function registerSplitioCommands(program2) {
|
|
|
12302
12101
|
fail(err, "splitio", "flags update", start);
|
|
12303
12102
|
}
|
|
12304
12103
|
});
|
|
12305
|
-
flags.command("set-rule").description("Change one targeting rule without altering the rest of the flag definition").requiredOption("--workspace <id>", "Workspace ID").requiredOption("--flag <name>", "Feature flag name").requiredOption("--environment <id>", "Environment ID").requiredOption("--rule-index <n>", "Zero-based index of the targeting rule to update").option("--treatment <name>", "Treatment to assign to the entire rule bucket").option("--weights <json>", "JSON array of {treatment, size} objects for weighted distribution").requiredOption("--mnemonic <text>", "Short Change Request title (mnemonic)").requiredOption("--description <text>", "Change Request description").requiredOption("--change-number <CHG>", "
|
|
12104
|
+
flags.command("set-rule").description("Change one targeting rule without altering the rest of the flag definition").requiredOption("--workspace <id>", "Workspace ID").requiredOption("--flag <name>", "Feature flag name").requiredOption("--environment <id>", "Environment ID").requiredOption("--rule-index <n>", "Zero-based index of the targeting rule to update").option("--treatment <name>", "Treatment to assign to the entire rule bucket").option("--weights <json>", "JSON array of {treatment, size} objects for weighted distribution").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) => {
|
|
12306
12105
|
const start = Date.now();
|
|
12307
12106
|
try {
|
|
12308
12107
|
if (!opts.treatment && !opts.weights) {
|
|
12309
12108
|
throw new PncliError("Either --treatment or --weights must be specified");
|
|
12310
12109
|
}
|
|
12311
|
-
const http =
|
|
12110
|
+
const http = getHttp4(program2);
|
|
12312
12111
|
const current = await http.splitio(
|
|
12313
12112
|
`/internal/api/v2/splits/${encodeURIComponent(opts.flag)}/environments/${encodeURIComponent(opts.environment)}`,
|
|
12314
12113
|
{ params: { wsId: opts.workspace } }
|
|
@@ -12344,10 +12143,10 @@ function registerSplitioCommands(program2) {
|
|
|
12344
12143
|
fail(err, "splitio", "flags set-rule", start);
|
|
12345
12144
|
}
|
|
12346
12145
|
});
|
|
12347
|
-
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>", "
|
|
12146
|
+
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) => {
|
|
12348
12147
|
const start = Date.now();
|
|
12349
12148
|
try {
|
|
12350
|
-
const http =
|
|
12149
|
+
const http = getHttp4(program2);
|
|
12351
12150
|
const current = await http.splitio(
|
|
12352
12151
|
`/internal/api/v2/splits/${encodeURIComponent(opts.flag)}/environments/${encodeURIComponent(opts.environment)}`,
|
|
12353
12152
|
{ params: { wsId: opts.workspace } }
|
|
@@ -12375,13 +12174,13 @@ function registerSplitioCommands(program2) {
|
|
|
12375
12174
|
fail(err, "splitio", "flags set-default", start);
|
|
12376
12175
|
}
|
|
12377
12176
|
});
|
|
12378
|
-
flags.command("toggle").description("Enable or disable a single flag via a Change Request").requiredOption("--workspace <id>", "Workspace ID").requiredOption("--flag <name>", "Feature flag name").requiredOption("--environment <id>", "Environment ID").requiredOption("--enabled <bool>", "true to restore / false to kill the flag").requiredOption("--mnemonic <text>", "Short Change Request title (mnemonic)").requiredOption("--description <text>", "Change Request description").requiredOption("--change-number <CHG>", "
|
|
12177
|
+
flags.command("toggle").description("Enable or disable a single flag via a Change Request").requiredOption("--workspace <id>", "Workspace ID").requiredOption("--flag <name>", "Feature flag name").requiredOption("--environment <id>", "Environment ID").requiredOption("--enabled <bool>", "true to restore / false to kill the flag").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) => {
|
|
12379
12178
|
const start = Date.now();
|
|
12380
12179
|
try {
|
|
12381
12180
|
const enable = opts.enabled.toLowerCase() !== "false" && opts.enabled !== "0";
|
|
12382
12181
|
const opType = enable ? "RESTORE_SPLIT" : "KILL_SPLIT";
|
|
12383
12182
|
await confirmWrite(opts, `${opType} ${opts.flag} in ${opts.environment}`);
|
|
12384
|
-
const http =
|
|
12183
|
+
const http = getHttp4(program2);
|
|
12385
12184
|
const body = {
|
|
12386
12185
|
...buildCrBase(opts),
|
|
12387
12186
|
operationType: opType,
|
|
@@ -12397,14 +12196,14 @@ function registerSplitioCommands(program2) {
|
|
|
12397
12196
|
fail(err, "splitio", "flags toggle", start);
|
|
12398
12197
|
}
|
|
12399
12198
|
});
|
|
12400
|
-
flags.command("batch-toggle").description("Enable or disable multiple flags from a JSON file (each creates its own Change Request)").requiredOption("--workspace <id>", "Workspace ID").requiredOption("--environment <id>", "Environment ID").requiredOption("--mnemonic <text>", "Short Change Request title prefix (mnemonic)").requiredOption("--description <text>", "Change Request description").requiredOption("--change-number <CHG>", "
|
|
12199
|
+
flags.command("batch-toggle").description("Enable or disable multiple flags from a JSON file (each creates its own Change Request)").requiredOption("--workspace <id>", "Workspace ID").requiredOption("--environment <id>", "Environment ID").requiredOption("--mnemonic <text>", "Short Change Request title prefix (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 each CR").option("--input-file <path>", "JSON file: array of {flag, enabled} objects (use - for stdin)").option("--yes", "Skip interactive confirmation prompt").action(async (opts) => {
|
|
12401
12200
|
const start = Date.now();
|
|
12402
12201
|
try {
|
|
12403
12202
|
if (!opts.inputFile) throw new PncliError("--input-file is required for batch-toggle");
|
|
12404
12203
|
const entries = loadInputFile(opts.inputFile);
|
|
12405
12204
|
if (!Array.isArray(entries)) throw new PncliError("Input file must be a JSON array of {flag, enabled} objects");
|
|
12406
12205
|
await confirmWrite(opts, `BATCH_TOGGLE ${entries.length} flags in ${opts.environment}`);
|
|
12407
|
-
const http =
|
|
12206
|
+
const http = getHttp4(program2);
|
|
12408
12207
|
const results = [];
|
|
12409
12208
|
for (const entry of entries) {
|
|
12410
12209
|
try {
|
|
@@ -12434,11 +12233,11 @@ function registerSplitioCommands(program2) {
|
|
|
12434
12233
|
fail(err, "splitio", "flags batch-toggle", start);
|
|
12435
12234
|
}
|
|
12436
12235
|
});
|
|
12437
|
-
flags.command("kill").description("Submit a Change Request to kill (disable) a flag").requiredOption("--workspace <id>", "Workspace ID").requiredOption("--flag <name>", "Feature flag name").requiredOption("--environment <id>", "Environment ID").requiredOption("--mnemonic <text>", "Short Change Request title (mnemonic)").requiredOption("--description <text>", "Change Request description").requiredOption("--change-number <CHG>", "
|
|
12236
|
+
flags.command("kill").description("Submit a Change Request to kill (disable) a flag").requiredOption("--workspace <id>", "Workspace ID").requiredOption("--flag <name>", "Feature flag name").requiredOption("--environment <id>", "Environment ID").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) => {
|
|
12438
12237
|
const start = Date.now();
|
|
12439
12238
|
try {
|
|
12440
12239
|
await confirmWrite(opts, `KILL ${opts.flag} in ${opts.environment}`);
|
|
12441
|
-
const http =
|
|
12240
|
+
const http = getHttp4(program2);
|
|
12442
12241
|
const body = {
|
|
12443
12242
|
...buildCrBase(opts),
|
|
12444
12243
|
operationType: "KILL_SPLIT",
|
|
@@ -12454,11 +12253,11 @@ function registerSplitioCommands(program2) {
|
|
|
12454
12253
|
fail(err, "splitio", "flags kill", start);
|
|
12455
12254
|
}
|
|
12456
12255
|
});
|
|
12457
|
-
flags.command("restore").description("Submit a Change Request to restore a killed flag").requiredOption("--workspace <id>", "Workspace ID").requiredOption("--flag <name>", "Feature flag name").requiredOption("--environment <id>", "Environment ID").requiredOption("--mnemonic <text>", "Short Change Request title (mnemonic)").requiredOption("--description <text>", "Change Request description").requiredOption("--change-number <CHG>", "
|
|
12256
|
+
flags.command("restore").description("Submit a Change Request to restore a killed flag").requiredOption("--workspace <id>", "Workspace ID").requiredOption("--flag <name>", "Feature flag name").requiredOption("--environment <id>", "Environment ID").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) => {
|
|
12458
12257
|
const start = Date.now();
|
|
12459
12258
|
try {
|
|
12460
12259
|
await confirmWrite(opts, `RESTORE ${opts.flag} in ${opts.environment}`);
|
|
12461
|
-
const http =
|
|
12260
|
+
const http = getHttp4(program2);
|
|
12462
12261
|
const body = {
|
|
12463
12262
|
...buildCrBase(opts),
|
|
12464
12263
|
operationType: "RESTORE_SPLIT",
|
|
@@ -12474,11 +12273,11 @@ function registerSplitioCommands(program2) {
|
|
|
12474
12273
|
fail(err, "splitio", "flags restore", start);
|
|
12475
12274
|
}
|
|
12476
12275
|
});
|
|
12477
|
-
flags.command("archive").description("Submit a Change Request to archive (delete definition of) a flag").requiredOption("--workspace <id>", "Workspace ID").requiredOption("--flag <name>", "Feature flag name").requiredOption("--mnemonic <text>", "Short Change Request title (mnemonic)").requiredOption("--description <text>", "Change Request description").requiredOption("--change-number <CHG>", "
|
|
12276
|
+
flags.command("archive").description("Submit a Change Request to archive (delete definition of) a flag").requiredOption("--workspace <id>", "Workspace ID").requiredOption("--flag <name>", "Feature flag name").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("--yes", "Skip interactive confirmation prompt").action(async (opts) => {
|
|
12478
12277
|
const start = Date.now();
|
|
12479
12278
|
try {
|
|
12480
12279
|
await confirmWrite(opts, `ARCHIVE ${opts.flag}`);
|
|
12481
|
-
const http =
|
|
12280
|
+
const http = getHttp4(program2);
|
|
12482
12281
|
const body = {
|
|
12483
12282
|
...buildCrBase(opts),
|
|
12484
12283
|
operationType: "ARCHIVE_SPLIT",
|
|
@@ -12498,7 +12297,7 @@ function registerSplitioCommands(program2) {
|
|
|
12498
12297
|
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) => {
|
|
12499
12298
|
const start = Date.now();
|
|
12500
12299
|
try {
|
|
12501
|
-
const http =
|
|
12300
|
+
const http = getHttp4(program2);
|
|
12502
12301
|
const params = {
|
|
12503
12302
|
wsId: opts.workspace,
|
|
12504
12303
|
limit: parseInt(opts.limit, 10),
|
|
@@ -12523,7 +12322,7 @@ function registerSplitioCommands(program2) {
|
|
|
12523
12322
|
changeRequests.command("get").description("Get a Change Request by ID").requiredOption("--id <id>", "Change Request ID").action(async (opts) => {
|
|
12524
12323
|
const start = Date.now();
|
|
12525
12324
|
try {
|
|
12526
|
-
const http =
|
|
12325
|
+
const http = getHttp4(program2);
|
|
12527
12326
|
const data = await http.splitio(
|
|
12528
12327
|
`/internal/api/v2/changeRequests/${encodeURIComponent(opts.id)}`
|
|
12529
12328
|
);
|
|
@@ -12546,7 +12345,7 @@ Expected format: https://www.figma.com/design/<file-key>/...`);
|
|
|
12546
12345
|
}
|
|
12547
12346
|
return input3;
|
|
12548
12347
|
}
|
|
12549
|
-
function
|
|
12348
|
+
function getHttp5(program2) {
|
|
12550
12349
|
const opts = program2.optsWithGlobals();
|
|
12551
12350
|
return createHttpClient(
|
|
12552
12351
|
loadConfig({ configPath: opts.config }),
|
|
@@ -12557,15 +12356,14 @@ function registerFigmaCommands(program2) {
|
|
|
12557
12356
|
const figma = program2.command("figma").description("Figma design operations (files, comments, versions)");
|
|
12558
12357
|
figma.command("file").description("Get a Figma file \u2014 metadata, structure, and component/style inventory").argument("<file-key-or-url>", "Figma file key or full Figma URL (https://www.figma.com/design/<key>/...)").option("--document", "Include the full document node tree (can be large; omitted by default)").action(async (fileKeyOrUrl, opts) => {
|
|
12559
12358
|
const start = Date.now();
|
|
12560
|
-
const { success: success2, fail: fail2 } = await import("./output-
|
|
12359
|
+
const { success: success2, fail: fail2 } = await import("./output-3G3WZVZA.js");
|
|
12561
12360
|
try {
|
|
12562
12361
|
const fileKey = parseFileKey(fileKeyOrUrl);
|
|
12563
12362
|
const params = {};
|
|
12564
12363
|
if (!opts.document) {
|
|
12565
|
-
params["
|
|
12566
|
-
params["depth"] = 0;
|
|
12364
|
+
params["depth"] = 1;
|
|
12567
12365
|
}
|
|
12568
|
-
const data = await
|
|
12366
|
+
const data = await getHttp5(program2).figma(`/v1/files/${encodeURIComponent(fileKey)}`, { params });
|
|
12569
12367
|
success2(
|
|
12570
12368
|
{
|
|
12571
12369
|
fileKey,
|
|
@@ -12590,12 +12388,12 @@ function registerFigmaCommands(program2) {
|
|
|
12590
12388
|
});
|
|
12591
12389
|
figma.command("comments").description("Get comments on a Figma file").argument("<file-key-or-url>", "Figma file key or full Figma URL").option("--as-of <date>", "ISO 8601 timestamp \u2014 return only comments created before this time").action(async (fileKeyOrUrl, opts) => {
|
|
12592
12390
|
const start = Date.now();
|
|
12593
|
-
const { success: success2, fail: fail2 } = await import("./output-
|
|
12391
|
+
const { success: success2, fail: fail2 } = await import("./output-3G3WZVZA.js");
|
|
12594
12392
|
try {
|
|
12595
12393
|
const fileKey = parseFileKey(fileKeyOrUrl);
|
|
12596
12394
|
const params = {};
|
|
12597
12395
|
if (opts.asOf) params["as_of"] = opts.asOf;
|
|
12598
|
-
const data = await
|
|
12396
|
+
const data = await getHttp5(program2).figma(`/v1/files/${encodeURIComponent(fileKey)}/comments`, { params });
|
|
12599
12397
|
success2(
|
|
12600
12398
|
{ fileKey, count: data.comments.length, comments: data.comments },
|
|
12601
12399
|
"figma",
|
|
@@ -12608,10 +12406,10 @@ function registerFigmaCommands(program2) {
|
|
|
12608
12406
|
});
|
|
12609
12407
|
figma.command("versions").description("Get the version history of a Figma file").argument("<file-key-or-url>", "Figma file key or full Figma URL").action(async (fileKeyOrUrl) => {
|
|
12610
12408
|
const start = Date.now();
|
|
12611
|
-
const { success: success2, fail: fail2 } = await import("./output-
|
|
12409
|
+
const { success: success2, fail: fail2 } = await import("./output-3G3WZVZA.js");
|
|
12612
12410
|
try {
|
|
12613
12411
|
const fileKey = parseFileKey(fileKeyOrUrl);
|
|
12614
|
-
const data = await
|
|
12412
|
+
const data = await getHttp5(program2).figma(`/v1/files/${encodeURIComponent(fileKey)}/versions`);
|
|
12615
12413
|
success2(
|
|
12616
12414
|
{ fileKey, count: data.versions.length, versions: data.versions },
|
|
12617
12415
|
"figma",
|
|
@@ -12624,9 +12422,9 @@ function registerFigmaCommands(program2) {
|
|
|
12624
12422
|
});
|
|
12625
12423
|
figma.command("project-files").description("List files in a Figma project").argument("<project-id>", "Figma project ID (visible in the project URL)").action(async (projectId) => {
|
|
12626
12424
|
const start = Date.now();
|
|
12627
|
-
const { success: success2, fail: fail2 } = await import("./output-
|
|
12425
|
+
const { success: success2, fail: fail2 } = await import("./output-3G3WZVZA.js");
|
|
12628
12426
|
try {
|
|
12629
|
-
const data = await
|
|
12427
|
+
const data = await getHttp5(program2).figma(`/v1/projects/${encodeURIComponent(projectId)}/files`);
|
|
12630
12428
|
success2(
|
|
12631
12429
|
{ projectId, count: data.files.length, files: data.files },
|
|
12632
12430
|
"figma",
|
|
@@ -12639,9 +12437,9 @@ function registerFigmaCommands(program2) {
|
|
|
12639
12437
|
});
|
|
12640
12438
|
figma.command("me").description("Get the current Figma user (useful for verifying credentials)").action(async () => {
|
|
12641
12439
|
const start = Date.now();
|
|
12642
|
-
const { success: success2, fail: fail2 } = await import("./output-
|
|
12440
|
+
const { success: success2, fail: fail2 } = await import("./output-3G3WZVZA.js");
|
|
12643
12441
|
try {
|
|
12644
|
-
const data = await
|
|
12442
|
+
const data = await getHttp5(program2).figma("/v1/me");
|
|
12645
12443
|
success2(data, "figma", "me", start);
|
|
12646
12444
|
} catch (err) {
|
|
12647
12445
|
fail2(err, "figma", "me", start);
|
|
@@ -12685,7 +12483,6 @@ registerAdoCommands(program);
|
|
|
12685
12483
|
registerJenkinsCommands(program);
|
|
12686
12484
|
registerArtifactoryCommands(program);
|
|
12687
12485
|
registerCheckmarxCommands(program);
|
|
12688
|
-
registerServiceNowCommands(program);
|
|
12689
12486
|
registerContrastCommands(program);
|
|
12690
12487
|
registerSonatypeIqCommands(program);
|
|
12691
12488
|
registerSkillsCommands(program);
|
|
@@ -12709,7 +12506,6 @@ Services:
|
|
|
12709
12506
|
jenkins Jenkins (jobs, builds, logs, named instances)
|
|
12710
12507
|
artifactory Artifactory (repos, artifact search, build info, properties)
|
|
12711
12508
|
checkmarx Checkmarx One (projects, scans, scan statistics)
|
|
12712
|
-
servicenow ServiceNow (change requests)
|
|
12713
12509
|
contrast Contrast IAST (applications, vulnerability findings, libraries)
|
|
12714
12510
|
sonatypeiq Sonatype IQ Server (applications, organizations, policies)
|
|
12715
12511
|
openshift OpenShift / Kubernetes (pods, events, logs, metrics)
|