@erdoai/cli 0.183.0 → 0.184.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 +20 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -506,6 +506,14 @@ var ErdoClient = class {
|
|
|
506
506
|
`/v1/managed-organizations/${encodeURIComponent(slug)}`
|
|
507
507
|
);
|
|
508
508
|
}
|
|
509
|
+
// Turn an allow-listed feature flag on (or back to its normal resolution) for
|
|
510
|
+
// a managed org. Only flags Erdo declares manager-settable are accepted.
|
|
511
|
+
setManagedOrganizationFeatureFlag(slug, key, enabled) {
|
|
512
|
+
return this.request(
|
|
513
|
+
enabled ? "PUT" : "DELETE",
|
|
514
|
+
`/v1/managed-organizations/${encodeURIComponent(slug)}/feature-flags/${encodeURIComponent(key)}`
|
|
515
|
+
);
|
|
516
|
+
}
|
|
509
517
|
createManagerKey() {
|
|
510
518
|
return this.request("POST", "/v1/manager-key");
|
|
511
519
|
}
|
|
@@ -3644,6 +3652,18 @@ managed.command("revoke <slug>").description("Stop managing a client org (remove
|
|
|
3644
3652
|
fail(e);
|
|
3645
3653
|
}
|
|
3646
3654
|
});
|
|
3655
|
+
managed.command("flag <slug> <key> <state>").description("Turn a manager-settable feature flag on or off for a client org (state: on|off)").action(async (slug, key, state) => {
|
|
3656
|
+
if (state !== "on" && state !== "off") {
|
|
3657
|
+
fail(new Error("state must be on or off"));
|
|
3658
|
+
}
|
|
3659
|
+
try {
|
|
3660
|
+
const res = await new ErdoClient().setManagedOrganizationFeatureFlag(slug, key, state === "on");
|
|
3661
|
+
const source = res.set_by === "staff" ? "set by Erdo staff" : res.set_by ? "set by your manager org" : "normal resolution";
|
|
3662
|
+
console.log(`${res.flag_key} for ${res.org_slug}: ${res.enabled ? "on" : "off"} (${source})`);
|
|
3663
|
+
} catch (e) {
|
|
3664
|
+
fail(e);
|
|
3665
|
+
}
|
|
3666
|
+
});
|
|
3647
3667
|
managed.command("key").description("Mint (or rotate) your manager key \u2014 one credential for every managed org; shown ONCE").action(async () => {
|
|
3648
3668
|
try {
|
|
3649
3669
|
const res = await new ErdoClient().createManagerKey();
|