@gravity-rail/cli 0.56.0 → 0.57.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/gr.js CHANGED
@@ -3164,7 +3164,7 @@ var init_libphonenumber_js = __esm({
3164
3164
  }
3165
3165
  });
3166
3166
 
3167
- // ../sdk/dist/chunk-BQOKENBF.js
3167
+ // ../sdk/dist/chunk-7ABBH5CC.js
3168
3168
  function resourceWorkflowsPath(wid, ...segments) {
3169
3169
  const tail = segments.map((segment) => encodeURIComponent(String(segment))).join("/");
3170
3170
  const base = `w/${encodeURIComponent(wid)}/resource-workflows`;
@@ -3404,6 +3404,7 @@ function createApiModules(apiKey, baseUrl3, customFetch) {
3404
3404
  patientSyncConnections: new PatientSyncConnectionsApi(apiKey, baseUrl3, customFetch),
3405
3405
  healthie: new HealthieApi(apiKey, baseUrl3, customFetch),
3406
3406
  documoFax: new DocumoFaxApi(apiKey, baseUrl3, customFetch),
3407
+ claimMd: new ClaimMdApi(apiKey, baseUrl3, customFetch),
3407
3408
  hubspot: new HubspotApi(apiKey, baseUrl3, customFetch),
3408
3409
  features: new FeaturesApi(apiKey, baseUrl3, customFetch),
3409
3410
  files: new FilesApi(apiKey, baseUrl3, customFetch),
@@ -3545,6 +3546,7 @@ function bindChatsMethods(target, chats) {
3545
3546
  target.updateChat = chats.updateChat.bind(chats);
3546
3547
  target.getChatModelOverride = chats.getChatModelOverride.bind(chats);
3547
3548
  target.updateChatModelOverride = chats.updateChatModelOverride.bind(chats);
3549
+ target.setChatStar = chats.setChatStar.bind(chats);
3548
3550
  target.updateChatMute = chats.updateChatMute.bind(chats);
3549
3551
  target.summarizeChat = chats.summarizeChat.bind(chats);
3550
3552
  target.getChatMessages = chats.getChatMessages.bind(chats);
@@ -3579,8 +3581,8 @@ function bindChatsMethods(target, chats) {
3579
3581
  }
3580
3582
  function bindCallsMethods(target, calls, cel) {
3581
3583
  target.getPhoneCalls = calls.getPhoneCalls.bind(calls);
3584
+ target.getPhoneCallByUuid = calls.getPhoneCallByUuid.bind(calls);
3582
3585
  target.getMessageTiming = calls.getMessageTiming.bind(calls);
3583
- target.getRecordingInfo = calls.getRecordingInfo.bind(calls);
3584
3586
  target.getEdgeCaptureInfo = calls.getEdgeCaptureInfo.bind(calls);
3585
3587
  target.getCallRecordingDownloadUrl = calls.getCallRecordingDownloadUrl.bind(calls);
3586
3588
  target.getCelContext = cel.getCelContext.bind(cel);
@@ -3806,6 +3808,7 @@ function bindWorkspacesMethods(target, workspaces, signupRequests) {
3806
3808
  target.getWorkspaceScopes = workspaces.getWorkspaceScopes.bind(workspaces);
3807
3809
  target.getUsageDashboard = workspaces.getUsageDashboard.bind(workspaces);
3808
3810
  target.getVapidPublicKey = workspaces.getVapidPublicKey.bind(workspaces);
3811
+ target.testPushSubscription = workspaces.testPushSubscription.bind(workspaces);
3809
3812
  target.registerPushSubscription = workspaces.registerPushSubscription.bind(workspaces);
3810
3813
  target.unregisterPushSubscription = workspaces.unregisterPushSubscription.bind(workspaces);
3811
3814
  target.listPushSubscriptions = workspaces.listPushSubscriptions.bind(workspaces);
@@ -4114,6 +4117,7 @@ function bindCommunicationsMethods(target, phoneNumbers, inboxes, notificationRu
4114
4117
  target.createPhoneNumber = phoneNumbers.createPhoneNumber.bind(phoneNumbers);
4115
4118
  target.updatePhoneNumber = phoneNumbers.updatePhoneNumber.bind(phoneNumbers);
4116
4119
  target.getArchiveBlockers = phoneNumbers.getArchiveBlockers.bind(phoneNumbers);
4120
+ target.getPhoneNumberSetupStatus = phoneNumbers.getPhoneNumberSetupStatus.bind(phoneNumbers);
4117
4121
  target.archivePhoneNumber = phoneNumbers.archivePhoneNumber.bind(phoneNumbers);
4118
4122
  target.getPhoneNumberCalls = phoneNumbers.getPhoneNumberCalls.bind(phoneNumbers);
4119
4123
  target.getPhoneNumberOutboundAnalyticsSummary = phoneNumbers.getPhoneNumberOutboundAnalyticsSummary.bind(phoneNumbers);
@@ -4146,6 +4150,7 @@ function bindCommunicationsMethods(target, phoneNumbers, inboxes, notificationRu
4146
4150
  target.sendInboxEmail = inboxes.sendInboxEmail.bind(inboxes);
4147
4151
  target.previewInboxEmail = inboxes.previewInboxEmail.bind(inboxes);
4148
4152
  target.previewEmailReply = inboxes.previewEmailReply.bind(inboxes);
4153
+ target.getInboxOutboundEmailStats = inboxes.getInboxOutboundEmailStats.bind(inboxes);
4149
4154
  target.getNotificationRules = notificationRules.getNotificationRules.bind(notificationRules);
4150
4155
  target.createNotificationRule = notificationRules.createNotificationRule.bind(notificationRules);
4151
4156
  target.updateNotificationRule = notificationRules.updateNotificationRule.bind(notificationRules);
@@ -4254,7 +4259,7 @@ function bindAppsMethods(target, apps, builders, inquiries, oauth, oauthConnecti
4254
4259
  target.getOAuthAuthorizationUrl = oauthConnections.getAuthorizationUrl.bind(oauthConnections);
4255
4260
  target.disconnectOAuthProvider = oauthConnections.disconnect.bind(oauthConnections);
4256
4261
  }
4257
- function bindIntegrationsMethods(target, mondayIntegration, discordBots, slackApps, teamsApps, fhirConnections, patientSyncConnections, healthie, documoFax, salesforce, hubspot, appConnections, connectionSync, confluence) {
4262
+ function bindIntegrationsMethods(target, mondayIntegration, discordBots, slackApps, teamsApps, fhirConnections, patientSyncConnections, healthie, documoFax, claimMd, salesforce, hubspot, appConnections, connectionSync, confluence) {
4258
4263
  target.getMondayBoards = mondayIntegration.getBoards.bind(mondayIntegration);
4259
4264
  target.getMondayBoardColumns = mondayIntegration.getBoardColumns.bind(mondayIntegration);
4260
4265
  target.getMondayBoardGroups = mondayIntegration.getBoardGroups.bind(mondayIntegration);
@@ -4304,6 +4309,7 @@ function bindIntegrationsMethods(target, mondayIntegration, discordBots, slackAp
4304
4309
  target.deleteSlackApp = slackApps.deleteSlackApp.bind(slackApps);
4305
4310
  target.getSlackThreads = slackApps.getSlackThreads.bind(slackApps);
4306
4311
  target.getSlackInstallations = slackApps.getSlackInstallations.bind(slackApps);
4312
+ target.removeSlackInstallation = slackApps.removeSlackInstallation.bind(slackApps);
4307
4313
  target.getSlackChannelChoices = slackApps.getSlackChannelChoices.bind(slackApps);
4308
4314
  target.getSlackEntryPoints = slackApps.getSlackEntryPoints.bind(slackApps);
4309
4315
  target.connectSlackEntryPoint = slackApps.connectSlackEntryPoint.bind(slackApps);
@@ -4347,8 +4353,9 @@ function bindIntegrationsMethods(target, mondayIntegration, discordBots, slackAp
4347
4353
  target.fhirGetEncounterSyncRuns = fhirConnections.fhirGetEncounterSyncRuns.bind(fhirConnections);
4348
4354
  target.fhirRefreshEncounterPatient = fhirConnections.fhirRefreshEncounterPatient.bind(fhirConnections);
4349
4355
  target.fhirBackfillEncounterSync = fhirConnections.fhirBackfillEncounterSync.bind(fhirConnections);
4350
- target.fhirStartOnboardingImport = fhirConnections.fhirStartOnboardingImport.bind(fhirConnections);
4351
- target.fhirGetOnboardingImportStatus = fhirConnections.fhirGetOnboardingImportStatus.bind(fhirConnections);
4356
+ target.getAthenaPlatformApp = fhirConnections.getAthenaPlatformApp.bind(fhirConnections);
4357
+ target.verifyAthenaAccess = fhirConnections.verifyAthenaAccess.bind(fhirConnections);
4358
+ target.connectAthena = fhirConnections.connectAthena.bind(fhirConnections);
4352
4359
  target.configurePatientSync = patientSyncConnections.configurePatientSync.bind(patientSyncConnections);
4353
4360
  target.getPatientSyncStatus = patientSyncConnections.getPatientSyncStatus.bind(patientSyncConnections);
4354
4361
  target.deletePatientSyncConnection = patientSyncConnections.deletePatientSyncConnection.bind(patientSyncConnections);
@@ -4359,6 +4366,10 @@ function bindIntegrationsMethods(target, mondayIntegration, discordBots, slackAp
4359
4366
  target.configureDocumoFax = documoFax.configureDocumoFax.bind(documoFax);
4360
4367
  target.verifyDocumoFax = documoFax.verifyDocumoFax.bind(documoFax);
4361
4368
  target.rotateDocumoFaxCredentials = documoFax.rotateDocumoFaxCredentials.bind(documoFax);
4369
+ target.getClaimMdStatus = claimMd.getClaimMdStatus.bind(claimMd);
4370
+ target.installClaimMd = claimMd.installClaimMd.bind(claimMd);
4371
+ target.configureClaimMd = claimMd.configureClaimMd.bind(claimMd);
4372
+ target.verifyClaimMdKey = claimMd.verifyClaimMdKey.bind(claimMd);
4362
4373
  target.configureHealthie = healthie.configureHealthie.bind(healthie);
4363
4374
  target.getHealthieStatus = healthie.getHealthieStatus.bind(healthie);
4364
4375
  target.listHealthieProviders = healthie.listHealthieProviders.bind(healthie);
@@ -4420,6 +4431,10 @@ function bindIntegrationsMethods(target, mondayIntegration, discordBots, slackAp
4420
4431
  target.searchHubspotRecords = hubspot.searchHubspotRecords.bind(hubspot);
4421
4432
  target.importHubspotMembers = hubspot.importHubspotMembers.bind(hubspot);
4422
4433
  target.getHubspotContactProperties = hubspot.getHubspotContactProperties.bind(hubspot);
4434
+ target.getHubspotDealProperties = hubspot.getHubspotDealProperties.bind(hubspot);
4435
+ target.getHubspotForms = hubspot.getHubspotForms.bind(hubspot);
4436
+ target.getHubspotMeetingLinks = hubspot.getHubspotMeetingLinks.bind(hubspot);
4437
+ target.getHubspotObjectProperties = hubspot.getHubspotObjectProperties.bind(hubspot);
4423
4438
  target.getHubspotManagedRules = hubspot.getHubspotManagedRules.bind(hubspot);
4424
4439
  target.getHubspotSyncLogs = hubspot.getHubspotSyncLogs.bind(hubspot);
4425
4440
  target.getHubspotTransformPresets = hubspot.getHubspotTransformPresets.bind(hubspot);
@@ -4431,7 +4446,23 @@ function bindIntegrationsMethods(target, mondayIntegration, discordBots, slackAp
4431
4446
  target.getSyncRuns = connectionSync.getSyncRuns.bind(connectionSync);
4432
4447
  target.getSyncRunItems = connectionSync.getSyncRunItems.bind(connectionSync);
4433
4448
  target.getMemberSyncSummary = connectionSync.getMemberSyncSummary.bind(connectionSync);
4449
+ target.getConnectionFieldHomes = connectionSync.getConnectionFieldHomes.bind(connectionSync);
4450
+ target.getInboundRecordStatus = connectionSync.getInboundRecordStatus.bind(connectionSync);
4451
+ target.getConnectionWritePreview = connectionSync.getConnectionWritePreview.bind(connectionSync);
4434
4452
  target.clearConnectionMemberExclusion = connectionSync.clearConnectionMemberExclusion.bind(connectionSync);
4453
+ target.linkUnlinkedMembersByIdentity = connectionSync.linkUnlinkedMembersByIdentity.bind(connectionSync);
4454
+ target.listSubsetImports = connectionSync.listSubsetImports.bind(connectionSync);
4455
+ target.getSubsetImport = connectionSync.getSubsetImport.bind(connectionSync);
4456
+ target.createSubsetImport = connectionSync.createSubsetImport.bind(connectionSync);
4457
+ target.updateSubsetImport = connectionSync.updateSubsetImport.bind(connectionSync);
4458
+ target.deleteSubsetImport = connectionSync.deleteSubsetImport.bind(connectionSync);
4459
+ target.previewSubsetImportSelection = connectionSync.previewSubsetImportSelection.bind(connectionSync);
4460
+ target.previewSubsetImport = connectionSync.previewSubsetImport.bind(connectionSync);
4461
+ target.runSubsetImport = connectionSync.runSubsetImport.bind(connectionSync);
4462
+ target.cancelSubsetImport = connectionSync.cancelSubsetImport.bind(connectionSync);
4463
+ target.listSubsetImportRuns = connectionSync.listSubsetImportRuns.bind(connectionSync);
4464
+ target.listSubsetImportVendorLists = connectionSync.listSubsetImportVendorLists.bind(connectionSync);
4465
+ target.listSubsetImportFilterFields = connectionSync.listSubsetImportFilterFields.bind(connectionSync);
4435
4466
  target.listAvailableAppConnections = appConnections.listAvailableAppConnections.bind(appConnections);
4436
4467
  target.listAppConnections = appConnections.listAppConnections.bind(appConnections);
4437
4468
  target.enablePlatformApp = appConnections.enablePlatformApp.bind(appConnections);
@@ -4578,6 +4609,7 @@ function bindJourneysMethods(target, journeys) {
4578
4609
  target.getJourneyV2Validation = journeys.getJourneyV2Validation.bind(journeys);
4579
4610
  target.getJourneyFilterOptions = journeys.getJourneyFilterOptions.bind(journeys);
4580
4611
  target.getJourneyHealth = journeys.getJourneyHealth.bind(journeys);
4612
+ target.getJourneySendEstimate = journeys.getJourneySendEstimate.bind(journeys);
4581
4613
  target.cloneJourneyAsV2 = journeys.cloneJourneyAsV2.bind(journeys);
4582
4614
  target.createJourney = journeys.createJourney.bind(journeys);
4583
4615
  target.updateJourney = journeys.updateJourney.bind(journeys);
@@ -4620,11 +4652,14 @@ function bindQualificationsMethods(target, qualifications) {
4620
4652
  target.deleteScenario = qualifications.deleteScenario.bind(qualifications);
4621
4653
  target.listTestChatRuns = qualifications.listTestChatRuns.bind(qualifications);
4622
4654
  target.listScenarioHealthSummaries = qualifications.listScenarioHealthSummaries.bind(qualifications);
4655
+ target.getChatTestRun = qualifications.getChatTestRun.bind(qualifications);
4623
4656
  target.getTestChatRun = qualifications.getTestChatRun.bind(qualifications);
4624
4657
  target.listChatCapturedEffects = qualifications.listChatCapturedEffects.bind(qualifications);
4625
4658
  target.listChatRecordChanges = qualifications.listChatRecordChanges.bind(qualifications);
4626
4659
  target.takeTestChatRunEmailTurn = qualifications.takeTestChatRunEmailTurn.bind(qualifications);
4627
4660
  target.takeTestChatRunSmsTurn = qualifications.takeTestChatRunSmsTurn.bind(qualifications);
4661
+ target.captureScenarioDraft = qualifications.captureScenarioDraft.bind(qualifications);
4662
+ target.promoteTestChatFeedback = qualifications.promoteTestChatFeedback.bind(qualifications);
4628
4663
  target.startTestChatRun = qualifications.startTestChatRun.bind(qualifications);
4629
4664
  target.evaluateTestChatRun = qualifications.evaluateTestChatRun.bind(qualifications);
4630
4665
  target.endTestChatRun = qualifications.endTestChatRun.bind(qualifications);
@@ -4632,6 +4667,9 @@ function bindQualificationsMethods(target, qualifications) {
4632
4667
  function bindPersonasMethods(target, personas) {
4633
4668
  target.listPersonas = personas.listPersonas.bind(personas);
4634
4669
  target.getPersona = personas.getPersona.bind(personas);
4670
+ target.getPersonaTestMember = personas.getPersonaTestMember.bind(personas);
4671
+ target.createPersonaTestMember = personas.createPersonaTestMember.bind(personas);
4672
+ target.resetPersonaTestMember = personas.resetPersonaTestMember.bind(personas);
4635
4673
  target.createPersona = personas.createPersona.bind(personas);
4636
4674
  target.updatePersona = personas.updatePersona.bind(personas);
4637
4675
  target.archivePersona = personas.archivePersona.bind(personas);
@@ -4720,9 +4758,9 @@ function getRevisionState(workflow, revision) {
4720
4758
  state: revision?.publishedAt != null ? "published" : "draft"
4721
4759
  };
4722
4760
  }
4723
- var AbilitiesApi, ResourceWorkflowsApi, BundlesApi, InstallationsApi, 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, RoutingRulesApi, SalesforceApi, ConnectionSyncApi, HubspotApi, SitesApi, SubscriptionsApi, SupportRequestsApi, CustomersApi, ResellersApi, SupervisorsApi, TasksApi, TemplatesApi, ToolkitsApi, JourneysApi, WorkflowsApi, WorkflowNotesApi, EventRuleObjectType, EventRuleEventType, EventRuleActionType, DriverMode, MEMBER_RELATIONSHIP_KINDS, WorkspaceInvitationsApi, WorkspacesApi, DashboardsApi, DevicesApi, TeamsAppsApi, ExperimentsApi, PatientSyncConnectionsApi, 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;
4724
- var init_chunk_BQOKENBF = __esm({
4725
- "../sdk/dist/chunk-BQOKENBF.js"() {
4761
+ var AbilitiesApi, ResourceWorkflowsApi, BundlesApi, InstallationsApi, 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, RoutingRulesApi, SalesforceApi, ConnectionSyncApi, HubspotApi, SitesApi, SubscriptionsApi, SupportRequestsApi, CustomersApi, ResellersApi, SupervisorsApi, TasksApi, TemplatesApi, ToolkitsApi, JourneysApi, WorkflowsApi, WorkflowNotesApi, EventRuleObjectType, EventRuleEventType, EventRuleActionType, DriverMode, MEMBER_RELATIONSHIP_KINDS, WorkspaceInvitationsApi, WorkspacesApi, 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;
4762
+ var init_chunk_7ABBH5CC = __esm({
4763
+ "../sdk/dist/chunk-7ABBH5CC.js"() {
4726
4764
  init_chunk_GCN4OMYU();
4727
4765
  init_libphonenumber_js();
4728
4766
  AbilitiesApi = class extends BaseApiClient {
@@ -5283,11 +5321,15 @@ var init_chunk_BQOKENBF = __esm({
5283
5321
  return this.fetch("ai-models/manager");
5284
5322
  }
5285
5323
  /**
5286
- * Get available realtime AI models
5324
+ * Get available realtime AI models.
5325
+ *
5326
+ * `includeHidden` also lists models no longer offered for new selection
5327
+ * (deprecated, flagged `hidden: true`), so a saved selection can be named.
5287
5328
  */
5288
- async getRealtimeModels(provider) {
5329
+ async getRealtimeModels(provider, options) {
5289
5330
  const searchParams = new URLSearchParams();
5290
5331
  if (provider) searchParams.append("provider", provider);
5332
+ if (options?.includeHidden) searchParams.append("includeHidden", "true");
5291
5333
  const queryString = searchParams.toString();
5292
5334
  const url = queryString ? `ai-models/realtime?${queryString}` : "ai-models/realtime";
5293
5335
  return this.fetch(url);
@@ -6265,6 +6307,18 @@ var init_chunk_BQOKENBF = __esm({
6265
6307
  `w/${wid}/calls${params.toString() ? `?${params.toString()}` : ""}`
6266
6308
  );
6267
6309
  }
6310
+ /**
6311
+ * Get one phone call by uuid — the subject a `call.*` Activity event names.
6312
+ *
6313
+ * Authorization is the call's own chat (`chats:read`, then the chat access
6314
+ * policy), so a call with no chat, or one the caller's chat access does not
6315
+ * reach, is a 404. The response carries `chatId`/`chatUuid`, the terminal
6316
+ * disposition axes and `workflowId`, which is what an Activity call card
6317
+ * needs to show the call's outcome and link to its conversation.
6318
+ */
6319
+ async getPhoneCallByUuid(wid, uuid) {
6320
+ return this.fetch(`w/${wid}/calls/by-uuid/${encodeURIComponent(uuid)}`);
6321
+ }
6268
6322
  /**
6269
6323
  * Get message timing data for a chat recording. `source` selects whose
6270
6324
  * timeline the offsets are measured against; omitted means `standard`.
@@ -6285,19 +6339,11 @@ var init_chunk_BQOKENBF = __esm({
6285
6339
  async getEdgeCaptureInfo(wid, chatId) {
6286
6340
  return this.fetch(`w/${wid}/recordings/chat/${chatId}/edge-capture`);
6287
6341
  }
6288
- /**
6289
- * Get PHI-safe provenance metadata for the recording served by
6290
- * `/audio.wav` — source, encryption, channels, duration, status, etc.
6291
- * Staff-only Twilio SIDs are present only for superusers. Returns 404
6292
- * when the chat has no native recording row.
6293
- */
6294
- async getRecordingInfo(wid, chatId) {
6295
- return this.fetch(`w/${wid}/recordings/chat/${chatId}/info`);
6296
- }
6297
6342
  /**
6298
6343
  * Get a single short-lived presigned URL to download the complete call
6299
- * recording as one file: the playable Twilio-native recording, else the
6300
- * complete internal recording. 404 when neither is available.
6344
+ * recording as one file: the complete internal recording, else the newest
6345
+ * ready stored recording (`twilio_native` or `legacy_chunks`). 404 when
6346
+ * neither is available.
6301
6347
  */
6302
6348
  async getCallRecordingDownloadUrl(wid, chatId, options = {}) {
6303
6349
  const params = new URLSearchParams();
@@ -6610,6 +6656,13 @@ var init_chunk_BQOKENBF = __esm({
6610
6656
  body: JSON.stringify(override)
6611
6657
  });
6612
6658
  }
6659
+ /** Set the authenticated Member's personal star without changing Chat access. */
6660
+ async setChatStar(wid, id, isStarred) {
6661
+ return this.fetch(`w/${wid}/chats/${id}/star`, {
6662
+ method: "PUT",
6663
+ body: JSON.stringify({ isStarred })
6664
+ });
6665
+ }
6613
6666
  /** Update the mute status of a chat. */
6614
6667
  async updateChatMute(wid, id, muted, muteReason, muteExpiresOnInbound) {
6615
6668
  return this.fetch(`w/${wid}/chats/${id}/mute`, {
@@ -7460,9 +7513,16 @@ var init_chunk_BQOKENBF = __esm({
7460
7513
  }
7461
7514
  };
7462
7515
  SlackAppsApi = class extends BaseApiClient {
7463
- async getSlackChannelChoices(wid, appId, cursor) {
7516
+ async removeSlackInstallation(wid, appId, installationId) {
7517
+ return this.fetch(
7518
+ `w/${wid}/app-connections/slack/apps/${appId}/installations/${installationId}`,
7519
+ { method: "DELETE" }
7520
+ );
7521
+ }
7522
+ async getSlackChannelChoices(wid, appId, cursor, teamId) {
7464
7523
  const params = new URLSearchParams({ appId: String(appId) });
7465
7524
  if (cursor) params.set("cursor", cursor);
7525
+ if (teamId) params.set("teamId", teamId);
7466
7526
  return this.fetch(
7467
7527
  `w/${wid}/app-connections/slack/channel-choices?${params}`
7468
7528
  );
@@ -7543,6 +7603,8 @@ var init_chunk_BQOKENBF = __esm({
7543
7603
  const params = new URLSearchParams();
7544
7604
  if (options.page) params.append("page", options.page.toString());
7545
7605
  if (options.pageSize) params.append("pageSize", options.pageSize.toString());
7606
+ if (options.search) params.set("search", options.search);
7607
+ if (options.connection) params.set("connection", options.connection);
7546
7608
  return this.fetch(
7547
7609
  `w/${wid}/app-connections/slack/apps/${appId}/installations${params.toString() ? `?${params.toString()}` : ""}`
7548
7610
  );
@@ -7831,6 +7893,36 @@ var init_chunk_BQOKENBF = __esm({
7831
7893
  body: JSON.stringify(data)
7832
7894
  });
7833
7895
  }
7896
+ /**
7897
+ * Which environments of the shared Gravity Rail athenahealth app this
7898
+ * deployment can use. Requires `apps:read`.
7899
+ */
7900
+ async getAthenaPlatformApp(wid) {
7901
+ return this.fetch(
7902
+ `w/${wid}/app-connections/fhir/athena/platform-app`
7903
+ );
7904
+ }
7905
+ /**
7906
+ * Check that the Gravity Rail athenahealth app can reach a practice in an
7907
+ * environment. Saves nothing. Requires `apps:write`.
7908
+ */
7909
+ async verifyAthenaAccess(wid, data) {
7910
+ return this.fetch(
7911
+ `w/${wid}/app-connections/fhir/athena/verify-access`,
7912
+ { method: "POST", body: JSON.stringify(data) }
7913
+ );
7914
+ }
7915
+ /**
7916
+ * Create an athenahealth connection through the shared Gravity Rail app.
7917
+ * The server re-runs the access probe and answers 400 with
7918
+ * `detail: { code, message }` when it fails. Requires `apps:write`.
7919
+ */
7920
+ async connectAthena(wid, data) {
7921
+ return this.fetch(`w/${wid}/app-connections/fhir/athena/connections`, {
7922
+ method: "POST",
7923
+ body: JSON.stringify(data)
7924
+ });
7925
+ }
7834
7926
  /**
7835
7927
  * Update an existing FHIR connection configuration.
7836
7928
  */
@@ -8049,36 +8141,6 @@ var init_chunk_BQOKENBF = __esm({
8049
8141
  { method: "POST", body: JSON.stringify(data) }
8050
8142
  );
8051
8143
  }
8052
- /**
8053
- * Start, resume, override or preview (dry run) an athenahealth connection's
8054
- * onboarding import. The body is exactly the three mode flags; the server
8055
- * traverses the connection's configured department/status pairs. Returns
8056
- * 202 with the Temporal workflow and run ids. Requires `workspace:admin`.
8057
- */
8058
- async fhirStartOnboardingImport(wid, connectionId, data = {}) {
8059
- const body = {
8060
- dryRun: data.dryRun ?? false,
8061
- resume: data.resume ?? false,
8062
- override: data.override ?? false
8063
- };
8064
- return this.fetch(
8065
- `w/${wid}/app-connections/fhir/connections/${connectionId}/onboarding-import`,
8066
- {
8067
- method: "POST",
8068
- body: JSON.stringify(body)
8069
- }
8070
- );
8071
- }
8072
- /**
8073
- * Read an athenahealth connection's onboarding-import progress (durable,
8074
- * approximate totals) and its known Temporal execution. GET-only: never
8075
- * starts or resumes work. Requires `workspace:admin`.
8076
- */
8077
- async fhirGetOnboardingImportStatus(wid, connectionId) {
8078
- return this.fetch(
8079
- `w/${wid}/app-connections/fhir/connections/${connectionId}/onboarding-import`
8080
- );
8081
- }
8082
8144
  };
8083
8145
  InboundFaxStatus = {
8084
8146
  pending: "pending",
@@ -8699,6 +8761,23 @@ var init_chunk_BQOKENBF = __esm({
8699
8761
  );
8700
8762
  return response.arrayBuffer();
8701
8763
  }
8764
+ /**
8765
+ * Reply and bounce rates for the emails one inbox sent in a period.
8766
+ *
8767
+ * `dateFrom` (inclusive) and `dateTo` (exclusive) are ISO 8601 instants with
8768
+ * an offset and must be passed together, at most 90 days apart; omit both
8769
+ * for the server's rolling last 30 days. Requires `inboxes:read` and
8770
+ * `analytics:read` plus admin access to the inbox. Aggregates only.
8771
+ */
8772
+ async getInboxOutboundEmailStats(wid, inboxId, period = {}) {
8773
+ const params = new URLSearchParams();
8774
+ if (period.dateFrom) params.append("date_from", period.dateFrom);
8775
+ if (period.dateTo) params.append("date_to", period.dateTo);
8776
+ const query = params.toString();
8777
+ return this.fetch(
8778
+ `w/${wid}/inboxes/${inboxId}/outbound-email-stats${query ? `?${query}` : ""}`
8779
+ );
8780
+ }
8702
8781
  /** List email threads in an inbox. */
8703
8782
  async getInboxThreads(wid, inboxId) {
8704
8783
  return this.fetch(`w/${wid}/inboxes/${inboxId}/threads`);
@@ -10689,6 +10768,18 @@ var init_chunk_BQOKENBF = __esm({
10689
10768
  async listA2PBrands(orgUuid) {
10690
10769
  return this.fetch(`o/${orgUuid}/a2p-brands`);
10691
10770
  }
10771
+ /**
10772
+ * Poll Twilio for one brand now and record its brand and campaign statuses,
10773
+ * as the scheduled sync would. Returns the brand as recorded afterwards,
10774
+ * without the live workflow fields `getA2PBrand` adds.
10775
+ */
10776
+ async syncA2PBrand(orgUuid, brandUuid) {
10777
+ return this.fetch(
10778
+ `o/${orgUuid}/a2p-brands/${brandUuid}/sync`,
10779
+ // Empty JSON body is the CSRF barrier the route requires (GRA-6284).
10780
+ { method: "POST", body: JSON.stringify({}) }
10781
+ );
10782
+ }
10692
10783
  /**
10693
10784
  * Live per-brand campaign use-case eligibility. Approved brands only — a
10694
10785
  * brand still under TCR review comes back as a structured 412 the picker
@@ -11139,6 +11230,14 @@ var init_chunk_BQOKENBF = __esm({
11139
11230
  async getPhoneNumber(wid, id) {
11140
11231
  return this.fetch(`w/${wid}/phone-numbers/${id}`);
11141
11232
  }
11233
+ /**
11234
+ * What this number still needs from its organization: the texting and
11235
+ * caller ID registration states of the business it belongs to. States only —
11236
+ * readable with `phones:read`, so it carries none of the business's forms.
11237
+ */
11238
+ async getPhoneNumberSetupStatus(wid, id) {
11239
+ return this.fetch(`w/${wid}/phone-numbers/${id}/setup-status`);
11240
+ }
11142
11241
  /** Create a new phone number record. */
11143
11242
  async createPhoneNumber(wid, phoneNumber) {
11144
11243
  return this.fetch(`w/${wid}/phone-numbers`, {
@@ -11447,6 +11546,21 @@ var init_chunk_BQOKENBF = __esm({
11447
11546
  async getPersona(wid, id) {
11448
11547
  return this.fetch(`w/${wid}/personas/${id}`);
11449
11548
  }
11549
+ async getPersonaTestMember(wid, id) {
11550
+ return this.fetch(`w/${wid}/personas/${id}/test-member`);
11551
+ }
11552
+ async createPersonaTestMember(wid, id) {
11553
+ return this.fetch(`w/${wid}/personas/${id}/test-member`, {
11554
+ method: "POST",
11555
+ body: JSON.stringify({})
11556
+ });
11557
+ }
11558
+ async resetPersonaTestMember(wid, id) {
11559
+ return this.fetch(`w/${wid}/personas/${id}/test-member/reset`, {
11560
+ method: "POST",
11561
+ body: JSON.stringify({})
11562
+ });
11563
+ }
11450
11564
  async createPersona(wid, data) {
11451
11565
  return this.fetch(`w/${wid}/personas`, {
11452
11566
  method: "POST",
@@ -11505,6 +11619,21 @@ var init_chunk_BQOKENBF = __esm({
11505
11619
  }
11506
11620
  };
11507
11621
  QualificationsApi = class extends BaseApiClient {
11622
+ /** Copy an authorized test Chat prefix into an editable Scenario draft. */
11623
+ async captureScenarioDraft(wid, chatId, throughMessageId) {
11624
+ return this.fetch(`w/${wid}/qualifications/chats/${chatId}/scenario-draft`, {
11625
+ method: "POST",
11626
+ body: JSON.stringify({ throughMessageId })
11627
+ });
11628
+ }
11629
+ /** Pause before the next Persona turn; a current Agent reply may finish. */
11630
+ /** Turn feedback into an explicitly authored rubric on the same Workflow. */
11631
+ async promoteTestChatFeedback(wid, runId, request) {
11632
+ return this.fetch(`w/${wid}/qualifications/test-chat-runs/${runId}/feedback/criterion`, {
11633
+ method: "POST",
11634
+ body: JSON.stringify(request)
11635
+ });
11636
+ }
11508
11637
  /** List qualifications in a workspace, paginated. */
11509
11638
  async getQualifications(wid, params) {
11510
11639
  const query = new URLSearchParams();
@@ -11596,6 +11725,12 @@ var init_chunk_BQOKENBF = __esm({
11596
11725
  `w/${wid}/qualifications/workflows/${workflowId}/scenario-health-summaries${qs}`
11597
11726
  );
11598
11727
  }
11728
+ /** The saved run of a test Chat, including its driver and completion state. */
11729
+ async getChatTestRun(wid, chatId) {
11730
+ return this.fetch(
11731
+ `w/${wid}/qualifications/chats/${chatId}/test-chat-run`
11732
+ );
11733
+ }
11599
11734
  async getTestChatRun(wid, runId) {
11600
11735
  return this.fetch(`w/${wid}/qualifications/test-chat-runs/${runId}`);
11601
11736
  }
@@ -11876,9 +12011,9 @@ var init_chunk_BQOKENBF = __esm({
11876
12011
  });
11877
12012
  }
11878
12013
  /**
11879
- * Start a durable run that links unlinked members by Salesforce Id / email
11880
- * and hydrates them. One run per connection; a second start while one is
11881
- * in flight is 409.
12014
+ * @deprecated Use `linkUnlinkedMembersByIdentity(wid, connectionId)`, which
12015
+ * serves every connector that links by identity. This calls the retained
12016
+ * Salesforce-only route and will be removed once no caller remains.
11882
12017
  */
11883
12018
  async linkUnlinkedSalesforceMembersByIdentity(wid) {
11884
12019
  return this.fetch(
@@ -12003,6 +12138,20 @@ var init_chunk_BQOKENBF = __esm({
12003
12138
  { method: "PUT", body: JSON.stringify(data) }
12004
12139
  );
12005
12140
  }
12141
+ async getConnectionFieldHomes(wid, connectionId) {
12142
+ return this.fetch(`w/${wid}/app-connections/${connectionId}/field-homes`);
12143
+ }
12144
+ /** Each inbound record source's latest pass: closed status, times and counts. */
12145
+ async getInboundRecordStatus(wid, connectionId) {
12146
+ return this.fetch(
12147
+ `w/${wid}/app-connections/${connectionId}/inbound-records/status`
12148
+ );
12149
+ }
12150
+ async getConnectionWritePreview(wid, connectionId, memberId) {
12151
+ return this.fetch(
12152
+ `w/${wid}/app-connections/${connectionId}/write-preview/members/${memberId}`
12153
+ );
12154
+ }
12006
12155
  async getConnectionSyncCheckpoint(wid, connectionId, direction = "inbound", syncKey = "default") {
12007
12156
  const query = new URLSearchParams({
12008
12157
  direction,
@@ -12065,6 +12214,108 @@ var init_chunk_BQOKENBF = __esm({
12065
12214
  { method: "DELETE" }
12066
12215
  );
12067
12216
  }
12217
+ /**
12218
+ * Start a durable run that links the connection's unlinked members to
12219
+ * remote records by identity (email, phone, or the vendor's own key) and
12220
+ * hydrates them. Served for any connector that declares a remote identity
12221
+ * resolver (Salesforce, HubSpot); another connector is 400. One run per
12222
+ * connection: a second start while one is in flight is 409.
12223
+ */
12224
+ async linkUnlinkedMembersByIdentity(wid, connectionId) {
12225
+ return this.fetch(
12226
+ `w/${wid}/app-connections/${connectionId}/link-unlinked-by-identity`,
12227
+ { method: "POST", body: JSON.stringify({}) }
12228
+ );
12229
+ }
12230
+ // --- Saved subset imports (Integration Standard IM-1..IM-4) ---------------
12231
+ subsetImportsPath(wid, connectionId, suffix2 = "") {
12232
+ return `w/${wid}/app-connections/${connectionId}/subset-imports${suffix2}`;
12233
+ }
12234
+ /** The connection's saved imports, newest first, and the kinds it accepts. */
12235
+ async listSubsetImports(wid, connectionId) {
12236
+ return this.fetch(this.subsetImportsPath(wid, connectionId));
12237
+ }
12238
+ async getSubsetImport(wid, connectionId, importId) {
12239
+ return this.fetch(
12240
+ this.subsetImportsPath(wid, connectionId, `/${encodeURIComponent(importId)}`)
12241
+ );
12242
+ }
12243
+ /** Save a named selection. Saving never reads the vendor or imports. */
12244
+ async createSubsetImport(wid, connectionId, data) {
12245
+ return this.fetch(this.subsetImportsPath(wid, connectionId), {
12246
+ method: "POST",
12247
+ body: JSON.stringify(data)
12248
+ });
12249
+ }
12250
+ /** Replace a saved selection. A changed selection resets its progress. */
12251
+ async updateSubsetImport(wid, connectionId, importId, data) {
12252
+ return this.fetch(
12253
+ this.subsetImportsPath(wid, connectionId, `/${encodeURIComponent(importId)}`),
12254
+ { method: "PUT", body: JSON.stringify(data) }
12255
+ );
12256
+ }
12257
+ /** Remove a saved import. Its Members and links stay. */
12258
+ async deleteSubsetImport(wid, connectionId, importId) {
12259
+ await this.fetch(
12260
+ this.subsetImportsPath(wid, connectionId, `/${encodeURIComponent(importId)}`),
12261
+ { method: "DELETE" }
12262
+ );
12263
+ }
12264
+ /** Count and sample an unsaved selection. Never writes. */
12265
+ async previewSubsetImportSelection(wid, connectionId, selection) {
12266
+ return this.fetch(
12267
+ this.subsetImportsPath(wid, connectionId, "/preview"),
12268
+ { method: "POST", body: JSON.stringify({ selection }) }
12269
+ );
12270
+ }
12271
+ /** Count and sample a saved selection. Never writes. */
12272
+ async previewSubsetImport(wid, connectionId, importId) {
12273
+ return this.fetch(
12274
+ this.subsetImportsPath(wid, connectionId, `/${encodeURIComponent(importId)}/preview`),
12275
+ // The CSRF barrier refuses a body-less POST (422); `{}` is the request.
12276
+ { method: "POST", body: JSON.stringify({}) }
12277
+ );
12278
+ }
12279
+ /**
12280
+ * Start the import in the background (202). A failed or cancelled import
12281
+ * resumes where it stopped unless `restart` is true.
12282
+ */
12283
+ async runSubsetImport(wid, connectionId, importId, options) {
12284
+ return this.fetch(
12285
+ this.subsetImportsPath(wid, connectionId, `/${encodeURIComponent(importId)}/run`),
12286
+ { method: "POST", body: JSON.stringify({ restart: options?.restart ?? false }) }
12287
+ );
12288
+ }
12289
+ /** Ask a running import to stop (202); its progress is kept for a resume. */
12290
+ async cancelSubsetImport(wid, connectionId, importId) {
12291
+ return this.fetch(
12292
+ this.subsetImportsPath(wid, connectionId, `/${encodeURIComponent(importId)}/cancel`),
12293
+ // The CSRF barrier refuses a body-less POST (422); `{}` is the request.
12294
+ { method: "POST", body: JSON.stringify({}) }
12295
+ );
12296
+ }
12297
+ /** The connection's import-run history, newest first (counts only). */
12298
+ async listSubsetImportRuns(wid, connectionId, limit = 20) {
12299
+ return this.fetch(
12300
+ this.subsetImportsPath(wid, connectionId, `/runs?limit=${limit}`)
12301
+ );
12302
+ }
12303
+ /** Vendor lists a `vendor_list` import can name (configuration only). */
12304
+ async listSubsetImportVendorLists(wid, connectionId, options) {
12305
+ const query = new URLSearchParams({
12306
+ query: options?.query ?? "",
12307
+ limit: String(options?.limit ?? 50)
12308
+ });
12309
+ return this.fetch(
12310
+ this.subsetImportsPath(wid, connectionId, `/vendor-lists?${query}`)
12311
+ );
12312
+ }
12313
+ /** Remote fields a `field_filter` import can name, with their operators. */
12314
+ async listSubsetImportFilterFields(wid, connectionId) {
12315
+ return this.fetch(
12316
+ this.subsetImportsPath(wid, connectionId, "/filter-fields")
12317
+ );
12318
+ }
12068
12319
  };
12069
12320
  HubspotApi = class extends BaseApiClient {
12070
12321
  /**
@@ -12168,6 +12419,35 @@ var init_chunk_BQOKENBF = __esm({
12168
12419
  `w/${wid}/app-connections/hubspot/sync-settings/hs-properties`
12169
12420
  );
12170
12421
  }
12422
+ /** Mappable HubSpot deal property definitions (deal inbound record sources). */
12423
+ async getHubspotDealProperties(wid) {
12424
+ return this.fetch(
12425
+ `w/${wid}/app-connections/hubspot/sync-settings/hs-properties?objectType=deals`
12426
+ );
12427
+ }
12428
+ /** The portal's Meetings booking links, or `missing_scope` without the scheduler scope. */
12429
+ async getHubspotMeetingLinks(wid) {
12430
+ return this.fetch(
12431
+ `w/${wid}/app-connections/hubspot/sync-settings/meeting-links`
12432
+ );
12433
+ }
12434
+ /** The portal's forms and their fields, or `missing_scope` without the `forms` scope. */
12435
+ async getHubspotForms(wid) {
12436
+ return this.fetch(
12437
+ `w/${wid}/app-connections/hubspot/sync-settings/forms`
12438
+ );
12439
+ }
12440
+ /**
12441
+ * Raw HubSpot property definitions for one CRM object type
12442
+ * (`GET /get_properties/{objectType}`), as HubSpot's properties API
12443
+ * returns them. Use `getHubspotContactProperties` for the sync-mappable
12444
+ * contact property list the field mapper shows.
12445
+ */
12446
+ async getHubspotObjectProperties(wid, objectType) {
12447
+ return this.fetch(
12448
+ `w/${wid}/app-connections/hubspot/get_properties/${encodeURIComponent(objectType)}`
12449
+ );
12450
+ }
12171
12451
  async getHubspotManagedRules(wid) {
12172
12452
  return this.fetch(`w/${wid}/app-connections/hubspot/managed-rules`);
12173
12453
  }
@@ -13186,6 +13466,17 @@ var init_chunk_BQOKENBF = __esm({
13186
13466
  async getJourneyHealth(wid, journeyId) {
13187
13467
  return this.fetch(`w/${wid}/journeys/${journeyId}/health`);
13188
13468
  }
13469
+ /**
13470
+ * How many days the journey's texts take at the workspace's current sending
13471
+ * limits — advice for the publish and enroll confirmations, never a gate.
13472
+ * `additionalMembers` is the size of a batch about to be enrolled.
13473
+ */
13474
+ async getJourneySendEstimate(wid, journeyId, additionalMembers = 0) {
13475
+ const query = new URLSearchParams({ additionalMembers: String(additionalMembers) });
13476
+ return this.fetch(
13477
+ `w/${wid}/journeys/${journeyId}/send-estimate?${query.toString()}`
13478
+ );
13479
+ }
13189
13480
  /** Create a step within a journey. */
13190
13481
  async createStep(wid, journeyId, data) {
13191
13482
  return this.fetch(`w/${wid}/journeys/${journeyId}/steps`, {
@@ -14352,13 +14643,10 @@ var init_chunk_BQOKENBF = __esm({
14352
14643
  }
14353
14644
  /** Register a Web Push subscription for the current user. */
14354
14645
  async registerPushSubscription(wid, subscription) {
14355
- return this.fetch(
14356
- `w/${wid}/push-subscriptions`,
14357
- {
14358
- method: "POST",
14359
- body: JSON.stringify(subscription)
14360
- }
14361
- );
14646
+ return this.fetch(`w/${wid}/push-subscriptions`, {
14647
+ method: "POST",
14648
+ body: JSON.stringify(subscription)
14649
+ });
14362
14650
  }
14363
14651
  /** Unregister a Web Push subscription by endpoint URL. */
14364
14652
  async unregisterPushSubscription(wid, endpoint) {
@@ -14373,6 +14661,14 @@ var init_chunk_BQOKENBF = __esm({
14373
14661
  async listPushSubscriptions(wid) {
14374
14662
  return this.fetch(`w/${wid}/push-subscriptions`);
14375
14663
  }
14664
+ /** Submit a fixed generic test to an owned browser registration. */
14665
+ async testPushSubscription(wid, subscriptionId) {
14666
+ const body = {};
14667
+ return this.fetch(
14668
+ `w/${wid}/push-subscriptions/${subscriptionId}/test`,
14669
+ { method: "POST", body: JSON.stringify(body) }
14670
+ );
14671
+ }
14376
14672
  /** List org domains available for workspace email inbox routing. */
14377
14673
  async getWorkspaceEmailDomains(wid) {
14378
14674
  return this.fetch(`w/${wid}/domains/for-email`);
@@ -15104,6 +15400,31 @@ var init_chunk_BQOKENBF = __esm({
15104
15400
  return this.fetch(`w/${wid}/app-connections/patientsync/`, { method: "DELETE" });
15105
15401
  }
15106
15402
  };
15403
+ ClaimMdApi = class extends BaseApiClient {
15404
+ async getClaimMdStatus(wid) {
15405
+ return this.fetch(`w/${wid}/app-connections/claim-md/status`);
15406
+ }
15407
+ /** Sends `{}` deliberately: the route requires a JSON body as a CSRF barrier. */
15408
+ async installClaimMd(wid) {
15409
+ return this.fetch(`w/${wid}/app-connections/claim-md/install`, {
15410
+ method: "POST",
15411
+ body: JSON.stringify({})
15412
+ });
15413
+ }
15414
+ async configureClaimMd(wid, data) {
15415
+ return this.fetch(`w/${wid}/app-connections/claim-md/configure`, {
15416
+ method: "POST",
15417
+ body: JSON.stringify(data)
15418
+ });
15419
+ }
15420
+ /** Checks a pasted AccountKey without storing it. */
15421
+ async verifyClaimMdKey(wid, data) {
15422
+ return this.fetch(`w/${wid}/app-connections/claim-md/verify`, {
15423
+ method: "POST",
15424
+ body: JSON.stringify(data)
15425
+ });
15426
+ }
15427
+ };
15107
15428
  ActivityApi = class extends BaseApiClient {
15108
15429
  /** The account mount: this caller's whole estate, at any grain. */
15109
15430
  async queryActivity(request) {
@@ -15626,6 +15947,7 @@ var init_chunk_BQOKENBF = __esm({
15626
15947
  "cancelCalendarEvent",
15627
15948
  "cancelChatCallback",
15628
15949
  "cancelCredentialUpdateInvite",
15950
+ "cancelSubsetImport",
15629
15951
  "checkAvailability",
15630
15952
  "checkSiteDomainAvailability",
15631
15953
  "checkSiteSlugAvailability",
@@ -15640,6 +15962,7 @@ var init_chunk_BQOKENBF = __esm({
15640
15962
  "commentOnWorkspaceSupportRequest",
15641
15963
  "completeDiscordLink",
15642
15964
  "configureConfluence",
15965
+ "configureClaimMd",
15643
15966
  "configureDocumoFax",
15644
15967
  "configureHealthie",
15645
15968
  "configurePatientSync",
@@ -15647,6 +15970,7 @@ var init_chunk_BQOKENBF = __esm({
15647
15970
  "configureMondayConnection",
15648
15971
  "configureSalesforce",
15649
15972
  "configureZendeskConnection",
15973
+ "connectAthena",
15650
15974
  "convertEmail",
15651
15975
  "convertFile",
15652
15976
  "createAbility",
@@ -15655,6 +15979,15 @@ var init_chunk_BQOKENBF = __esm({
15655
15979
  "createApiKey",
15656
15980
  "createAssignment",
15657
15981
  "bindInstallationSlots",
15982
+ "createSubsetImport",
15983
+ "deleteSubsetImport",
15984
+ "getSubsetImport",
15985
+ "listSubsetImportFilterFields",
15986
+ "listSubsetImportRuns",
15987
+ "listSubsetImports",
15988
+ "listSubsetImportVendorLists",
15989
+ "previewSubsetImport",
15990
+ "previewSubsetImportSelection",
15658
15991
  "restoreInstallationForm",
15659
15992
  "createBundle",
15660
15993
  "createCalendar",
@@ -15663,6 +15996,7 @@ var init_chunk_BQOKENBF = __esm({
15663
15996
  "createCalendarSchedule",
15664
15997
  "createChat",
15665
15998
  "createChatInteractionSession",
15999
+ "runSubsetImport",
15666
16000
  "transitionChatInteractionSession",
15667
16001
  "createChatCompletion",
15668
16002
  "createChatFilter",
@@ -15843,7 +16177,6 @@ var init_chunk_BQOKENBF = __esm({
15843
16177
  "fhirGetCsvImportSettings",
15844
16178
  "fhirGetEncounterSyncRuns",
15845
16179
  "fhirGetEncounterSyncStatus",
15846
- "fhirGetOnboardingImportStatus",
15847
16180
  "fhirImportPatient",
15848
16181
  "fhirLinkMember",
15849
16182
  "fhirListLinkedMembers",
@@ -15852,7 +16185,6 @@ var init_chunk_BQOKENBF = __esm({
15852
16185
  "fhirSearchLocations",
15853
16186
  "fhirSearchPatients",
15854
16187
  "fhirSearchPractitioners",
15855
- "fhirStartOnboardingImport",
15856
16188
  "fhirSyncMember",
15857
16189
  "fhirUnlinkMember",
15858
16190
  "fhirUpdateCsvImportSettings",
@@ -15878,6 +16210,7 @@ var init_chunk_BQOKENBF = __esm({
15878
16210
  "getAnonymousResolutions",
15879
16211
  "getApiKeys",
15880
16212
  "getArchiveBlockers",
16213
+ "getAthenaPlatformApp",
15881
16214
  "getAssignment",
15882
16215
  "getAssignmentCelContext",
15883
16216
  "getAssignmentMessages",
@@ -15940,9 +16273,12 @@ var init_chunk_BQOKENBF = __esm({
15940
16273
  "getClientWorkspace",
15941
16274
  "getConfigurationHealth",
15942
16275
  "getConfluenceStatus",
16276
+ "getConnectionFieldHomes",
16277
+ "getInboundRecordStatus",
15943
16278
  "getConnectionSyncCapabilities",
15944
16279
  "getConnectionSyncCheckpoint",
15945
16280
  "getConnectionSyncConfig",
16281
+ "getConnectionWritePreview",
15946
16282
  "getCredentialUpdateInvites",
15947
16283
  "getCurrentMember",
15948
16284
  "clearMemberWorkflowVoice",
@@ -15979,6 +16315,7 @@ var init_chunk_BQOKENBF = __esm({
15979
16315
  "getDiscordBots",
15980
16316
  "getDiscordGuilds",
15981
16317
  "getDiscordThreads",
16318
+ "getClaimMdStatus",
15982
16319
  "getDocumoFaxSetup",
15983
16320
  "listDocumoFaxes",
15984
16321
  "getDocumoFaxStatus",
@@ -16007,6 +16344,7 @@ var init_chunk_BQOKENBF = __esm({
16007
16344
  "getSiteSourceTemplates",
16008
16345
  "getThemeSettings",
16009
16346
  "importSiteSourceZip",
16347
+ "installClaimMd",
16010
16348
  "installDocumoFax",
16011
16349
  "previewDataReport",
16012
16350
  "previewQuery",
@@ -16043,7 +16381,11 @@ var init_chunk_BQOKENBF = __esm({
16043
16381
  "getHealthieStatus",
16044
16382
  "getPatientSyncStatus",
16045
16383
  "getHubspotContactProperties",
16384
+ "getHubspotDealProperties",
16385
+ "getHubspotForms",
16386
+ "getHubspotMeetingLinks",
16046
16387
  "getHubspotManagedRules",
16388
+ "getHubspotObjectProperties",
16047
16389
  "getHubspotReconciliationMatches",
16048
16390
  "getHubspotStatus",
16049
16391
  "getHubspotSyncLogs",
@@ -16055,6 +16397,7 @@ var init_chunk_BQOKENBF = __esm({
16055
16397
  "getInbox",
16056
16398
  "getInboxEmail",
16057
16399
  "getInboxEmails",
16400
+ "getInboxOutboundEmailStats",
16058
16401
  "getInboxThreads",
16059
16402
  "getInboxes",
16060
16403
  "getInterventionRequests",
@@ -16064,6 +16407,7 @@ var init_chunk_BQOKENBF = __esm({
16064
16407
  "getJourneyHealth",
16065
16408
  "getJourneyMembers",
16066
16409
  "getJourneyNotes",
16410
+ "getJourneySendEstimate",
16067
16411
  "getJourneyV2Validation",
16068
16412
  "getJourneys",
16069
16413
  "getLinkablePhones",
@@ -16124,11 +16468,16 @@ var init_chunk_BQOKENBF = __esm({
16124
16468
  "getPage",
16125
16469
  "getPageBySlug",
16126
16470
  "getPersona",
16471
+ "getPersonaTestMember",
16472
+ "createPersonaTestMember",
16473
+ "resetPersonaTestMember",
16127
16474
  "getPhoneCalls",
16475
+ "getPhoneCallByUuid",
16128
16476
  "getPhoneNumber",
16129
16477
  "getPhoneNumberCalls",
16130
16478
  "getPhoneNumberFaxes",
16131
16479
  "getPhoneNumberMessages",
16480
+ "getPhoneNumberSetupStatus",
16132
16481
  "getPhoneNumberVoicemails",
16133
16482
  "getPhoneNumbers",
16134
16483
  "getPhoneUsageReport",
@@ -16144,7 +16493,6 @@ var init_chunk_BQOKENBF = __esm({
16144
16493
  "getPublicProducts",
16145
16494
  "getQualification",
16146
16495
  "getQualifications",
16147
- "getRecordingInfo",
16148
16496
  "getResellerWorkspaces",
16149
16497
  "getRoutine",
16150
16498
  "getRoutineConfigEvents",
@@ -16171,6 +16519,7 @@ var init_chunk_BQOKENBF = __esm({
16171
16519
  "getSlackAppAccounts",
16172
16520
  "getSlackApps",
16173
16521
  "getSlackInstallations",
16522
+ "removeSlackInstallation",
16174
16523
  "getSlackThreads",
16175
16524
  "getStepMemberCounts",
16176
16525
  "getStepMembers",
@@ -16187,6 +16536,7 @@ var init_chunk_BQOKENBF = __esm({
16187
16536
  "getTeamsConversations",
16188
16537
  "getTeamsInstallations",
16189
16538
  "getTemplateContext",
16539
+ "getChatTestRun",
16190
16540
  "getTestChatRun",
16191
16541
  "getThreadEmails",
16192
16542
  "getTool",
@@ -16260,6 +16610,7 @@ var init_chunk_BQOKENBF = __esm({
16260
16610
  "linkMemberToMonday",
16261
16611
  "linkMemberToSalesforce",
16262
16612
  "linkPhoneNumber",
16613
+ "linkUnlinkedMembersByIdentity",
16263
16614
  "linkUnlinkedSalesforceMembersByIdentity",
16264
16615
  "listAbilities",
16265
16616
  "listAnonymousFormSubmissions",
@@ -16343,6 +16694,7 @@ var init_chunk_BQOKENBF = __esm({
16343
16694
  "reenrollMember",
16344
16695
  "renameFieldSlug",
16345
16696
  "registerLinkedRolesMetadata",
16697
+ "testPushSubscription",
16346
16698
  "registerPushSubscription",
16347
16699
  "reindexFolder",
16348
16700
  "releasePhoneNumber",
@@ -16354,6 +16706,7 @@ var init_chunk_BQOKENBF = __esm({
16354
16706
  "reorderMenuItems",
16355
16707
  "reconcileInstallation",
16356
16708
  "setInstallationPolicy",
16709
+ "updateSubsetImport",
16357
16710
  "upgradeInstallation",
16358
16711
  "replaceBundleDraft",
16359
16712
  "replyToEmail",
@@ -16389,6 +16742,8 @@ var init_chunk_BQOKENBF = __esm({
16389
16742
  "startHubspotOAuth",
16390
16743
  "startSalesforceOAuth",
16391
16744
  "startSyncRun",
16745
+ "captureScenarioDraft",
16746
+ "promoteTestChatFeedback",
16392
16747
  "startTestChatRun",
16393
16748
  "summarizeChat",
16394
16749
  "syncCalendarWithGoogle",
@@ -16428,6 +16783,7 @@ var init_chunk_BQOKENBF = __esm({
16428
16783
  "updateChatFilter",
16429
16784
  "updateChatLabel",
16430
16785
  "updateChatModelOverride",
16786
+ "setChatStar",
16431
16787
  "updateChatMute",
16432
16788
  "updateClientWorkspace",
16433
16789
  "updateConnection",
@@ -16507,6 +16863,8 @@ var init_chunk_BQOKENBF = __esm({
16507
16863
  "validateDataTypeSlug",
16508
16864
  "validateQuery",
16509
16865
  "validateWorkflowName",
16866
+ "verifyAthenaAccess",
16867
+ "verifyClaimMdKey",
16510
16868
  "verifyDocumoFax"
16511
16869
  ];
16512
16870
  WORKSPACE_METHOD_NAME_SET = new Set(WORKSPACE_METHOD_NAMES);
@@ -16560,6 +16918,7 @@ var init_chunk_BQOKENBF = __esm({
16560
16918
  updateChat;
16561
16919
  getChatModelOverride;
16562
16920
  updateChatModelOverride;
16921
+ setChatStar;
16563
16922
  updateChatMute;
16564
16923
  summarizeChat;
16565
16924
  getChatMessages;
@@ -16593,8 +16952,8 @@ var init_chunk_BQOKENBF = __esm({
16593
16952
  getChatFilterCount;
16594
16953
  // Calls API
16595
16954
  getPhoneCalls;
16955
+ getPhoneCallByUuid;
16596
16956
  getMessageTiming;
16597
- getRecordingInfo;
16598
16957
  getEdgeCaptureInfo;
16599
16958
  getCallRecordingDownloadUrl;
16600
16959
  getCelContext;
@@ -16739,11 +17098,14 @@ var init_chunk_BQOKENBF = __esm({
16739
17098
  deleteScenario;
16740
17099
  listTestChatRuns;
16741
17100
  listScenarioHealthSummaries;
17101
+ getChatTestRun;
16742
17102
  getTestChatRun;
16743
17103
  listChatCapturedEffects;
16744
17104
  listChatRecordChanges;
16745
17105
  takeTestChatRunEmailTurn;
16746
17106
  takeTestChatRunSmsTurn;
17107
+ captureScenarioDraft;
17108
+ promoteTestChatFeedback;
16747
17109
  startTestChatRun;
16748
17110
  evaluateTestChatRun;
16749
17111
  endTestChatRun;
@@ -16757,6 +17119,9 @@ var init_chunk_BQOKENBF = __esm({
16757
17119
  previewDataReport;
16758
17120
  listPersonas;
16759
17121
  getPersona;
17122
+ getPersonaTestMember;
17123
+ createPersonaTestMember;
17124
+ resetPersonaTestMember;
16760
17125
  createPersona;
16761
17126
  updatePersona;
16762
17127
  archivePersona;
@@ -16827,6 +17192,7 @@ var init_chunk_BQOKENBF = __esm({
16827
17192
  getJourneyV2Validation;
16828
17193
  getJourneyFilterOptions;
16829
17194
  getJourneyHealth;
17195
+ getJourneySendEstimate;
16830
17196
  cloneJourneyAsV2;
16831
17197
  createJourney;
16832
17198
  updateJourney;
@@ -17053,6 +17419,7 @@ var init_chunk_BQOKENBF = __esm({
17053
17419
  setWorkspaceLabels;
17054
17420
  previewWorkspaceScope;
17055
17421
  getVapidPublicKey;
17422
+ testPushSubscription;
17056
17423
  registerPushSubscription;
17057
17424
  unregisterPushSubscription;
17058
17425
  listPushSubscriptions;
@@ -17332,6 +17699,7 @@ var init_chunk_BQOKENBF = __esm({
17332
17699
  createPhoneNumber;
17333
17700
  updatePhoneNumber;
17334
17701
  getArchiveBlockers;
17702
+ getPhoneNumberSetupStatus;
17335
17703
  archivePhoneNumber;
17336
17704
  getPhoneNumberCalls;
17337
17705
  getPhoneNumberOutboundAnalyticsSummary;
@@ -17364,6 +17732,7 @@ var init_chunk_BQOKENBF = __esm({
17364
17732
  sendInboxEmail;
17365
17733
  previewInboxEmail;
17366
17734
  previewEmailReply;
17735
+ getInboxOutboundEmailStats;
17367
17736
  getNotificationRules;
17368
17737
  createNotificationRule;
17369
17738
  updateNotificationRule;
@@ -17528,6 +17897,7 @@ var init_chunk_BQOKENBF = __esm({
17528
17897
  deleteSlackApp;
17529
17898
  getSlackThreads;
17530
17899
  getSlackInstallations;
17900
+ removeSlackInstallation;
17531
17901
  getSlackChannelChoices;
17532
17902
  getSlackEntryPoints;
17533
17903
  connectSlackEntryPoint;
@@ -17573,8 +17943,9 @@ var init_chunk_BQOKENBF = __esm({
17573
17943
  fhirGetEncounterSyncRuns;
17574
17944
  fhirRefreshEncounterPatient;
17575
17945
  fhirBackfillEncounterSync;
17576
- fhirStartOnboardingImport;
17577
- fhirGetOnboardingImportStatus;
17946
+ getAthenaPlatformApp;
17947
+ verifyAthenaAccess;
17948
+ connectAthena;
17578
17949
  // Healthie API
17579
17950
  getDocumoFaxStatus;
17580
17951
  getDocumoFaxSetup;
@@ -17583,6 +17954,10 @@ var init_chunk_BQOKENBF = __esm({
17583
17954
  configureDocumoFax;
17584
17955
  verifyDocumoFax;
17585
17956
  rotateDocumoFaxCredentials;
17957
+ getClaimMdStatus;
17958
+ installClaimMd;
17959
+ configureClaimMd;
17960
+ verifyClaimMdKey;
17586
17961
  configurePatientSync;
17587
17962
  getPatientSyncStatus;
17588
17963
  deletePatientSyncConnection;
@@ -17650,6 +18025,10 @@ var init_chunk_BQOKENBF = __esm({
17650
18025
  searchHubspotRecords;
17651
18026
  importHubspotMembers;
17652
18027
  getHubspotContactProperties;
18028
+ getHubspotDealProperties;
18029
+ getHubspotForms;
18030
+ getHubspotMeetingLinks;
18031
+ getHubspotObjectProperties;
17653
18032
  getHubspotManagedRules;
17654
18033
  getHubspotSyncLogs;
17655
18034
  getHubspotTransformPresets;
@@ -17662,7 +18041,23 @@ var init_chunk_BQOKENBF = __esm({
17662
18041
  getSyncRuns;
17663
18042
  getSyncRunItems;
17664
18043
  getMemberSyncSummary;
18044
+ getConnectionFieldHomes;
18045
+ getInboundRecordStatus;
18046
+ getConnectionWritePreview;
17665
18047
  clearConnectionMemberExclusion;
18048
+ linkUnlinkedMembersByIdentity;
18049
+ listSubsetImports;
18050
+ getSubsetImport;
18051
+ createSubsetImport;
18052
+ updateSubsetImport;
18053
+ deleteSubsetImport;
18054
+ previewSubsetImportSelection;
18055
+ previewSubsetImport;
18056
+ runSubsetImport;
18057
+ cancelSubsetImport;
18058
+ listSubsetImportRuns;
18059
+ listSubsetImportVendorLists;
18060
+ listSubsetImportFilterFields;
17666
18061
  // App Connections API
17667
18062
  listAvailableAppConnections;
17668
18063
  listAppConnections;
@@ -17799,6 +18194,7 @@ var init_chunk_BQOKENBF = __esm({
17799
18194
  apis.patientSyncConnections,
17800
18195
  apis.healthie,
17801
18196
  apis.documoFax,
18197
+ apis.claimMd,
17802
18198
  apis.salesforce,
17803
18199
  apis.hubspot,
17804
18200
  apis.appConnections,
@@ -17928,9 +18324,9 @@ var init_chunk_BQOKENBF = __esm({
17928
18324
  }
17929
18325
  });
17930
18326
 
17931
- // ../sdk/dist/chunk-HXVJF54M.js
17932
- var init_chunk_HXVJF54M = __esm({
17933
- "../sdk/dist/chunk-HXVJF54M.js"() {
18327
+ // ../sdk/dist/chunk-D5VNVTUQ.js
18328
+ var init_chunk_D5VNVTUQ = __esm({
18329
+ "../sdk/dist/chunk-D5VNVTUQ.js"() {
17934
18330
  }
17935
18331
  });
17936
18332
 
@@ -17985,8 +18381,8 @@ var init_chunk_6KPGCPGW = __esm({
17985
18381
  var SEARCHABLE_EVENT_RULE_SOURCE_FIELDS, ActivityEventType, EntityKind;
17986
18382
  var init_dist = __esm({
17987
18383
  "../sdk/dist/index.js"() {
17988
- init_chunk_BQOKENBF();
17989
- init_chunk_HXVJF54M();
18384
+ init_chunk_7ABBH5CC();
18385
+ init_chunk_D5VNVTUQ();
17990
18386
  init_chunk_6KPGCPGW();
17991
18387
  init_chunk_GCN4OMYU();
17992
18388
  SEARCHABLE_EVENT_RULE_SOURCE_FIELDS = [
@@ -18011,6 +18407,7 @@ var init_dist = __esm({
18011
18407
  importcompleted: "import.completed",
18012
18408
  assignmentstarted: "assignment.started",
18013
18409
  assignmentconcluded: "assignment.concluded",
18410
+ assignmenttask_entered: "assignment.task_entered",
18014
18411
  journeyenrolled: "journey.enrolled",
18015
18412
  journeyunenrolled: "journey.unenrolled",
18016
18413
  journeycompleted: "journey.completed",
@@ -18021,6 +18418,8 @@ var init_dist = __esm({
18021
18418
  chathuman_replied: "chat.human_replied",
18022
18419
  chatcall_ended: "chat.call_ended",
18023
18420
  chatsummary: "chat.summary",
18421
+ messagesent: "message.sent",
18422
+ membermessage_received: "member.message_received",
18024
18423
  escalationopened: "escalation.opened",
18025
18424
  escalationresolved: "escalation.resolved",
18026
18425
  callstarted: "call.started",
@@ -20570,6 +20969,28 @@ function findNearestGit(startDir) {
20570
20969
  dir = parent;
20571
20970
  }
20572
20971
  }
20972
+ function nativeWorktreePorts(envPath) {
20973
+ let content;
20974
+ try {
20975
+ content = readFileSync(envPath, "utf-8");
20976
+ } catch {
20977
+ return void 0;
20978
+ }
20979
+ const wanted = /* @__PURE__ */ new Set(["GR_PROVISIONED_RUNTIME", "API_NGINX_PORT", "FRONTEND_PORT"]);
20980
+ const values = /* @__PURE__ */ new Map();
20981
+ for (const line of content.split(/\r?\n/)) {
20982
+ const match = /^\s*([A-Z_][A-Z0-9_]*)=(.*)$/.exec(line);
20983
+ const key = match?.[1];
20984
+ const raw = match?.[2];
20985
+ if (key === void 0 || raw === void 0 || !wanted.has(key)) continue;
20986
+ values.set(key, raw.trim().replace(/^(['"])(.*)\1$/, "$2"));
20987
+ }
20988
+ if (values.get("GR_PROVISIONED_RUNTIME") !== "native") return void 0;
20989
+ const apiPort = parsePortToken(values.get("API_NGINX_PORT"));
20990
+ const frontendPort = parsePortToken(values.get("FRONTEND_PORT"));
20991
+ if (apiPort === void 0 || frontendPort === void 0) return void 0;
20992
+ return { envPath, ports: { apiPort, frontendPort } };
20993
+ }
20573
20994
  function unresolved(root, overridePath, reason) {
20574
20995
  return { kind: "unresolved-worktree", root, overridePath, reason };
20575
20996
  }
@@ -20588,7 +21009,17 @@ function classifyCheckout(startDir = process.cwd()) {
20588
21009
  return { kind: "non-worktree", root: git?.root };
20589
21010
  }
20590
21011
  const overridePath = join(git.root, OVERRIDE_FILENAME);
21012
+ const envPath = join(git.root, ENV_FILENAME);
20591
21013
  if (!existsSync(overridePath)) {
21014
+ const native = nativeWorktreePorts(envPath);
21015
+ if (native) {
21016
+ return {
21017
+ kind: "resolved-worktree",
21018
+ root: git.root,
21019
+ overridePath: native.envPath,
21020
+ ...native.ports
21021
+ };
21022
+ }
20592
21023
  return unresolved(
20593
21024
  git.root,
20594
21025
  overridePath,
@@ -20685,6 +21116,12 @@ function getEnvironmentConfig(env, options = {}) {
20685
21116
  frontendUrl: explicitFrontend || config.frontendUrl
20686
21117
  };
20687
21118
  }
21119
+ if (process.env.ENVIRONMENT === "dev-cloud") {
21120
+ return {
21121
+ apiUrl: explicitApi || DEV_CLOUD_POD_DEV.apiUrl,
21122
+ frontendUrl: explicitFrontend || DEV_CLOUD_POD_DEV.frontendUrl
21123
+ };
21124
+ }
20688
21125
  const checkout = classifyCheckout(options.startDir ?? process.cwd());
20689
21126
  if (checkout.kind === "non-worktree") {
20690
21127
  return {
@@ -20707,7 +21144,7 @@ function getEnvironmentConfig(env, options = {}) {
20707
21144
  }
20708
21145
  return { apiUrl: explicitApi, frontendUrl: explicitFrontend };
20709
21146
  }
20710
- var ENVIRONMENTS, CALLBACK_PORT, CALLBACK_PATH, REDIRECT_URI, API_CONTAINER_PORT, FRONTEND_CONTAINER_PORT, WORKTREE_SETUP_MARKER, OVERRIDE_FILENAME, OVERRIDE_SEQUENCE_TAG, COMPOSE_OVERRIDE_SCHEMA, WorktreeConfigError;
21147
+ var ENVIRONMENTS, DEV_CLOUD_POD_DEV, CALLBACK_PORT, CALLBACK_PATH, REDIRECT_URI, API_CONTAINER_PORT, FRONTEND_CONTAINER_PORT, WORKTREE_SETUP_MARKER, OVERRIDE_FILENAME, ENV_FILENAME, OVERRIDE_SEQUENCE_TAG, COMPOSE_OVERRIDE_SCHEMA, WorktreeConfigError;
20711
21148
  var init_config = __esm({
20712
21149
  "src/cli-utils/config.ts"() {
20713
21150
  init_js_yaml();
@@ -20725,6 +21162,10 @@ var init_config = __esm({
20725
21162
  frontendUrl: "https://app.gr-staging.com"
20726
21163
  }
20727
21164
  };
21165
+ DEV_CLOUD_POD_DEV = {
21166
+ apiUrl: "http://127.0.0.1:5050",
21167
+ frontendUrl: "http://127.0.0.1:3000"
21168
+ };
20728
21169
  CALLBACK_PORT = 31337;
20729
21170
  CALLBACK_PATH = "/oauth/callback";
20730
21171
  REDIRECT_URI = `http://localhost:${CALLBACK_PORT}${CALLBACK_PATH}`;
@@ -20732,6 +21173,7 @@ var init_config = __esm({
20732
21173
  FRONTEND_CONTAINER_PORT = 3e3;
20733
21174
  WORKTREE_SETUP_MARKER = "worktree-setup.sh";
20734
21175
  OVERRIDE_FILENAME = "docker-compose.override.yml";
21176
+ ENV_FILENAME = ".env";
20735
21177
  OVERRIDE_SEQUENCE_TAG = defineSequenceTag("!override", {
20736
21178
  create: () => [],
20737
21179
  addItem: (carrier, item) => {
@@ -22331,7 +22773,7 @@ var init_package = __esm({
22331
22773
  "package.json"() {
22332
22774
  package_default = {
22333
22775
  name: "@gravity-rail/cli",
22334
- version: "0.56.0",
22776
+ version: "0.57.0",
22335
22777
  description: "Gravity Rail CLI \u2014 manage workspaces from the command line",
22336
22778
  type: "module",
22337
22779
  bin: {
@@ -22396,10 +22838,11 @@ var init_package = __esm({
22396
22838
  };
22397
22839
  }
22398
22840
  });
22399
- var DEFAULT_PROFILE, CredentialsManager;
22841
+ var DEFAULT_PROFILE, LOOPBACK_HOSTNAMES, CredentialsManager;
22400
22842
  var init_credentials_manager = __esm({
22401
22843
  "src/cli-utils/credentials-manager.ts"() {
22402
22844
  DEFAULT_PROFILE = "default";
22845
+ LOOPBACK_HOSTNAMES = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "[::1]"]);
22403
22846
  CredentialsManager = class {
22404
22847
  cacheDir;
22405
22848
  apiUrl;
@@ -22496,7 +22939,7 @@ var init_credentials_manager = __esm({
22496
22939
  const url = new URL(this.apiUrl);
22497
22940
  const port = url.port;
22498
22941
  if (port && port !== "80" && port !== "443") {
22499
- const isCanonicalLocalDev = url.hostname === "localhost" && port === "5050" || url.hostname.endsWith("gravityrail.test") && port === "5054";
22942
+ const isCanonicalLocalDev = LOOPBACK_HOSTNAMES.has(url.hostname) && port === "5050" || url.hostname.endsWith("gravityrail.test") && port === "5054";
22500
22943
  if (!isCanonicalLocalDev) {
22501
22944
  return join(this.cacheDir, `credentials-${env}-${port}.json`);
22502
22945
  }
@@ -24564,7 +25007,7 @@ function commandNeedsJsonBody(cmd, parsedArgs) {
24564
25007
  }
24565
25008
  return false;
24566
25009
  }
24567
- if (cmd.acceptsJsonInput === true) {
25010
+ if (cmd.acceptsJsonInput === true || cmd.pipesJsonInput !== void 0) {
24568
25011
  return true;
24569
25012
  }
24570
25013
  if (parsedArgs.data !== void 0 || parsedArgs.file !== void 0) {
@@ -24585,7 +25028,19 @@ function commandNeedsJsonBody(cmd, parsedArgs) {
24585
25028
  }
24586
25029
  return false;
24587
25030
  }
24588
- async function readJsonInput(args) {
25031
+ var PIPED_INPUT_FIRST_BYTE_WAIT_MS = 6e4;
25032
+ function commandAwaitsPipedInput(cmd, parsedArgs) {
25033
+ if (parsedArgs.data !== void 0 || parsedArgs.file !== void 0) return false;
25034
+ const declared = cmd.pipesJsonInput;
25035
+ return typeof declared === "function" ? declared(parsedArgs) : declared === true;
25036
+ }
25037
+ async function readCommandJsonInput(cmd, parsedArgs) {
25038
+ if (!commandNeedsJsonBody(cmd, parsedArgs)) return void 0;
25039
+ return readJsonInput(parsedArgs, {
25040
+ pipedInputWaitMs: commandAwaitsPipedInput(cmd, parsedArgs) ? PIPED_INPUT_FIRST_BYTE_WAIT_MS : 0
25041
+ });
25042
+ }
25043
+ async function readJsonInput(args, options = {}) {
24589
25044
  const dataStr = args.data;
24590
25045
  const filePath = args.file;
24591
25046
  if (dataStr) {
@@ -24616,15 +25071,17 @@ async function readJsonInput(args) {
24616
25071
  if (process.stdin.isTTY === true) {
24617
25072
  return void 0;
24618
25073
  }
24619
- return readStdinIfPiped();
25074
+ return readStdinIfPiped(options.pipedInputWaitMs ?? 0);
24620
25075
  }
24621
- function readStdinIfPiped() {
25076
+ function readStdinIfPiped(firstByteWaitMs) {
24622
25077
  return new Promise((resolve3, reject) => {
24623
25078
  let data = "";
24624
25079
  let settled = false;
25080
+ let idleTimer;
24625
25081
  const finish2 = (value) => {
24626
25082
  if (settled) return;
24627
25083
  settled = true;
25084
+ if (idleTimer) clearTimeout(idleTimer);
24628
25085
  resolve3(value);
24629
25086
  };
24630
25087
  const flush = () => {
@@ -24653,6 +25110,15 @@ function readStdinIfPiped() {
24653
25110
  flush();
24654
25111
  return;
24655
25112
  }
25113
+ if (firstByteWaitMs > 0) {
25114
+ idleTimer = setTimeout(() => {
25115
+ if (!data) {
25116
+ process.stdin.pause();
25117
+ finish2(void 0);
25118
+ }
25119
+ }, firstByteWaitMs);
25120
+ return;
25121
+ }
24656
25122
  finish2(void 0);
24657
25123
  });
24658
25124
  });
@@ -25420,9 +25886,9 @@ Optional
25420
25886
  systemPrompt (string) Base instructions / identity
25421
25887
  chatModelConfig (object|null) Chat model overrides (temperature, thinking, \u2026)
25422
25888
  realtimeModelId (string|null) Voice/realtime model (see \`gr ai-models realtime\`)
25423
- e.g. "xai:realtime:voice-agent-2" (Grok Voice Think Fast 2)
25424
- or opt in to "xai:realtime:voice-agent-3" (Grok Voice
25425
- 3.0; not yet cleared for strict-routing workflows)
25889
+ e.g. "xai:realtime:voice-agent-3" (Grok Voice 3, the
25890
+ default; not yet cleared for strict-routing workflows).
25891
+ "xai:realtime:voice-agent-2" is deprecated.
25426
25892
  Native models auto-fill tts=native + default voice when
25427
25893
  realtimeModelConfig is omitted.
25428
25894
  realtimeModelConfig (object|null) Realtime config. Native example:
@@ -25440,11 +25906,7 @@ Attach an agent\u2019s models/identity to a workflow (draft), then publish:
25440
25906
  gr workflows update --id <wf> -d '{"copyFromAgentId": <agentId>}'
25441
25907
  gr workflows publish --workflow-id <wf>
25442
25908
 
25443
- One-shot workflow voice WITHOUT creating an agent (preferred for "use Grok Voice 2"):
25444
- gr workflows update --id <wf> -d '{"realtimeModelId":"xai:realtime:voice-agent-2"}'
25445
- gr workflows publish --workflow-id <wf>
25446
-
25447
- Opt a workflow into Grok Voice 3.0 (same xAI voices as 2.0; not the default):
25909
+ One-shot workflow voice WITHOUT creating an agent (preferred for "use Grok Voice 3"):
25448
25910
  gr workflows update --id <wf> -d '{"realtimeModelId":"xai:realtime:voice-agent-3"}'
25449
25911
  gr workflows publish --workflow-id <wf>
25450
25912
 
@@ -25472,11 +25934,10 @@ ${AGENT_FIELD_REFERENCE}`,
25472
25934
  updateHelp: `Update an agent. All fields optional.
25473
25935
  ${AGENT_FIELD_REFERENCE}`,
25474
25936
  createExamples: [
25475
- `gr agents create -d '{"name":"Support","chatModelId":"openai:chat:gpt-6-luna","realtimeModelId":"xai:realtime:voice-agent-2"}'`,
25937
+ `gr agents create -d '{"name":"Support","chatModelId":"openai:chat:gpt-6-luna","realtimeModelId":"xai:realtime:voice-agent-3"}'`,
25476
25938
  "gr agents create --file agent.json"
25477
25939
  ],
25478
25940
  updateExamples: [
25479
- `gr agents update --id 42 -d '{"realtimeModelId":"xai:realtime:voice-agent-2"}'`,
25480
25941
  `gr agents update --id 42 -d '{"realtimeModelId":"xai:realtime:voice-agent-3"}'`,
25481
25942
  "gr agents update --id 42 --file agent.json"
25482
25943
  ]
@@ -27355,23 +27816,24 @@ Assistant / models (live on the DRAFT revision \u2014 publish to go live)
27355
27816
  chatModelId (string) Text chat model (see \`gr ai-models chat\`)
27356
27817
  chatModelConfig (object|null) Chat model overrides
27357
27818
  realtimeModelId (string|null) Voice/realtime model (see \`gr ai-models realtime\`)
27358
- create: omit \u2192 xai:realtime:voice-agent-2 with
27359
- voice xai:voice:cosmo; null = voice off
27819
+ create: omit \u2192 xai:realtime:voice-agent-3 with
27820
+ voice xai:voice:cosmo; null = voice off.
27821
+ routingMode "strict": omit \u2192 no voice (use
27822
+ custom:realtime:composable)
27360
27823
  update: null = voice off
27361
27824
  One-shot switch (keeps the stored voice and
27362
27825
  call settings; resets only a voice the new
27363
27826
  model cannot use):
27364
- {"realtimeModelId":"xai:realtime:voice-agent-2"}
27365
- Opt in to Grok Voice 3.0 (not the default; not yet
27366
- cleared for routingMode "strict"; same xAI voices):
27367
27827
  {"realtimeModelId":"xai:realtime:voice-agent-3"}
27828
+ Grok Voice 3 is not yet cleared for routingMode
27829
+ "strict". voice-agent-2 is deprecated.
27368
27830
  On create, a native model id with no stored or
27369
27831
  copied config gets tts=native + that
27370
27832
  provider's fallback voice. A composable id
27371
27833
  still needs its own config. On update,
27372
27834
  omitting the config keeps the stored one.
27373
27835
  Explicit config replaces it:
27374
- {"realtimeModelId":"xai:realtime:voice-agent-2",
27836
+ {"realtimeModelId":"xai:realtime:voice-agent-3",
27375
27837
  "realtimeModelConfig":{"ttsModel":"native",
27376
27838
  "voiceModel":"xai:voice:ara"}}
27377
27839
  realtimeModelConfig (object|null) Realtime config. Omit on update to keep the
@@ -32584,7 +33046,7 @@ var bundlesDomain = {
32584
33046
  },
32585
33047
  {
32586
33048
  path: ["bundles", "draft", "set"],
32587
- description: 'Replace draft items from {"items": [...]}; an optional "links": [{"label", "url"}] replaces the draft links. Use --expected-generation from draft get to protect edits.',
33049
+ description: 'Replace draft items from {"items": [...]}. Journey items require {"key", "kind":"journey", "journeyUuid"}; the server captures the source Journey. An optional "links": [{"label", "url"}] replaces the draft links. Use --expected-generation from draft get to protect edits.',
32588
33050
  requiresWorkspace: true,
32589
33051
  mutates: true,
32590
33052
  args: [BUNDLE_ARG, GENERATION_ARG],
@@ -33966,9 +34428,9 @@ var REALTIME_AUDIO_USD_PER_MIN = {
33966
34428
  "xai:realtime:voice-agent": 0.05,
33967
34429
  // Grok Voice Think Fast 1
33968
34430
  "xai:realtime:voice-agent-2": 0.08,
33969
- // Grok Voice Think Fast 2 (pinned grok-voice-2.0)
34431
+ // Grok Voice 2 (pinned grok-voice-2.0)
33970
34432
  "xai:realtime:voice-agent-3": 0.08
33971
- // Grok Voice 3.0 — same audio rate as 2.0
34433
+ // Grok Voice 3 — same audio rate as 2.0
33972
34434
  };
33973
34435
  var DEFAULT_REALTIME_AUDIO_USD_PER_MIN = 0.08;
33974
34436
  var EST_AUDIO_MIN_PER_RUN = 3;
@@ -34047,6 +34509,10 @@ function runToBatchRow(job, workflowId, run, error, batchLabel, pinnedRevisionId
34047
34509
  ...job.realtime ? { realtime_model_id: job.modelId } : {},
34048
34510
  ...batchLabel ? { batch_label: batchLabel } : {},
34049
34511
  run_id: run?.id,
34512
+ lane: run?.lane ?? null,
34513
+ outcome: run?.outcome ?? null,
34514
+ assistant_chat_model_id: run?.assistantChatModelId ?? null,
34515
+ assistant_realtime_model_id: run?.assistantRealtimeModelId ?? null,
34050
34516
  error,
34051
34517
  failure_reason: run?.failureReason ?? null,
34052
34518
  passed: run?.passed ?? null,
@@ -34341,7 +34807,15 @@ var SCENARIO_COLUMNS = [
34341
34807
  COL.id(),
34342
34808
  COL.name(),
34343
34809
  { header: "PERSONA", getValue: (item) => item.personaName ?? "" },
34344
- { header: "CHANNEL", getValue: (item) => item.channel ?? "" }
34810
+ { header: "CHANNEL", getValue: (item) => item.channel ?? "" },
34811
+ {
34812
+ header: "SEED",
34813
+ getValue: (item) => {
34814
+ const turns = Array.isArray(item.seedTurns) ? item.seedTurns.length : 0;
34815
+ if (turns === 0) return "";
34816
+ return item.singleTurn ? `${turns} turns, single-turn` : `${turns} turns`;
34817
+ }
34818
+ }
34345
34819
  ];
34346
34820
  var RUN_COLUMNS = [
34347
34821
  COL.id(),
@@ -34433,7 +34907,7 @@ var qualificationsDomain = {
34433
34907
  },
34434
34908
  {
34435
34909
  path: ["qualifications", "scenarios", "create"],
34436
- description: "Create a scenario on a qualification (pass JSON via --data)",
34910
+ description: 'Create a scenario on a qualification (pass JSON via --data). Seed history: "seedTurns": [{"speaker": "member"|"agent", "content": "..."}]; "singleTurn": true grades only the Agent reply to the last seeded member turn',
34437
34911
  mutates: true,
34438
34912
  requiresWorkspace: true,
34439
34913
  args: [{ name: "qualification-id", description: "Qualification ID", required: true }],
@@ -34448,7 +34922,7 @@ var qualificationsDomain = {
34448
34922
  },
34449
34923
  {
34450
34924
  path: ["qualifications", "scenarios", "update"],
34451
- description: "Update a scenario (pass JSON via --data)",
34925
+ description: 'Update a scenario (pass JSON via --data). "seedTurns": [] clears the seed history; "singleTurn" needs seed turns that end on a member turn',
34452
34926
  mutates: true,
34453
34927
  requiresWorkspace: true,
34454
34928
  args: [{ name: "id", description: "Scenario ID", required: true }],
@@ -37151,7 +37625,7 @@ var COLUMNS15 = [
37151
37625
  ];
37152
37626
  var aiModelsDomain = {
37153
37627
  name: "ai-models",
37154
- description: `List available AI models (chat, realtime/voice stacks, speaker voices). Use realtime ids as workflow/agent realtimeModelId; voice ids go in realtimeModelConfig.voiceModel. One-shot workflow voice: gr workflows update -d '{"realtimeModelId":"xai:realtime:voice-agent-2"}' then publish.`,
37628
+ description: `List available AI models (chat, realtime/voice stacks, speaker voices). Use realtime ids as workflow/agent realtimeModelId; voice ids go in realtimeModelConfig.voiceModel. One-shot workflow voice: gr workflows update -d '{"realtimeModelId":"xai:realtime:voice-agent-3"}' then publish.`,
37155
37629
  commands: [
37156
37630
  {
37157
37631
  path: ["ai-models", "list"],
@@ -37173,7 +37647,7 @@ var aiModelsDomain = {
37173
37647
  },
37174
37648
  {
37175
37649
  path: ["ai-models", "realtime"],
37176
- description: "List realtime/voice stacks (use as realtimeModelId). e.g. xai:realtime:voice-agent-2 = Grok Voice Think Fast 2 (default); xai:realtime:voice-agent-3 = Grok Voice 3.0 (explicit opt-in)",
37650
+ description: "List realtime/voice stacks (use as realtimeModelId). e.g. xai:realtime:voice-agent-3 = Grok Voice 3 (default). Deprecated models (xai:realtime:voice-agent-2) are not listed.",
37177
37651
  requiresWorkspace: false,
37178
37652
  handler: async ({ ctx }) => {
37179
37653
  const result2 = await requireAuth(ctx).apiClient.getRealtimeModels();
@@ -38492,7 +38966,9 @@ var memberMemoriesDomain = {
38492
38966
  { name: "key", description: "Memory key", required: true },
38493
38967
  {
38494
38968
  name: "type",
38495
- description: "Memory type (basic, preferences, semantic, summaries, episodic)"
38969
+ // The API refuses preferences and semantic deletes (a Member cannot
38970
+ // be shown to own those AgentCore records), so they are not offered.
38971
+ description: "Memory type (basic, summaries, episodic)"
38496
38972
  }
38497
38973
  ],
38498
38974
  handler: async ({ ctx, workspace, args }) => {
@@ -42275,6 +42751,92 @@ async function streamSyncRun(response, verbose) {
42275
42751
  console.log(JSON.stringify(lastRun, null, 2));
42276
42752
  }
42277
42753
  }
42754
+ var SYNC_RUN_OPTION_ARGS = [
42755
+ { name: "dry-run", description: "Test sync without making changes", isFlag: true },
42756
+ {
42757
+ name: "full-resync",
42758
+ description: "Clear checkpoints and re-sync all records",
42759
+ isFlag: true
42760
+ },
42761
+ { name: "quiet", description: "Only output final result JSON", isFlag: true },
42762
+ { name: "entity-type", description: "Scope to entity type: member or record" },
42763
+ {
42764
+ name: "board-id",
42765
+ description: "Scope to a single board mapping (requires --entity-type)"
42766
+ },
42767
+ {
42768
+ name: "record-limit",
42769
+ description: "Cap the run to a preview sample (1..200). Requires --dry-run and --entity-type."
42770
+ }
42771
+ ];
42772
+ var VALID_ENTITY_TYPES = ["member", "record"];
42773
+ function parseSyncRunOptions(args) {
42774
+ const dryRun = args["dry-run"] === true;
42775
+ const fullResync = args["full-resync"] === true;
42776
+ const quiet = args["quiet"] === true;
42777
+ const rawEntityType = args["entity-type"];
42778
+ let entityType;
42779
+ if (rawEntityType) {
42780
+ if (!VALID_ENTITY_TYPES.includes(rawEntityType)) {
42781
+ throw new CLIError(
42782
+ `Invalid --entity-type "${rawEntityType}". Allowed values: ${VALID_ENTITY_TYPES.join(", ")}`
42783
+ );
42784
+ }
42785
+ entityType = rawEntityType;
42786
+ }
42787
+ const boardId = args["board-id"];
42788
+ const rawRecordLimit = args["record-limit"];
42789
+ let recordLimit;
42790
+ if (rawRecordLimit !== void 0 && rawRecordLimit !== "") {
42791
+ const parsed = Number(rawRecordLimit);
42792
+ if (!Number.isInteger(parsed) || parsed < 1 || parsed > 200) {
42793
+ throw new CLIError(
42794
+ `Invalid --record-limit "${rawRecordLimit}". Must be an integer between 1 and 200.`
42795
+ );
42796
+ }
42797
+ if (!dryRun) {
42798
+ throw new CLIError("--record-limit requires --dry-run: capped runs are preview-only.");
42799
+ }
42800
+ if (entityType === void 0) {
42801
+ throw new CLIError(
42802
+ "--record-limit requires --entity-type: capped previews must target a single entity type."
42803
+ );
42804
+ }
42805
+ recordLimit = parsed;
42806
+ }
42807
+ if (fullResync && (dryRun || recordLimit !== void 0)) {
42808
+ throw new CLIError(
42809
+ "--full-resync is incompatible with --dry-run / --record-limit: checkpoint reset must happen on a non-preview run."
42810
+ );
42811
+ }
42812
+ return { dryRun, fullResync, quiet, entityType, boardId, recordLimit };
42813
+ }
42814
+ async function runSyncAndStream(ctx, workspace, connectionId, options) {
42815
+ const { dryRun, fullResync, quiet, entityType, boardId, recordLimit } = options;
42816
+ if (!quiet) {
42817
+ const flags = [
42818
+ dryRun && "(dry run)",
42819
+ fullResync && "(full re-sync)",
42820
+ entityType && `(${entityType} only)`,
42821
+ boardId && `(board ${boardId})`,
42822
+ recordLimit !== void 0 && `(limit ${recordLimit})`
42823
+ ].filter(Boolean).join(" ");
42824
+ console.error(`Starting sync for connection ${connectionId}${flags ? ` ${flags}` : ""}...`);
42825
+ }
42826
+ const response = await requireAuth(ctx).apiClient.startSyncRun(workspace, connectionId, {
42827
+ dryRun,
42828
+ resetCheckpoints: fullResync,
42829
+ entityType,
42830
+ boardId,
42831
+ recordLimit
42832
+ });
42833
+ if (!response.ok) {
42834
+ const text = await response.text();
42835
+ console.error(`Sync failed: ${response.status} ${text}`);
42836
+ process.exit(1);
42837
+ }
42838
+ await streamSyncRun(response, !quiet);
42839
+ }
42278
42840
  var syncDomain = {
42279
42841
  name: "sync",
42280
42842
  description: "Run and monitor connection syncs",
@@ -42284,22 +42846,7 @@ var syncDomain = {
42284
42846
  description: "Start a sync run and stream progress (SSE)",
42285
42847
  args: [
42286
42848
  { name: "connection-id", description: "Connection ID", required: true },
42287
- { name: "dry-run", description: "Test sync without making changes", isFlag: true },
42288
- {
42289
- name: "full-resync",
42290
- description: "Clear checkpoints and re-sync all records",
42291
- isFlag: true
42292
- },
42293
- { name: "quiet", description: "Only output final result JSON", isFlag: true },
42294
- { name: "entity-type", description: "Scope to entity type: member or record" },
42295
- {
42296
- name: "board-id",
42297
- description: "Scope to a single board mapping (requires --entity-type)"
42298
- },
42299
- {
42300
- name: "record-limit",
42301
- description: "Cap the run to a preview sample (1..200). Requires --dry-run and --entity-type."
42302
- }
42849
+ ...SYNC_RUN_OPTION_ARGS
42303
42850
  ],
42304
42851
  examples: [
42305
42852
  "sync run --connection-id 6",
@@ -42313,76 +42860,7 @@ var syncDomain = {
42313
42860
  mutates: true,
42314
42861
  handler: async ({ ctx, args, workspace }) => {
42315
42862
  const connectionId = requireNumber(args, "connection-id");
42316
- const dryRun = args["dry-run"] === true;
42317
- const fullResync = args["full-resync"] === true;
42318
- const quiet = args["quiet"] === true;
42319
- const VALID_ENTITY_TYPES = ["member", "record"];
42320
- const rawEntityType = args["entity-type"];
42321
- let entityType;
42322
- if (rawEntityType) {
42323
- if (!VALID_ENTITY_TYPES.includes(rawEntityType)) {
42324
- throw new CLIError(
42325
- `Invalid --entity-type "${rawEntityType}". Allowed values: ${VALID_ENTITY_TYPES.join(", ")}`
42326
- );
42327
- }
42328
- entityType = rawEntityType;
42329
- }
42330
- const boardId = args["board-id"];
42331
- const rawRecordLimit = args["record-limit"];
42332
- let recordLimit;
42333
- if (rawRecordLimit !== void 0 && rawRecordLimit !== "") {
42334
- const parsed = Number(rawRecordLimit);
42335
- if (!Number.isInteger(parsed) || parsed < 1 || parsed > 200) {
42336
- throw new CLIError(
42337
- `Invalid --record-limit "${rawRecordLimit}". Must be an integer between 1 and 200.`
42338
- );
42339
- }
42340
- if (!dryRun) {
42341
- throw new CLIError(
42342
- "--record-limit requires --dry-run: capped runs are preview-only."
42343
- );
42344
- }
42345
- if (entityType === void 0) {
42346
- throw new CLIError(
42347
- "--record-limit requires --entity-type: capped previews must target a single entity type."
42348
- );
42349
- }
42350
- recordLimit = parsed;
42351
- }
42352
- if (fullResync && (dryRun || recordLimit !== void 0)) {
42353
- throw new CLIError(
42354
- "--full-resync is incompatible with --dry-run / --record-limit: checkpoint reset must happen on a non-preview run."
42355
- );
42356
- }
42357
- if (!quiet) {
42358
- const flags = [
42359
- dryRun && "(dry run)",
42360
- fullResync && "(full re-sync)",
42361
- entityType && `(${entityType} only)`,
42362
- boardId && `(board ${boardId})`,
42363
- recordLimit !== void 0 && `(limit ${recordLimit})`
42364
- ].filter(Boolean).join(" ");
42365
- console.error(
42366
- `Starting sync for connection ${connectionId}${flags ? ` ${flags}` : ""}...`
42367
- );
42368
- }
42369
- const response = await requireAuth(ctx).apiClient.startSyncRun(
42370
- workspace,
42371
- connectionId,
42372
- {
42373
- dryRun,
42374
- resetCheckpoints: fullResync,
42375
- entityType,
42376
- boardId,
42377
- recordLimit
42378
- }
42379
- );
42380
- if (!response.ok) {
42381
- const text = await response.text();
42382
- console.error(`Sync failed: ${response.status} ${text}`);
42383
- process.exit(1);
42384
- }
42385
- await streamSyncRun(response, !quiet);
42863
+ await runSyncAndStream(ctx, workspace, connectionId, parseSyncRunOptions(args));
42386
42864
  }
42387
42865
  },
42388
42866
  {
@@ -43154,71 +43632,6 @@ var ENCOUNTER_RUN_COLUMNS = [
43154
43632
  getValue: (item) => summarizeReasons(item.attribution?.collections, "errorReasonCounts")
43155
43633
  }
43156
43634
  ];
43157
- var ONBOARDING_START_COLUMNS = [
43158
- { header: "MODE", getValue: (item) => item.mode ?? "" },
43159
- { header: "WORKFLOW ID", getValue: (item) => item.workflowId ?? "" },
43160
- { header: "RUN ID", getValue: (item) => item.runId ?? "" }
43161
- ];
43162
- var ONBOARDING_PAIR_COLUMNS = [
43163
- { header: "DEPARTMENT", getValue: (item) => String(item.departmentId ?? "") },
43164
- { header: "PATIENT STATUS", getValue: (item) => item.patientStatus ?? "" },
43165
- { header: "STATUS", getValue: (item) => item.status ?? "" },
43166
- { header: "STOP REASON", getValue: (item) => item.stopReason ?? "" },
43167
- { header: "GEN", getValue: (item) => String(item.generation ?? "") },
43168
- { header: "NEXT OFFSET", getValue: (item) => String(item.nextOffset ?? "") },
43169
- { header: "PAGES (RUN)", getValue: (item) => String(item.pagesDone ?? 0) },
43170
- { header: "~FETCHED", getValue: (item) => String(item.totals?.fetched ?? 0) },
43171
- { header: "~APPLIED", getValue: (item) => String(item.totals?.applied ?? 0) },
43172
- { header: "~SKIPPED", getValue: (item) => String(item.totals?.skipped ?? 0) },
43173
- { header: "~FAILED", getValue: (item) => String(item.totals?.failed ?? 0) },
43174
- { header: "RUN ID", getValue: (item) => item.runId ?? "" }
43175
- ];
43176
- var RESUMABLE_PAIR_STATUSES = /* @__PURE__ */ new Set([
43177
- "failed",
43178
- "aborted",
43179
- "truncated",
43180
- "pending",
43181
- "running",
43182
- "waiting"
43183
- ]);
43184
- function onboardingStatusLines(status, connectionId) {
43185
- const lines = [];
43186
- const execution = status.execution;
43187
- if (execution) {
43188
- const failure = execution.failureCode ? ` (failure: ${execution.failureCode})` : "";
43189
- lines.push(
43190
- `Temporal execution: ${execution.workflowId} run ${execution.runId ?? "-"} \u2014 ${execution.status}${failure}`
43191
- );
43192
- } else {
43193
- lines.push("Temporal execution: none recorded");
43194
- }
43195
- if (status.waitingUntil) {
43196
- lines.push(
43197
- `Waiting for the operator window (21:00\u201308:00 America/New_York) until ${status.waitingUntil}`
43198
- );
43199
- }
43200
- if (status.preview) {
43201
- const previewPairs = status.preview.pairs ?? [];
43202
- const admitted = previewPairs.reduce((n, p) => n + (p.totals?.admitted ?? 0), 0);
43203
- const notAdmitted = previewPairs.reduce(
43204
- (n, p) => n + (p.totals?.notAdmitted ?? 0),
43205
- 0
43206
- );
43207
- lines.push(
43208
- `Latest preview: ${previewPairs.length} pair(s), ~${admitted} admission-eligible (incl. already-linked), ~${notAdmitted} not admitted (read-only)`
43209
- );
43210
- }
43211
- lines.push("Counts are approximate.");
43212
- const unfinished = (status.pairs ?? []).some(
43213
- (p) => p.inCurrentCohort && RESUMABLE_PAIR_STATUSES.has(p.status) && p.runId
43214
- );
43215
- if (unfinished && execution?.status !== "running") {
43216
- lines.push(
43217
- `Unfinished pairs continue only on an explicit resume: gr fhir-connections onboarding-import start --id ${connectionId} --resume --allow-write`
43218
- );
43219
- }
43220
- return lines;
43221
- }
43222
43635
  var fhirConnectionsDomain = {
43223
43636
  name: "fhir-connections",
43224
43637
  description: "Manage FHIR connections",
@@ -43276,77 +43689,6 @@ var fhirConnectionsDomain = {
43276
43689
  );
43277
43690
  outputData(runs, ctx, ENCOUNTER_RUN_COLUMNS);
43278
43691
  }
43279
- },
43280
- {
43281
- // athenahealth onboarding import (PR-C): one explicit, audited
43282
- // operator execution per connection, at most 50 pages per pair per
43283
- // run. Thin over the SDK; the server decides everything.
43284
- path: ["fhir-connections", "onboarding-import", "start"],
43285
- description: "Start an athenahealth onboarding import (or --resume / --override / --dry-run preview)",
43286
- requiresWorkspace: true,
43287
- mutates: true,
43288
- args: [
43289
- { name: "id", description: "FHIR connection ID", required: true },
43290
- {
43291
- name: "dry-run",
43292
- description: "Preview: read and classify admission only, write no Members",
43293
- isFlag: true
43294
- },
43295
- {
43296
- name: "resume",
43297
- description: "Continue unfinished (failed, truncated, aborted) pairs at their stored frontier",
43298
- isFlag: true
43299
- },
43300
- {
43301
- name: "override",
43302
- description: "Rescan completed pairs from offset 0 under a new generation",
43303
- isFlag: true
43304
- }
43305
- ],
43306
- examples: [
43307
- "fhir-connections onboarding-import start --id 12 --dry-run --allow-write",
43308
- "fhir-connections onboarding-import start --id 12 --allow-write",
43309
- "fhir-connections onboarding-import start --id 12 --resume --allow-write"
43310
- ],
43311
- handler: async ({ ctx, workspace, args }) => {
43312
- const connectionId = requireNumber(args, "id");
43313
- const started = await requireAuth(ctx).apiClient.fhirStartOnboardingImport(
43314
- workspace,
43315
- connectionId,
43316
- {
43317
- dryRun: args["dry-run"] === true,
43318
- resume: args["resume"] === true,
43319
- override: args["override"] === true
43320
- }
43321
- );
43322
- outputSingle(started, ctx, ONBOARDING_START_COLUMNS);
43323
- hint(ctx, [
43324
- `Started. Follow progress with: gr fhir-connections onboarding-import status --id ${connectionId}`
43325
- ]);
43326
- }
43327
- },
43328
- {
43329
- path: ["fhir-connections", "onboarding-import", "status"],
43330
- description: "Show athenahealth onboarding-import progress and its Temporal execution (read-only)",
43331
- requiresWorkspace: true,
43332
- args: [{ name: "id", description: "FHIR connection ID", required: true }],
43333
- examples: [
43334
- "fhir-connections onboarding-import status --id 12",
43335
- "fhir-connections onboarding-import status --id 12 --output-format json"
43336
- ],
43337
- handler: async ({ ctx, workspace, args }) => {
43338
- const connectionId = requireNumber(args, "id");
43339
- const status = await requireAuth(ctx).apiClient.fhirGetOnboardingImportStatus(
43340
- workspace,
43341
- connectionId
43342
- );
43343
- if (ctx.jq || (ctx.outputFormat ?? "table") !== "table") {
43344
- outputSingle(status, ctx);
43345
- return;
43346
- }
43347
- outputData(status.pairs, ctx, ONBOARDING_PAIR_COLUMNS);
43348
- hint(ctx, onboardingStatusLines(status, connectionId));
43349
- }
43350
43692
  }
43351
43693
  ]
43352
43694
  };
@@ -43683,6 +44025,316 @@ init_errors();
43683
44025
  init_output();
43684
44026
  init_pagination();
43685
44027
  init_context();
44028
+
44029
+ // src/domains/integrations/connection-commands.ts
44030
+ init_errors();
44031
+ init_output();
44032
+ init_context();
44033
+ var POLL_INTERVAL_MIN_MINUTES = 15;
44034
+ var POLL_INTERVAL_MAX_MINUTES = 1440;
44035
+ function connectionIdArg(target) {
44036
+ return {
44037
+ name: "connection-id",
44038
+ description: `Connection ID (default: the workspace's ${target.label} connection)`
44039
+ };
44040
+ }
44041
+ async function resolveConnectionId(ctx, workspace, target, args) {
44042
+ const explicit = optionalNumber(args, "connection-id");
44043
+ if (explicit !== void 0) return explicit;
44044
+ const connections = await requireAuth(ctx).apiClient.listAppConnections(workspace);
44045
+ const matches = connections.filter((c) => c.connectionType === target.connectionType);
44046
+ if (matches.length === 0) {
44047
+ throw new CLIError(
44048
+ `No ${target.label} connection in this workspace. Run: gr ${target.command} install`
44049
+ );
44050
+ }
44051
+ if (matches.length > 1) {
44052
+ const ids = matches.map((c) => c.id).join(", ");
44053
+ throw new CLIError(
44054
+ `This workspace has ${matches.length} ${target.label} connections (${ids}). Pass --connection-id.`
44055
+ );
44056
+ }
44057
+ return matches[0].id;
44058
+ }
44059
+ function parsePollInterval(raw) {
44060
+ const minutes = Number(raw);
44061
+ if (!Number.isInteger(minutes) || minutes < POLL_INTERVAL_MIN_MINUTES || minutes > POLL_INTERVAL_MAX_MINUTES) {
44062
+ throw new CLIError(
44063
+ `Invalid --poll-interval "${String(raw)}". Must be a whole number of minutes between ${POLL_INTERVAL_MIN_MINUTES} and ${POLL_INTERVAL_MAX_MINUTES}.`
44064
+ );
44065
+ }
44066
+ return minutes;
44067
+ }
44068
+ function connectionCommands(target) {
44069
+ const c = target.command;
44070
+ const connectionId = connectionIdArg(target);
44071
+ return [
44072
+ {
44073
+ path: [c, "sync-config", "get"],
44074
+ description: `Get the ${target.label} sync configuration`,
44075
+ requiresWorkspace: true,
44076
+ args: [connectionId],
44077
+ handler: async ({ ctx, workspace, args }) => {
44078
+ const id = await resolveConnectionId(ctx, workspace, target, args);
44079
+ const result2 = await requireAuth(ctx).apiClient.getConnectionSyncConfig(workspace, id);
44080
+ outputSingle(result2, ctx);
44081
+ }
44082
+ },
44083
+ {
44084
+ path: [c, "sync-config", "set"],
44085
+ // `sync-config get -o json | … | sync-config set` pipes the whole
44086
+ // configuration; with --poll-interval alone there is no body to wait for.
44087
+ pipesJsonInput: (args) => args["poll-interval"] === void 0,
44088
+ description: `Replace the ${target.label} sync configuration (--data), or change one setting of the saved configuration (--poll-interval)`,
44089
+ mutates: true,
44090
+ requiresWorkspace: true,
44091
+ args: [
44092
+ connectionId,
44093
+ {
44094
+ name: "poll-interval",
44095
+ description: `Inbound poll cadence in minutes (${POLL_INTERVAL_MIN_MINUTES}..${POLL_INTERVAL_MAX_MINUTES}). Without --data, updates the saved configuration.`
44096
+ }
44097
+ ],
44098
+ examples: [
44099
+ `gr ${c} sync-config get -w <ws> -o json > sync-config.json`,
44100
+ `gr ${c} sync-config set -w <ws> --allow-write --file sync-config.json`,
44101
+ `gr ${c} sync-config set -w <ws> --allow-write --poll-interval 60`
44102
+ ],
44103
+ handler: async ({ ctx, workspace, args, data }) => {
44104
+ const rawInterval = args["poll-interval"];
44105
+ const hasInterval = rawInterval !== void 0 && rawInterval !== "";
44106
+ if (!data && !hasInterval) {
44107
+ throw new CLIError(
44108
+ "Pass the configuration (--data, --file, or stdin) or --poll-interval"
44109
+ );
44110
+ }
44111
+ if (data !== void 0 && (typeof data !== "object" || data === null || Array.isArray(data) || Object.keys(data).length === 0)) {
44112
+ throw new CLIError(
44113
+ "The configuration must be a non-empty JSON object (start from `sync-config get -o json`)"
44114
+ );
44115
+ }
44116
+ const minutes = hasInterval ? parsePollInterval(rawInterval) : void 0;
44117
+ const api = requireAuth(ctx).apiClient;
44118
+ const id = await resolveConnectionId(ctx, workspace, target, args);
44119
+ const base = data ?? await api.getConnectionSyncConfig(workspace, id);
44120
+ const config = minutes === void 0 ? base : { ...base, inboundPollIntervalMinutes: minutes };
44121
+ const result2 = await api.updateConnectionSyncConfig(workspace, id, config);
44122
+ outputSingle(result2, ctx);
44123
+ }
44124
+ },
44125
+ {
44126
+ path: [c, "sync", "capabilities"],
44127
+ description: `What the ${target.label} sync engine supports (entities, directions, modes)`,
44128
+ requiresWorkspace: true,
44129
+ args: [connectionId],
44130
+ handler: async ({ ctx, workspace, args }) => {
44131
+ const id = await resolveConnectionId(ctx, workspace, target, args);
44132
+ const result2 = await requireAuth(ctx).apiClient.getConnectionSyncCapabilities(
44133
+ workspace,
44134
+ id
44135
+ );
44136
+ outputSingle(result2, ctx);
44137
+ }
44138
+ },
44139
+ {
44140
+ path: [c, "sync", "run"],
44141
+ description: `Start a ${target.label} sync run and stream its progress`,
44142
+ mutates: true,
44143
+ requiresWorkspace: true,
44144
+ args: [connectionId, ...SYNC_RUN_OPTION_ARGS],
44145
+ examples: [
44146
+ `gr ${c} sync run -w <ws> --allow-write --dry-run --entity-type member --record-limit 5`,
44147
+ `gr ${c} sync run -w <ws> --allow-write`,
44148
+ `gr ${c} sync run -w <ws> --allow-write --full-resync --quiet`
44149
+ ],
44150
+ handler: async ({ ctx, workspace, args }) => {
44151
+ const options = parseSyncRunOptions(args);
44152
+ const id = await resolveConnectionId(ctx, workspace, target, args);
44153
+ await runSyncAndStream(ctx, workspace, id, options);
44154
+ }
44155
+ },
44156
+ {
44157
+ path: [c, "sync", "runs"],
44158
+ description: `List recent ${target.label} sync runs`,
44159
+ requiresWorkspace: true,
44160
+ args: [connectionId, { name: "limit", description: "Max runs to return (default 20)" }],
44161
+ handler: async ({ ctx, workspace, args }) => {
44162
+ const id = await resolveConnectionId(ctx, workspace, target, args);
44163
+ const runs = await requireAuth(ctx).apiClient.getSyncRuns(
44164
+ workspace,
44165
+ id,
44166
+ optionalNumber(args, "limit") ?? 20
44167
+ );
44168
+ outputData(runs, ctx, RUN_COLUMNS2);
44169
+ }
44170
+ },
44171
+ {
44172
+ path: [c, "sync", "run-items"],
44173
+ description: `List the items of one ${target.label} sync run`,
44174
+ requiresWorkspace: true,
44175
+ args: [
44176
+ connectionId,
44177
+ { name: "run-id", description: "Run ID (from sync runs)", required: true },
44178
+ { name: "limit", description: "Max items to return (default 500)" }
44179
+ ],
44180
+ handler: async ({ ctx, workspace, args }) => {
44181
+ const runId = requireString(args, "run-id");
44182
+ const id = await resolveConnectionId(ctx, workspace, target, args);
44183
+ const items = await requireAuth(ctx).apiClient.getSyncRunItems(
44184
+ workspace,
44185
+ id,
44186
+ runId,
44187
+ optionalNumber(args, "limit") ?? 500
44188
+ );
44189
+ outputData(items, ctx, ITEM_COLUMNS2);
44190
+ }
44191
+ },
44192
+ {
44193
+ path: [c, "sync", "checkpoint"],
44194
+ description: `Show the ${target.label} sync checkpoint (where the next run resumes)`,
44195
+ requiresWorkspace: true,
44196
+ args: [
44197
+ connectionId,
44198
+ { name: "direction", description: "'inbound' (default) or 'outbound'" },
44199
+ { name: "sync-key", description: "Sync key (default 'default')" }
44200
+ ],
44201
+ handler: async ({ ctx, workspace, args }) => {
44202
+ const direction = args["direction"] ?? "inbound";
44203
+ if (direction !== "inbound" && direction !== "outbound") {
44204
+ throw new CLIError(
44205
+ `--direction must be 'inbound' or 'outbound', got '${direction}'`
44206
+ );
44207
+ }
44208
+ const id = await resolveConnectionId(ctx, workspace, target, args);
44209
+ const result2 = await requireAuth(ctx).apiClient.getConnectionSyncCheckpoint(
44210
+ workspace,
44211
+ id,
44212
+ direction,
44213
+ args["sync-key"] ?? "default"
44214
+ );
44215
+ outputSingle(result2, ctx);
44216
+ }
44217
+ },
44218
+ {
44219
+ path: [c, "sync", "member-summary"],
44220
+ description: `Count members by ${target.label} sync state (linked, failed, never synced)`,
44221
+ requiresWorkspace: true,
44222
+ args: [connectionId],
44223
+ handler: async ({ ctx, workspace, args }) => {
44224
+ const id = await resolveConnectionId(ctx, workspace, target, args);
44225
+ const result2 = await requireAuth(ctx).apiClient.getMemberSyncSummary(workspace, id);
44226
+ outputSingle(result2, ctx);
44227
+ }
44228
+ },
44229
+ {
44230
+ path: [c, "field-keys"],
44231
+ description: `List the Member field keys the ${target.label} connection holds values for`,
44232
+ requiresWorkspace: true,
44233
+ args: [connectionId],
44234
+ handler: async ({ ctx, workspace, args }) => {
44235
+ const id = await resolveConnectionId(ctx, workspace, target, args);
44236
+ const result2 = await requireAuth(ctx).apiClient.listConnectionMemberFieldKeys(
44237
+ workspace,
44238
+ id
44239
+ );
44240
+ outputData(result2.keys, ctx);
44241
+ }
44242
+ },
44243
+ {
44244
+ path: [c, "reconciliation", "relink"],
44245
+ description: `Let sync re-link a member you unlinked from ${target.label} (clears the manual-unlink exclusion). Idempotent: cleared=false when there was none.`,
44246
+ mutates: true,
44247
+ requiresWorkspace: true,
44248
+ args: [connectionId, { name: "member-id", description: "Member ID", required: true }],
44249
+ handler: async ({ ctx, workspace, args }) => {
44250
+ const memberId = requireNumber(args, "member-id");
44251
+ const id = await resolveConnectionId(ctx, workspace, target, args);
44252
+ const result2 = await requireAuth(ctx).apiClient.clearConnectionMemberExclusion(
44253
+ workspace,
44254
+ id,
44255
+ memberId
44256
+ );
44257
+ outputSingle(result2, ctx);
44258
+ }
44259
+ },
44260
+ {
44261
+ path: [c, "reconciliation", "link-by-identity"],
44262
+ description: `Start the background run that links unlinked members to their ${target.label} records by identity, then syncs them. Prints the run's workflowId. Refused (400) when the connector has no identity resolver, and (409) while the connection is disabled or a run is already in flight.`,
44263
+ mutates: true,
44264
+ requiresWorkspace: true,
44265
+ args: [connectionId],
44266
+ examples: [
44267
+ `gr ${c} reconciliation link-by-identity -w <ws> --allow-write`,
44268
+ `gr ${c} reconciliation linked -w <ws> # check the new links afterwards`
44269
+ ],
44270
+ handler: async ({ ctx, workspace, args }) => {
44271
+ const id = await resolveConnectionId(ctx, workspace, target, args);
44272
+ const result2 = await requireAuth(ctx).apiClient.linkUnlinkedMembersByIdentity(
44273
+ workspace,
44274
+ id
44275
+ );
44276
+ outputSingle(result2, ctx);
44277
+ }
44278
+ }
44279
+ ];
44280
+ }
44281
+
44282
+ // src/domains/integrations/hubspot.ts
44283
+ var HUBSPOT = {
44284
+ command: "hubspot",
44285
+ label: "HubSpot",
44286
+ connectionType: "hubspot_connection"
44287
+ };
44288
+ var OBJECT_TYPES = ["contacts", "companies", "deals"];
44289
+ var SEARCHABLE_OBJECT_TYPES = ["contacts", "companies"];
44290
+ var SEARCH_COLUMNS = [
44291
+ { header: "ID", getValue: (item) => item.id ?? "" },
44292
+ { header: "TYPE", getValue: (item) => item.objectType ?? "" },
44293
+ { header: "NAME", getValue: (item) => item.name ?? "" },
44294
+ { header: "EMAIL", getValue: (item) => item.email ?? "" },
44295
+ {
44296
+ header: "MEMBER",
44297
+ getValue: (item) => item.existingMember ? `${item.existingMember.memberId} (${item.existingMember.matchType})` : ""
44298
+ }
44299
+ ];
44300
+ var MATCH_COLUMNS2 = [
44301
+ { header: "MEMBER", getValue: (item) => String(item.memberId ?? "") },
44302
+ { header: "RECORD", getValue: (item) => item.hubspotRecordId ?? "" },
44303
+ { header: "MATCH", getValue: (item) => item.matchType ?? "" },
44304
+ { header: "OBJECT", getValue: (item) => item.objectType ?? "" }
44305
+ ];
44306
+ var LINKED_COLUMNS2 = [
44307
+ { header: "MEMBER", getValue: (item) => String(item.memberId ?? "") },
44308
+ { header: "RECORD", getValue: (item) => item.hubspotRecordId ?? "" },
44309
+ { header: "NAME", getValue: (item) => item.memberName ?? "" },
44310
+ { header: "LAST SYNC", getValue: (item) => item.lastSyncStatus ?? "" }
44311
+ ];
44312
+ var IMPORT_COLUMNS = [
44313
+ { header: "HUBSPOT ID", getValue: (item) => item.hubspotId ?? "" },
44314
+ { header: "MEMBER", getValue: (item) => String(item.memberId ?? "") },
44315
+ { header: "OK", getValue: (item) => item.success ? "yes" : "no" },
44316
+ { header: "ERROR", getValue: (item) => item.error ?? "" }
44317
+ ];
44318
+ function importRecordsFrom(data) {
44319
+ const body = data;
44320
+ const rows = Array.isArray(body) ? body : Array.isArray(body?.records) ? body.records : Array.isArray(body?.results) ? body.results : void 0;
44321
+ if (!rows) {
44322
+ throw new CLIError(
44323
+ 'JSON input must be {"records":[...]}, a `gr hubspot search -o json` response, or an array'
44324
+ );
44325
+ }
44326
+ return rows.map((row, index) => {
44327
+ const hubspotId = row?.hubspotId ?? row?.id;
44328
+ if (!hubspotId) throw new CLIError(`Record ${index} has no hubspotId (or id)`);
44329
+ return {
44330
+ hubspotId: String(hubspotId),
44331
+ name: row.name ?? null,
44332
+ email: row.email ?? null,
44333
+ phone: row.phone ?? null,
44334
+ objectType: row.objectType ?? "contacts"
44335
+ };
44336
+ });
44337
+ }
43686
44338
  var hubspotDomain = {
43687
44339
  name: "hubspot",
43688
44340
  description: "HubSpot CRM integration",
@@ -43694,18 +44346,21 @@ var hubspotDomain = {
43694
44346
  requiresWorkspace: true,
43695
44347
  examples: [
43696
44348
  "# When the response shows platformAppAvailable=true, the workspace connects through",
43697
- "# the shared Gravity Rail HubSpot app: install, then authorize. That's all.",
43698
- "gr hubspot install -w <ws> --allow-write",
43699
- "gr hubspot authorize -w <ws> --allow-write # then open the returned authorizeUrl",
44349
+ "# the shared Gravity Rail HubSpot app: one command, then open the authorizeUrl.",
44350
+ "gr hubspot connect -w <ws> --allow-write",
43700
44351
  "",
43701
44352
  "# To use your own HubSpot app instead (a Projects-platform app; HubSpot no longer",
43702
44353
  "# allows new private or developer apps):",
43703
44354
  '# 1. install -> creates the connection; the response includes the OAuth "callbackUrl"',
43704
44355
  "# 2. in HubSpot: give your app that callbackUrl as a Redirect URL, with CRM scopes",
43705
- "# (contacts/companies/deals read+write). Copy the Client ID + Secret.",
44356
+ "# (contacts/companies/deals read+write), plus crm.lists.read and",
44357
+ "# crm.objects.owners.read, forms, and scheduler.meetings.meeting-link.read",
44358
+ "# as OPTIONAL scopes (HubSpot rejects the authorize",
44359
+ "# request if the app lacks them).",
44360
+ "# Copy the Client ID + Secret.",
43706
44361
  "# 3. configure -> save that Client ID / Secret",
43707
44362
  '# 4. authorize -> returns an "authorizeUrl"; open it to grant access.',
43708
- "gr hubspot status -w <ws> # read back callbackUrl + configured/connected",
44363
+ "gr hubspot install -w <ws> --allow-write",
43709
44364
  `gr hubspot configure -w <ws> --allow-write -d '{"clientId":"...","clientSecret":"..."}'`,
43710
44365
  "gr hubspot authorize -w <ws> --allow-write # then open the returned authorizeUrl"
43711
44366
  ],
@@ -43714,6 +44369,33 @@ var hubspotDomain = {
43714
44369
  outputSingle(result2, ctx);
43715
44370
  }
43716
44371
  },
44372
+ {
44373
+ path: ["hubspot", "connect"],
44374
+ description: "Install HubSpot if needed and start OAuth: prints the authorizeUrl to open and the exact callbackUrl the HubSpot app must allow",
44375
+ mutates: true,
44376
+ requiresWorkspace: true,
44377
+ examples: ["gr hubspot connect -w <ws> --allow-write"],
44378
+ handler: async ({ ctx, workspace }) => {
44379
+ const api = requireAuth(ctx).apiClient;
44380
+ const installed = await api.installHubspot(workspace);
44381
+ if (!installed.configured) {
44382
+ outputSingle(installed, ctx);
44383
+ throw new CLIError(
44384
+ "HubSpot is installed but has no app credentials. Register the callbackUrl above on your HubSpot app, then run: gr hubspot configure, then gr hubspot connect"
44385
+ );
44386
+ }
44387
+ const started = await api.startHubspotOAuth(workspace);
44388
+ outputSingle(
44389
+ {
44390
+ connectionId: started.connectionId,
44391
+ usesPlatformApp: started.usesPlatformApp,
44392
+ callbackUrl: started.callbackUrl,
44393
+ authorizeUrl: started.authorizeUrl
44394
+ },
44395
+ ctx
44396
+ );
44397
+ }
44398
+ },
43717
44399
  {
43718
44400
  path: ["hubspot", "status"],
43719
44401
  description: "Get HubSpot connection status (shows configured/connected state + the OAuth callback URL)",
@@ -43725,6 +44407,8 @@ var hubspotDomain = {
43725
44407
  },
43726
44408
  {
43727
44409
  path: ["hubspot", "configure"],
44410
+ // Reads its body from --data, --file or piped stdin.
44411
+ acceptsJsonInput: true,
43728
44412
  description: "Configure HubSpot credentials (setup step 3): save the Client ID / Secret",
43729
44413
  mutates: true,
43730
44414
  requiresWorkspace: true,
@@ -43752,7 +44436,7 @@ var hubspotDomain = {
43752
44436
  },
43753
44437
  {
43754
44438
  path: ["hubspot", "disconnect"],
43755
- description: "Disconnect HubSpot",
44439
+ description: "Disconnect HubSpot: clear the stored OAuth tokens and return the connection to setup (HubSpot keeps the app install)",
43756
44440
  mutates: true,
43757
44441
  requiresWorkspace: true,
43758
44442
  handler: async ({ ctx, workspace }) => {
@@ -43791,121 +44475,270 @@ var hubspotDomain = {
43791
44475
  }
43792
44476
  },
43793
44477
  {
43794
- path: ["hubspot", "sync-config"],
43795
- description: "Get HubSpot sync configuration",
44478
+ path: ["hubspot", "search"],
44479
+ description: "Search HubSpot contacts or companies; each result shows the workspace member it matches",
43796
44480
  requiresWorkspace: true,
43797
- handler: async ({ ctx, workspace }) => {
43798
- const conns = await requireAuth(ctx).apiClient.listAppConnections(workspace);
43799
- const conn = conns.find((c) => c.connectionType === "hubspot_connection");
43800
- if (!conn) throw new CLIError("No HubSpot connection found");
43801
- const result2 = await requireAuth(ctx).apiClient.getConnectionSyncConfig(
43802
- workspace,
43803
- conn.id
43804
- );
43805
- outputSingle(result2, ctx);
44481
+ args: [
44482
+ {
44483
+ name: "query",
44484
+ description: "Contacts whose email, or companies whose name, contains this text; empty lists all"
44485
+ },
44486
+ { name: "object-type", description: "'contacts' (default) or 'companies'" },
44487
+ { name: "limit", description: "Max results (1..100, default 20)" },
44488
+ {
44489
+ name: "after",
44490
+ description: "Cursor from a previous page (nextCursor); only without --query"
44491
+ }
44492
+ ],
44493
+ examples: [
44494
+ "gr hubspot search -w <ws> --query smith",
44495
+ "gr hubspot search -w <ws> --object-type companies --limit 50"
44496
+ ],
44497
+ handler: async ({ ctx, workspace, args }) => {
44498
+ const objectType = args["object-type"] ?? "contacts";
44499
+ if (!SEARCHABLE_OBJECT_TYPES.includes(objectType)) {
44500
+ throw new CLIError(
44501
+ `--object-type must be one of ${SEARCHABLE_OBJECT_TYPES.join(", ")}, got '${objectType}'`
44502
+ );
44503
+ }
44504
+ if (args["query"] && args["after"]) {
44505
+ throw new CLIError("--after pages only the listing without --query");
44506
+ }
44507
+ const result2 = await requireAuth(ctx).apiClient.searchHubspotRecords(workspace, {
44508
+ query: args["query"] ?? "",
44509
+ objectType,
44510
+ limit: optionalNumber(args, "limit") ?? 20,
44511
+ ...args["after"] ? { after: String(args["after"]) } : {}
44512
+ });
44513
+ if (ctx.outputFormat !== "table") {
44514
+ outputSingle(result2, ctx);
44515
+ return;
44516
+ }
44517
+ outputData(result2.results, ctx, SEARCH_COLUMNS);
44518
+ if (result2.hasMore && result2.nextCursor && !args["query"]) {
44519
+ console.error(`More results: --after ${result2.nextCursor}`);
44520
+ }
43806
44521
  }
43807
44522
  },
43808
44523
  {
43809
- path: ["hubspot", "update-sync-config"],
43810
- description: "Update HubSpot sync configuration",
44524
+ path: ["hubspot", "import-members"],
44525
+ // Its input is usually the previous command's output: wait for the pipe.
44526
+ pipesJsonInput: true,
44527
+ description: "Create (or update and link) workspace members from HubSpot records (max 100 per call)",
43811
44528
  mutates: true,
43812
44529
  requiresWorkspace: true,
43813
- handler: async ({ ctx, workspace, data }) => {
43814
- if (!data) throw new CLIError("JSON data required (--data, --file, or stdin)");
43815
- const conns = await requireAuth(ctx).apiClient.listAppConnections(workspace);
43816
- const conn = conns.find((c) => c.connectionType === "hubspot_connection");
43817
- if (!conn) throw new CLIError("No HubSpot connection found");
43818
- const result2 = await requireAuth(ctx).apiClient.updateConnectionSyncConfig(
43819
- workspace,
43820
- conn.id,
43821
- data
43822
- );
43823
- outputSingle(result2, ctx);
44530
+ args: [
44531
+ {
44532
+ name: "member-role-id",
44533
+ description: "Member role for new members (overrides memberRoleId in the body)"
44534
+ },
44535
+ {
44536
+ name: "ids",
44537
+ description: "Comma-separated HubSpot IDs: import only these rows of the input"
44538
+ },
44539
+ { name: "add-to-org", description: "Also add new members to the org", isFlag: true },
44540
+ {
44541
+ name: "org-role",
44542
+ description: "Org role with --add-to-org: 'member' (default), 'admin', 'owner'"
44543
+ }
44544
+ ],
44545
+ examples: [
44546
+ "gr hubspot search -w <ws> --query smith -o json \\",
44547
+ " | gr hubspot import-members -w <ws> --member-role-id 3 --allow-write",
44548
+ "gr hubspot search -w <ws> -o json > found.json",
44549
+ "gr hubspot import-members -w <ws> --file found.json --ids 101,102 --member-role-id 3 --allow-write"
44550
+ ],
44551
+ handler: async ({ ctx, workspace, args, data }) => {
44552
+ if (!data) {
44553
+ throw new CLIError(
44554
+ "JSON input required (--data, --file, or stdin): pipe `gr hubspot search -o json`"
44555
+ );
44556
+ }
44557
+ let records = importRecordsFrom(data);
44558
+ const rawIds = args["ids"];
44559
+ if (rawIds) {
44560
+ const wanted = new Set(
44561
+ rawIds.split(",").map((id) => id.trim()).filter(Boolean)
44562
+ );
44563
+ records = records.filter((r) => wanted.has(r.hubspotId));
44564
+ const missing = [...wanted].filter((id) => !records.some((r) => r.hubspotId === id));
44565
+ if (missing.length > 0) {
44566
+ throw new CLIError(`--ids not found in the input: ${missing.join(", ")}`);
44567
+ }
44568
+ }
44569
+ if (records.length === 0) throw new CLIError("No records to import");
44570
+ if (records.length > 100) {
44571
+ throw new CLIError(`At most 100 records per import; got ${records.length}`);
44572
+ }
44573
+ const bodyRoleId = data?.memberRoleId;
44574
+ const memberRoleId = optionalNumber(args, "member-role-id") ?? (typeof bodyRoleId === "number" ? bodyRoleId : void 0);
44575
+ if (memberRoleId === void 0) {
44576
+ throw new CLIError("--member-role-id is required (see: gr member-roles list)");
44577
+ }
44578
+ const addToOrg = args["add-to-org"] === true || data?.addToOrg === true;
44579
+ const orgRole = args["org-role"] ?? data?.orgRole;
44580
+ const result2 = await requireAuth(ctx).apiClient.importHubspotMembers(workspace, {
44581
+ records,
44582
+ memberRoleId,
44583
+ addToOrg,
44584
+ ...orgRole ? { orgRole } : {}
44585
+ });
44586
+ if (ctx.outputFormat !== "table") {
44587
+ outputSingle(result2, ctx);
44588
+ return;
44589
+ }
44590
+ outputData(result2.results, ctx, IMPORT_COLUMNS);
44591
+ console.error(`Imported ${result2.imported}, failed ${result2.failed}`);
43824
44592
  }
43825
44593
  },
43826
44594
  {
43827
- path: ["hubspot", "reconciliation"],
43828
- description: "Find matching HubSpot contacts for workspace members",
44595
+ path: ["hubspot", "reconciliation", "matches"],
44596
+ description: "Find unlinked members with a likely HubSpot record (by email/phone); queries HubSpot",
43829
44597
  requiresWorkspace: true,
43830
44598
  args: [
43831
- { name: "offset", description: "Pagination offset" },
43832
- { name: "limit", description: "Max results" }
44599
+ { name: "offset", description: "Scan offset (default 0)" },
44600
+ { name: "limit", description: "Max members to scan (default 50, max 200)" }
43833
44601
  ],
43834
44602
  handler: async ({ ctx, workspace, args }) => {
43835
- const offset = args["offset"] ? Number(args["offset"]) : void 0;
43836
- const limit = args["limit"] ? Number(args["limit"]) : void 0;
43837
44603
  const result2 = await requireAuth(ctx).apiClient.getHubspotReconciliationMatches(
43838
44604
  workspace,
43839
- {
43840
- offset,
43841
- limit
43842
- }
44605
+ { offset: optionalNumber(args, "offset"), limit: optionalNumber(args, "limit") }
43843
44606
  );
43844
- outputData(result2, ctx);
44607
+ outputData(result2, ctx, MATCH_COLUMNS2);
43845
44608
  }
43846
44609
  },
43847
44610
  {
43848
- path: ["hubspot", "linked-members"],
43849
- description: "List members linked to HubSpot contacts",
44611
+ path: ["hubspot", "reconciliation", "linked"],
44612
+ description: "List members linked to HubSpot records",
43850
44613
  requiresWorkspace: true,
43851
- args: LIST_PAGINATION_ARGS,
44614
+ args: [
44615
+ ...LIST_PAGINATION_ARGS,
44616
+ { name: "search", description: "Filter by member name/email/phone or HubSpot ID" }
44617
+ ],
43852
44618
  handler: async ({ ctx, workspace, args }) => {
43853
44619
  const pag = parsePaginationArgs(args);
44620
+ const search = args["search"] ? String(args["search"]) : void 0;
44621
+ const api = requireAuth(ctx).apiClient;
43854
44622
  if (pag.all) {
43855
44623
  const allItems = await fetchAllPages(
43856
- ({ page, pageSize }) => requireAuth(ctx).apiClient.getLinkedHubspotMembers(workspace, { page, pageSize })
44624
+ ({ page, pageSize }) => api.getLinkedHubspotMembers(workspace, { page, pageSize, search })
43857
44625
  );
43858
- outputData(allItems, ctx);
44626
+ outputData(allItems, ctx, LINKED_COLUMNS2);
43859
44627
  return;
43860
44628
  }
43861
- const options = {};
43862
- if (pag.page) options.page = pag.page;
43863
- if (pag.pageSize) options.pageSize = pag.pageSize;
43864
- const result2 = await requireAuth(ctx).apiClient.getLinkedHubspotMembers(
43865
- workspace,
43866
- options
43867
- );
43868
- outputData(listResult(result2, true), ctx);
44629
+ const result2 = await api.getLinkedHubspotMembers(workspace, {
44630
+ ...pag.page ? { page: pag.page } : {},
44631
+ ...pag.pageSize ? { pageSize: pag.pageSize } : {},
44632
+ ...search ? { search } : {}
44633
+ });
44634
+ outputData(listResult(result2, true), ctx, LINKED_COLUMNS2);
43869
44635
  }
43870
44636
  },
43871
44637
  {
43872
- path: ["hubspot", "link-member"],
43873
- description: "Link a member to a HubSpot contact",
44638
+ path: ["hubspot", "reconciliation", "link"],
44639
+ description: "Link a member to a HubSpot record",
43874
44640
  mutates: true,
43875
44641
  requiresWorkspace: true,
43876
44642
  args: [
43877
44643
  { name: "member-id", description: "Member ID", required: true },
43878
- { name: "contact-id", description: "HubSpot contact ID", required: true }
44644
+ { name: "record-id", description: "HubSpot record ID", required: true },
44645
+ { name: "object-type", description: "HubSpot object type (default 'contacts')" }
44646
+ ],
44647
+ examples: [
44648
+ "gr hubspot reconciliation link -w <ws> --member-id 42 --record-id 101 --allow-write"
43879
44649
  ],
43880
44650
  handler: async ({ ctx, workspace, args }) => {
44651
+ const objectType = args["object-type"] ? String(args["object-type"]) : void 0;
43881
44652
  const result2 = await requireAuth(ctx).apiClient.linkMemberToHubspot(workspace, {
43882
44653
  memberId: requireNumber(args, "member-id"),
43883
- hubspotRecordId: requireString(args, "contact-id")
44654
+ hubspotRecordId: requireString(args, "record-id"),
44655
+ ...objectType ? { objectType } : {}
44656
+ });
44657
+ outputSingle(result2, ctx);
44658
+ }
44659
+ },
44660
+ {
44661
+ path: ["hubspot", "reconciliation", "link-bulk"],
44662
+ // Its input is usually the previous command's output: wait for the pipe.
44663
+ pipesJsonInput: true,
44664
+ description: 'Link many members at once. Body: {"links":[{"memberId":1,"recordId":"101"}]} (hubspotRecordId is accepted too); `reconciliation matches -o json` pipes in',
44665
+ mutates: true,
44666
+ requiresWorkspace: true,
44667
+ examples: [
44668
+ "gr hubspot reconciliation matches -w <ws> -o json \\",
44669
+ " | gr hubspot reconciliation link-bulk -w <ws> --allow-write"
44670
+ ],
44671
+ handler: async ({ ctx, workspace, data }) => {
44672
+ const body = data;
44673
+ const rows = Array.isArray(body) ? body : body?.links;
44674
+ if (!Array.isArray(rows) || rows.length === 0) {
44675
+ throw new CLIError('JSON input must be {"links":[...]} or an array of matches');
44676
+ }
44677
+ const links = rows.map((row, index) => {
44678
+ const memberId = Number(row?.memberId);
44679
+ const recordId = row?.recordId ?? row?.hubspotRecordId;
44680
+ if (!Number.isInteger(memberId) || !recordId) {
44681
+ throw new CLIError(
44682
+ `links[${index}] needs a numeric memberId and a recordId (or hubspotRecordId)`
44683
+ );
44684
+ }
44685
+ return {
44686
+ memberId,
44687
+ hubspotRecordId: String(recordId),
44688
+ ...row.objectType ? { objectType: String(row.objectType) } : {}
44689
+ };
44690
+ });
44691
+ const result2 = await requireAuth(ctx).apiClient.bulkLinkMembersToHubspot(workspace, {
44692
+ links
43884
44693
  });
43885
44694
  outputSingle(result2, ctx);
43886
44695
  }
43887
44696
  },
43888
44697
  {
43889
- path: ["hubspot", "unlink-member"],
43890
- description: "Unlink a member from HubSpot",
44698
+ path: ["hubspot", "reconciliation", "unlink"],
44699
+ description: "Unlink a member from HubSpot (sync will not re-link them until reconciliation relink)",
43891
44700
  mutates: true,
43892
44701
  requiresWorkspace: true,
43893
44702
  args: [{ name: "member-id", description: "Member ID", required: true }],
43894
44703
  handler: async ({ ctx, workspace, args }) => {
43895
- await requireAuth(ctx).apiClient.unlinkMemberFromHubspot(
44704
+ const result2 = await requireAuth(ctx).apiClient.unlinkMemberFromHubspot(
43896
44705
  workspace,
43897
44706
  requireNumber(args, "member-id")
43898
44707
  );
43899
- process.stdout.write("Unlinked member from HubSpot\n");
44708
+ outputSingle(result2, ctx);
43900
44709
  }
43901
44710
  },
43902
44711
  {
43903
- path: ["hubspot", "contact-properties"],
43904
- description: "List available HubSpot contact properties",
44712
+ path: ["hubspot", "properties"],
44713
+ description: "List HubSpot property definitions: the sync-mappable contact properties by default, or every property of --object-type as HubSpot defines it",
43905
44714
  requiresWorkspace: true,
43906
- handler: async ({ ctx, workspace }) => {
43907
- const result2 = await requireAuth(ctx).apiClient.getHubspotContactProperties(workspace);
43908
- outputData(result2, ctx);
44715
+ args: [
44716
+ {
44717
+ name: "object-type",
44718
+ description: "Raw HubSpot schema for 'contacts', 'companies' or 'deals'"
44719
+ }
44720
+ ],
44721
+ examples: [
44722
+ "gr hubspot properties -w <ws>",
44723
+ "gr hubspot properties -w <ws> --object-type deals -o json"
44724
+ ],
44725
+ handler: async ({ ctx, workspace, args }) => {
44726
+ const objectType = args["object-type"];
44727
+ const api = requireAuth(ctx).apiClient;
44728
+ if (objectType === void 0) {
44729
+ outputData(await api.getHubspotContactProperties(workspace), ctx);
44730
+ return;
44731
+ }
44732
+ if (!OBJECT_TYPES.includes(objectType)) {
44733
+ throw new CLIError(
44734
+ `--object-type must be one of ${OBJECT_TYPES.join(", ")}, got '${objectType}'`
44735
+ );
44736
+ }
44737
+ const result2 = await api.getHubspotObjectProperties(
44738
+ workspace,
44739
+ objectType
44740
+ );
44741
+ outputSingle(result2, ctx);
43909
44742
  }
43910
44743
  },
43911
44744
  {
@@ -43917,6 +44750,22 @@ var hubspotDomain = {
43917
44750
  outputData(result2, ctx);
43918
44751
  }
43919
44752
  },
44753
+ {
44754
+ path: ["hubspot", "sync", "logs"],
44755
+ description: "List HubSpot managed-rule executions (newest first, cursor-paged)",
44756
+ requiresWorkspace: true,
44757
+ args: [
44758
+ { name: "page-size", description: "Rows per page" },
44759
+ { name: "cursor", description: "Cursor from a previous page (nextCursor)" }
44760
+ ],
44761
+ handler: async ({ ctx, workspace, args }) => {
44762
+ const result2 = await requireAuth(ctx).apiClient.getHubspotSyncLogs(workspace, {
44763
+ pageSize: optionalNumber(args, "page-size"),
44764
+ cursor: args["cursor"] ? String(args["cursor"]) : void 0
44765
+ });
44766
+ outputSingle(result2, ctx);
44767
+ }
44768
+ },
43920
44769
  {
43921
44770
  path: ["hubspot", "transform-presets"],
43922
44771
  description: "List available HubSpot field transform presets",
@@ -43925,7 +44774,8 @@ var hubspotDomain = {
43925
44774
  const result2 = await requireAuth(ctx).apiClient.getHubspotTransformPresets(workspace);
43926
44775
  outputData(result2, ctx);
43927
44776
  }
43928
- }
44777
+ },
44778
+ ...connectionCommands(HUBSPOT)
43929
44779
  ]
43930
44780
  };
43931
44781
 
@@ -44209,37 +45059,39 @@ var salesforceDomain = {
44209
45059
  commands: [
44210
45060
  {
44211
45061
  path: ["salesforce", "install"],
44212
- description: "Install Salesforce (setup step 1): create the connection and get its OAuth callback URL",
45062
+ description: "Install Salesforce (setup step 1): create the connection for an environment, then authorize",
44213
45063
  mutates: true,
44214
45064
  requiresWorkspace: true,
44215
45065
  args: [
44216
45066
  {
44217
- name: "instance-url",
44218
- description: "Salesforce login host (default https://login.salesforce.com; sandbox: https://test.salesforce.com; Developer Edition/custom domain: your org's My Domain login URL)"
45067
+ name: "environment",
45068
+ description: "Salesforce environment: production (default) or sandbox"
45069
+ },
45070
+ {
45071
+ name: "my-domain",
45072
+ description: "The org's My Domain host (e.g. acme.my.salesforce.com), only for an org that blocks login.salesforce.com / test.salesforce.com"
44219
45073
  }
44220
45074
  ],
44221
45075
  examples: [
44222
- "# Salesforce setup is a 4-step flow \u2014 this command is step 1:",
44223
- '# 1. install -> creates the connection; the response includes the OAuth "callbackUrl"',
44224
- "# 2. in Salesforce: create a Connected App (or External Client App) whose Callback URL",
44225
- "# is that callbackUrl, with OAuth scopes: api, refresh_token offline_access, openid,",
44226
- "# id profile email address phone. Copy the Consumer Key + Consumer Secret.",
44227
- "# 3. configure -> save that Client ID / Secret (and instance URL)",
44228
- '# 4. authorize -> returns an "authorizeUrl"; open it to grant access. status then',
44229
- "# reports configured=true and connected=true.",
45076
+ "# One-click setup through the shared Gravity Rail Salesforce app:",
45077
+ "# 1. install -> creates the connection for the chosen environment",
45078
+ '# 2. authorize -> returns an "authorizeUrl"; open it, sign in and approve access.',
45079
+ "# status then reports connected=true.",
45080
+ "# Advanced (own app): run configure between install and authorize, with an app whose",
45081
+ '# Callback URL is the status "callbackUrl".',
44230
45082
  "",
44231
45083
  "gr salesforce install -w <ws> --allow-write",
44232
- "gr salesforce install -w <ws> --instance-url https://test.salesforce.com --allow-write # sandbox",
44233
- "gr salesforce status -w <ws> # read back callbackUrl + configured/connected",
44234
- `gr salesforce configure -w <ws> --allow-write -d '{"clientId":"...","clientSecret":"...","instanceUrl":"https://login.salesforce.com"}'`,
44235
- "gr salesforce authorize -w <ws> --allow-write # then open the returned authorizeUrl"
45084
+ "gr salesforce install -w <ws> --environment sandbox --allow-write",
45085
+ "gr salesforce authorize -w <ws> --allow-write # then open the returned authorizeUrl",
45086
+ "gr salesforce status -w <ws>"
44236
45087
  ],
44237
45088
  handler: async ({ ctx, workspace, args }) => {
44238
- const instanceUrl = args["instance-url"];
44239
- const result2 = await requireAuth(ctx).apiClient.installSalesforce(
44240
- workspace,
44241
- typeof instanceUrl === "string" ? { instanceUrl } : void 0
44242
- );
45089
+ const environment = args["environment"];
45090
+ const myDomain = args["my-domain"];
45091
+ const result2 = await requireAuth(ctx).apiClient.installSalesforce(workspace, {
45092
+ ...typeof environment === "string" ? { environment } : {},
45093
+ ...typeof myDomain === "string" ? { myDomain } : {}
45094
+ });
44243
45095
  outputSingle(result2, ctx);
44244
45096
  }
44245
45097
  },
@@ -44254,12 +45106,12 @@ var salesforceDomain = {
44254
45106
  },
44255
45107
  {
44256
45108
  path: ["salesforce", "configure"],
44257
- description: "Configure Salesforce credentials (setup step 3): save the Client ID / Secret + instance URL",
45109
+ description: "Advanced: save your own Salesforce app's Client ID / Secret and environment, then open the returned authorizeUrl",
44258
45110
  mutates: true,
44259
45111
  requiresWorkspace: true,
44260
45112
  examples: [
44261
45113
  "gr salesforce configure -w <ws> --allow-write \\",
44262
- ` -d '{"clientId":"3MVG9...","clientSecret":"1A2B...","instanceUrl":"https://login.salesforce.com"}'`
45114
+ ` -d '{"clientId":"3MVG9...","clientSecret":"1A2B...","environment":"production"}'`
44263
45115
  ],
44264
45116
  handler: async ({ ctx, workspace, data }) => {
44265
45117
  if (!data) throw new CLIError("JSON data required (--data, --file, or stdin)");
@@ -44272,7 +45124,7 @@ var salesforceDomain = {
44272
45124
  },
44273
45125
  {
44274
45126
  path: ["salesforce", "authorize"],
44275
- description: "Authorize Salesforce via OAuth (setup step 4): returns an authorizeUrl to open in a browser",
45127
+ description: "Authorize Salesforce via OAuth (setup step 2): returns an authorizeUrl to open in a browser",
44276
45128
  mutates: true,
44277
45129
  requiresWorkspace: true,
44278
45130
  handler: async ({ ctx, workspace }) => {
@@ -49359,7 +50211,7 @@ async function main() {
49359
50211
  process.stderr.write("Error: --workspace (-w) is required\n");
49360
50212
  process.exit(1);
49361
50213
  }
49362
- const data = commandNeedsJsonBody(cmd, parsedArgs) ? await readJsonInput(parsedArgs) : void 0;
50214
+ const data = await readCommandJsonInput(cmd, parsedArgs);
49363
50215
  hctx = { ctx, args: parsedArgs, workspace, data };
49364
50216
  } else {
49365
50217
  const baseCtx = createPublicContext(opts);