@gravity-rail/cli 6.0.0 → 7.0.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/{account-verify-phone-IC7FNUQE.js → account-verify-phone-N6TMI2HX.js} +2 -2
- package/dist/{chunk-VA6G6IBW.js → chunk-XDEGL6VD.js} +2 -2
- package/dist/{chunk-VA6G6IBW.js.map → chunk-XDEGL6VD.js.map} +1 -1
- package/dist/cli-utils.js +1 -1
- package/dist/{errors-YBSCLOHE.js → errors-JY4564PH.js} +2 -2
- package/dist/gr.js +143 -20
- package/dist/gr.js.map +1 -1
- package/dist/lib.js +80 -3
- package/dist/lib.js.map +1 -1
- package/package.json +3 -3
- /package/dist/{account-verify-phone-IC7FNUQE.js.map → account-verify-phone-N6TMI2HX.js.map} +0 -0
- /package/dist/{errors-YBSCLOHE.js.map → errors-JY4564PH.js.map} +0 -0
package/dist/lib.js
CHANGED
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
selectFromList,
|
|
48
48
|
stderr,
|
|
49
49
|
unwrapItems
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-XDEGL6VD.js";
|
|
51
51
|
|
|
52
52
|
// src/lib/args.ts
|
|
53
53
|
var PAGINATION_ARGS = [
|
|
@@ -12815,6 +12815,8 @@ ENVELOPE (POST /queries/{validate,preview,run} body: {"query": <envelope>, "mode
|
|
|
12815
12815
|
"sort": [{"field": "...", "dir": "asc"|"desc"}], // max 3
|
|
12816
12816
|
"limit": 1..500, // default 50
|
|
12817
12817
|
"cursor": "...", // page token from a prior run
|
|
12818
|
+
"timezone": "UTC", // optional; record date reads, day bounds
|
|
12819
|
+
// and bucket truncation
|
|
12818
12820
|
"aggregate": {...}, // GROUP BY mode; excludes select/sort/computed
|
|
12819
12821
|
"includeArchived": false,
|
|
12820
12822
|
"computed": [{"alias": "minutes", <aggregate fields>}]
|
|
@@ -13096,6 +13098,7 @@ Relations (relationMatch): ${relations.join(", ")}`);
|
|
|
13096
13098
|
|
|
13097
13099
|
// src/domains/sites.ts
|
|
13098
13100
|
import { readFileSync as readFileSync4, writeFileSync as writeFileSync2 } from "fs";
|
|
13101
|
+
import { AccessLevel } from "@gravity-rail/sdk";
|
|
13099
13102
|
var COLUMNS13 = [
|
|
13100
13103
|
COL.id(),
|
|
13101
13104
|
COL.name(),
|
|
@@ -13583,6 +13586,80 @@ var sitesDomain = {
|
|
|
13583
13586
|
outputSingle(result, ctx, SOURCE_COLUMNS);
|
|
13584
13587
|
}
|
|
13585
13588
|
},
|
|
13589
|
+
{
|
|
13590
|
+
path: ["sites", "sharing", "get"],
|
|
13591
|
+
description: "Show a site's access (private, workspace or public), its audience of Member Roles, and individual grants",
|
|
13592
|
+
verb: "read",
|
|
13593
|
+
revealsSecret: false,
|
|
13594
|
+
requiresWorkspace: true,
|
|
13595
|
+
args: [{ name: "site-id", description: "Site ID", required: true }],
|
|
13596
|
+
examples: [`gr sites sharing get -w $WS --site-id 1`],
|
|
13597
|
+
handler: async ({ ctx, workspace, args }) => {
|
|
13598
|
+
const result = await requireAuth(ctx).apiClient.getSiteSharing(
|
|
13599
|
+
workspace,
|
|
13600
|
+
requireNumber(args, "site-id")
|
|
13601
|
+
);
|
|
13602
|
+
outputSingle(result, ctx);
|
|
13603
|
+
}
|
|
13604
|
+
},
|
|
13605
|
+
{
|
|
13606
|
+
path: ["sites", "sharing", "set"],
|
|
13607
|
+
description: "Set a site's access and audience, keeping its individual grants. --access private|workspace|public. --audience is a comma-separated list of Member Role UUIDs whose Members may use the site and replaces the whole audience; '' clears it, and omitted it is kept. Making a site private needs --audience unless it already is. With workspace, every role is in the audience and --audience is ignored.",
|
|
13608
|
+
verb: "update",
|
|
13609
|
+
revealsSecret: false,
|
|
13610
|
+
requiresWorkspace: true,
|
|
13611
|
+
args: [
|
|
13612
|
+
{ name: "site-id", description: "Site ID", required: true },
|
|
13613
|
+
{ name: "access", description: "private | workspace | public", required: true },
|
|
13614
|
+
{
|
|
13615
|
+
name: "audience",
|
|
13616
|
+
description: "Comma-separated Member Role UUIDs (replaces the whole audience; omitted keeps it)"
|
|
13617
|
+
}
|
|
13618
|
+
],
|
|
13619
|
+
examples: [
|
|
13620
|
+
`gr sites sharing set -w $WS --site-id 1 --access private --audience $ADMIN_ROLE_UUID --allow-write`
|
|
13621
|
+
],
|
|
13622
|
+
handler: async ({ ctx, workspace, args }) => {
|
|
13623
|
+
const ACCESS_LEVELS = {
|
|
13624
|
+
private: AccessLevel.PRIVATE,
|
|
13625
|
+
workspace: AccessLevel.WORKSPACE,
|
|
13626
|
+
public: AccessLevel.PUBLIC
|
|
13627
|
+
};
|
|
13628
|
+
const accessArg = String(args.access ?? "");
|
|
13629
|
+
const access = Object.hasOwn(ACCESS_LEVELS, accessArg) ? ACCESS_LEVELS[accessArg] : void 0;
|
|
13630
|
+
if (!access) {
|
|
13631
|
+
throw new CLIError("--access must be one of: private, workspace, public");
|
|
13632
|
+
}
|
|
13633
|
+
const current = await requireAuth(ctx).apiClient.getSiteSharing(
|
|
13634
|
+
workspace,
|
|
13635
|
+
requireNumber(args, "site-id")
|
|
13636
|
+
);
|
|
13637
|
+
if (access === AccessLevel.PRIVATE && args.audience === void 0 && current.access !== AccessLevel.PRIVATE) {
|
|
13638
|
+
throw new CLIError(
|
|
13639
|
+
"--access private needs --audience: the Member Role UUIDs that keep access, or '' for none"
|
|
13640
|
+
);
|
|
13641
|
+
}
|
|
13642
|
+
const audience = access === AccessLevel.WORKSPACE ? [] : args.audience === void 0 ? current.audience ?? [] : String(args.audience).split(",").map((entry) => entry.trim()).filter(Boolean);
|
|
13643
|
+
const result = await requireAuth(ctx).apiClient.updateSiteSharing(
|
|
13644
|
+
workspace,
|
|
13645
|
+
requireNumber(args, "site-id"),
|
|
13646
|
+
{
|
|
13647
|
+
access,
|
|
13648
|
+
grants: (current.grants ?? []).map((grant) => ({
|
|
13649
|
+
granteeMemberId: grant.granteeMemberId,
|
|
13650
|
+
accessMode: grant.accessMode
|
|
13651
|
+
})),
|
|
13652
|
+
audience
|
|
13653
|
+
}
|
|
13654
|
+
);
|
|
13655
|
+
if (result.access !== access) {
|
|
13656
|
+
throw new CLIError(
|
|
13657
|
+
`The site's access is ${result.access}, not ${access}; check --audience`
|
|
13658
|
+
);
|
|
13659
|
+
}
|
|
13660
|
+
outputSingle(result, ctx);
|
|
13661
|
+
}
|
|
13662
|
+
},
|
|
13586
13663
|
{
|
|
13587
13664
|
path: ["sites", "theme-settings", "get"],
|
|
13588
13665
|
description: "Show the active theme's settings schema, values, and features",
|
|
@@ -24539,7 +24616,7 @@ async function resolveDirectoryTrust(opts) {
|
|
|
24539
24616
|
return "trusted";
|
|
24540
24617
|
}
|
|
24541
24618
|
async function requireDirectoryTrust(opts) {
|
|
24542
|
-
const { CLIError: CLIError2 } = await import("./errors-
|
|
24619
|
+
const { CLIError: CLIError2 } = await import("./errors-JY4564PH.js");
|
|
24543
24620
|
const dir = path3.resolve(opts.trustDir ?? opts.cwd ?? process.cwd());
|
|
24544
24621
|
const status = await resolveDirectoryTrust(opts);
|
|
24545
24622
|
if (status === "trusted") return;
|
|
@@ -27962,7 +28039,7 @@ var topLevelCommands = [
|
|
|
27962
28039
|
revealsSecret: false,
|
|
27963
28040
|
args: [{ name: "phone", description: "E.164 phone number (optional; prompts if omitted)" }],
|
|
27964
28041
|
handler: async (hctx) => {
|
|
27965
|
-
const { accountVerifyPhoneCommand } = await import("./account-verify-phone-
|
|
28042
|
+
const { accountVerifyPhoneCommand } = await import("./account-verify-phone-N6TMI2HX.js");
|
|
27966
28043
|
await accountVerifyPhoneCommand(hctx);
|
|
27967
28044
|
}
|
|
27968
28045
|
},
|