@gravity-rail/cli 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +137 -83
- package/dist/{account-verify-phone-XNXA7HNG.js → account-verify-phone-7YQXKU3X.js} +3 -3
- package/dist/{chunk-XJ2EBXJZ.js → chunk-GRLUFHMI.js} +48 -117
- package/dist/chunk-GRLUFHMI.js.map +1 -0
- package/dist/{chunk-GVUGFPCN.js → chunk-SIV2WU2I.js} +284 -45
- package/dist/chunk-SIV2WU2I.js.map +1 -0
- package/dist/cli-client-context-C5l8lg7h.d.ts +130 -0
- package/dist/cli-utils.d.ts +60 -3
- package/dist/cli-utils.js +3 -1
- package/dist/gr.js +5794 -1959
- package/dist/gr.js.map +1 -1
- package/dist/lib.d.ts +65 -9
- package/dist/lib.js +1405 -644
- package/dist/lib.js.map +1 -1
- package/package.json +3 -3
- package/dist/chunk-GVUGFPCN.js.map +0 -1
- package/dist/chunk-XJ2EBXJZ.js.map +0 -1
- package/dist/cli-client-context-BbyBEGcg.d.ts +0 -99
- /package/dist/{account-verify-phone-XNXA7HNG.js.map → account-verify-phone-7YQXKU3X.js.map} +0 -0
package/dist/lib.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GravityRailClient, PhoneCall } from '@gravity-rail/sdk';
|
|
2
|
-
import { E as EnvironmentConfig, C as CredentialsManager } from './cli-client-context-
|
|
3
|
-
export {
|
|
2
|
+
import { E as EnvironmentConfig, C as CredentialsManager, a as CLICredentials } from './cli-client-context-C5l8lg7h.js';
|
|
3
|
+
export { b as ConciergeAppContextPayload, c as buildCliConciergeAppContext } from './cli-client-context-C5l8lg7h.js';
|
|
4
4
|
|
|
5
5
|
/** Metadata extracted from a paginated API response */
|
|
6
6
|
interface PaginationMeta {
|
|
@@ -114,7 +114,12 @@ declare function detectOutputFormat(explicit?: string): OutputFormat;
|
|
|
114
114
|
declare function outputData(data: unknown, opts: OutputOptions, columns?: TableColumn<any>[], paginationMeta?: PaginationMeta, supportsAll?: boolean): void;
|
|
115
115
|
/** Write a single object to stdout in the requested format */
|
|
116
116
|
declare function outputSingle<T>(data: T, opts: OutputOptions, columns?: TableColumn<T>[]): void;
|
|
117
|
-
/** Common column factory helpers for domain files
|
|
117
|
+
/** Common column factory helpers for domain files.
|
|
118
|
+
*
|
|
119
|
+
* GR app-facing API wire is camelCase. First-party consumers (CLI, lambdas we
|
|
120
|
+
* own) read that shape only — no snake_case dual-read "bandaid". When the API
|
|
121
|
+
* flips a key, convert the consumer; do not carry both. (#19305)
|
|
122
|
+
*/
|
|
118
123
|
declare const COL: {
|
|
119
124
|
id: () => TableColumn<any>;
|
|
120
125
|
uuid: () => TableColumn<any>;
|
|
@@ -130,12 +135,13 @@ declare function stderr(msg: string): void;
|
|
|
130
135
|
|
|
131
136
|
interface GlobalOptions {
|
|
132
137
|
env: string;
|
|
133
|
-
realm?: string;
|
|
134
138
|
/** Override API base URL (also: GRAVITY_RAIL_API_URL env var). */
|
|
135
139
|
apiUrl?: string;
|
|
136
140
|
outputFormat?: string;
|
|
137
141
|
verbose?: boolean;
|
|
138
142
|
allowWrite?: boolean;
|
|
143
|
+
/** Named credential profile (`--profile` / GRAVITY_RAIL_PROFILE). */
|
|
144
|
+
profile?: string;
|
|
139
145
|
}
|
|
140
146
|
interface PublicGlobalOptions {
|
|
141
147
|
env?: string;
|
|
@@ -144,6 +150,8 @@ interface PublicGlobalOptions {
|
|
|
144
150
|
outputFormat?: string;
|
|
145
151
|
verbose?: boolean;
|
|
146
152
|
allowWrite?: boolean;
|
|
153
|
+
/** Named credential profile (`--profile` / GRAVITY_RAIL_PROFILE). */
|
|
154
|
+
profile?: string;
|
|
147
155
|
}
|
|
148
156
|
interface CommandContext {
|
|
149
157
|
env: string;
|
|
@@ -152,15 +160,24 @@ interface CommandContext {
|
|
|
152
160
|
verbose: boolean;
|
|
153
161
|
allowWrite: boolean;
|
|
154
162
|
credentialsManager: CredentialsManager;
|
|
163
|
+
/** Resolved credential profile for this invocation. */
|
|
164
|
+
profile: string;
|
|
155
165
|
}
|
|
156
166
|
interface AuthenticatedContext extends CommandContext {
|
|
157
167
|
accessToken: string;
|
|
158
168
|
apiClient: GravityRailClient;
|
|
159
|
-
|
|
169
|
+
/** Default workspace UUID from the profile (dev workspace/member profiles). */
|
|
170
|
+
profileWorkspace?: string;
|
|
160
171
|
}
|
|
161
172
|
/** Create a base command context (no auth required) */
|
|
162
173
|
declare function createContext(opts: GlobalOptions): CommandContext;
|
|
163
|
-
/**
|
|
174
|
+
/**
|
|
175
|
+
* Create an authenticated command context.
|
|
176
|
+
* Order: GRAVITY_RAIL_API_KEY → named/current profile store. Never auto-triggers OAuth.
|
|
177
|
+
*
|
|
178
|
+
* Dev accounts that used to be selected with `--realm` are now named profiles
|
|
179
|
+
* (import with `gr auth import-dev` after provisioning).
|
|
180
|
+
*/
|
|
164
181
|
declare function createAuthenticatedContext(opts: GlobalOptions): Promise<AuthenticatedContext>;
|
|
165
182
|
/**
|
|
166
183
|
* Narrow a handler context to `AuthenticatedContext`.
|
|
@@ -512,8 +529,47 @@ declare function requireDirectoryTrust(opts: DirectoryTrustOptions): Promise<voi
|
|
|
512
529
|
|
|
513
530
|
declare function devImportLocalCommand(ctx: AuthenticatedContext, workspace: string): Promise<void>;
|
|
514
531
|
|
|
515
|
-
declare function loginCommand(ctx: CommandContext): Promise<void>;
|
|
516
|
-
declare function logoutCommand(ctx: CommandContext): Promise<void>;
|
|
532
|
+
declare function loginCommand(ctx: CommandContext, args?: ParsedArgs): Promise<void>;
|
|
533
|
+
declare function logoutCommand(ctx: CommandContext, args?: ParsedArgs): Promise<void>;
|
|
534
|
+
/** List stored credential profiles for the current environment. */
|
|
535
|
+
declare function authListCommand(ctx: CommandContext): Promise<void>;
|
|
536
|
+
/** Switch the default profile for subsequent commands. */
|
|
537
|
+
declare function authSwitchCommand(ctx: CommandContext, args: ParsedArgs): Promise<void>;
|
|
538
|
+
/**
|
|
539
|
+
* Import account + workspace/member tokens from dev-realms.json into named profiles.
|
|
540
|
+
* Replaces the old per-invocation `--realm` flag.
|
|
541
|
+
*/
|
|
542
|
+
declare function authImportDevCommand(ctx: CommandContext, args?: ParsedArgs): Promise<void>;
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* Import local/dev-cloud auth tokens from dev-realms.json into gr CLI profiles.
|
|
546
|
+
*
|
|
547
|
+
* Replaces the old `--realm` flag: after import, use
|
|
548
|
+
* yarn gr whoami --profile superadmin
|
|
549
|
+
* yarn gr tasks list --profile acme-demo/acme-admin
|
|
550
|
+
*
|
|
551
|
+
* dev-realms.json remains the provisioner output (and is still used by e2e /
|
|
552
|
+
* site-template tooling). The gr CLI no longer reads it at command time.
|
|
553
|
+
*/
|
|
554
|
+
|
|
555
|
+
interface ImportDevProfilesResult {
|
|
556
|
+
path: string;
|
|
557
|
+
imported: number;
|
|
558
|
+
accountProfiles: number;
|
|
559
|
+
memberProfiles: number;
|
|
560
|
+
storePath: string;
|
|
561
|
+
}
|
|
562
|
+
/** Parse dev-realms.json into profile name → credentials (token + optional workspace). */
|
|
563
|
+
declare function profilesFromDevRealms(data: Record<string, unknown>): Record<string, CLICredentials>;
|
|
564
|
+
/**
|
|
565
|
+
* Import all accounts + workspace/member entries from dev-realms into the
|
|
566
|
+
* credential store for `env`. Overwrites matching profile names; leaves
|
|
567
|
+
* unrelated OAuth profiles intact.
|
|
568
|
+
*/
|
|
569
|
+
declare function importDevProfiles(credentialsManager: CredentialsManager, env: string, options?: {
|
|
570
|
+
file?: string;
|
|
571
|
+
preferCurrent?: string;
|
|
572
|
+
}): ImportDevProfilesResult;
|
|
517
573
|
|
|
518
574
|
declare function manageCommand(hctx: CommandHandlerContext): Promise<void>;
|
|
519
575
|
declare function chatCommand(hctx: CommandHandlerContext): Promise<void>;
|
|
@@ -522,4 +578,4 @@ declare function organizationsListCommand(ctx: AuthenticatedContext): Promise<vo
|
|
|
522
578
|
|
|
523
579
|
declare function whoamiCommand(ctx: AuthenticatedContext): Promise<void>;
|
|
524
580
|
|
|
525
|
-
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, topLevelCommands, unwrapItems, waitForOutboundPhoneCallOutcome, whoamiCommand };
|
|
581
|
+
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, authImportDevCommand, authListCommand, authSwitchCommand, chatCommand, commandNeedsJsonBody, conciergeCommand, conciergeOutboundCommand, confirmAccountPhoneVerify, createAuthenticatedContext, createConciergeChat, createContext, createPublicAuthenticatedContext, createPublicContext, crudCommands, detectOutputFormat, devImportLocalCommand, extractPaginationMeta, fetchAllCursorPages, fetchAllPages, formatPaginationWarning, getConciergeChat, getConciergeChatMessages, getStartedCommand, handleError, importDevProfiles, isCursorPaginatedResponse, isDirectoryTrusted, isLikelySeedPhoneNumber, isListResult, isPagePaginatedResponse, isPaginatedResponse, listConciergeChats, listResult, loginCommand, logoutCommand, manageCommand, organizationsListCommand, originateConciergeCall, originateConciergeSms, outputData, outputSingle, parseArgs, parsePaginationArgs, profilesFromDevRealms, readJsonInput, registerPublicDomains, requireAuth, requireDirectoryTrust, requireNumber, requireString, resolveVoicePhoneNumberId, simpleCrudCommands, startAccountPhoneVerify, stderr, topLevelCommands, unwrapItems, waitForOutboundPhoneCallOutcome, whoamiCommand };
|