@simplr-ai/connect 0.7.3 → 0.7.5
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/dist/index.js +58 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -122,7 +122,7 @@ var KanbanReconciliationError = class extends Error {
|
|
|
122
122
|
};
|
|
123
123
|
var DeferredUpdateError = class extends Error {
|
|
124
124
|
};
|
|
125
|
-
var APP_VERSION =
|
|
125
|
+
var APP_VERSION = "0.7.5";
|
|
126
126
|
var STANDALONE_EXECUTABLE = process.env.SIMPLR_CONNECT_STANDALONE === "true";
|
|
127
127
|
var MANIFEST_PUBLIC_KEY = process.env.SIMPLR_CONNECT_MANIFEST_PUBLIC_KEY || "";
|
|
128
128
|
var HERMES_INSTALL_COMMIT = "542e146b055f0d43767ac43cdb9e78054b240263";
|
|
@@ -3520,6 +3520,62 @@ async function main() {
|
|
|
3520
3520
|
token
|
|
3521
3521
|
);
|
|
3522
3522
|
process.stdout.write(`${JSON.stringify(result)}
|
|
3523
|
+
`);
|
|
3524
|
+
return;
|
|
3525
|
+
}
|
|
3526
|
+
if (command === "release-action-authorize") {
|
|
3527
|
+
const organizationId = argument("--organization-id");
|
|
3528
|
+
const action = argument("--action");
|
|
3529
|
+
if (!isUuid(organizationId) || !["review", "merge", "promote", "rollback_release", "rollback_flag"].includes(action || ""))
|
|
3530
|
+
throw new Error("Use: simplr-connect release-action-authorize --organization-id <uuid> --action <action> [exact target arguments]");
|
|
3531
|
+
const state = await loadState();
|
|
3532
|
+
const connection = state.connections.find((item) => item.organization_id === organizationId);
|
|
3533
|
+
if (!connection) throw new Error("Organization is not connected");
|
|
3534
|
+
const token = await loadCredential(stateForConnection(state, connection));
|
|
3535
|
+
const pullRequestNumber = argument("--pull-request-number");
|
|
3536
|
+
const body = {
|
|
3537
|
+
action,
|
|
3538
|
+
service_id: argument("--service-id"),
|
|
3539
|
+
repository: argument("--repository"),
|
|
3540
|
+
pull_request_number: pullRequestNumber ? Number(pullRequestNumber) : void 0,
|
|
3541
|
+
head_sha: argument("--head-sha"),
|
|
3542
|
+
base_branch: argument("--base-branch"),
|
|
3543
|
+
target_environment_id: argument("--target-environment-id"),
|
|
3544
|
+
feature_flag_id: argument("--feature-flag-id")
|
|
3545
|
+
};
|
|
3546
|
+
const result = await post(`${connection.api_url}/v1/ai-workstations/release-actions/authorize`, body, token);
|
|
3547
|
+
process.stdout.write(`${JSON.stringify(result)}
|
|
3548
|
+
`);
|
|
3549
|
+
return;
|
|
3550
|
+
}
|
|
3551
|
+
if (command === "release-action-consume") {
|
|
3552
|
+
const organizationId = argument("--organization-id");
|
|
3553
|
+
const authorizationId = argument("--authorization-id");
|
|
3554
|
+
if (!isUuid(organizationId) || !isUuid(authorizationId))
|
|
3555
|
+
throw new Error("Use: simplr-connect release-action-consume --organization-id <uuid> --authorization-id <uuid>");
|
|
3556
|
+
const state = await loadState();
|
|
3557
|
+
const connection = state.connections.find((item) => item.organization_id === organizationId);
|
|
3558
|
+
if (!connection) throw new Error("Organization is not connected");
|
|
3559
|
+
const token = await loadCredential(stateForConnection(state, connection));
|
|
3560
|
+
const result = await post(`${connection.api_url}/v1/ai-workstations/release-actions/${authorizationId}/consume`, {}, token);
|
|
3561
|
+
process.stdout.write(`${JSON.stringify(result)}
|
|
3562
|
+
`);
|
|
3563
|
+
return;
|
|
3564
|
+
}
|
|
3565
|
+
if (command === "release-action-complete") {
|
|
3566
|
+
const organizationId = argument("--organization-id");
|
|
3567
|
+
const authorizationId = argument("--authorization-id");
|
|
3568
|
+
const outcome = argument("--outcome");
|
|
3569
|
+
const resultingSha = argument("--resulting-sha");
|
|
3570
|
+
const summary = (await readStandardInput()).trim();
|
|
3571
|
+
if (!isUuid(organizationId) || !isUuid(authorizationId) || !["succeeded", "failed"].includes(outcome || "") || !summary || summary.length > 2e3)
|
|
3572
|
+
throw new Error("Use: simplr-connect release-action-complete --organization-id <uuid> --authorization-id <uuid> --outcome <succeeded|failed> [--resulting-sha <full-sha>] < summary");
|
|
3573
|
+
const state = await loadState();
|
|
3574
|
+
const connection = state.connections.find((item) => item.organization_id === organizationId);
|
|
3575
|
+
if (!connection) throw new Error("Organization is not connected");
|
|
3576
|
+
const token = await loadCredential(stateForConnection(state, connection));
|
|
3577
|
+
const result = await post(`${connection.api_url}/v1/ai-workstations/release-actions/${authorizationId}/complete`, { outcome, summary, resulting_sha: resultingSha }, token);
|
|
3578
|
+
process.stdout.write(`${JSON.stringify(result)}
|
|
3523
3579
|
`);
|
|
3524
3580
|
return;
|
|
3525
3581
|
}
|
|
@@ -3592,7 +3648,7 @@ async function main() {
|
|
|
3592
3648
|
return;
|
|
3593
3649
|
}
|
|
3594
3650
|
process.stdout.write(
|
|
3595
|
-
"Simplr Connect\n\nCommands:\n wizard\n enroll --api-url <url> --code <code> [--setup-hermes] [--install-service]\n hermes-setup\n status\n overview --organization-id <uuid>\n work-order-traces --organization-id <uuid>\n service-install\n repair\n update-check\n update\n sync\n watch\n run -- <ai-command> [arguments]\n"
|
|
3651
|
+
"Simplr Connect\n\nCommands:\n wizard\n enroll --api-url <url> --code <code> [--setup-hermes] [--install-service]\n hermes-setup\n status\n overview --organization-id <uuid>\n work-order-traces --organization-id <uuid>\n release-action-authorize --organization-id <uuid> --action <action> [exact target arguments]\n service-install\n repair\n update-check\n update\n sync\n watch\n run -- <ai-command> [arguments]\n"
|
|
3596
3652
|
);
|
|
3597
3653
|
}
|
|
3598
3654
|
main().catch(async (error) => {
|