@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/cli-utils.js
CHANGED
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
CLIError,
|
|
4
4
|
handleError,
|
|
5
5
|
unauthorizedHint
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-XDEGL6VD.js";
|
|
7
7
|
export {
|
|
8
8
|
AuthRequiredError,
|
|
9
9
|
CLIError,
|
|
10
10
|
handleError,
|
|
11
11
|
unauthorizedHint
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=errors-
|
|
13
|
+
//# sourceMappingURL=errors-JY4564PH.js.map
|
package/dist/gr.js
CHANGED
|
@@ -3121,7 +3121,7 @@ var init_libphonenumber_js = __esm({
|
|
|
3121
3121
|
}
|
|
3122
3122
|
});
|
|
3123
3123
|
|
|
3124
|
-
// ../sdk/dist/chunk-
|
|
3124
|
+
// ../sdk/dist/chunk-M77YVSBD.js
|
|
3125
3125
|
function resourceWorkflowsPath(wid, ...segments) {
|
|
3126
3126
|
const tail = segments.map((segment) => encodeURIComponent(String(segment))).join("/");
|
|
3127
3127
|
const base = `w/${encodeURIComponent(wid)}/resource-workflows`;
|
|
@@ -3745,6 +3745,7 @@ function bindDataTypesMethods(target, dataTypes) {
|
|
|
3745
3745
|
target.unarchiveDataType = dataTypes.unarchiveDataType.bind(dataTypes);
|
|
3746
3746
|
target.cloneDataType = dataTypes.cloneDataType.bind(dataTypes);
|
|
3747
3747
|
target.getDataRecords = dataTypes.getDataRecords.bind(dataTypes);
|
|
3748
|
+
target.recordCcmBillingExport = dataTypes.recordCcmBillingExport.bind(dataTypes);
|
|
3748
3749
|
target.getWorkspaceValuesRecord = dataTypes.getWorkspaceValuesRecord.bind(dataTypes);
|
|
3749
3750
|
target.listAnonymousFormSubmissions = dataTypes.listAnonymousFormSubmissions.bind(dataTypes);
|
|
3750
3751
|
target.getAnonymousFormSubmission = dataTypes.getAnonymousFormSubmission.bind(dataTypes);
|
|
@@ -4443,7 +4444,7 @@ function bindIntegrationsMethods(target, mondayIntegration, discordBots, slackAp
|
|
|
4443
4444
|
target.getTeamsConversations = teamsApps.getTeamsConversations.bind(teamsApps);
|
|
4444
4445
|
target.getTeamsInstallations = teamsApps.getTeamsInstallations.bind(teamsApps);
|
|
4445
4446
|
target.getTeamsAppAccounts = teamsApps.getTeamsAppAccounts.bind(teamsApps);
|
|
4446
|
-
target.
|
|
4447
|
+
target.getTeamsNotificationDelivery = teamsApps.getTeamsNotificationDelivery.bind(teamsApps);
|
|
4447
4448
|
target.getFhirConnections = fhirConnections.getFhirConnections.bind(fhirConnections);
|
|
4448
4449
|
target.getFhirConnection = fhirConnections.getFhirConnection.bind(fhirConnections);
|
|
4449
4450
|
target.getFhirConnectionByUuid = fhirConnections.getFhirConnectionByUuid.bind(fhirConnections);
|
|
@@ -4914,9 +4915,9 @@ function getRevisionState(workflow, revision) {
|
|
|
4914
4915
|
state: revision?.publishedAt != null ? "published" : "draft"
|
|
4915
4916
|
};
|
|
4916
4917
|
}
|
|
4917
|
-
var AbilitiesApi, ResourceWorkflowsApi, BundlesApi, InstallationsApi, AccessGrantsApi, AgentTasksApi, AgentsApi, AIModelsApi, ApiKeysApi, AppLinksApi, AppsApi, AssignmentsApi, VoiceApi, AuthApi, BuildersApi, CalendarsApi, CallsApi, CELApi, ChatApi, ChatsApi, ConfluenceApi, CustomToolkitsApi, DataTypesApi, DiscordBotsApi, SlackAppsApi, EventsApi, FeaturesApi, FhirConnectionsApi, StediApi, InboundFaxStatus, DocumoFaxApi, HealthieApi, FilesApi, InboxesApi, InquiriesApi, AppConnectionsApi, McpServersApi, MemberImportValidationError, MembersApi, MondayIntegrationApi, NotificationRulesApi, OperatorApi, OrgApiKeyLimitUnconfirmedError, OrgWebhookScopeUnconfirmedError, OrgApi, OAuthConnectionsApi, OAuthApi, PhoneNumbersApi, PronunciationsApi, PromptsApi, PersonasApi, QueriesApi, QualificationsApi, ReportsApi, RoutingRulesApi, ConnectionSyncApi, SalesforceApi, HubspotApi, SitesApi, SubscriptionsApi, SupportRequestsApi, OrganizationBillingApi, ResellersApi, SupervisorsApi, TasksApi, TemplatesApi, ToolkitsApi, JourneysApi, WorkflowsApi, WorkflowNotesApi, EventRuleObjectType, EventRuleEventType, EventRuleActionType, SyncErrorCode, DriverMode, MEMBER_RELATIONSHIP_KINDS, PROPOSED_MESSAGE_TOOL_NAMES, PROPOSED_MESSAGE_SETTLEMENT_STATUSES, PROPOSED_SERVICES, PROPOSED_FIELDS, WorkspaceInvitationsApi, WorkspacesApi, MedicalBillingApi, DashboardsApi, DevicesApi, TeamsAppsApi, ExperimentsApi, PatientSyncConnectionsApi, ClaimMdApi, ActivityApi, MotdApi, InterventionRequestsApi, MetricsApi, DataReportsApi, ProjectsApi, TrackedLinksApi, WORKSPACE_METHOD_NAMES, WORKSPACE_METHOD_NAME_SET, GravityRailClient, WIDGET_SLUGS, CHAT_TYPES, BUILTIN_ASSISTANT_CHAT_TYPES, MEMBER_AGENT_CHAT_TYPES, ActivityGrain, ActivityGroupBy, ActivityOpenItemOrder, ActivityWindowBasis;
|
|
4918
|
-
var
|
|
4919
|
-
"../sdk/dist/chunk-
|
|
4918
|
+
var AbilitiesApi, ResourceWorkflowsApi, BundlesApi, InstallationsApi, AccessGrantsApi, AgentTasksApi, AgentsApi, AIModelsApi, ApiKeysApi, AppLinksApi, AppsApi, AssignmentsApi, VoiceApi, AuthApi, BuildersApi, CalendarsApi, CallsApi, CELApi, ChatApi, ChatsApi, ConfluenceApi, CustomToolkitsApi, DataTypesApi, DiscordBotsApi, SlackAppsApi, EventsApi, FeaturesApi, FhirConnectionsApi, StediApi, InboundFaxStatus, DocumoFaxApi, HealthieApi, FilesApi, InboxesApi, InquiriesApi, AppConnectionsApi, McpServersApi, MemberImportValidationError, MembersApi, MondayIntegrationApi, NotificationRulesApi, OperatorApi, OrgApiKeyLimitUnconfirmedError, OrgWebhookScopeUnconfirmedError, OrgApi, OAuthConnectionsApi, OAuthApi, PhoneNumbersApi, PronunciationsApi, PromptsApi, PersonasApi, QueriesApi, QualificationsApi, ReportsApi, RoutingRulesApi, ConnectionSyncApi, SalesforceApi, HubspotApi, SitesApi, SubscriptionsApi, SupportRequestsApi, OrganizationBillingApi, ResellersApi, SupervisorsApi, TasksApi, TemplatesApi, ToolkitsApi, JourneysApi, WorkflowsApi, WorkflowNotesApi, AccessLevel2, EventRuleObjectType, EventRuleEventType, EventRuleActionType, SyncErrorCode, DriverMode, MEMBER_RELATIONSHIP_KINDS, PROPOSED_MESSAGE_TOOL_NAMES, PROPOSED_MESSAGE_SETTLEMENT_STATUSES, PROPOSED_SERVICES, PROPOSED_FIELDS, WorkspaceInvitationsApi, WorkspacesApi, MedicalBillingApi, DashboardsApi, DevicesApi, TeamsAppsApi, ExperimentsApi, PatientSyncConnectionsApi, ClaimMdApi, ActivityApi, MotdApi, InterventionRequestsApi, MetricsApi, DataReportsApi, ProjectsApi, TrackedLinksApi, WORKSPACE_METHOD_NAMES, WORKSPACE_METHOD_NAME_SET, GravityRailClient, WIDGET_SLUGS, CHAT_TYPES, BUILTIN_ASSISTANT_CHAT_TYPES, MEMBER_AGENT_CHAT_TYPES, ActivityGrain, ActivityGroupBy, ActivityOpenItemOrder, ActivityWindowBasis;
|
|
4919
|
+
var init_chunk_M77YVSBD = __esm({
|
|
4920
|
+
"../sdk/dist/chunk-M77YVSBD.js"() {
|
|
4920
4921
|
init_chunk_P2X5TOYY();
|
|
4921
4922
|
init_libphonenumber_js();
|
|
4922
4923
|
AbilitiesApi = class extends BaseApiClient {
|
|
@@ -7499,6 +7500,13 @@ var init_chunk_L4XC6KDG = __esm({
|
|
|
7499
7500
|
body: JSON.stringify(data)
|
|
7500
7501
|
});
|
|
7501
7502
|
}
|
|
7503
|
+
/** Record that a care console billing CSV was downloaded, for the export audit trail. */
|
|
7504
|
+
async recordCcmBillingExport(wid, data) {
|
|
7505
|
+
await this.fetch(`w/${wid}/ccm/billing-exports`, {
|
|
7506
|
+
method: "POST",
|
|
7507
|
+
body: JSON.stringify(data)
|
|
7508
|
+
});
|
|
7509
|
+
}
|
|
7502
7510
|
/** List data records for a data type with optional filtering and pagination. */
|
|
7503
7511
|
async getDataRecords(wid, dataTypeId, options) {
|
|
7504
7512
|
const params = new URLSearchParams();
|
|
@@ -7991,6 +7999,7 @@ var init_chunk_L4XC6KDG = __esm({
|
|
|
7991
7999
|
searchParams.append("workflowRevisionId", params.workflowRevisionId.toString());
|
|
7992
8000
|
if (params.journeyStepId)
|
|
7993
8001
|
searchParams.append("journeyStepId", params.journeyStepId.toString());
|
|
8002
|
+
if (params.folderId != null) searchParams.append("folderId", params.folderId.toString());
|
|
7994
8003
|
if (params.includeDisabled) searchParams.append("includeDisabled", "true");
|
|
7995
8004
|
return this.fetch(`w/${wid}/event-rules/search?${searchParams.toString()}`);
|
|
7996
8005
|
}
|
|
@@ -10697,6 +10706,30 @@ var init_chunk_L4XC6KDG = __esm({
|
|
|
10697
10706
|
method: "DELETE"
|
|
10698
10707
|
});
|
|
10699
10708
|
}
|
|
10709
|
+
/**
|
|
10710
|
+
* Read the organization's Inference API page: base URL, models, harness
|
|
10711
|
+
* snippets, credit posture and usage. Requires `org:admin`.
|
|
10712
|
+
*/
|
|
10713
|
+
async getOrgInferenceApi(orgIdOrUuid) {
|
|
10714
|
+
return this.fetch(`o/${orgIdOrUuid}/inference-api`);
|
|
10715
|
+
}
|
|
10716
|
+
/** Set the Inference API credit mode. Requires `org:admin`. */
|
|
10717
|
+
async updateOrgInferenceApi(orgIdOrUuid, data) {
|
|
10718
|
+
return this.fetch(`o/${orgIdOrUuid}/inference-api`, {
|
|
10719
|
+
method: "PUT",
|
|
10720
|
+
body: JSON.stringify(data)
|
|
10721
|
+
});
|
|
10722
|
+
}
|
|
10723
|
+
/**
|
|
10724
|
+
* Mint a workspace-bound Inference API key. The secret is returned once.
|
|
10725
|
+
* Requires `org:admin`.
|
|
10726
|
+
*/
|
|
10727
|
+
async createOrgInferenceApiKey(orgIdOrUuid, data) {
|
|
10728
|
+
return this.fetch(`o/${orgIdOrUuid}/inference-api/keys`, {
|
|
10729
|
+
method: "POST",
|
|
10730
|
+
body: JSON.stringify(data)
|
|
10731
|
+
});
|
|
10732
|
+
}
|
|
10700
10733
|
/** Current Organization billing access and billable subscription. */
|
|
10701
10734
|
async getOrgBillingAccess(orgIdOrUuid) {
|
|
10702
10735
|
return this.fetch(`o/${orgIdOrUuid}/billing-access`);
|
|
@@ -15180,6 +15213,12 @@ var init_chunk_L4XC6KDG = __esm({
|
|
|
15180
15213
|
});
|
|
15181
15214
|
}
|
|
15182
15215
|
};
|
|
15216
|
+
AccessLevel2 = /* @__PURE__ */ ((AccessLevel3) => {
|
|
15217
|
+
AccessLevel3["PRIVATE"] = "private";
|
|
15218
|
+
AccessLevel3["PUBLIC"] = "public";
|
|
15219
|
+
AccessLevel3["WORKSPACE"] = "workspace";
|
|
15220
|
+
return AccessLevel3;
|
|
15221
|
+
})(AccessLevel2 || {});
|
|
15183
15222
|
EventRuleObjectType = /* @__PURE__ */ ((EventRuleObjectType2) => {
|
|
15184
15223
|
EventRuleObjectType2["TASK"] = "task";
|
|
15185
15224
|
EventRuleObjectType2["WORKSPACE"] = "workspace";
|
|
@@ -15194,6 +15233,7 @@ var init_chunk_L4XC6KDG = __esm({
|
|
|
15194
15233
|
EventRuleObjectType2["CALL"] = "call";
|
|
15195
15234
|
EventRuleObjectType2["VOICEMAIL"] = "voicemail";
|
|
15196
15235
|
EventRuleObjectType2["FAX"] = "fax";
|
|
15236
|
+
EventRuleObjectType2["FOLDER"] = "folder";
|
|
15197
15237
|
return EventRuleObjectType2;
|
|
15198
15238
|
})(EventRuleObjectType || {});
|
|
15199
15239
|
EventRuleEventType = /* @__PURE__ */ ((EventRuleEventType2) => {
|
|
@@ -15230,11 +15270,16 @@ var init_chunk_L4XC6KDG = __esm({
|
|
|
15230
15270
|
EventRuleEventType2["CALL_SUMMARY"] = "call:summary";
|
|
15231
15271
|
EventRuleEventType2["VOICEMAIL_RECEIVED"] = "voicemail:received";
|
|
15232
15272
|
EventRuleEventType2["FAX_RECEIVED"] = "fax:received";
|
|
15273
|
+
EventRuleEventType2["FILE_CREATED"] = "file:created";
|
|
15274
|
+
EventRuleEventType2["FILE_UPDATED"] = "file:updated";
|
|
15275
|
+
EventRuleEventType2["FILE_MOVED"] = "file:moved";
|
|
15276
|
+
EventRuleEventType2["FILE_DELETED"] = "file:deleted";
|
|
15233
15277
|
return EventRuleEventType2;
|
|
15234
15278
|
})(EventRuleEventType || {});
|
|
15235
15279
|
EventRuleActionType = /* @__PURE__ */ ((EventRuleActionType2) => {
|
|
15236
15280
|
EventRuleActionType2["MEMBER_NOTIFY_ACTION"] = "member:notify";
|
|
15237
15281
|
EventRuleActionType2["MEMBER_LABEL_ACTION"] = "member:label";
|
|
15282
|
+
EventRuleActionType2["FILE_LABEL_ACTION"] = "file:label";
|
|
15238
15283
|
EventRuleActionType2["MEMBER_UPSERT"] = "member:upsert";
|
|
15239
15284
|
EventRuleActionType2["SWITCH_TASK_ACTION"] = "task:switch";
|
|
15240
15285
|
EventRuleActionType2["ASSISTANT_MESSAGE"] = "assistant:message";
|
|
@@ -16800,14 +16845,12 @@ var init_chunk_L4XC6KDG = __esm({
|
|
|
16800
16845
|
);
|
|
16801
16846
|
}
|
|
16802
16847
|
/**
|
|
16803
|
-
*
|
|
16804
|
-
*
|
|
16805
|
-
*
|
|
16848
|
+
* The organization Bot Teams connection that delivers this workspace's
|
|
16849
|
+
* notifications, the connections it may choose, and the caller's own
|
|
16850
|
+
* readiness. Reads only; nothing is sent to Microsoft.
|
|
16806
16851
|
*/
|
|
16807
|
-
async
|
|
16808
|
-
return this.fetch(
|
|
16809
|
-
`w/${wid}/app-connections/teams/apps/${appId}/notification-destinations`
|
|
16810
|
-
);
|
|
16852
|
+
async getTeamsNotificationDelivery(wid) {
|
|
16853
|
+
return this.fetch(`w/${wid}/notification-delivery/teams`);
|
|
16811
16854
|
}
|
|
16812
16855
|
async getTeamsAppAccounts(wid, appId, options = {}) {
|
|
16813
16856
|
const params = new URLSearchParams();
|
|
@@ -18147,7 +18190,7 @@ var init_chunk_L4XC6KDG = __esm({
|
|
|
18147
18190
|
"getTeamsApps",
|
|
18148
18191
|
"getTeamsConversations",
|
|
18149
18192
|
"getTeamsInstallations",
|
|
18150
|
-
"
|
|
18193
|
+
"getTeamsNotificationDelivery",
|
|
18151
18194
|
"getTemplateContext",
|
|
18152
18195
|
"getChatTestRun",
|
|
18153
18196
|
"getTestChatRun",
|
|
@@ -18618,6 +18661,7 @@ var init_chunk_L4XC6KDG = __esm({
|
|
|
18618
18661
|
unarchiveDataType;
|
|
18619
18662
|
cloneDataType;
|
|
18620
18663
|
getDataRecords;
|
|
18664
|
+
recordCcmBillingExport;
|
|
18621
18665
|
getWorkspaceValuesRecord;
|
|
18622
18666
|
listAnonymousFormSubmissions;
|
|
18623
18667
|
getAnonymousFormSubmission;
|
|
@@ -19602,7 +19646,7 @@ var init_chunk_L4XC6KDG = __esm({
|
|
|
19602
19646
|
getTeamsConversations;
|
|
19603
19647
|
getTeamsInstallations;
|
|
19604
19648
|
getTeamsAppAccounts;
|
|
19605
|
-
|
|
19649
|
+
getTeamsNotificationDelivery;
|
|
19606
19650
|
// FHIR Connections API
|
|
19607
19651
|
getFhirConnections;
|
|
19608
19652
|
getFhirConnection;
|
|
@@ -20068,9 +20112,9 @@ var init_chunk_L4XC6KDG = __esm({
|
|
|
20068
20112
|
}
|
|
20069
20113
|
});
|
|
20070
20114
|
|
|
20071
|
-
// ../sdk/dist/chunk-
|
|
20072
|
-
var
|
|
20073
|
-
"../sdk/dist/chunk-
|
|
20115
|
+
// ../sdk/dist/chunk-T26HRHRS.js
|
|
20116
|
+
var init_chunk_T26HRHRS = __esm({
|
|
20117
|
+
"../sdk/dist/chunk-T26HRHRS.js"() {
|
|
20074
20118
|
}
|
|
20075
20119
|
});
|
|
20076
20120
|
|
|
@@ -20125,8 +20169,8 @@ var init_chunk_6KPGCPGW = __esm({
|
|
|
20125
20169
|
var SEARCHABLE_EVENT_RULE_SOURCE_FIELDS, ActivityEventType, EntityKind;
|
|
20126
20170
|
var init_dist = __esm({
|
|
20127
20171
|
"../sdk/dist/index.js"() {
|
|
20128
|
-
|
|
20129
|
-
|
|
20172
|
+
init_chunk_M77YVSBD();
|
|
20173
|
+
init_chunk_T26HRHRS();
|
|
20130
20174
|
init_chunk_6KPGCPGW();
|
|
20131
20175
|
init_chunk_P2X5TOYY();
|
|
20132
20176
|
SEARCHABLE_EVENT_RULE_SOURCE_FIELDS = [
|
|
@@ -24556,7 +24600,7 @@ var init_package = __esm({
|
|
|
24556
24600
|
"package.json"() {
|
|
24557
24601
|
package_default = {
|
|
24558
24602
|
name: "@gravity-rail/cli",
|
|
24559
|
-
version: "
|
|
24603
|
+
version: "7.0.0",
|
|
24560
24604
|
description: "Gravity Rail CLI \u2014 manage workspaces from the command line",
|
|
24561
24605
|
type: "module",
|
|
24562
24606
|
bin: {
|
|
@@ -39641,6 +39685,8 @@ ENVELOPE (POST /queries/{validate,preview,run} body: {"query": <envelope>, "mode
|
|
|
39641
39685
|
"sort": [{"field": "...", "dir": "asc"|"desc"}], // max 3
|
|
39642
39686
|
"limit": 1..500, // default 50
|
|
39643
39687
|
"cursor": "...", // page token from a prior run
|
|
39688
|
+
"timezone": "UTC", // optional; record date reads, day bounds
|
|
39689
|
+
// and bucket truncation
|
|
39644
39690
|
"aggregate": {...}, // GROUP BY mode; excludes select/sort/computed
|
|
39645
39691
|
"includeArchived": false,
|
|
39646
39692
|
"computed": [{"alias": "minutes", <aggregate fields>}]
|
|
@@ -39919,6 +39965,9 @@ Relations (relationMatch): ${relations.join(", ")}`);
|
|
|
39919
39965
|
}
|
|
39920
39966
|
]
|
|
39921
39967
|
};
|
|
39968
|
+
|
|
39969
|
+
// src/domains/sites.ts
|
|
39970
|
+
init_dist();
|
|
39922
39971
|
init_output();
|
|
39923
39972
|
init_context();
|
|
39924
39973
|
init_errors();
|
|
@@ -40409,6 +40458,80 @@ var sitesDomain = {
|
|
|
40409
40458
|
outputSingle(result3, ctx, SOURCE_COLUMNS);
|
|
40410
40459
|
}
|
|
40411
40460
|
},
|
|
40461
|
+
{
|
|
40462
|
+
path: ["sites", "sharing", "get"],
|
|
40463
|
+
description: "Show a site's access (private, workspace or public), its audience of Member Roles, and individual grants",
|
|
40464
|
+
verb: "read",
|
|
40465
|
+
revealsSecret: false,
|
|
40466
|
+
requiresWorkspace: true,
|
|
40467
|
+
args: [{ name: "site-id", description: "Site ID", required: true }],
|
|
40468
|
+
examples: [`gr sites sharing get -w $WS --site-id 1`],
|
|
40469
|
+
handler: async ({ ctx, workspace, args }) => {
|
|
40470
|
+
const result3 = await requireAuth(ctx).apiClient.getSiteSharing(
|
|
40471
|
+
workspace,
|
|
40472
|
+
requireNumber(args, "site-id")
|
|
40473
|
+
);
|
|
40474
|
+
outputSingle(result3, ctx);
|
|
40475
|
+
}
|
|
40476
|
+
},
|
|
40477
|
+
{
|
|
40478
|
+
path: ["sites", "sharing", "set"],
|
|
40479
|
+
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.",
|
|
40480
|
+
verb: "update",
|
|
40481
|
+
revealsSecret: false,
|
|
40482
|
+
requiresWorkspace: true,
|
|
40483
|
+
args: [
|
|
40484
|
+
{ name: "site-id", description: "Site ID", required: true },
|
|
40485
|
+
{ name: "access", description: "private | workspace | public", required: true },
|
|
40486
|
+
{
|
|
40487
|
+
name: "audience",
|
|
40488
|
+
description: "Comma-separated Member Role UUIDs (replaces the whole audience; omitted keeps it)"
|
|
40489
|
+
}
|
|
40490
|
+
],
|
|
40491
|
+
examples: [
|
|
40492
|
+
`gr sites sharing set -w $WS --site-id 1 --access private --audience $ADMIN_ROLE_UUID --allow-write`
|
|
40493
|
+
],
|
|
40494
|
+
handler: async ({ ctx, workspace, args }) => {
|
|
40495
|
+
const ACCESS_LEVELS = {
|
|
40496
|
+
private: AccessLevel2.PRIVATE,
|
|
40497
|
+
workspace: AccessLevel2.WORKSPACE,
|
|
40498
|
+
public: AccessLevel2.PUBLIC
|
|
40499
|
+
};
|
|
40500
|
+
const accessArg = String(args.access ?? "");
|
|
40501
|
+
const access = Object.hasOwn(ACCESS_LEVELS, accessArg) ? ACCESS_LEVELS[accessArg] : void 0;
|
|
40502
|
+
if (!access) {
|
|
40503
|
+
throw new CLIError("--access must be one of: private, workspace, public");
|
|
40504
|
+
}
|
|
40505
|
+
const current = await requireAuth(ctx).apiClient.getSiteSharing(
|
|
40506
|
+
workspace,
|
|
40507
|
+
requireNumber(args, "site-id")
|
|
40508
|
+
);
|
|
40509
|
+
if (access === AccessLevel2.PRIVATE && args.audience === void 0 && current.access !== AccessLevel2.PRIVATE) {
|
|
40510
|
+
throw new CLIError(
|
|
40511
|
+
"--access private needs --audience: the Member Role UUIDs that keep access, or '' for none"
|
|
40512
|
+
);
|
|
40513
|
+
}
|
|
40514
|
+
const audience = access === AccessLevel2.WORKSPACE ? [] : args.audience === void 0 ? current.audience ?? [] : String(args.audience).split(",").map((entry) => entry.trim()).filter(Boolean);
|
|
40515
|
+
const result3 = await requireAuth(ctx).apiClient.updateSiteSharing(
|
|
40516
|
+
workspace,
|
|
40517
|
+
requireNumber(args, "site-id"),
|
|
40518
|
+
{
|
|
40519
|
+
access,
|
|
40520
|
+
grants: (current.grants ?? []).map((grant) => ({
|
|
40521
|
+
granteeMemberId: grant.granteeMemberId,
|
|
40522
|
+
accessMode: grant.accessMode
|
|
40523
|
+
})),
|
|
40524
|
+
audience
|
|
40525
|
+
}
|
|
40526
|
+
);
|
|
40527
|
+
if (result3.access !== access) {
|
|
40528
|
+
throw new CLIError(
|
|
40529
|
+
`The site's access is ${result3.access}, not ${access}; check --audience`
|
|
40530
|
+
);
|
|
40531
|
+
}
|
|
40532
|
+
outputSingle(result3, ctx);
|
|
40533
|
+
}
|
|
40534
|
+
},
|
|
40412
40535
|
{
|
|
40413
40536
|
path: ["sites", "theme-settings", "get"],
|
|
40414
40537
|
description: "Show the active theme's settings schema, values, and features",
|