@erdoai/cli 0.165.0 → 0.166.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/dist/index.js +22 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2044,6 +2044,13 @@ var ErdoClient = class {
|
|
|
2044
2044
|
}
|
|
2045
2045
|
// One decision in full. A slug belonging to another organization reads as 404,
|
|
2046
2046
|
// so it cannot be probed for existence.
|
|
2047
|
+
retireDecision(slug, reason, organization_slug) {
|
|
2048
|
+
return this.request(
|
|
2049
|
+
"POST",
|
|
2050
|
+
`/v1/decisions/${encodeURIComponent(slug)}/retire`,
|
|
2051
|
+
{ reason, organization_slug }
|
|
2052
|
+
);
|
|
2053
|
+
}
|
|
2047
2054
|
getDecision(slug) {
|
|
2048
2055
|
return this.request(
|
|
2049
2056
|
"GET",
|
|
@@ -5123,6 +5130,21 @@ function renderDecision(detail) {
|
|
|
5123
5130
|
console.log(" The approval card could not be loaded.");
|
|
5124
5131
|
}
|
|
5125
5132
|
}
|
|
5133
|
+
decisionsCmd.command("retire <slug>").description("End a standing workstream commitment without changing provider state (admin or owner)").requiredOption("--reason <text>", "why this commitment is no longer applicable").option("--organization <slug>", "target organization, including an authorized managed client").option("--json", "output raw JSON").action(async (slug, opts) => {
|
|
5134
|
+
try {
|
|
5135
|
+
if (!opts.reason.trim()) throw new Error("--reason must not be blank");
|
|
5136
|
+
const result = await new ErdoClient().retireDecision(slug, opts.reason, opts.organization);
|
|
5137
|
+
if (opts.json) {
|
|
5138
|
+
print(result);
|
|
5139
|
+
return;
|
|
5140
|
+
}
|
|
5141
|
+
console.log(`${result.decision.slug} ${result.created ? "retired" : "already ended"}`);
|
|
5142
|
+
if (result.decision.superseded_by_decision_slug) console.log(`Superseded by: ${result.decision.superseded_by_decision_slug}`);
|
|
5143
|
+
if (result.decision.lapsed) console.log(`Lapsed at: ${result.decision.review_by}`);
|
|
5144
|
+
} catch (e) {
|
|
5145
|
+
fail(e);
|
|
5146
|
+
}
|
|
5147
|
+
});
|
|
5126
5148
|
decisionsCmd.command("show <slug>").description(
|
|
5127
5149
|
"Show one decision in full: the commitment and its authority, every exact action it authorized with how each one ended, every declared effect with the evidence that settled it, and what it replaced or was replaced by"
|
|
5128
5150
|
).option("--json", "output raw JSON").action(async (slug, opts) => {
|