@gravity-rail/cli 0.34.0 → 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 +273 -57
- package/dist/gr.js.map +1 -1
- package/dist/lib.js +252 -46
- package/dist/lib.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -418,11 +418,33 @@ gr org domains verify-ownership --org-uuid $ORG_UUID --domain-uuid $DOMAIN_UUID
|
|
|
418
418
|
gr org domains email enable --org-uuid $ORG_UUID --domain-uuid $DOMAIN_UUID --allow-write
|
|
419
419
|
gr org domains email verify-mx --org-uuid $ORG_UUID --domain-uuid $DOMAIN_UUID --allow-write
|
|
420
420
|
|
|
421
|
-
# Site DNS: enable custom site routing, then verify
|
|
421
|
+
# Site DNS: check the CNAME resolves, enable custom site routing, then verify
|
|
422
|
+
gr org domains site preflight --org-uuid $ORG_UUID --domain-uuid $DOMAIN_UUID
|
|
422
423
|
gr org domains site enable --org-uuid $ORG_UUID --domain-uuid $DOMAIN_UUID --allow-write
|
|
423
424
|
gr org domains site verify-cname --org-uuid $ORG_UUID --domain-uuid $DOMAIN_UUID --allow-write
|
|
424
425
|
```
|
|
425
426
|
|
|
427
|
+
### Host many sites under one wildcard
|
|
428
|
+
|
|
429
|
+
```sh
|
|
430
|
+
# Enable a verified domain as a parent: publish *.<domain> first, then enable
|
|
431
|
+
gr org domains site preflight --org-uuid $ORG_UUID --domain-uuid $PARENT_UUID --child-hosting
|
|
432
|
+
gr org domains site enable --org-uuid $ORG_UUID --domain-uuid $PARENT_UUID --child-hosting --allow-write
|
|
433
|
+
|
|
434
|
+
# Add hosts one at a time; each reports its own result, and the command exits
|
|
435
|
+
# non-zero if any failed. New hosts verify on their own within minutes.
|
|
436
|
+
gr org domains site children add --org-uuid $ORG_UUID --domain-uuid $PARENT_UUID \
|
|
437
|
+
--label clinic-a --label clinic-b --allow-write
|
|
438
|
+
gr org domains site children add --org-uuid $ORG_UUID --domain-uuid $PARENT_UUID \
|
|
439
|
+
--labels-file labels.txt --allow-write
|
|
440
|
+
gr org domains site children list --org-uuid $ORG_UUID --domain-uuid $PARENT_UUID
|
|
441
|
+
|
|
442
|
+
# Remove hosts: certificate, routing and registration. --confirm also removes
|
|
443
|
+
# hosts that still route sites.
|
|
444
|
+
gr org domains site children remove --org-uuid $ORG_UUID --domain-uuid $PARENT_UUID \
|
|
445
|
+
--label clinic-a --allow-write
|
|
446
|
+
```
|
|
447
|
+
|
|
426
448
|
### Find members by label
|
|
427
449
|
|
|
428
450
|
```sh
|
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);
|
|
@@ -4442,6 +4442,8 @@ function bindOrgMethods(target, org) {
|
|
|
4442
4442
|
target.enableOrgDomainSite = org.enableOrgDomainSite.bind(org);
|
|
4443
4443
|
target.getOrgDomainSite = org.getOrgDomainSite.bind(org);
|
|
4444
4444
|
target.preflightOrgDomainSite = org.preflightOrgDomainSite.bind(org);
|
|
4445
|
+
target.createOrgDomainSiteChildHost = org.createOrgDomainSiteChildHost.bind(org);
|
|
4446
|
+
target.listOrgDomainSiteChildHosts = org.listOrgDomainSiteChildHosts.bind(org);
|
|
4445
4447
|
target.verifyOrgDomainSite = org.verifyOrgDomainSite.bind(org);
|
|
4446
4448
|
target.disableOrgDomainSite = org.disableOrgDomainSite.bind(org);
|
|
4447
4449
|
target.getBusinessProfile = org.getBusinessProfile.bind(org);
|
|
@@ -4609,8 +4611,8 @@ function getRevisionState(workflow, revision) {
|
|
|
4609
4611
|
};
|
|
4610
4612
|
}
|
|
4611
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;
|
|
4612
|
-
var
|
|
4613
|
-
"../sdk/dist/chunk-
|
|
4614
|
+
var init_chunk_3OQ6HJ3I = __esm({
|
|
4615
|
+
"../sdk/dist/chunk-3OQ6HJ3I.js"() {
|
|
4614
4616
|
init_chunk_P2E6LU7I();
|
|
4615
4617
|
init_libphonenumber_js();
|
|
4616
4618
|
AbilitiesApi = class extends BaseApiClient {
|
|
@@ -5712,8 +5714,14 @@ var init_chunk_ON7HBHJA = __esm({
|
|
|
5712
5714
|
});
|
|
5713
5715
|
}
|
|
5714
5716
|
/** List all calendar event types in the workspace. */
|
|
5715
|
-
async getEventTypes(wid) {
|
|
5716
|
-
|
|
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
|
+
);
|
|
5717
5725
|
}
|
|
5718
5726
|
/** Get a single calendar event type by ID. */
|
|
5719
5727
|
async getEventType(wid, id) {
|
|
@@ -6647,17 +6655,17 @@ var init_chunk_ON7HBHJA = __esm({
|
|
|
6647
6655
|
return this.fetch(`w/${wid}/data-types/records/${recordId}`);
|
|
6648
6656
|
}
|
|
6649
6657
|
/** Create a new data record under the specified data type. */
|
|
6650
|
-
async createDataRecord(wid, dataTypeId,
|
|
6658
|
+
async createDataRecord(wid, dataTypeId, record2) {
|
|
6651
6659
|
return this.fetch(`w/${wid}/data-types/${dataTypeId}/records`, {
|
|
6652
6660
|
method: "POST",
|
|
6653
|
-
body: JSON.stringify(
|
|
6661
|
+
body: JSON.stringify(record2)
|
|
6654
6662
|
});
|
|
6655
6663
|
}
|
|
6656
6664
|
/** Update an existing data record's field values. */
|
|
6657
|
-
async updateDataRecord(wid, dataTypeId, recordId,
|
|
6665
|
+
async updateDataRecord(wid, dataTypeId, recordId, record2) {
|
|
6658
6666
|
return this.fetch(`w/${wid}/data-types/${dataTypeId}/records/${recordId}`, {
|
|
6659
6667
|
method: "PUT",
|
|
6660
|
-
body: JSON.stringify(
|
|
6668
|
+
body: JSON.stringify(record2)
|
|
6661
6669
|
});
|
|
6662
6670
|
}
|
|
6663
6671
|
/** Delete a data record by ID. */
|
|
@@ -15380,6 +15388,8 @@ var init_chunk_ON7HBHJA = __esm({
|
|
|
15380
15388
|
enableOrgDomainSite;
|
|
15381
15389
|
getOrgDomainSite;
|
|
15382
15390
|
preflightOrgDomainSite;
|
|
15391
|
+
createOrgDomainSiteChildHost;
|
|
15392
|
+
listOrgDomainSiteChildHosts;
|
|
15383
15393
|
verifyOrgDomainSite;
|
|
15384
15394
|
disableOrgDomainSite;
|
|
15385
15395
|
getBusinessProfile;
|
|
@@ -16277,7 +16287,7 @@ var init_chunk_HRUMZ46V = __esm({
|
|
|
16277
16287
|
var SEARCHABLE_EVENT_RULE_SOURCE_FIELDS, ActivityEventType, EntityKind;
|
|
16278
16288
|
var init_dist = __esm({
|
|
16279
16289
|
"../sdk/dist/index.js"() {
|
|
16280
|
-
|
|
16290
|
+
init_chunk_3OQ6HJ3I();
|
|
16281
16291
|
init_chunk_HRUMZ46V();
|
|
16282
16292
|
init_chunk_P2E6LU7I();
|
|
16283
16293
|
SEARCHABLE_EVENT_RULE_SOURCE_FIELDS = [
|
|
@@ -21014,7 +21024,6 @@ function findDef(defs, arg) {
|
|
|
21014
21024
|
|
|
21015
21025
|
// src/lib/global-options.ts
|
|
21016
21026
|
init_errors();
|
|
21017
|
-
var MAX_COMMAND_WORDS = 4;
|
|
21018
21027
|
function parseGlobalOptions(argv, spec) {
|
|
21019
21028
|
let env = spec.defaultEnv;
|
|
21020
21029
|
let profile;
|
|
@@ -21081,9 +21090,6 @@ function parseGlobalOptions(argv, spec) {
|
|
|
21081
21090
|
rest.push(arg);
|
|
21082
21091
|
}
|
|
21083
21092
|
}
|
|
21084
|
-
while (commandWords.length > MAX_COMMAND_WORDS) {
|
|
21085
|
-
rest.unshift(commandWords.pop());
|
|
21086
|
-
}
|
|
21087
21093
|
return {
|
|
21088
21094
|
opts: { env, profile, apiUrl, outputFormat, jq, verbose, allowWrite },
|
|
21089
21095
|
commandWords,
|
|
@@ -21551,7 +21557,7 @@ var CommandRegistry = class {
|
|
|
21551
21557
|
/** Resolve command words to a CommandDef using longest-match.
|
|
21552
21558
|
* Supports {param} path segments that match any word and extract as pathParams. */
|
|
21553
21559
|
resolve(words) {
|
|
21554
|
-
for (let len =
|
|
21560
|
+
for (let len = words.length; len >= 1; len--) {
|
|
21555
21561
|
const key = words.slice(0, len).join(" ");
|
|
21556
21562
|
const cmd = this.commands.get(key);
|
|
21557
21563
|
if (cmd) {
|
|
@@ -24587,8 +24593,8 @@ function parseBindingsFile(payload) {
|
|
|
24587
24593
|
if (typeof entry !== "object" || entry === null || Array.isArray(entry)) {
|
|
24588
24594
|
throw new CLIError(`${where}: each binding must be a JSON object.`);
|
|
24589
24595
|
}
|
|
24590
|
-
const
|
|
24591
|
-
const value =
|
|
24596
|
+
const record2 = entry;
|
|
24597
|
+
const value = record2.value;
|
|
24592
24598
|
if (typeof value !== "string" && typeof value !== "boolean") {
|
|
24593
24599
|
throw new CLIError(`${where}: "value" must be a string or a boolean.`);
|
|
24594
24600
|
}
|
|
@@ -24596,14 +24602,14 @@ function parseBindingsFile(payload) {
|
|
|
24596
24602
|
throw new CLIError(`${where}: "value" must not be empty.`);
|
|
24597
24603
|
}
|
|
24598
24604
|
const binding = {
|
|
24599
|
-
entityType: requireString2(
|
|
24600
|
-
sourceUuid: requireString2(
|
|
24601
|
-
fieldPath: requireString2(
|
|
24605
|
+
entityType: requireString2(record2.entityType, "entityType", where),
|
|
24606
|
+
sourceUuid: requireString2(record2.sourceUuid, "sourceUuid", where),
|
|
24607
|
+
fieldPath: requireString2(record2.fieldPath, "fieldPath", where),
|
|
24602
24608
|
value
|
|
24603
24609
|
};
|
|
24604
|
-
const parentKind = optionalString2(
|
|
24610
|
+
const parentKind = optionalString2(record2.parentKind, "parentKind", where);
|
|
24605
24611
|
if (parentKind !== void 0) binding.parentKind = parentKind;
|
|
24606
|
-
const parentUuid = optionalString2(
|
|
24612
|
+
const parentUuid = optionalString2(record2.parentUuid, "parentUuid", where);
|
|
24607
24613
|
if (parentUuid !== void 0) binding.parentUuid = parentUuid;
|
|
24608
24614
|
return binding;
|
|
24609
24615
|
});
|
|
@@ -33388,6 +33394,7 @@ var operatorGroupsDomain = {
|
|
|
33388
33394
|
};
|
|
33389
33395
|
|
|
33390
33396
|
// src/domains/org.ts
|
|
33397
|
+
init_dist();
|
|
33391
33398
|
init_context();
|
|
33392
33399
|
init_errors();
|
|
33393
33400
|
init_output();
|
|
@@ -33438,6 +33445,95 @@ var DOMAIN_UUID_ARG = {
|
|
|
33438
33445
|
function pluralize(count, singular, plural = `${singular}s`) {
|
|
33439
33446
|
return count === 1 ? singular : plural;
|
|
33440
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
|
+
}
|
|
33441
33537
|
function emailVerifyCommand(path4, description) {
|
|
33442
33538
|
return {
|
|
33443
33539
|
path: path4,
|
|
@@ -33641,19 +33737,42 @@ var domainCommands = [
|
|
|
33641
33737
|
`);
|
|
33642
33738
|
}
|
|
33643
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
|
+
},
|
|
33644
33761
|
{
|
|
33645
33762
|
path: ["org", "domains", "site", "enable"],
|
|
33646
|
-
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",
|
|
33647
33764
|
mutates: true,
|
|
33648
33765
|
requiresWorkspace: false,
|
|
33649
|
-
args: [ORG_UUID_ARG2, DOMAIN_UUID_ARG],
|
|
33766
|
+
args: [ORG_UUID_ARG2, DOMAIN_UUID_ARG, CHILD_HOSTING_ARG],
|
|
33650
33767
|
examples: [
|
|
33651
|
-
"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"
|
|
33652
33770
|
],
|
|
33653
33771
|
handler: async (hctx) => {
|
|
33654
33772
|
const result2 = await requireAuth(hctx.ctx).apiClient.enableOrgDomainSite(
|
|
33655
33773
|
requireOrgRef(hctx.args),
|
|
33656
|
-
requireDomainUuid(hctx.args)
|
|
33774
|
+
requireDomainUuid(hctx.args),
|
|
33775
|
+
{ childHosting: hctx.args["child-hosting"] === true }
|
|
33657
33776
|
);
|
|
33658
33777
|
outputSingle(result2, hctx.ctx);
|
|
33659
33778
|
}
|
|
@@ -33716,6 +33835,103 @@ var domainCommands = [
|
|
|
33716
33835
|
process.stdout.write(`Disabled site routing for org domain ${domainUuid}
|
|
33717
33836
|
`);
|
|
33718
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
|
+
}
|
|
33719
33935
|
}
|
|
33720
33936
|
];
|
|
33721
33937
|
var orgDomain = {
|
|
@@ -34958,9 +35174,9 @@ ${PHONE_NUMBER_FIELD_REFERENCE}`,
|
|
|
34958
35174
|
workspace,
|
|
34959
35175
|
payload
|
|
34960
35176
|
);
|
|
34961
|
-
const
|
|
34962
|
-
const warnings = collectPhoneNumberWarnings(
|
|
34963
|
-
outputData([
|
|
35177
|
+
const record2 = asPhoneRecord(result2);
|
|
35178
|
+
const warnings = collectPhoneNumberWarnings(record2);
|
|
35179
|
+
outputData([record2], ctx, COLUMNS26);
|
|
34964
35180
|
if (warnings.length > 0) {
|
|
34965
35181
|
process.stderr.write("\nWarnings after create:\n");
|
|
34966
35182
|
for (const w of warnings) {
|
|
@@ -38866,17 +39082,17 @@ function parseUiPromptResponse(content) {
|
|
|
38866
39082
|
return null;
|
|
38867
39083
|
}
|
|
38868
39084
|
if (!parsed || typeof parsed !== "object") return null;
|
|
38869
|
-
const
|
|
38870
|
-
const hasChoice =
|
|
38871
|
-
const hasValues =
|
|
38872
|
-
if (
|
|
39085
|
+
const record2 = parsed;
|
|
39086
|
+
const hasChoice = record2.chosenValue !== void 0;
|
|
39087
|
+
const hasValues = record2.values !== void 0;
|
|
39088
|
+
if (record2.status === "declined") {
|
|
38873
39089
|
return hasChoice || hasValues ? null : { promptId, kind, body: { status: "declined" } };
|
|
38874
39090
|
}
|
|
38875
|
-
if (
|
|
39091
|
+
if (record2.status !== "submitted" || hasChoice === hasValues) return null;
|
|
38876
39092
|
if (hasChoice) {
|
|
38877
|
-
return typeof
|
|
39093
|
+
return typeof record2.chosenValue === "string" ? { promptId, kind, body: { status: "submitted", chosenValue: record2.chosenValue } } : null;
|
|
38878
39094
|
}
|
|
38879
|
-
const values = parseFormValues(
|
|
39095
|
+
const values = parseFormValues(record2.values);
|
|
38880
39096
|
return values ? { promptId, kind, body: { status: "submitted", values } } : null;
|
|
38881
39097
|
}
|
|
38882
39098
|
function parseFormValues(raw) {
|
|
@@ -39874,8 +40090,8 @@ async function handleUIChoiceTerminal(payload) {
|
|
|
39874
40090
|
}
|
|
39875
40091
|
|
|
39876
40092
|
// src/lib/ui-prompt-presented.ts
|
|
39877
|
-
function optionalString3(
|
|
39878
|
-
const value =
|
|
40093
|
+
function optionalString3(record2, key) {
|
|
40094
|
+
const value = record2[key];
|
|
39879
40095
|
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
39880
40096
|
}
|
|
39881
40097
|
var CONNECT_TOOL_NAME = /^connect_[a-z0-9_]+_account$/;
|
|
@@ -39885,14 +40101,14 @@ function isUiPromptToolName(name) {
|
|
|
39885
40101
|
}
|
|
39886
40102
|
function parseConnect(value) {
|
|
39887
40103
|
if (!value || typeof value !== "object") return void 0;
|
|
39888
|
-
const
|
|
39889
|
-
const appSlug = optionalString3(
|
|
40104
|
+
const record2 = value;
|
|
40105
|
+
const appSlug = optionalString3(record2, "appSlug");
|
|
39890
40106
|
if (!appSlug) return void 0;
|
|
39891
40107
|
return {
|
|
39892
40108
|
appSlug,
|
|
39893
|
-
connectionUuid: optionalString3(
|
|
39894
|
-
label: optionalString3(
|
|
39895
|
-
expiresInMinutes: typeof
|
|
40109
|
+
connectionUuid: optionalString3(record2, "connectionUuid") ?? "",
|
|
40110
|
+
label: optionalString3(record2, "label") ?? appSlug,
|
|
40111
|
+
expiresInMinutes: typeof record2.expiresInMinutes === "number" ? record2.expiresInMinutes : 0
|
|
39896
40112
|
};
|
|
39897
40113
|
}
|
|
39898
40114
|
function parseUiPromptPresented(content) {
|
|
@@ -39907,24 +40123,24 @@ function parseUiPromptPresented(content) {
|
|
|
39907
40123
|
}
|
|
39908
40124
|
}
|
|
39909
40125
|
if (!value || typeof value !== "object") return null;
|
|
39910
|
-
const
|
|
39911
|
-
if (
|
|
39912
|
-
const promptId = optionalString3(
|
|
39913
|
-
const kind =
|
|
40126
|
+
const record2 = value;
|
|
40127
|
+
if (record2.status !== "presented") return null;
|
|
40128
|
+
const promptId = optionalString3(record2, "promptId");
|
|
40129
|
+
const kind = record2.kind;
|
|
39914
40130
|
if (!promptId || !isUiPromptKind(kind)) return null;
|
|
39915
|
-
const connect = parseConnect(
|
|
40131
|
+
const connect = parseConnect(record2.connect);
|
|
39916
40132
|
if (kind === "inline_connect" && !connect) return null;
|
|
39917
40133
|
return {
|
|
39918
40134
|
status: "presented",
|
|
39919
40135
|
promptId,
|
|
39920
40136
|
kind,
|
|
39921
|
-
userPrompt: optionalString3(
|
|
39922
|
-
openuiMarkup: optionalString3(
|
|
39923
|
-
description: optionalString3(
|
|
39924
|
-
multi:
|
|
40137
|
+
userPrompt: optionalString3(record2, "userPrompt"),
|
|
40138
|
+
openuiMarkup: optionalString3(record2, "openuiMarkup"),
|
|
40139
|
+
description: optionalString3(record2, "description"),
|
|
40140
|
+
multi: record2.multi === true,
|
|
39925
40141
|
// LLM-facing guidance. The CLI never renders it, but it is part of the
|
|
39926
40142
|
// result, so it travels rather than being dropped on the floor.
|
|
39927
|
-
instructions: typeof
|
|
40143
|
+
instructions: typeof record2.instructions === "string" ? record2.instructions : "",
|
|
39928
40144
|
...connect ? { connect } : {}
|
|
39929
40145
|
};
|
|
39930
40146
|
}
|
|
@@ -40015,9 +40231,9 @@ async function runConciergeAguiLoop(client, initialMessages, onEvent, opts) {
|
|
|
40015
40231
|
const type = event.type?.toLowerCase() ?? "";
|
|
40016
40232
|
if (type === "tool_call_start") {
|
|
40017
40233
|
hasToolCalls = true;
|
|
40018
|
-
const
|
|
40019
|
-
const callId =
|
|
40020
|
-
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;
|
|
40021
40237
|
if (typeof callId === "string" && typeof name === "string") {
|
|
40022
40238
|
toolCallNames.set(callId, name);
|
|
40023
40239
|
}
|
|
@@ -43141,7 +43357,7 @@ init_concierge_api();
|
|
|
43141
43357
|
|
|
43142
43358
|
// package.json
|
|
43143
43359
|
var package_default = {
|
|
43144
|
-
version: "0.
|
|
43360
|
+
version: "0.35.0"};
|
|
43145
43361
|
|
|
43146
43362
|
// src/gr.ts
|
|
43147
43363
|
var VERSION = package_default.version;
|