@gravity-rail/cli 0.33.1 → 0.35.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/README.md +23 -1
- package/dist/gr.js +343 -62
- package/dist/gr.js.map +1 -1
- package/dist/lib.js +252 -46
- package/dist/lib.js.map +1 -1
- package/package.json +2 -2
package/dist/gr.js
CHANGED
|
@@ -3230,7 +3230,7 @@ var init_libphonenumber_js = __esm({
|
|
|
3230
3230
|
}
|
|
3231
3231
|
});
|
|
3232
3232
|
|
|
3233
|
-
// ../sdk/dist/chunk-
|
|
3233
|
+
// ../sdk/dist/chunk-3OQ6HJ3I.js
|
|
3234
3234
|
function sanitizePhoneForBackend(phoneNumber) {
|
|
3235
3235
|
try {
|
|
3236
3236
|
let parsed = parsePhoneNumber4(phoneNumber);
|
|
@@ -4134,6 +4134,8 @@ function bindCommunicationsMethods(target, phoneNumbers, inboxes, notificationRu
|
|
|
4134
4134
|
target.getChatEmails = inboxes.getChatEmails.bind(inboxes);
|
|
4135
4135
|
target.replyToEmail = inboxes.replyToEmail.bind(inboxes);
|
|
4136
4136
|
target.sendInboxEmail = inboxes.sendInboxEmail.bind(inboxes);
|
|
4137
|
+
target.previewInboxEmail = inboxes.previewInboxEmail.bind(inboxes);
|
|
4138
|
+
target.previewEmailReply = inboxes.previewEmailReply.bind(inboxes);
|
|
4137
4139
|
target.getNotificationRules = notificationRules.getNotificationRules.bind(notificationRules);
|
|
4138
4140
|
target.createNotificationRule = notificationRules.createNotificationRule.bind(notificationRules);
|
|
4139
4141
|
target.updateNotificationRule = notificationRules.updateNotificationRule.bind(notificationRules);
|
|
@@ -4440,6 +4442,8 @@ function bindOrgMethods(target, org) {
|
|
|
4440
4442
|
target.enableOrgDomainSite = org.enableOrgDomainSite.bind(org);
|
|
4441
4443
|
target.getOrgDomainSite = org.getOrgDomainSite.bind(org);
|
|
4442
4444
|
target.preflightOrgDomainSite = org.preflightOrgDomainSite.bind(org);
|
|
4445
|
+
target.createOrgDomainSiteChildHost = org.createOrgDomainSiteChildHost.bind(org);
|
|
4446
|
+
target.listOrgDomainSiteChildHosts = org.listOrgDomainSiteChildHosts.bind(org);
|
|
4443
4447
|
target.verifyOrgDomainSite = org.verifyOrgDomainSite.bind(org);
|
|
4444
4448
|
target.disableOrgDomainSite = org.disableOrgDomainSite.bind(org);
|
|
4445
4449
|
target.getBusinessProfile = org.getBusinessProfile.bind(org);
|
|
@@ -4607,8 +4611,8 @@ function getRevisionState(workflow, revision) {
|
|
|
4607
4611
|
};
|
|
4608
4612
|
}
|
|
4609
4613
|
var AbilitiesApi, AccessGrantsApi, AgentTasksApi, AgentsApi, AIModelsApi, ApiKeysApi, AppsApi, AssignmentsApi, VoiceApi, AuthApi, BuildersApi, CalendarsApi, CallsApi, CELApi, ChatsApi, ConfluenceApi, CustomToolkitsApi, DataTypesApi, DiscordBotsApi, SlackAppsApi, EventsApi, FeaturesApi, FhirConnectionsApi, InboundFaxStatus, DocumoFaxApi, HealthieApi, FilesApi, InboxesApi, InquiriesApi, AppConnectionsApi, McpServersApi, MemberImportValidationError, MembersApi, MondayIntegrationApi, NotificationRulesApi, OperatorApi, OrgApi, OAuthConnectionsApi, OAuthApi, PhoneNumbersApi, PronunciationsApi, PromptsApi, PersonasApi, QueriesApi, QualificationsApi, ReportsApi, SalesforceApi, ConnectionSyncApi, HubspotApi, SitesApi, SubscriptionsApi, SupportRequestsApi, CustomersApi, ResellersApi, SupervisorsApi, TasksApi, TemplatesApi, ToolkitsApi, JourneysApi, WorkflowsApi, WorkflowNotesApi, EventRuleObjectType, EventRuleEventType, EventRuleActionType, DriverMode, WorkspaceInvitationsApi, WorkspacesApi, DashboardsApi, DevicesApi, TeamsAppsApi, ExperimentsApi, PatientSyncConnectionsApi, ActivityApi, MotdApi, InterventionRequestsApi, MetricsApi, 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;
|
|
4610
|
-
var
|
|
4611
|
-
"../sdk/dist/chunk-
|
|
4614
|
+
var init_chunk_3OQ6HJ3I = __esm({
|
|
4615
|
+
"../sdk/dist/chunk-3OQ6HJ3I.js"() {
|
|
4612
4616
|
init_chunk_P2E6LU7I();
|
|
4613
4617
|
init_libphonenumber_js();
|
|
4614
4618
|
AbilitiesApi = class extends BaseApiClient {
|
|
@@ -5710,8 +5714,14 @@ var init_chunk_ZGXE5SVN = __esm({
|
|
|
5710
5714
|
});
|
|
5711
5715
|
}
|
|
5712
5716
|
/** List all calendar event types in the workspace. */
|
|
5713
|
-
async getEventTypes(wid) {
|
|
5714
|
-
|
|
5717
|
+
async getEventTypes(wid, options) {
|
|
5718
|
+
const params = new URLSearchParams();
|
|
5719
|
+
if (options?.page !== void 0) params.set("page", String(options.page));
|
|
5720
|
+
if (options?.pageSize !== void 0) params.set("pageSize", String(options.pageSize));
|
|
5721
|
+
const query = params.size ? `?${params}` : "";
|
|
5722
|
+
return this.fetch(
|
|
5723
|
+
`w/${wid}/calendar-event-types${query}`
|
|
5724
|
+
);
|
|
5715
5725
|
}
|
|
5716
5726
|
/** Get a single calendar event type by ID. */
|
|
5717
5727
|
async getEventType(wid, id) {
|
|
@@ -6645,17 +6655,17 @@ var init_chunk_ZGXE5SVN = __esm({
|
|
|
6645
6655
|
return this.fetch(`w/${wid}/data-types/records/${recordId}`);
|
|
6646
6656
|
}
|
|
6647
6657
|
/** Create a new data record under the specified data type. */
|
|
6648
|
-
async createDataRecord(wid, dataTypeId,
|
|
6658
|
+
async createDataRecord(wid, dataTypeId, record2) {
|
|
6649
6659
|
return this.fetch(`w/${wid}/data-types/${dataTypeId}/records`, {
|
|
6650
6660
|
method: "POST",
|
|
6651
|
-
body: JSON.stringify(
|
|
6661
|
+
body: JSON.stringify(record2)
|
|
6652
6662
|
});
|
|
6653
6663
|
}
|
|
6654
6664
|
/** Update an existing data record's field values. */
|
|
6655
|
-
async updateDataRecord(wid, dataTypeId, recordId,
|
|
6665
|
+
async updateDataRecord(wid, dataTypeId, recordId, record2) {
|
|
6656
6666
|
return this.fetch(`w/${wid}/data-types/${dataTypeId}/records/${recordId}`, {
|
|
6657
6667
|
method: "PUT",
|
|
6658
|
-
body: JSON.stringify(
|
|
6668
|
+
body: JSON.stringify(record2)
|
|
6659
6669
|
});
|
|
6660
6670
|
}
|
|
6661
6671
|
/** Delete a data record by ID. */
|
|
@@ -8012,6 +8022,32 @@ var init_chunk_ZGXE5SVN = __esm({
|
|
|
8012
8022
|
body: JSON.stringify(body)
|
|
8013
8023
|
});
|
|
8014
8024
|
}
|
|
8025
|
+
/**
|
|
8026
|
+
* Render a compose or `email:send` template draft through the same
|
|
8027
|
+
* outbound body-assembly seam (footer, layout wrapper, markdown fallback)
|
|
8028
|
+
* as sending. Preview excludes delivery-specific MIME transformations,
|
|
8029
|
+
* including inline-image content IDs.
|
|
8030
|
+
*/
|
|
8031
|
+
async previewInboxEmail(wid, inboxId, body) {
|
|
8032
|
+
return this.fetch(`w/${wid}/inboxes/${inboxId}/emails/preview`, {
|
|
8033
|
+
method: "POST",
|
|
8034
|
+
body: JSON.stringify(body)
|
|
8035
|
+
});
|
|
8036
|
+
}
|
|
8037
|
+
/**
|
|
8038
|
+
* Render a reply draft, including its quote, through outbound body
|
|
8039
|
+
* assembly. Preview excludes delivery-specific MIME transformations,
|
|
8040
|
+
* including inline-image content IDs.
|
|
8041
|
+
*/
|
|
8042
|
+
async previewEmailReply(wid, inboxId, emailId, body) {
|
|
8043
|
+
return this.fetch(
|
|
8044
|
+
`w/${wid}/inboxes/${inboxId}/emails/${emailId}/reply-preview`,
|
|
8045
|
+
{
|
|
8046
|
+
method: "POST",
|
|
8047
|
+
body: JSON.stringify(body)
|
|
8048
|
+
}
|
|
8049
|
+
);
|
|
8050
|
+
}
|
|
8015
8051
|
/**
|
|
8016
8052
|
* Make a stored email's sender a Member of this workspace.
|
|
8017
8053
|
*
|
|
@@ -9598,10 +9634,19 @@ var init_chunk_ZGXE5SVN = __esm({
|
|
|
9598
9634
|
}
|
|
9599
9635
|
/**
|
|
9600
9636
|
* Enable custom site routing for a verified org domain.
|
|
9637
|
+
*
|
|
9638
|
+
* Pass `{ childHosting: true }` to enable the domain as a **parent**
|
|
9639
|
+
* instead: it publishes one `*.<domain>` wildcard CNAME, serves nothing
|
|
9640
|
+
* at its own name, and hosts are added beneath it afterwards. The mode
|
|
9641
|
+
* is fixed at enable — disable and re-enable to change it.
|
|
9642
|
+
*
|
|
9643
|
+
* The request always carries a JSON body, `{}` by default: the route
|
|
9644
|
+
* requires one as a CSRF barrier.
|
|
9601
9645
|
*/
|
|
9602
|
-
async enableOrgDomainSite(orgIdOrUuid, domainUuid) {
|
|
9646
|
+
async enableOrgDomainSite(orgIdOrUuid, domainUuid, options = {}) {
|
|
9603
9647
|
return this.fetch(`o/${orgIdOrUuid}/domains/${domainUuid}/site`, {
|
|
9604
|
-
method: "POST"
|
|
9648
|
+
method: "POST",
|
|
9649
|
+
body: JSON.stringify(options)
|
|
9605
9650
|
});
|
|
9606
9651
|
}
|
|
9607
9652
|
/**
|
|
@@ -9613,12 +9658,15 @@ var init_chunk_ZGXE5SVN = __esm({
|
|
|
9613
9658
|
/**
|
|
9614
9659
|
* Pre-enable DNS check: is the site CNAME resolving to the routing
|
|
9615
9660
|
* endpoint yet? Pure DNS — consumes no enable budget.
|
|
9661
|
+
*
|
|
9662
|
+
* Pass `{ childHosting: true }` to check the mode you intend to enable
|
|
9663
|
+
* in: the wildcard is probed instead of the domain's own CNAME.
|
|
9616
9664
|
*/
|
|
9617
|
-
async preflightOrgDomainSite(orgIdOrUuid, domainUuid) {
|
|
9665
|
+
async preflightOrgDomainSite(orgIdOrUuid, domainUuid, options = {}) {
|
|
9618
9666
|
return this.fetch(
|
|
9619
9667
|
`o/${orgIdOrUuid}/domains/${domainUuid}/site/preflight`,
|
|
9620
|
-
//
|
|
9621
|
-
{ method: "POST", body: JSON.stringify(
|
|
9668
|
+
// JSON body, `{}` by default: the route requires one as a CSRF barrier.
|
|
9669
|
+
{ method: "POST", body: JSON.stringify(options) }
|
|
9622
9670
|
);
|
|
9623
9671
|
}
|
|
9624
9672
|
/**
|
|
@@ -9630,6 +9678,27 @@ var init_chunk_ZGXE5SVN = __esm({
|
|
|
9630
9678
|
{ method: "POST" }
|
|
9631
9679
|
);
|
|
9632
9680
|
}
|
|
9681
|
+
/**
|
|
9682
|
+
* Create one child host beneath a child-hosting parent domain.
|
|
9683
|
+
*
|
|
9684
|
+
* The child gets its own CloudFront tenant and managed certificate and
|
|
9685
|
+
* needs no customer DNS: the parent's wildcard CNAME already routes it.
|
|
9686
|
+
*/
|
|
9687
|
+
async createOrgDomainSiteChildHost(orgIdOrUuid, parentDomainUuid, request) {
|
|
9688
|
+
return this.fetch(
|
|
9689
|
+
`o/${orgIdOrUuid}/domains/${parentDomainUuid}/site/children`,
|
|
9690
|
+
{ method: "POST", body: JSON.stringify(request) }
|
|
9691
|
+
);
|
|
9692
|
+
}
|
|
9693
|
+
/**
|
|
9694
|
+
* List the child hosts beneath a child-hosting parent domain, with live
|
|
9695
|
+
* per-host status.
|
|
9696
|
+
*/
|
|
9697
|
+
async listOrgDomainSiteChildHosts(orgIdOrUuid, parentDomainUuid) {
|
|
9698
|
+
return this.fetch(
|
|
9699
|
+
`o/${orgIdOrUuid}/domains/${parentDomainUuid}/site/children`
|
|
9700
|
+
);
|
|
9701
|
+
}
|
|
9633
9702
|
/**
|
|
9634
9703
|
* Disable custom site routing for an org domain.
|
|
9635
9704
|
*/
|
|
@@ -14696,10 +14765,12 @@ var init_chunk_ZGXE5SVN = __esm({
|
|
|
14696
14765
|
"markEmailAsUnread",
|
|
14697
14766
|
"markNotificationAsRead",
|
|
14698
14767
|
"mergeMemberRoles",
|
|
14768
|
+
"previewEmailReply",
|
|
14699
14769
|
"previewImportMembers",
|
|
14700
14770
|
"previewMemberWorkflowVoice",
|
|
14701
14771
|
"previewRenameFieldSlug",
|
|
14702
14772
|
"previewImportWorkspace",
|
|
14773
|
+
"previewInboxEmail",
|
|
14703
14774
|
"previewRoutineVoiceReadiness",
|
|
14704
14775
|
"previewRoutineWorkflowAccess",
|
|
14705
14776
|
"previewSchedule",
|
|
@@ -15317,6 +15388,8 @@ var init_chunk_ZGXE5SVN = __esm({
|
|
|
15317
15388
|
enableOrgDomainSite;
|
|
15318
15389
|
getOrgDomainSite;
|
|
15319
15390
|
preflightOrgDomainSite;
|
|
15391
|
+
createOrgDomainSiteChildHost;
|
|
15392
|
+
listOrgDomainSiteChildHosts;
|
|
15320
15393
|
verifyOrgDomainSite;
|
|
15321
15394
|
disableOrgDomainSite;
|
|
15322
15395
|
getBusinessProfile;
|
|
@@ -15640,6 +15713,8 @@ var init_chunk_ZGXE5SVN = __esm({
|
|
|
15640
15713
|
getChatEmails;
|
|
15641
15714
|
replyToEmail;
|
|
15642
15715
|
sendInboxEmail;
|
|
15716
|
+
previewInboxEmail;
|
|
15717
|
+
previewEmailReply;
|
|
15643
15718
|
getNotificationRules;
|
|
15644
15719
|
createNotificationRule;
|
|
15645
15720
|
updateNotificationRule;
|
|
@@ -16212,7 +16287,7 @@ var init_chunk_HRUMZ46V = __esm({
|
|
|
16212
16287
|
var SEARCHABLE_EVENT_RULE_SOURCE_FIELDS, ActivityEventType, EntityKind;
|
|
16213
16288
|
var init_dist = __esm({
|
|
16214
16289
|
"../sdk/dist/index.js"() {
|
|
16215
|
-
|
|
16290
|
+
init_chunk_3OQ6HJ3I();
|
|
16216
16291
|
init_chunk_HRUMZ46V();
|
|
16217
16292
|
init_chunk_P2E6LU7I();
|
|
16218
16293
|
SEARCHABLE_EVENT_RULE_SOURCE_FIELDS = [
|
|
@@ -20949,7 +21024,6 @@ function findDef(defs, arg) {
|
|
|
20949
21024
|
|
|
20950
21025
|
// src/lib/global-options.ts
|
|
20951
21026
|
init_errors();
|
|
20952
|
-
var MAX_COMMAND_WORDS = 4;
|
|
20953
21027
|
function parseGlobalOptions(argv, spec) {
|
|
20954
21028
|
let env = spec.defaultEnv;
|
|
20955
21029
|
let profile;
|
|
@@ -21016,9 +21090,6 @@ function parseGlobalOptions(argv, spec) {
|
|
|
21016
21090
|
rest.push(arg);
|
|
21017
21091
|
}
|
|
21018
21092
|
}
|
|
21019
|
-
while (commandWords.length > MAX_COMMAND_WORDS) {
|
|
21020
|
-
rest.unshift(commandWords.pop());
|
|
21021
|
-
}
|
|
21022
21093
|
return {
|
|
21023
21094
|
opts: { env, profile, apiUrl, outputFormat, jq, verbose, allowWrite },
|
|
21024
21095
|
commandWords,
|
|
@@ -21486,7 +21557,7 @@ var CommandRegistry = class {
|
|
|
21486
21557
|
/** Resolve command words to a CommandDef using longest-match.
|
|
21487
21558
|
* Supports {param} path segments that match any word and extract as pathParams. */
|
|
21488
21559
|
resolve(words) {
|
|
21489
|
-
for (let len =
|
|
21560
|
+
for (let len = words.length; len >= 1; len--) {
|
|
21490
21561
|
const key = words.slice(0, len).join(" ");
|
|
21491
21562
|
const cmd = this.commands.get(key);
|
|
21492
21563
|
if (cmd) {
|
|
@@ -24522,8 +24593,8 @@ function parseBindingsFile(payload) {
|
|
|
24522
24593
|
if (typeof entry !== "object" || entry === null || Array.isArray(entry)) {
|
|
24523
24594
|
throw new CLIError(`${where}: each binding must be a JSON object.`);
|
|
24524
24595
|
}
|
|
24525
|
-
const
|
|
24526
|
-
const value =
|
|
24596
|
+
const record2 = entry;
|
|
24597
|
+
const value = record2.value;
|
|
24527
24598
|
if (typeof value !== "string" && typeof value !== "boolean") {
|
|
24528
24599
|
throw new CLIError(`${where}: "value" must be a string or a boolean.`);
|
|
24529
24600
|
}
|
|
@@ -24531,14 +24602,14 @@ function parseBindingsFile(payload) {
|
|
|
24531
24602
|
throw new CLIError(`${where}: "value" must not be empty.`);
|
|
24532
24603
|
}
|
|
24533
24604
|
const binding = {
|
|
24534
|
-
entityType: requireString2(
|
|
24535
|
-
sourceUuid: requireString2(
|
|
24536
|
-
fieldPath: requireString2(
|
|
24605
|
+
entityType: requireString2(record2.entityType, "entityType", where),
|
|
24606
|
+
sourceUuid: requireString2(record2.sourceUuid, "sourceUuid", where),
|
|
24607
|
+
fieldPath: requireString2(record2.fieldPath, "fieldPath", where),
|
|
24537
24608
|
value
|
|
24538
24609
|
};
|
|
24539
|
-
const parentKind = optionalString2(
|
|
24610
|
+
const parentKind = optionalString2(record2.parentKind, "parentKind", where);
|
|
24540
24611
|
if (parentKind !== void 0) binding.parentKind = parentKind;
|
|
24541
|
-
const parentUuid = optionalString2(
|
|
24612
|
+
const parentUuid = optionalString2(record2.parentUuid, "parentUuid", where);
|
|
24542
24613
|
if (parentUuid !== void 0) binding.parentUuid = parentUuid;
|
|
24543
24614
|
return binding;
|
|
24544
24615
|
});
|
|
@@ -33323,6 +33394,7 @@ var operatorGroupsDomain = {
|
|
|
33323
33394
|
};
|
|
33324
33395
|
|
|
33325
33396
|
// src/domains/org.ts
|
|
33397
|
+
init_dist();
|
|
33326
33398
|
init_context();
|
|
33327
33399
|
init_errors();
|
|
33328
33400
|
init_output();
|
|
@@ -33373,6 +33445,95 @@ var DOMAIN_UUID_ARG = {
|
|
|
33373
33445
|
function pluralize(count, singular, plural = `${singular}s`) {
|
|
33374
33446
|
return count === 1 ? singular : plural;
|
|
33375
33447
|
}
|
|
33448
|
+
var CHILD_HOST_COLUMNS = [
|
|
33449
|
+
{ header: "HOST", getValue: (item) => item.domain },
|
|
33450
|
+
{ header: "STATUS", getValue: (item) => item.status },
|
|
33451
|
+
{ header: "UUID", getValue: (item) => item.orgDomainUuid },
|
|
33452
|
+
{ header: "CREATED", getValue: (item) => String(item.createdAt) }
|
|
33453
|
+
];
|
|
33454
|
+
var CHILD_HOST_ROW_COLUMNS = [
|
|
33455
|
+
{ header: "HOST", getValue: (row) => row.host },
|
|
33456
|
+
{ header: "STATUS", getValue: (row) => row.status },
|
|
33457
|
+
{ header: "DETAIL", getValue: (row) => row.detail ?? "", maxWidth: 80 }
|
|
33458
|
+
];
|
|
33459
|
+
var CHILD_HOSTING_ARG = {
|
|
33460
|
+
name: "child-hosting",
|
|
33461
|
+
description: "Child-hosting mode: the domain hosts children under its *.<domain> wildcard (see `site children`)",
|
|
33462
|
+
isFlag: true
|
|
33463
|
+
};
|
|
33464
|
+
var PARENT_DOMAIN_UUID_ARG = {
|
|
33465
|
+
...DOMAIN_UUID_ARG,
|
|
33466
|
+
description: "OrgDomain UUID of the child-hosting parent"
|
|
33467
|
+
};
|
|
33468
|
+
var LABEL_ARGS = [
|
|
33469
|
+
{ name: "label", description: "Host label, e.g. clinic-a (repeatable)", repeatable: true },
|
|
33470
|
+
{
|
|
33471
|
+
name: "labels-file",
|
|
33472
|
+
description: "File with one label per line; blank lines and # comments are skipped"
|
|
33473
|
+
}
|
|
33474
|
+
];
|
|
33475
|
+
async function readLabelsFile(filePath) {
|
|
33476
|
+
const { readFile } = await import('fs/promises');
|
|
33477
|
+
let raw;
|
|
33478
|
+
try {
|
|
33479
|
+
raw = await readFile(filePath, "utf8");
|
|
33480
|
+
} catch (err) {
|
|
33481
|
+
throw new CLIError(
|
|
33482
|
+
`Could not read --labels-file ${filePath}: ${err?.code ?? "unknown error"}`
|
|
33483
|
+
);
|
|
33484
|
+
}
|
|
33485
|
+
return raw.split("\n").map((line) => line.trim()).filter((line) => line && !line.startsWith("#"));
|
|
33486
|
+
}
|
|
33487
|
+
async function collectLabels(args) {
|
|
33488
|
+
const raw = [...repeatedValues(args, "label")];
|
|
33489
|
+
const labelsFile = args["labels-file"];
|
|
33490
|
+
if (typeof labelsFile === "string" && labelsFile) {
|
|
33491
|
+
raw.push(...await readLabelsFile(labelsFile));
|
|
33492
|
+
}
|
|
33493
|
+
const labels = [...new Set(raw.map((label) => label.trim().toLowerCase()).filter(Boolean))];
|
|
33494
|
+
if (labels.length === 0) {
|
|
33495
|
+
throw new CLIError("Give at least one --label, or a --labels-file with one label per line.");
|
|
33496
|
+
}
|
|
33497
|
+
return labels;
|
|
33498
|
+
}
|
|
33499
|
+
var detailOf = (err) => err instanceof Error ? err.message : String(err);
|
|
33500
|
+
function record(rows, row) {
|
|
33501
|
+
rows.push(row);
|
|
33502
|
+
stderr2(`${row.host}: ${row.status}${row.detail ? ` (${row.detail})` : ""}`);
|
|
33503
|
+
}
|
|
33504
|
+
function reportRows(rows, opts, verb) {
|
|
33505
|
+
outputData(rows, opts, CHILD_HOST_ROW_COLUMNS);
|
|
33506
|
+
if (rows.some((row) => row.status === "pending")) {
|
|
33507
|
+
hint(opts, [
|
|
33508
|
+
"New hosts verify on their own once their certificates issue, usually within minutes.",
|
|
33509
|
+
"Check with `gr org domains site children list`."
|
|
33510
|
+
]);
|
|
33511
|
+
}
|
|
33512
|
+
const failed = rows.filter((row) => row.status === "error").length;
|
|
33513
|
+
if (failed > 0) {
|
|
33514
|
+
throw new CLIError(
|
|
33515
|
+
`${failed} of ${rows.length} ${pluralize(rows.length, "host")} could not be ${verb}.`
|
|
33516
|
+
);
|
|
33517
|
+
}
|
|
33518
|
+
}
|
|
33519
|
+
async function removeChildHost(client, orgRef, host, confirm) {
|
|
33520
|
+
try {
|
|
33521
|
+
const result2 = await client.disableOrgDomainSite(orgRef, host.orgDomainUuid, confirm);
|
|
33522
|
+
if (!result2.ok) {
|
|
33523
|
+
const { siteCount } = result2.impact;
|
|
33524
|
+
const sites = `${siteCount} ${pluralize(siteCount, "site")}`;
|
|
33525
|
+
return {
|
|
33526
|
+
host: host.domain,
|
|
33527
|
+
status: "error",
|
|
33528
|
+
detail: confirm ? `Still routes ${sites} after a confirmed disable; it was not removed.` : `Still routes ${sites}; re-run with --confirm to remove it anyway.`
|
|
33529
|
+
};
|
|
33530
|
+
}
|
|
33531
|
+
} catch (err) {
|
|
33532
|
+
if (!(err instanceof ApiError && err.statusCode === 404)) throw err;
|
|
33533
|
+
}
|
|
33534
|
+
await client.deleteOrgDomain(orgRef, host.orgDomainUuid);
|
|
33535
|
+
return { host: host.domain, status: "removed" };
|
|
33536
|
+
}
|
|
33376
33537
|
function emailVerifyCommand(path4, description) {
|
|
33377
33538
|
return {
|
|
33378
33539
|
path: path4,
|
|
@@ -33576,19 +33737,42 @@ var domainCommands = [
|
|
|
33576
33737
|
`);
|
|
33577
33738
|
}
|
|
33578
33739
|
},
|
|
33740
|
+
{
|
|
33741
|
+
path: ["org", "domains", "site", "preflight"],
|
|
33742
|
+
description: "Check the DNS that enabling sites needs, without enabling; exits non-zero until it resolves",
|
|
33743
|
+
requiresWorkspace: false,
|
|
33744
|
+
args: [ORG_UUID_ARG2, DOMAIN_UUID_ARG, CHILD_HOSTING_ARG],
|
|
33745
|
+
examples: [
|
|
33746
|
+
"yarn gr org domains site preflight --org-uuid $ORG_UUID --domain-uuid $DOMAIN_UUID",
|
|
33747
|
+
"yarn gr org domains site preflight --org-uuid $ORG_UUID --domain-uuid $DOMAIN_UUID --child-hosting"
|
|
33748
|
+
],
|
|
33749
|
+
handler: async (hctx) => {
|
|
33750
|
+
const result2 = await requireAuth(hctx.ctx).apiClient.preflightOrgDomainSite(
|
|
33751
|
+
requireOrgRef(hctx.args),
|
|
33752
|
+
requireDomainUuid(hctx.args),
|
|
33753
|
+
{ childHosting: hctx.args["child-hosting"] === true }
|
|
33754
|
+
);
|
|
33755
|
+
outputSingle(result2, hctx.ctx);
|
|
33756
|
+
if (!result2.dnsReady) {
|
|
33757
|
+
throw new CLIError("DNS is not ready yet. Publish the records above, then re-run.");
|
|
33758
|
+
}
|
|
33759
|
+
}
|
|
33760
|
+
},
|
|
33579
33761
|
{
|
|
33580
33762
|
path: ["org", "domains", "site", "enable"],
|
|
33581
|
-
description: "Enable custom site
|
|
33763
|
+
description: "Enable custom site routing on a verified organization domain, or with --child-hosting as a parent for hosts under its wildcard",
|
|
33582
33764
|
mutates: true,
|
|
33583
33765
|
requiresWorkspace: false,
|
|
33584
|
-
args: [ORG_UUID_ARG2, DOMAIN_UUID_ARG],
|
|
33766
|
+
args: [ORG_UUID_ARG2, DOMAIN_UUID_ARG, CHILD_HOSTING_ARG],
|
|
33585
33767
|
examples: [
|
|
33586
|
-
"yarn gr org domains site enable --org-uuid $ORG_UUID --domain-uuid $DOMAIN_UUID --allow-write"
|
|
33768
|
+
"yarn gr org domains site enable --org-uuid $ORG_UUID --domain-uuid $DOMAIN_UUID --allow-write",
|
|
33769
|
+
"yarn gr org domains site enable --org-uuid $ORG_UUID --domain-uuid $DOMAIN_UUID --child-hosting --allow-write"
|
|
33587
33770
|
],
|
|
33588
33771
|
handler: async (hctx) => {
|
|
33589
33772
|
const result2 = await requireAuth(hctx.ctx).apiClient.enableOrgDomainSite(
|
|
33590
33773
|
requireOrgRef(hctx.args),
|
|
33591
|
-
requireDomainUuid(hctx.args)
|
|
33774
|
+
requireDomainUuid(hctx.args),
|
|
33775
|
+
{ childHosting: hctx.args["child-hosting"] === true }
|
|
33592
33776
|
);
|
|
33593
33777
|
outputSingle(result2, hctx.ctx);
|
|
33594
33778
|
}
|
|
@@ -33651,6 +33835,103 @@ var domainCommands = [
|
|
|
33651
33835
|
process.stdout.write(`Disabled site routing for org domain ${domainUuid}
|
|
33652
33836
|
`);
|
|
33653
33837
|
}
|
|
33838
|
+
},
|
|
33839
|
+
{
|
|
33840
|
+
path: ["org", "domains", "site", "children", "list"],
|
|
33841
|
+
description: "List the hosts beneath a child-hosting parent domain, with their status",
|
|
33842
|
+
requiresWorkspace: false,
|
|
33843
|
+
args: [ORG_UUID_ARG2, PARENT_DOMAIN_UUID_ARG],
|
|
33844
|
+
examples: [
|
|
33845
|
+
"yarn gr org domains site children list --org-uuid $ORG_UUID --domain-uuid $PARENT_UUID"
|
|
33846
|
+
],
|
|
33847
|
+
handler: async (hctx) => {
|
|
33848
|
+
const result2 = await requireAuth(hctx.ctx).apiClient.listOrgDomainSiteChildHosts(
|
|
33849
|
+
requireOrgRef(hctx.args),
|
|
33850
|
+
requireDomainUuid(hctx.args)
|
|
33851
|
+
);
|
|
33852
|
+
outputData(result2.items, hctx.ctx, CHILD_HOST_COLUMNS);
|
|
33853
|
+
}
|
|
33854
|
+
},
|
|
33855
|
+
{
|
|
33856
|
+
path: ["org", "domains", "site", "children", "add"],
|
|
33857
|
+
description: "Add hosts beneath a child-hosting parent domain, one at a time; exits non-zero if any fail",
|
|
33858
|
+
mutates: true,
|
|
33859
|
+
requiresWorkspace: false,
|
|
33860
|
+
args: [ORG_UUID_ARG2, PARENT_DOMAIN_UUID_ARG, ...LABEL_ARGS],
|
|
33861
|
+
examples: [
|
|
33862
|
+
"yarn gr org domains site children add --org-uuid $ORG_UUID --domain-uuid $PARENT_UUID --label clinic-a --label clinic-b --allow-write",
|
|
33863
|
+
"yarn gr org domains site children add --org-uuid $ORG_UUID --domain-uuid $PARENT_UUID --labels-file labels.txt --allow-write"
|
|
33864
|
+
],
|
|
33865
|
+
handler: async (hctx) => {
|
|
33866
|
+
const client = requireAuth(hctx.ctx).apiClient;
|
|
33867
|
+
const orgRef = requireOrgRef(hctx.args);
|
|
33868
|
+
const parentUuid = requireDomainUuid(hctx.args);
|
|
33869
|
+
const labels = await collectLabels(hctx.args);
|
|
33870
|
+
const parent = await client.getOrgDomain(orgRef, parentUuid);
|
|
33871
|
+
const rows = [];
|
|
33872
|
+
for (const label of labels) {
|
|
33873
|
+
try {
|
|
33874
|
+
const created = await client.createOrgDomainSiteChildHost(orgRef, parentUuid, {
|
|
33875
|
+
label
|
|
33876
|
+
});
|
|
33877
|
+
record(rows, { host: created.domain, status: created.status });
|
|
33878
|
+
} catch (err) {
|
|
33879
|
+
record(rows, {
|
|
33880
|
+
host: `${label}.${parent.domain}`,
|
|
33881
|
+
status: "error",
|
|
33882
|
+
detail: detailOf(err)
|
|
33883
|
+
});
|
|
33884
|
+
}
|
|
33885
|
+
}
|
|
33886
|
+
reportRows(rows, hctx.ctx, "added");
|
|
33887
|
+
}
|
|
33888
|
+
},
|
|
33889
|
+
{
|
|
33890
|
+
path: ["org", "domains", "site", "children", "remove"],
|
|
33891
|
+
description: "Remove hosts from a child-hosting parent domain (certificate, routing and registration); exits non-zero if any fail",
|
|
33892
|
+
mutates: true,
|
|
33893
|
+
requiresWorkspace: false,
|
|
33894
|
+
args: [
|
|
33895
|
+
ORG_UUID_ARG2,
|
|
33896
|
+
PARENT_DOMAIN_UUID_ARG,
|
|
33897
|
+
...LABEL_ARGS,
|
|
33898
|
+
{
|
|
33899
|
+
name: "confirm",
|
|
33900
|
+
description: "Also remove hosts that still route sites",
|
|
33901
|
+
isFlag: true
|
|
33902
|
+
}
|
|
33903
|
+
],
|
|
33904
|
+
examples: [
|
|
33905
|
+
"yarn gr org domains site children remove --org-uuid $ORG_UUID --domain-uuid $PARENT_UUID --label clinic-a --allow-write",
|
|
33906
|
+
"yarn gr org domains site children remove --org-uuid $ORG_UUID --domain-uuid $PARENT_UUID --labels-file labels.txt --confirm --allow-write"
|
|
33907
|
+
],
|
|
33908
|
+
handler: async (hctx) => {
|
|
33909
|
+
const client = requireAuth(hctx.ctx).apiClient;
|
|
33910
|
+
const orgRef = requireOrgRef(hctx.args);
|
|
33911
|
+
const parentUuid = requireDomainUuid(hctx.args);
|
|
33912
|
+
const labels = await collectLabels(hctx.args);
|
|
33913
|
+
const confirm = hctx.args.confirm === true;
|
|
33914
|
+
const { items } = await client.listOrgDomainSiteChildHosts(orgRef, parentUuid);
|
|
33915
|
+
const hostsByLabel = new Map(items.map((host) => [host.label, host]));
|
|
33916
|
+
const rows = [];
|
|
33917
|
+
for (const label of labels) {
|
|
33918
|
+
const host = hostsByLabel.get(label);
|
|
33919
|
+
if (!host) {
|
|
33920
|
+
record(rows, {
|
|
33921
|
+
host: label,
|
|
33922
|
+
status: "error",
|
|
33923
|
+
detail: "No host with this label under this domain."
|
|
33924
|
+
});
|
|
33925
|
+
continue;
|
|
33926
|
+
}
|
|
33927
|
+
try {
|
|
33928
|
+
record(rows, await removeChildHost(client, orgRef, host, confirm));
|
|
33929
|
+
} catch (err) {
|
|
33930
|
+
record(rows, { host: host.domain, status: "error", detail: detailOf(err) });
|
|
33931
|
+
}
|
|
33932
|
+
}
|
|
33933
|
+
reportRows(rows, hctx.ctx, "removed");
|
|
33934
|
+
}
|
|
33654
33935
|
}
|
|
33655
33936
|
];
|
|
33656
33937
|
var orgDomain = {
|
|
@@ -34893,9 +35174,9 @@ ${PHONE_NUMBER_FIELD_REFERENCE}`,
|
|
|
34893
35174
|
workspace,
|
|
34894
35175
|
payload
|
|
34895
35176
|
);
|
|
34896
|
-
const
|
|
34897
|
-
const warnings = collectPhoneNumberWarnings(
|
|
34898
|
-
outputData([
|
|
35177
|
+
const record2 = asPhoneRecord(result2);
|
|
35178
|
+
const warnings = collectPhoneNumberWarnings(record2);
|
|
35179
|
+
outputData([record2], ctx, COLUMNS26);
|
|
34899
35180
|
if (warnings.length > 0) {
|
|
34900
35181
|
process.stderr.write("\nWarnings after create:\n");
|
|
34901
35182
|
for (const w of warnings) {
|
|
@@ -38801,17 +39082,17 @@ function parseUiPromptResponse(content) {
|
|
|
38801
39082
|
return null;
|
|
38802
39083
|
}
|
|
38803
39084
|
if (!parsed || typeof parsed !== "object") return null;
|
|
38804
|
-
const
|
|
38805
|
-
const hasChoice =
|
|
38806
|
-
const hasValues =
|
|
38807
|
-
if (
|
|
39085
|
+
const record2 = parsed;
|
|
39086
|
+
const hasChoice = record2.chosenValue !== void 0;
|
|
39087
|
+
const hasValues = record2.values !== void 0;
|
|
39088
|
+
if (record2.status === "declined") {
|
|
38808
39089
|
return hasChoice || hasValues ? null : { promptId, kind, body: { status: "declined" } };
|
|
38809
39090
|
}
|
|
38810
|
-
if (
|
|
39091
|
+
if (record2.status !== "submitted" || hasChoice === hasValues) return null;
|
|
38811
39092
|
if (hasChoice) {
|
|
38812
|
-
return typeof
|
|
39093
|
+
return typeof record2.chosenValue === "string" ? { promptId, kind, body: { status: "submitted", chosenValue: record2.chosenValue } } : null;
|
|
38813
39094
|
}
|
|
38814
|
-
const values = parseFormValues(
|
|
39095
|
+
const values = parseFormValues(record2.values);
|
|
38815
39096
|
return values ? { promptId, kind, body: { status: "submitted", values } } : null;
|
|
38816
39097
|
}
|
|
38817
39098
|
function parseFormValues(raw) {
|
|
@@ -39809,8 +40090,8 @@ async function handleUIChoiceTerminal(payload) {
|
|
|
39809
40090
|
}
|
|
39810
40091
|
|
|
39811
40092
|
// src/lib/ui-prompt-presented.ts
|
|
39812
|
-
function optionalString3(
|
|
39813
|
-
const value =
|
|
40093
|
+
function optionalString3(record2, key) {
|
|
40094
|
+
const value = record2[key];
|
|
39814
40095
|
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
39815
40096
|
}
|
|
39816
40097
|
var CONNECT_TOOL_NAME = /^connect_[a-z0-9_]+_account$/;
|
|
@@ -39820,14 +40101,14 @@ function isUiPromptToolName(name) {
|
|
|
39820
40101
|
}
|
|
39821
40102
|
function parseConnect(value) {
|
|
39822
40103
|
if (!value || typeof value !== "object") return void 0;
|
|
39823
|
-
const
|
|
39824
|
-
const appSlug = optionalString3(
|
|
40104
|
+
const record2 = value;
|
|
40105
|
+
const appSlug = optionalString3(record2, "appSlug");
|
|
39825
40106
|
if (!appSlug) return void 0;
|
|
39826
40107
|
return {
|
|
39827
40108
|
appSlug,
|
|
39828
|
-
connectionUuid: optionalString3(
|
|
39829
|
-
label: optionalString3(
|
|
39830
|
-
expiresInMinutes: typeof
|
|
40109
|
+
connectionUuid: optionalString3(record2, "connectionUuid") ?? "",
|
|
40110
|
+
label: optionalString3(record2, "label") ?? appSlug,
|
|
40111
|
+
expiresInMinutes: typeof record2.expiresInMinutes === "number" ? record2.expiresInMinutes : 0
|
|
39831
40112
|
};
|
|
39832
40113
|
}
|
|
39833
40114
|
function parseUiPromptPresented(content) {
|
|
@@ -39842,24 +40123,24 @@ function parseUiPromptPresented(content) {
|
|
|
39842
40123
|
}
|
|
39843
40124
|
}
|
|
39844
40125
|
if (!value || typeof value !== "object") return null;
|
|
39845
|
-
const
|
|
39846
|
-
if (
|
|
39847
|
-
const promptId = optionalString3(
|
|
39848
|
-
const kind =
|
|
40126
|
+
const record2 = value;
|
|
40127
|
+
if (record2.status !== "presented") return null;
|
|
40128
|
+
const promptId = optionalString3(record2, "promptId");
|
|
40129
|
+
const kind = record2.kind;
|
|
39849
40130
|
if (!promptId || !isUiPromptKind(kind)) return null;
|
|
39850
|
-
const connect = parseConnect(
|
|
40131
|
+
const connect = parseConnect(record2.connect);
|
|
39851
40132
|
if (kind === "inline_connect" && !connect) return null;
|
|
39852
40133
|
return {
|
|
39853
40134
|
status: "presented",
|
|
39854
40135
|
promptId,
|
|
39855
40136
|
kind,
|
|
39856
|
-
userPrompt: optionalString3(
|
|
39857
|
-
openuiMarkup: optionalString3(
|
|
39858
|
-
description: optionalString3(
|
|
39859
|
-
multi:
|
|
40137
|
+
userPrompt: optionalString3(record2, "userPrompt"),
|
|
40138
|
+
openuiMarkup: optionalString3(record2, "openuiMarkup"),
|
|
40139
|
+
description: optionalString3(record2, "description"),
|
|
40140
|
+
multi: record2.multi === true,
|
|
39860
40141
|
// LLM-facing guidance. The CLI never renders it, but it is part of the
|
|
39861
40142
|
// result, so it travels rather than being dropped on the floor.
|
|
39862
|
-
instructions: typeof
|
|
40143
|
+
instructions: typeof record2.instructions === "string" ? record2.instructions : "",
|
|
39863
40144
|
...connect ? { connect } : {}
|
|
39864
40145
|
};
|
|
39865
40146
|
}
|
|
@@ -39950,9 +40231,9 @@ async function runConciergeAguiLoop(client, initialMessages, onEvent, opts) {
|
|
|
39950
40231
|
const type = event.type?.toLowerCase() ?? "";
|
|
39951
40232
|
if (type === "tool_call_start") {
|
|
39952
40233
|
hasToolCalls = true;
|
|
39953
|
-
const
|
|
39954
|
-
const callId =
|
|
39955
|
-
const name =
|
|
40234
|
+
const record2 = event;
|
|
40235
|
+
const callId = record2.toolCallId ?? record2.tool_call_id;
|
|
40236
|
+
const name = record2.toolCallName ?? record2.tool_call_name ?? record2.toolName;
|
|
39956
40237
|
if (typeof callId === "string" && typeof name === "string") {
|
|
39957
40238
|
toolCallNames.set(callId, name);
|
|
39958
40239
|
}
|
|
@@ -43076,7 +43357,7 @@ init_concierge_api();
|
|
|
43076
43357
|
|
|
43077
43358
|
// package.json
|
|
43078
43359
|
var package_default = {
|
|
43079
|
-
version: "0.
|
|
43360
|
+
version: "0.35.0"};
|
|
43080
43361
|
|
|
43081
43362
|
// src/gr.ts
|
|
43082
43363
|
var VERSION = package_default.version;
|