@gravity-rail/cli 0.6.0 → 0.7.1

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/lib.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { ApiClient } from '@gravity-rail/client';
2
2
  import { E as EnvironmentConfig, C as CredentialsManager } from './cli-client-context-9KRUt6O-.js';
3
3
  export { a as ConciergeAppContextPayload, b as buildCliConciergeAppContext } from './cli-client-context-9KRUt6O-.js';
4
+ import { GravityRailClient, PhoneCall } from '@gravity-rail/sdk';
4
5
 
5
6
  /** Metadata extracted from a paginated API response */
6
7
  interface PaginationMeta {
@@ -131,6 +132,8 @@ declare function stderr(msg: string): void;
131
132
  interface GlobalOptions {
132
133
  env: string;
133
134
  realm?: string;
135
+ /** Override API base URL (also: GRAVITY_RAIL_API_URL env var). */
136
+ apiUrl?: string;
134
137
  outputFormat?: string;
135
138
  verbose?: boolean;
136
139
  allowWrite?: boolean;
@@ -241,9 +244,33 @@ declare class AuthRequiredError extends CLIError {
241
244
  }
242
245
  declare function handleError(err: unknown): never;
243
246
 
247
+ /**
248
+ * Whether the CLI should read --data / --file / stdin for this command.
249
+ *
250
+ * CRUD create/update handlers rely on COMMON_ARGS for --data, but those flags are
251
+ * not listed on cmd.args — without this helper, `gr members update --data …` silently
252
+ * skips the body.
253
+ */
254
+ declare function commandNeedsJsonBody(cmd: CommandDef, parsedArgs: ParsedArgs): boolean;
244
255
  /** Read JSON input from --data string, --file path, or stdin (if piped) */
245
256
  declare function readJsonInput(args: ParsedArgs): Promise<unknown | undefined>;
246
257
 
258
+ /** True when the number is a provisioned test placeholder, not a real handset. */
259
+ declare function isLikelySeedPhoneNumber(phone: string): boolean;
260
+ /**
261
+ * Poll until the outbound PhoneCall for a chat reaches a terminal or connected state.
262
+ * Throws CLIError when Twilio reports failure (often within 1–2s).
263
+ */
264
+ declare function waitForOutboundPhoneCallOutcome(client: GravityRailClient, workspaceUuid: string, chatId: number, memberId: number, options?: {
265
+ timeoutMs?: number;
266
+ intervalMs?: number;
267
+ }): Promise<PhoneCall>;
268
+ /**
269
+ * Resolve the workspace PhoneNumber id to use for outbound voice.
270
+ * Order: explicit flag → workspace defaults → first voice-enabled line.
271
+ */
272
+ declare function resolveVoicePhoneNumberId(client: GravityRailClient, workspaceUuid: string, explicitId?: number): Promise<number>;
273
+
247
274
  /**
248
275
  * @deprecated Use `SimpleCrudConfig` with `simpleCrudCommands()` for new code.
249
276
  *
@@ -270,6 +297,8 @@ interface CrudConfig<T = unknown> {
270
297
  extra?: CommandDef[];
271
298
  /** Example lines shown in help for the create command */
272
299
  createExamples?: string[];
300
+ /** Example lines shown in help for the update command */
301
+ updateExamples?: string[];
273
302
  /**
274
303
  * Controls how the CRUD list handler interacts with pagination.
275
304
  *
@@ -366,6 +395,10 @@ declare class CommandRegistry {
366
395
  /** Generate help text. If prefix given, show commands under that prefix. */
367
396
  getHelp(prefix?: string[]): string;
368
397
  private getCommandHelp;
398
+ /** All registered domains (for docs generation and introspection). */
399
+ getDomains(): readonly DomainDef[];
400
+ /** All registered commands (for docs generation and introspection). */
401
+ getAllCommands(): CommandDef[];
369
402
  private getTopLevelHelp;
370
403
  }
371
404
 
@@ -405,6 +438,18 @@ interface ConciergeMessage {
405
438
  declare function listConciergeChats(ctx: AuthenticatedContext): Promise<ConciergeChat[]>;
406
439
  declare function createConciergeChat(ctx: AuthenticatedContext, title?: string): Promise<ConciergeChat>;
407
440
  declare function getConciergeChat(ctx: AuthenticatedContext, chatId: number): Promise<ConciergeChat>;
441
+ interface ConciergeCallResult {
442
+ callSid: string;
443
+ startedAt: string;
444
+ }
445
+ interface ConciergeSmsResult {
446
+ messageSid: string;
447
+ conversationId: string;
448
+ }
449
+ declare function originateConciergeCall(ctx: AuthenticatedContext, kind?: string): Promise<ConciergeCallResult>;
450
+ declare function originateConciergeSms(ctx: AuthenticatedContext, kind?: string): Promise<ConciergeSmsResult>;
451
+ declare function startAccountPhoneVerify(ctx: AuthenticatedContext, phone: string): Promise<void>;
452
+ declare function confirmAccountPhoneVerify(ctx: AuthenticatedContext, code: string): Promise<void>;
408
453
  declare function getConciergeChatMessages(ctx: AuthenticatedContext, chatId: number): Promise<ConciergeMessage[]>;
409
454
 
410
455
  /**
@@ -424,6 +469,7 @@ declare function authBrowserCommand(ctx: AuthenticatedContext, args: Record<stri
424
469
  * but without requiring a workspace.
425
470
  */
426
471
 
472
+ declare function conciergeOutboundCommand(hctx: CommandHandlerContext): Promise<void>;
427
473
  declare function conciergeCommand(hctx: CommandHandlerContext): Promise<void>;
428
474
 
429
475
  /**
@@ -458,4 +504,4 @@ declare function organizationsListCommand(ctx: AuthenticatedContext): Promise<vo
458
504
 
459
505
  declare function whoamiCommand(ctx: AuthenticatedContext): Promise<void>;
460
506
 
461
- export { type ArgDef, AuthRequiredError, type AuthenticatedContext, CLIError, COL, type CommandContext, type CommandDef, type CommandHandlerContext, CommandRegistry, type ConciergeChat, type ConciergeMessage, type DomainDef, type GlobalOptions, LIST_PAGINATION_ARGS, type OutputFormat, type OutputOptions, PAGINATION_ARGS, type PaginationMeta, type ParsedArgs, type PublicGlobalOptions, type TableColumn, authBrowserCommand, chatCommand, conciergeCommand, createAuthenticatedContext, createConciergeChat, createContext, createPublicAuthenticatedContext, createPublicContext, crudCommands, detectOutputFormat, devImportLocalCommand, extractPaginationMeta, fetchAllCursorPages, fetchAllPages, formatPaginationWarning, getConciergeChat, getConciergeChatMessages, getStartedCommand, handleError, isCursorPaginatedResponse, isDirectoryTrusted, isListResult, isPagePaginatedResponse, isPaginatedResponse, listConciergeChats, listResult, loginCommand, logoutCommand, manageCommand, organizationsListCommand, outputData, outputSingle, parseArgs, parsePaginationArgs, readJsonInput, registerPublicDomains, requireAuth, requireDirectoryTrust, requireNumber, requireString, simpleCrudCommands, stderr, unwrapItems, whoamiCommand };
507
+ export { type ArgDef, AuthRequiredError, type AuthenticatedContext, CLIError, COL, type CommandContext, type CommandDef, type CommandHandlerContext, CommandRegistry, type ConciergeChat, type ConciergeMessage, type DomainDef, type GlobalOptions, LIST_PAGINATION_ARGS, type OutputFormat, type OutputOptions, PAGINATION_ARGS, type PaginationMeta, type ParsedArgs, type PublicGlobalOptions, type TableColumn, authBrowserCommand, chatCommand, commandNeedsJsonBody, conciergeCommand, conciergeOutboundCommand, confirmAccountPhoneVerify, createAuthenticatedContext, createConciergeChat, createContext, createPublicAuthenticatedContext, createPublicContext, crudCommands, detectOutputFormat, devImportLocalCommand, extractPaginationMeta, fetchAllCursorPages, fetchAllPages, formatPaginationWarning, getConciergeChat, getConciergeChatMessages, getStartedCommand, handleError, isCursorPaginatedResponse, isDirectoryTrusted, isLikelySeedPhoneNumber, isListResult, isPagePaginatedResponse, isPaginatedResponse, listConciergeChats, listResult, loginCommand, logoutCommand, manageCommand, organizationsListCommand, originateConciergeCall, originateConciergeSms, outputData, outputSingle, parseArgs, parsePaginationArgs, readJsonInput, registerPublicDomains, requireAuth, requireDirectoryTrust, requireNumber, requireString, resolveVoicePhoneNumberId, simpleCrudCommands, startAccountPhoneVerify, stderr, unwrapItems, waitForOutboundPhoneCallOutcome, whoamiCommand };