@gravity-rail/cli 6.1.0 → 8.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/cli-utils.js CHANGED
@@ -30,7 +30,7 @@ import {
30
30
  selectFromList,
31
31
  startCallbackServer,
32
32
  wrapText
33
- } from "./chunk-HTPFRSPP.js";
33
+ } from "./chunk-YKDH3GYW.js";
34
34
  export {
35
35
  AGUIClient,
36
36
  CALLBACK_PATH,
@@ -3,11 +3,11 @@ import {
3
3
  CLIError,
4
4
  handleError,
5
5
  unauthorizedHint
6
- } from "./chunk-HTPFRSPP.js";
6
+ } from "./chunk-YKDH3GYW.js";
7
7
  export {
8
8
  AuthRequiredError,
9
9
  CLIError,
10
10
  handleError,
11
11
  unauthorizedHint
12
12
  };
13
- //# sourceMappingURL=errors-CBQHNNRI.js.map
13
+ //# sourceMappingURL=errors-W4SQWN2A.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-VFOWHCQ7.js
3124
+ // ../sdk/dist/chunk-FWDDHKTM.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`;
@@ -3675,6 +3675,7 @@ function bindCallsMethods(target, calls, cel) {
3675
3675
  target.getPhoneCalls = calls.getPhoneCalls.bind(calls);
3676
3676
  target.getPhoneCallByUuid = calls.getPhoneCallByUuid.bind(calls);
3677
3677
  target.getMessageTiming = calls.getMessageTiming.bind(calls);
3678
+ target.getRecordingWaveform = calls.getRecordingWaveform.bind(calls);
3678
3679
  target.getEdgeCaptureInfo = calls.getEdgeCaptureInfo.bind(calls);
3679
3680
  target.getCallRecordingDownloadUrl = calls.getCallRecordingDownloadUrl.bind(calls);
3680
3681
  target.getCelContext = cel.getCelContext.bind(cel);
@@ -3745,6 +3746,7 @@ function bindDataTypesMethods(target, dataTypes) {
3745
3746
  target.unarchiveDataType = dataTypes.unarchiveDataType.bind(dataTypes);
3746
3747
  target.cloneDataType = dataTypes.cloneDataType.bind(dataTypes);
3747
3748
  target.getDataRecords = dataTypes.getDataRecords.bind(dataTypes);
3749
+ target.recordCcmBillingExport = dataTypes.recordCcmBillingExport.bind(dataTypes);
3748
3750
  target.getWorkspaceValuesRecord = dataTypes.getWorkspaceValuesRecord.bind(dataTypes);
3749
3751
  target.listAnonymousFormSubmissions = dataTypes.listAnonymousFormSubmissions.bind(dataTypes);
3750
3752
  target.getAnonymousFormSubmission = dataTypes.getAnonymousFormSubmission.bind(dataTypes);
@@ -4443,7 +4445,7 @@ function bindIntegrationsMethods(target, mondayIntegration, discordBots, slackAp
4443
4445
  target.getTeamsConversations = teamsApps.getTeamsConversations.bind(teamsApps);
4444
4446
  target.getTeamsInstallations = teamsApps.getTeamsInstallations.bind(teamsApps);
4445
4447
  target.getTeamsAppAccounts = teamsApps.getTeamsAppAccounts.bind(teamsApps);
4446
- target.getTeamsNotificationDestinations = teamsApps.getTeamsNotificationDestinations.bind(teamsApps);
4448
+ target.getTeamsNotificationDelivery = teamsApps.getTeamsNotificationDelivery.bind(teamsApps);
4447
4449
  target.getFhirConnections = fhirConnections.getFhirConnections.bind(fhirConnections);
4448
4450
  target.getFhirConnection = fhirConnections.getFhirConnection.bind(fhirConnections);
4449
4451
  target.getFhirConnectionByUuid = fhirConnections.getFhirConnectionByUuid.bind(fhirConnections);
@@ -4914,9 +4916,9 @@ function getRevisionState(workflow, revision) {
4914
4916
  state: revision?.publishedAt != null ? "published" : "draft"
4915
4917
  };
4916
4918
  }
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 init_chunk_VFOWHCQ7 = __esm({
4919
- "../sdk/dist/chunk-VFOWHCQ7.js"() {
4919
+ 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;
4920
+ var init_chunk_FWDDHKTM = __esm({
4921
+ "../sdk/dist/chunk-FWDDHKTM.js"() {
4920
4922
  init_chunk_P2X5TOYY();
4921
4923
  init_libphonenumber_js();
4922
4924
  AbilitiesApi = class extends BaseApiClient {
@@ -6602,6 +6604,19 @@ var init_chunk_VFOWHCQ7 = __esm({
6602
6604
  `w/${wid}/recordings/chat/${chatId}/message-timing${params.toString() ? `?${params.toString()}` : ""}`
6603
6605
  );
6604
6606
  }
6607
+ /**
6608
+ * A coarse loudness overview of the chat's playable call recording, for
6609
+ * drawing a player before any audio is fetched: the playable duration and
6610
+ * one value in `[0, 1]` per half second (at most 512). It describes the
6611
+ * recording `audio.wav` serves and is 404 exactly when that is. Reading it
6612
+ * fetches no audio.
6613
+ */
6614
+ async getRecordingWaveform(wid, chatId, options = {}) {
6615
+ return this.fetch(
6616
+ `w/${wid}/recordings/chat/${chatId}/waveform`,
6617
+ options.signal ? { signal: options.signal } : void 0
6618
+ );
6619
+ }
6605
6620
  /**
6606
6621
  * Staff-only discovery of retained edge-stream capture for a chat:
6607
6622
  * whether any is retained, its aggregate coverage status, the interval it
@@ -7499,6 +7514,13 @@ var init_chunk_VFOWHCQ7 = __esm({
7499
7514
  body: JSON.stringify(data)
7500
7515
  });
7501
7516
  }
7517
+ /** Record that a care console billing CSV was downloaded, for the export audit trail. */
7518
+ async recordCcmBillingExport(wid, data) {
7519
+ await this.fetch(`w/${wid}/ccm/billing-exports`, {
7520
+ method: "POST",
7521
+ body: JSON.stringify(data)
7522
+ });
7523
+ }
7502
7524
  /** List data records for a data type with optional filtering and pagination. */
7503
7525
  async getDataRecords(wid, dataTypeId, options) {
7504
7526
  const params = new URLSearchParams();
@@ -7991,6 +8013,7 @@ var init_chunk_VFOWHCQ7 = __esm({
7991
8013
  searchParams.append("workflowRevisionId", params.workflowRevisionId.toString());
7992
8014
  if (params.journeyStepId)
7993
8015
  searchParams.append("journeyStepId", params.journeyStepId.toString());
8016
+ if (params.folderId != null) searchParams.append("folderId", params.folderId.toString());
7994
8017
  if (params.includeDisabled) searchParams.append("includeDisabled", "true");
7995
8018
  return this.fetch(`w/${wid}/event-rules/search?${searchParams.toString()}`);
7996
8019
  }
@@ -10697,6 +10720,30 @@ var init_chunk_VFOWHCQ7 = __esm({
10697
10720
  method: "DELETE"
10698
10721
  });
10699
10722
  }
10723
+ /**
10724
+ * Read the organization's Inference API page: base URL, models, harness
10725
+ * snippets, credit posture and usage. Requires `org:admin`.
10726
+ */
10727
+ async getOrgInferenceApi(orgIdOrUuid) {
10728
+ return this.fetch(`o/${orgIdOrUuid}/inference-api`);
10729
+ }
10730
+ /** Set the Inference API credit mode. Requires `org:admin`. */
10731
+ async updateOrgInferenceApi(orgIdOrUuid, data) {
10732
+ return this.fetch(`o/${orgIdOrUuid}/inference-api`, {
10733
+ method: "PUT",
10734
+ body: JSON.stringify(data)
10735
+ });
10736
+ }
10737
+ /**
10738
+ * Mint an organization-bound Inference API key. The secret is returned once.
10739
+ * Requires `org:admin`.
10740
+ */
10741
+ async createOrgInferenceApiKey(orgIdOrUuid, data) {
10742
+ return this.fetch(`o/${orgIdOrUuid}/inference-api/keys`, {
10743
+ method: "POST",
10744
+ body: JSON.stringify(data)
10745
+ });
10746
+ }
10700
10747
  /** Current Organization billing access and billable subscription. */
10701
10748
  async getOrgBillingAccess(orgIdOrUuid) {
10702
10749
  return this.fetch(`o/${orgIdOrUuid}/billing-access`);
@@ -12399,10 +12446,10 @@ var init_chunk_VFOWHCQ7 = __esm({
12399
12446
  });
12400
12447
  }
12401
12448
  /** Execute a query (rows / count / aggregate). */
12402
- async runQuery(wid, query2, mode) {
12449
+ async runQuery(wid, query2, mode, options) {
12403
12450
  return this.fetch(`w/${wid}/queries/run`, {
12404
12451
  method: "POST",
12405
- body: JSON.stringify({ query: query2, mode })
12452
+ body: JSON.stringify({ query: query2, mode, sourceFaxId: options?.sourceFaxId })
12406
12453
  });
12407
12454
  }
12408
12455
  };
@@ -15180,6 +15227,12 @@ var init_chunk_VFOWHCQ7 = __esm({
15180
15227
  });
15181
15228
  }
15182
15229
  };
15230
+ AccessLevel2 = /* @__PURE__ */ ((AccessLevel3) => {
15231
+ AccessLevel3["PRIVATE"] = "private";
15232
+ AccessLevel3["PUBLIC"] = "public";
15233
+ AccessLevel3["WORKSPACE"] = "workspace";
15234
+ return AccessLevel3;
15235
+ })(AccessLevel2 || {});
15183
15236
  EventRuleObjectType = /* @__PURE__ */ ((EventRuleObjectType2) => {
15184
15237
  EventRuleObjectType2["TASK"] = "task";
15185
15238
  EventRuleObjectType2["WORKSPACE"] = "workspace";
@@ -15194,6 +15247,7 @@ var init_chunk_VFOWHCQ7 = __esm({
15194
15247
  EventRuleObjectType2["CALL"] = "call";
15195
15248
  EventRuleObjectType2["VOICEMAIL"] = "voicemail";
15196
15249
  EventRuleObjectType2["FAX"] = "fax";
15250
+ EventRuleObjectType2["FOLDER"] = "folder";
15197
15251
  return EventRuleObjectType2;
15198
15252
  })(EventRuleObjectType || {});
15199
15253
  EventRuleEventType = /* @__PURE__ */ ((EventRuleEventType2) => {
@@ -15230,11 +15284,16 @@ var init_chunk_VFOWHCQ7 = __esm({
15230
15284
  EventRuleEventType2["CALL_SUMMARY"] = "call:summary";
15231
15285
  EventRuleEventType2["VOICEMAIL_RECEIVED"] = "voicemail:received";
15232
15286
  EventRuleEventType2["FAX_RECEIVED"] = "fax:received";
15287
+ EventRuleEventType2["FILE_CREATED"] = "file:created";
15288
+ EventRuleEventType2["FILE_UPDATED"] = "file:updated";
15289
+ EventRuleEventType2["FILE_MOVED"] = "file:moved";
15290
+ EventRuleEventType2["FILE_DELETED"] = "file:deleted";
15233
15291
  return EventRuleEventType2;
15234
15292
  })(EventRuleEventType || {});
15235
15293
  EventRuleActionType = /* @__PURE__ */ ((EventRuleActionType2) => {
15236
15294
  EventRuleActionType2["MEMBER_NOTIFY_ACTION"] = "member:notify";
15237
15295
  EventRuleActionType2["MEMBER_LABEL_ACTION"] = "member:label";
15296
+ EventRuleActionType2["FILE_LABEL_ACTION"] = "file:label";
15238
15297
  EventRuleActionType2["MEMBER_UPSERT"] = "member:upsert";
15239
15298
  EventRuleActionType2["SWITCH_TASK_ACTION"] = "task:switch";
15240
15299
  EventRuleActionType2["ASSISTANT_MESSAGE"] = "assistant:message";
@@ -16800,14 +16859,12 @@ var init_chunk_VFOWHCQ7 = __esm({
16800
16859
  );
16801
16860
  }
16802
16861
  /**
16803
- * Channels this app has observed, for approval on its settings form.
16804
- * Approval is saved through `updateTeamsApp`
16805
- * (`approvedNotificationDestinationIds`); observation approves nothing.
16862
+ * The organization Bot Teams connection that delivers this workspace's
16863
+ * notifications, the connections it may choose, and the caller's own
16864
+ * readiness. Reads only; nothing is sent to Microsoft.
16806
16865
  */
16807
- async getTeamsNotificationDestinations(wid, appId) {
16808
- return this.fetch(
16809
- `w/${wid}/app-connections/teams/apps/${appId}/notification-destinations`
16810
- );
16866
+ async getTeamsNotificationDelivery(wid) {
16867
+ return this.fetch(`w/${wid}/notification-delivery/teams`);
16811
16868
  }
16812
16869
  async getTeamsAppAccounts(wid, appId, options = {}) {
16813
16870
  const params = new URLSearchParams();
@@ -18100,6 +18157,7 @@ var init_chunk_VFOWHCQ7 = __esm({
18100
18157
  "getPublicProducts",
18101
18158
  "getQualification",
18102
18159
  "getQualifications",
18160
+ "getRecordingWaveform",
18103
18161
  "getResellerWorkspaces",
18104
18162
  "getRoutine",
18105
18163
  "getRoutineConfigEvents",
@@ -18147,7 +18205,7 @@ var init_chunk_VFOWHCQ7 = __esm({
18147
18205
  "getTeamsApps",
18148
18206
  "getTeamsConversations",
18149
18207
  "getTeamsInstallations",
18150
- "getTeamsNotificationDestinations",
18208
+ "getTeamsNotificationDelivery",
18151
18209
  "getTemplateContext",
18152
18210
  "getChatTestRun",
18153
18211
  "getTestChatRun",
@@ -18599,6 +18657,7 @@ var init_chunk_VFOWHCQ7 = __esm({
18599
18657
  getPhoneCalls;
18600
18658
  getPhoneCallByUuid;
18601
18659
  getMessageTiming;
18660
+ getRecordingWaveform;
18602
18661
  getEdgeCaptureInfo;
18603
18662
  getCallRecordingDownloadUrl;
18604
18663
  getCelContext;
@@ -18618,6 +18677,7 @@ var init_chunk_VFOWHCQ7 = __esm({
18618
18677
  unarchiveDataType;
18619
18678
  cloneDataType;
18620
18679
  getDataRecords;
18680
+ recordCcmBillingExport;
18621
18681
  getWorkspaceValuesRecord;
18622
18682
  listAnonymousFormSubmissions;
18623
18683
  getAnonymousFormSubmission;
@@ -19602,7 +19662,7 @@ var init_chunk_VFOWHCQ7 = __esm({
19602
19662
  getTeamsConversations;
19603
19663
  getTeamsInstallations;
19604
19664
  getTeamsAppAccounts;
19605
- getTeamsNotificationDestinations;
19665
+ getTeamsNotificationDelivery;
19606
19666
  // FHIR Connections API
19607
19667
  getFhirConnections;
19608
19668
  getFhirConnection;
@@ -20068,9 +20128,9 @@ var init_chunk_VFOWHCQ7 = __esm({
20068
20128
  }
20069
20129
  });
20070
20130
 
20071
- // ../sdk/dist/chunk-P2MSMMMJ.js
20072
- var init_chunk_P2MSMMMJ = __esm({
20073
- "../sdk/dist/chunk-P2MSMMMJ.js"() {
20131
+ // ../sdk/dist/chunk-RKIR4UNS.js
20132
+ var init_chunk_RKIR4UNS = __esm({
20133
+ "../sdk/dist/chunk-RKIR4UNS.js"() {
20074
20134
  }
20075
20135
  });
20076
20136
 
@@ -20125,8 +20185,8 @@ var init_chunk_6KPGCPGW = __esm({
20125
20185
  var SEARCHABLE_EVENT_RULE_SOURCE_FIELDS, ActivityEventType, EntityKind;
20126
20186
  var init_dist = __esm({
20127
20187
  "../sdk/dist/index.js"() {
20128
- init_chunk_VFOWHCQ7();
20129
- init_chunk_P2MSMMMJ();
20188
+ init_chunk_FWDDHKTM();
20189
+ init_chunk_RKIR4UNS();
20130
20190
  init_chunk_6KPGCPGW();
20131
20191
  init_chunk_P2X5TOYY();
20132
20192
  SEARCHABLE_EVENT_RULE_SOURCE_FIELDS = [
@@ -20178,6 +20238,7 @@ var init_dist = __esm({
20178
20238
  presencewent_offline: "presence.went_offline",
20179
20239
  operator_groupmember_added: "operator_group.member_added",
20180
20240
  operator_groupmember_removed: "operator_group.member_removed",
20241
+ operatorinteraction_declined: "operator.interaction_declined",
20181
20242
  voicemailreceived: "voicemail.received",
20182
20243
  voicemailtranscribed: "voicemail.transcribed",
20183
20244
  voicemaillistened: "voicemail.listened",
@@ -24556,7 +24617,7 @@ var init_package = __esm({
24556
24617
  "package.json"() {
24557
24618
  package_default = {
24558
24619
  name: "@gravity-rail/cli",
24559
- version: "6.1.0",
24620
+ version: "8.0.0",
24560
24621
  description: "Gravity Rail CLI \u2014 manage workspaces from the command line",
24561
24622
  type: "module",
24562
24623
  bin: {
@@ -39641,6 +39702,8 @@ ENVELOPE (POST /queries/{validate,preview,run} body: {"query": <envelope>, "mode
39641
39702
  "sort": [{"field": "...", "dir": "asc"|"desc"}], // max 3
39642
39703
  "limit": 1..500, // default 50
39643
39704
  "cursor": "...", // page token from a prior run
39705
+ "timezone": "UTC", // optional; record date reads, day bounds
39706
+ // and bucket truncation
39644
39707
  "aggregate": {...}, // GROUP BY mode; excludes select/sort/computed
39645
39708
  "includeArchived": false,
39646
39709
  "computed": [{"alias": "minutes", <aggregate fields>}]
@@ -39901,6 +39964,11 @@ Relations (relationMatch): ${relations.join(", ")}`);
39901
39964
  name: "mode",
39902
39965
  description: "rows (default), count, or aggregate",
39903
39966
  required: false
39967
+ },
39968
+ {
39969
+ name: "source-fax-id",
39970
+ description: "Limit a Record query to Records produced from this received fax",
39971
+ required: false
39904
39972
  }
39905
39973
  ],
39906
39974
  examples: [
@@ -39909,16 +39977,25 @@ Relations (relationMatch): ${relations.join(", ")}`);
39909
39977
  ],
39910
39978
  handler: async ({ ctx, workspace, args, data }) => {
39911
39979
  const query2 = coerceQuery(data, args);
39980
+ const rawFaxId = args["source-fax-id"];
39981
+ const sourceFaxId = rawFaxId === void 0 ? void 0 : Number(rawFaxId);
39982
+ if (sourceFaxId !== void 0 && (typeof rawFaxId !== "string" || !/^[0-9]+$/.test(rawFaxId) || !Number.isInteger(sourceFaxId) || sourceFaxId < 1 || sourceFaxId > 2147483647)) {
39983
+ throw new CLIError("--source-fax-id must be a positive 32-bit integer");
39984
+ }
39912
39985
  const result3 = await requireAuth(ctx).apiClient.runQuery(
39913
39986
  workspace,
39914
39987
  query2,
39915
- runMode(args)
39988
+ runMode(args),
39989
+ { sourceFaxId }
39916
39990
  );
39917
39991
  outputSingle(result3, ctx);
39918
39992
  }
39919
39993
  }
39920
39994
  ]
39921
39995
  };
39996
+
39997
+ // src/domains/sites.ts
39998
+ init_dist();
39922
39999
  init_output();
39923
40000
  init_context();
39924
40001
  init_errors();
@@ -40409,6 +40486,80 @@ var sitesDomain = {
40409
40486
  outputSingle(result3, ctx, SOURCE_COLUMNS);
40410
40487
  }
40411
40488
  },
40489
+ {
40490
+ path: ["sites", "sharing", "get"],
40491
+ description: "Show a site's access (private, workspace or public), its audience of Member Roles, and individual grants",
40492
+ verb: "read",
40493
+ revealsSecret: false,
40494
+ requiresWorkspace: true,
40495
+ args: [{ name: "site-id", description: "Site ID", required: true }],
40496
+ examples: [`gr sites sharing get -w $WS --site-id 1`],
40497
+ handler: async ({ ctx, workspace, args }) => {
40498
+ const result3 = await requireAuth(ctx).apiClient.getSiteSharing(
40499
+ workspace,
40500
+ requireNumber(args, "site-id")
40501
+ );
40502
+ outputSingle(result3, ctx);
40503
+ }
40504
+ },
40505
+ {
40506
+ path: ["sites", "sharing", "set"],
40507
+ 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.",
40508
+ verb: "update",
40509
+ revealsSecret: false,
40510
+ requiresWorkspace: true,
40511
+ args: [
40512
+ { name: "site-id", description: "Site ID", required: true },
40513
+ { name: "access", description: "private | workspace | public", required: true },
40514
+ {
40515
+ name: "audience",
40516
+ description: "Comma-separated Member Role UUIDs (replaces the whole audience; omitted keeps it)"
40517
+ }
40518
+ ],
40519
+ examples: [
40520
+ `gr sites sharing set -w $WS --site-id 1 --access private --audience $ADMIN_ROLE_UUID --allow-write`
40521
+ ],
40522
+ handler: async ({ ctx, workspace, args }) => {
40523
+ const ACCESS_LEVELS = {
40524
+ private: AccessLevel2.PRIVATE,
40525
+ workspace: AccessLevel2.WORKSPACE,
40526
+ public: AccessLevel2.PUBLIC
40527
+ };
40528
+ const accessArg = String(args.access ?? "");
40529
+ const access = Object.hasOwn(ACCESS_LEVELS, accessArg) ? ACCESS_LEVELS[accessArg] : void 0;
40530
+ if (!access) {
40531
+ throw new CLIError("--access must be one of: private, workspace, public");
40532
+ }
40533
+ const current = await requireAuth(ctx).apiClient.getSiteSharing(
40534
+ workspace,
40535
+ requireNumber(args, "site-id")
40536
+ );
40537
+ if (access === AccessLevel2.PRIVATE && args.audience === void 0 && current.access !== AccessLevel2.PRIVATE) {
40538
+ throw new CLIError(
40539
+ "--access private needs --audience: the Member Role UUIDs that keep access, or '' for none"
40540
+ );
40541
+ }
40542
+ const audience = access === AccessLevel2.WORKSPACE ? [] : args.audience === void 0 ? current.audience ?? [] : String(args.audience).split(",").map((entry) => entry.trim()).filter(Boolean);
40543
+ const result3 = await requireAuth(ctx).apiClient.updateSiteSharing(
40544
+ workspace,
40545
+ requireNumber(args, "site-id"),
40546
+ {
40547
+ access,
40548
+ grants: (current.grants ?? []).map((grant) => ({
40549
+ granteeMemberId: grant.granteeMemberId,
40550
+ accessMode: grant.accessMode
40551
+ })),
40552
+ audience
40553
+ }
40554
+ );
40555
+ if (result3.access !== access) {
40556
+ throw new CLIError(
40557
+ `The site's access is ${result3.access}, not ${access}; check --audience`
40558
+ );
40559
+ }
40560
+ outputSingle(result3, ctx);
40561
+ }
40562
+ },
40412
40563
  {
40413
40564
  path: ["sites", "theme-settings", "get"],
40414
40565
  description: "Show the active theme's settings schema, values, and features",