@senticor/hive 1.89.0 → 1.90.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/hive.cjs +40 -7
- package/package.json +1 -1
package/hive.cjs
CHANGED
|
@@ -10429,22 +10429,22 @@ var artifactName = injectedString(
|
|
|
10429
10429
|
true ? "hive-cli" : void 0
|
|
10430
10430
|
) || String(process.env.HIVE_CLI_ARTIFACT_NAME || "hive-cli").trim() || "hive-cli";
|
|
10431
10431
|
var packageVersion = injectedString(
|
|
10432
|
-
true ? "1.
|
|
10432
|
+
true ? "1.90.0" : void 0
|
|
10433
10433
|
) || String(process.env.HIVE_CLI_PACKAGE_VERSION || "").trim() || readPackageVersion();
|
|
10434
10434
|
var releaseVersion = injectedString(
|
|
10435
|
-
true ? "1.
|
|
10435
|
+
true ? "1.90.0" : void 0
|
|
10436
10436
|
) || String(process.env.HIVE_CLI_RELEASE_VERSION || "").trim() || packageVersion || "dev";
|
|
10437
10437
|
var releaseChannel = injectedString(
|
|
10438
10438
|
true ? "final" : void 0
|
|
10439
10439
|
) || String(process.env.HIVE_CLI_RELEASE_CHANNEL || "").trim() || (releaseVersion.includes("-rc.") ? "rc" : releaseVersion === "dev" ? "dev" : "final");
|
|
10440
10440
|
var buildCommit = injectedString(
|
|
10441
|
-
true ? "
|
|
10441
|
+
true ? "2300d236d468220cf0f51188023b175234b566b7" : void 0
|
|
10442
10442
|
) || String(process.env.HIVE_CLI_BUILD_COMMIT || "").trim() || "unknown";
|
|
10443
10443
|
var buildTimestamp = injectedString(
|
|
10444
|
-
true ? "2026-10-
|
|
10444
|
+
true ? "2026-10-30T22:56:05Z" : void 0
|
|
10445
10445
|
) || String(process.env.HIVE_CLI_BUILD_TIMESTAMP || "").trim() || "unknown";
|
|
10446
10446
|
var ociRef = injectedString(
|
|
10447
|
-
true ? "registry.onstackit.cloud/senticor/hive-cli:1.
|
|
10447
|
+
true ? "registry.onstackit.cloud/senticor/hive-cli:1.90.0" : void 0
|
|
10448
10448
|
) || String(process.env.HIVE_CLI_OCI_REF || "").trim() || `registry.onstackit.cloud/senticor/${artifactName}:${releaseVersion}`;
|
|
10449
10449
|
var RELEASE_INFO = Object.freeze({
|
|
10450
10450
|
packageVersion,
|
|
@@ -32705,6 +32705,7 @@ async function listMembers(client, tenantId) {
|
|
|
32705
32705
|
return {
|
|
32706
32706
|
membershipId: String(m.membershipId ?? ""),
|
|
32707
32707
|
membershipStatus: String(m.membershipStatus ?? ""),
|
|
32708
|
+
directoryScope: typeof m.directoryScope === "string" ? m.directoryScope : void 0,
|
|
32708
32709
|
roles: Array.isArray(m.roles) ? m.roles.map(String).sort() : [],
|
|
32709
32710
|
principalId: String(principal.principalId ?? ""),
|
|
32710
32711
|
email: String(principal.email ?? "").toLowerCase()
|
|
@@ -32945,9 +32946,13 @@ var org = defineCommand({
|
|
|
32945
32946
|
}),
|
|
32946
32947
|
admit: defineCommand({
|
|
32947
32948
|
meta: { name: "admit", description: "Admit a user/principal by email and optional roles" },
|
|
32948
|
-
args: orgArgs,
|
|
32949
|
+
args: withArgs({ ...orgArgs, directoryScope: { type: "string", description: "tenant | shared-missions; omission preserves an existing scope" } }),
|
|
32949
32950
|
async run({ args }) {
|
|
32950
32951
|
printContextNotice(args, { adminScope: true });
|
|
32952
|
+
const directoryScope = args.directoryScope;
|
|
32953
|
+
if (directoryScope !== void 0 && directoryScope !== "tenant" && directoryScope !== "shared-missions") {
|
|
32954
|
+
throw commandError("INVALID_DIRECTORY_SCOPE", 1, "--directory-scope must be tenant or shared-missions.");
|
|
32955
|
+
}
|
|
32951
32956
|
const { tenantId } = await resolveTenantId(args);
|
|
32952
32957
|
req(args, "email");
|
|
32953
32958
|
const body = {
|
|
@@ -32956,12 +32961,38 @@ var org = defineCommand({
|
|
|
32956
32961
|
};
|
|
32957
32962
|
if (args.displayName) body.displayName = args.displayName;
|
|
32958
32963
|
if (args.kind) body.kind = args.kind;
|
|
32964
|
+
if (directoryScope !== void 0) body.directoryScope = directoryScope;
|
|
32959
32965
|
const { client, fmt } = adminCtx(args);
|
|
32966
|
+
if (directoryScope !== void 0) {
|
|
32967
|
+
const capability = await client.get("/api/capabilities");
|
|
32968
|
+
const supported = recordOf2(recordOf2(capability.data).tenantDirectoryScopes);
|
|
32969
|
+
if (!isHttpOk(capability.status) || supported.contractVersion !== 1) {
|
|
32970
|
+
throw commandError(
|
|
32971
|
+
"DIRECTORY_SCOPE_UNSUPPORTED",
|
|
32972
|
+
EXIT_GUARDRAIL,
|
|
32973
|
+
"This API does not advertise membership directory scopes. No admission was attempted; upgrade the API first."
|
|
32974
|
+
);
|
|
32975
|
+
}
|
|
32976
|
+
}
|
|
32960
32977
|
const email3 = String(args.email).trim().toLowerCase();
|
|
32961
32978
|
const before = findMember(await listMembers(client, tenantId), { email: email3 });
|
|
32962
32979
|
const res = await client.post(`/api/admin/orgs/${enc(tenantId)}/members`, body);
|
|
32963
32980
|
ensureOk(res.status, res.data, "admit tenant member");
|
|
32981
|
+
if (directoryScope !== void 0 && recordOf2(recordOf2(res.data).membership).directoryScope !== directoryScope) {
|
|
32982
|
+
throw commandError(
|
|
32983
|
+
"DIRECTORY_SCOPE_NOT_APPLIED",
|
|
32984
|
+
EXIT_GUARDRAIL,
|
|
32985
|
+
"The API did not confirm the requested directory scope. Verify the membership before using external access."
|
|
32986
|
+
);
|
|
32987
|
+
}
|
|
32964
32988
|
const after = findMember(await listMembers(client, tenantId), { email: email3 });
|
|
32989
|
+
if (directoryScope !== void 0 && after?.directoryScope !== directoryScope) {
|
|
32990
|
+
throw commandError(
|
|
32991
|
+
"DIRECTORY_SCOPE_NOT_APPLIED",
|
|
32992
|
+
EXIT_GUARDRAIL,
|
|
32993
|
+
"The membership read-back did not confirm the requested directory scope. Verify the membership before using external access."
|
|
32994
|
+
);
|
|
32995
|
+
}
|
|
32965
32996
|
const rolesBefore = before?.roles ?? [];
|
|
32966
32997
|
const rolesAfter = after?.roles ?? [];
|
|
32967
32998
|
const rolesAdded = without(rolesAfter, rolesBefore);
|
|
@@ -32970,10 +33001,12 @@ var org = defineCommand({
|
|
|
32970
33001
|
created: !before,
|
|
32971
33002
|
membershipStatusBefore: before?.membershipStatus ?? null,
|
|
32972
33003
|
membershipStatus: after?.membershipStatus ?? null,
|
|
33004
|
+
directoryScopeBefore: before?.directoryScope,
|
|
33005
|
+
directoryScope: after?.directoryScope,
|
|
32973
33006
|
rolesBefore,
|
|
32974
33007
|
rolesAfter,
|
|
32975
33008
|
rolesAdded,
|
|
32976
|
-
idempotent: Boolean(before) && before?.membershipStatus === "active" && rolesAdded.length === 0
|
|
33009
|
+
idempotent: Boolean(before) && before?.membershipStatus === "active" && rolesAdded.length === 0 && (directoryScope === void 0 || before.directoryScope === directoryScope)
|
|
32977
33010
|
}, fmt);
|
|
32978
33011
|
}
|
|
32979
33012
|
}),
|