@revos/cli 0.2.3 → 0.3.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/README.md +42 -4
- package/dist/adapters/oclif/commands/action-runs/get.mjs +1 -1
- package/dist/adapters/oclif/commands/action-runs/list.mjs +1 -1
- package/dist/adapters/oclif/commands/actions/get-input-schema.mjs +2 -2
- package/dist/adapters/oclif/commands/actions/get-params-schema.mjs +2 -2
- package/dist/adapters/oclif/commands/actions/get.mjs +1 -1
- package/dist/adapters/oclif/commands/actions/list.mjs +2 -2
- package/dist/adapters/oclif/commands/ai-instructions/create.mjs +1 -1
- package/dist/adapters/oclif/commands/ai-instructions/delete.mjs +1 -1
- package/dist/adapters/oclif/commands/ai-instructions/get.mjs +1 -1
- package/dist/adapters/oclif/commands/ai-instructions/list.mjs +1 -1
- package/dist/adapters/oclif/commands/ai-instructions/update.mjs +1 -1
- package/dist/adapters/oclif/commands/api.mjs +2 -2
- package/dist/adapters/oclif/commands/apply.d.mts +1 -1
- package/dist/adapters/oclif/commands/apply.mjs +2 -2
- package/dist/adapters/oclif/commands/auth/login.mjs +13 -28
- package/dist/adapters/oclif/commands/auth/logout.mjs +2 -2
- package/dist/adapters/oclif/commands/auth/status.mjs +2 -2
- package/dist/adapters/oclif/commands/connections/create.mjs +1 -1
- package/dist/adapters/oclif/commands/connections/delete.mjs +1 -1
- package/dist/adapters/oclif/commands/connections/get.mjs +1 -1
- package/dist/adapters/oclif/commands/connections/list.mjs +1 -1
- package/dist/adapters/oclif/commands/connections/update.mjs +1 -1
- package/dist/adapters/oclif/commands/cubes/create.mjs +1 -1
- package/dist/adapters/oclif/commands/cubes/delete.mjs +1 -1
- package/dist/adapters/oclif/commands/cubes/get.mjs +1 -1
- package/dist/adapters/oclif/commands/cubes/list.mjs +1 -1
- package/dist/adapters/oclif/commands/cubes/meta.d.mts +6 -0
- package/dist/adapters/oclif/commands/cubes/meta.mjs +45 -0
- package/dist/adapters/oclif/commands/cubes/query.d.mts +6 -0
- package/dist/adapters/oclif/commands/cubes/query.mjs +51 -0
- package/dist/adapters/oclif/commands/cubes/update.mjs +1 -1
- package/dist/adapters/oclif/commands/diff.d.mts +1 -1
- package/dist/adapters/oclif/commands/diff.mjs +2 -2
- package/dist/adapters/oclif/commands/gservice-account-keys/get.mjs +1 -1
- package/dist/adapters/oclif/commands/gservice-account-keys/reveal.mjs +2 -2
- package/dist/adapters/oclif/commands/gservice-accounts/create.mjs +1 -1
- package/dist/adapters/oclif/commands/gservice-accounts/delete.mjs +1 -1
- package/dist/adapters/oclif/commands/gservice-accounts/get.mjs +1 -1
- package/dist/adapters/oclif/commands/gservice-accounts/list.mjs +1 -1
- package/dist/adapters/oclif/commands/init.d.mts +2 -0
- package/dist/adapters/oclif/commands/init.mjs +92 -4
- package/dist/adapters/oclif/commands/org/create.mjs +1 -1
- package/dist/adapters/oclif/commands/org/current.mjs +2 -2
- package/dist/adapters/oclif/commands/org/get.mjs +1 -1
- package/dist/adapters/oclif/commands/org/list.mjs +2 -2
- package/dist/adapters/oclif/commands/org/switch.mjs +2 -2
- package/dist/adapters/oclif/commands/pull.d.mts +1 -1
- package/dist/adapters/oclif/commands/pull.mjs +2 -2
- package/dist/adapters/oclif/commands/score-groups/create.mjs +1 -1
- package/dist/adapters/oclif/commands/score-groups/delete.mjs +1 -1
- package/dist/adapters/oclif/commands/score-groups/get.mjs +1 -1
- package/dist/adapters/oclif/commands/score-groups/list.mjs +1 -1
- package/dist/adapters/oclif/commands/score-groups/update.mjs +1 -1
- package/dist/adapters/oclif/commands/scores/create.mjs +1 -1
- package/dist/adapters/oclif/commands/scores/delete.mjs +1 -1
- package/dist/adapters/oclif/commands/scores/list.mjs +1 -1
- package/dist/adapters/oclif/commands/scores/update.mjs +1 -1
- package/dist/adapters/oclif/commands/segments/create.mjs +1 -1
- package/dist/adapters/oclif/commands/segments/delete.mjs +1 -1
- package/dist/adapters/oclif/commands/segments/evaluate.mjs +2 -2
- package/dist/adapters/oclif/commands/segments/get-evaluation-history.mjs +2 -2
- package/dist/adapters/oclif/commands/segments/get-version.mjs +2 -2
- package/dist/adapters/oclif/commands/segments/get.mjs +1 -1
- package/dist/adapters/oclif/commands/segments/list-versions.mjs +2 -2
- package/dist/adapters/oclif/commands/segments/list.mjs +1 -1
- package/dist/adapters/oclif/commands/segments/restore-version.mjs +2 -2
- package/dist/adapters/oclif/commands/segments/update.mjs +1 -1
- package/dist/adapters/oclif/commands/sources/create.mjs +2 -2
- package/dist/adapters/oclif/commands/sources/delete.mjs +1 -1
- package/dist/adapters/oclif/commands/sources/get.mjs +1 -1
- package/dist/adapters/oclif/commands/sources/list-streams.mjs +2 -2
- package/dist/adapters/oclif/commands/sources/list.mjs +1 -1
- package/dist/adapters/oclif/commands/sources/update.mjs +2 -2
- package/dist/adapters/oclif/commands/status.d.mts +1 -1
- package/dist/adapters/oclif/commands/status.mjs +3 -3
- package/dist/adapters/oclif/commands/table-views/create.mjs +1 -1
- package/dist/adapters/oclif/commands/table-views/delete.mjs +1 -1
- package/dist/adapters/oclif/commands/table-views/list.mjs +1 -1
- package/dist/adapters/oclif/commands/table-views/update.mjs +1 -1
- package/dist/adapters/oclif/commands/tables/create.mjs +1 -1
- package/dist/adapters/oclif/commands/tables/delete.mjs +1 -1
- package/dist/adapters/oclif/commands/tables/get.mjs +1 -1
- package/dist/adapters/oclif/commands/tables/list.mjs +1 -1
- package/dist/adapters/oclif/commands/tables/update.mjs +1 -1
- package/dist/{base.command-D8taHOFF.mjs → base.command-CnVb4RG6.mjs} +1 -1
- package/dist/{core-B-IdeRNl.mjs → core-CY9pC37x.mjs} +68 -5
- package/dist/{factory-CCcimDhl.mjs → factory-DTqayaCF.mjs} +2 -2
- package/dist/{index-D0ax2I61.d.mts → index-Cbb9pLt6.d.mts} +26 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{presets-Bb9gwgeh.mjs → presets-mJzFGMhG.mjs} +2 -2
- package/dist/templates/.devcontainer/Dockerfile +8 -0
- package/dist/templates/.devcontainer/devcontainer.json +10 -9
- package/dist/templates/.devcontainer/post-create.sh +46 -0
- package/dist/templates/.devcontainer/post-start.sh +61 -0
- package/dist/templates/.devcontainer/welcome.sh +26 -0
- package/dist/templates/README.md +80 -12
- package/package.json +1 -1
- package/dist/templates/.devcontainer/setup.sh +0 -35
package/README.md
CHANGED
|
@@ -73,19 +73,25 @@ destination Path or project name (default: current directory)
|
|
|
73
73
|
|
|
74
74
|
If the destination already exists and is not empty, you will be prompted to confirm before proceeding. Use `--yes` to skip this prompt.
|
|
75
75
|
|
|
76
|
-
**What it does:**
|
|
76
|
+
**What it does (greenfield — no `revos.yaml` discovered):**
|
|
77
77
|
|
|
78
78
|
1. Fetches your organizations and prompts you to select one (auto-selects if only one).
|
|
79
79
|
2. Provisions a GCP service account for your org (idempotent) and writes the key to `~/.revos/{project-name}-gsa-creds.json`.
|
|
80
80
|
3. Writes `revos.yaml` — the project marker that pins this directory to your organization. CLI commands like `revos status` walk up from the current directory to find this file.
|
|
81
81
|
4. Creates the project directory structure (medallion layout: bronze/silver/gold).
|
|
82
|
-
5. Generates `.devcontainer
|
|
82
|
+
5. Generates `.devcontainer/` (`devcontainer.json`, `Dockerfile`, `post-create.sh`, `post-start.sh`, `welcome.sh`) with Python, Node.js, Google Cloud SDK (`bq`), GitHub CLI (`gh`), `jq`, and dbt pre-installed. The Dev Container persists three per-project named Docker volumes — `revos-{slug}-credentials` (`~/.revos`), `revos-{slug}-gcloud` (`~/.config/gcloud`), and `revos-{slug}-claude` (`~/.claude`) — so CLI login, GSA key, gcloud auth state, and Claude Code state all survive `Rebuild Container`. No host bind mounts.
|
|
83
83
|
6. Generates `dbt/profiles.yml` pre-configured for BigQuery.
|
|
84
84
|
7. Generates `.gitignore` and `README.md`.
|
|
85
85
|
8. Scaffolds AI companion files: `CLAUDE.md`, `AGENTS.md`, and `.claude/skills/` with six pre-installed skills: `explore-lakehouse`, `create-connections`, `create-cubes`, `create-dbt-transformations`, `load-sample-data`, and `visualize-semantic-model`. Also writes `.claude/settings.json` with deny rules that block AI assistants from reading `~/.revos/` (CLI credentials and service account keys), `~/.config/gcloud/` (Google Cloud Application Default Credentials), from running `gcloud auth print-*-token` commands, and from editing the settings file itself (so the AI can't lift its own restrictions).
|
|
86
86
|
9. Discovers every Connection and Cube currently in the org and writes them under `connections/` and `cubes/` so a developer joining an org with existing pipelines and cubes starts from the live state. Pass `--no-pull` to skip. Sources are managed only through the API surface (see [Sources](#sources)) and are referenced from Connection YAML by their server id.
|
|
87
87
|
|
|
88
|
-
**
|
|
88
|
+
**What it does (in-project — re-run inside an existing `revos.yaml` tree):**
|
|
89
|
+
|
|
90
|
+
`revos init` becomes idempotent: it skips the org prompt, skips scaffolding (no overwriting of existing files), skips IaC discovery, and only provisions the GCP service account key if `~/.revos/{project-name}-gsa-creds.json` is missing. If you aren't authenticated yet, it opens the browser to sign in first — the org is taken from `revos.yaml`, so no picker is shown. Useful inside the Dev Container, where the named credentials volume starts empty: a single `revos init` both signs you in and materializes the GSA key. Outside the container, re-running is a safe no-op if everything is already in place.
|
|
91
|
+
|
|
92
|
+
**Dev Container onboarding flow:** open project in VS Code → "Reopen in Container" → run `revos init`. The first run signs you in via the browser and provisions the GSA key. Subsequent container starts auto-activate the service account via `postStartCommand`.
|
|
93
|
+
|
|
94
|
+
**Requires:** `revos auth login` first (greenfield, since the multi-org picker and `--dev` selection live there). In-project init handles login itself.
|
|
89
95
|
|
|
90
96
|
---
|
|
91
97
|
|
|
@@ -290,6 +296,12 @@ The CLI walks up from the current working directory to find `revos.yaml` (or set
|
|
|
290
296
|
revos auth login
|
|
291
297
|
```
|
|
292
298
|
|
|
299
|
+
After the OAuth flow completes, the CLI picks your default organization:
|
|
300
|
+
|
|
301
|
+
- **Inside a project** (`revos.yaml` discovered) — uses `metadata.orgId` from `revos.yaml`; no prompt.
|
|
302
|
+
- **Outside a project, one org** — auto-selects it.
|
|
303
|
+
- **Outside a project, multiple orgs** — prompts you to pick.
|
|
304
|
+
|
|
293
305
|
#### Logout
|
|
294
306
|
|
|
295
307
|
```bash
|
|
@@ -394,7 +406,7 @@ The CLI exposes every method of `@revos/api-client` as a topic-prefixed command.
|
|
|
394
406
|
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
|
395
407
|
| `tables` | `list`, `get`, `create`, `update`, `delete` |
|
|
396
408
|
| `table-views` | `list`, `create`, `update`, `delete` |
|
|
397
|
-
| `cubes` | `list`, `get`, `create`, `update`, `delete`
|
|
409
|
+
| `cubes` | `list`, `get`, `create`, `update`, `delete`, `query`, `meta` |
|
|
398
410
|
| `connections` | `list`, `get`, `create`, `update`, `delete` |
|
|
399
411
|
| `scores` | `list`, `create`, `update`, `delete` |
|
|
400
412
|
| `score-groups` | `list`, `get`, `create`, `update`, `delete` |
|
|
@@ -451,6 +463,32 @@ revos actions get-params-schema act_789
|
|
|
451
463
|
revos gservice-account-keys reveal key_abc
|
|
452
464
|
```
|
|
453
465
|
|
|
466
|
+
#### Query the semantic model (`cubes query` / `cubes meta`)
|
|
467
|
+
|
|
468
|
+
`revos cubes meta` lists every cube and view exposed by the org's semantic
|
|
469
|
+
model along with its measures, dimensions, and segments — use it to discover
|
|
470
|
+
the member names you can reference in a query.
|
|
471
|
+
|
|
472
|
+
`revos cubes query` runs a Cube.js query and prints the resulting rows.
|
|
473
|
+
`--query` accepts inline JSON, `@path/to/file.json`, or `-` to read from
|
|
474
|
+
stdin. The payload may either be a bare query object or wrapped as
|
|
475
|
+
`{ "query": { ... } }`. Rows render as a table by default; pass `--json`
|
|
476
|
+
for the full response payload.
|
|
477
|
+
|
|
478
|
+
```bash
|
|
479
|
+
revos cubes meta
|
|
480
|
+
revos cubes meta --json | jq '.cubes[0]'
|
|
481
|
+
|
|
482
|
+
# inline
|
|
483
|
+
revos cubes query --query '{"measures":["Orders.count"]}'
|
|
484
|
+
|
|
485
|
+
# file
|
|
486
|
+
revos cubes query --query @./query.json --json
|
|
487
|
+
|
|
488
|
+
# stdin
|
|
489
|
+
echo '{"measures":["Orders.count"],"dimensions":["Orders.status"]}' | revos cubes query
|
|
490
|
+
```
|
|
491
|
+
|
|
454
492
|
---
|
|
455
493
|
|
|
456
494
|
### Raw API access (`revos api`)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { x as unwrap } from "../../../../core-
|
|
2
|
-
import { r as defineApiCommand } from "../../../../factory-
|
|
1
|
+
import { x as unwrap } from "../../../../core-CY9pC37x.mjs";
|
|
2
|
+
import { r as defineApiCommand } from "../../../../factory-DTqayaCF.mjs";
|
|
3
3
|
import { Args, Flags } from "@oclif/core";
|
|
4
4
|
//#region src/adapters/oclif/commands/actions/get-input-schema.ts
|
|
5
5
|
var get_input_schema_default = defineApiCommand({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { x as unwrap } from "../../../../core-
|
|
2
|
-
import { r as defineApiCommand } from "../../../../factory-
|
|
1
|
+
import { x as unwrap } from "../../../../core-CY9pC37x.mjs";
|
|
2
|
+
import { r as defineApiCommand } from "../../../../factory-DTqayaCF.mjs";
|
|
3
3
|
import { Args, Flags } from "@oclif/core";
|
|
4
4
|
//#region src/adapters/oclif/commands/actions/get-params-schema.ts
|
|
5
5
|
var get_params_schema_default = defineApiCommand({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { x as unwrap } from "../../../../core-
|
|
2
|
-
import { n as createListRender, r as defineApiCommand } from "../../../../factory-
|
|
1
|
+
import { x as unwrap } from "../../../../core-CY9pC37x.mjs";
|
|
2
|
+
import { n as createListRender, r as defineApiCommand } from "../../../../factory-DTqayaCF.mjs";
|
|
3
3
|
import { Flags } from "@oclif/core";
|
|
4
4
|
var list_default = defineApiCommand({
|
|
5
5
|
description: "List available actions",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createCommand } from "../../../../presets-
|
|
1
|
+
import { t as createCommand } from "../../../../presets-mJzFGMhG.mjs";
|
|
2
2
|
//#region src/adapters/oclif/commands/ai-instructions/create.ts
|
|
3
3
|
var create_default = createCommand({
|
|
4
4
|
resource: "aiInstructions",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as deleteCommand } from "../../../../presets-
|
|
1
|
+
import { n as deleteCommand } from "../../../../presets-mJzFGMhG.mjs";
|
|
2
2
|
//#region src/adapters/oclif/commands/ai-instructions/delete.ts
|
|
3
3
|
var delete_default = deleteCommand({
|
|
4
4
|
resource: "aiInstructions",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as updateCommand } from "../../../../presets-
|
|
1
|
+
import { a as updateCommand } from "../../../../presets-mJzFGMhG.mjs";
|
|
2
2
|
//#region src/adapters/oclif/commands/ai-instructions/update.ts
|
|
3
3
|
var update_default = updateCommand({
|
|
4
4
|
resource: "aiInstructions",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as defineApiCommand, t as bodyFlag } from "../../../factory-
|
|
1
|
+
import { G as ApiError } from "../../../core-CY9pC37x.mjs";
|
|
2
|
+
import { r as defineApiCommand, t as bodyFlag } from "../../../factory-DTqayaCF.mjs";
|
|
3
3
|
import { client } from "@revos/api-client";
|
|
4
4
|
import { Args, Flags } from "@oclif/core";
|
|
5
5
|
//#region src/adapters/oclif/commands/api.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as AppliedResource } from "../../../index-
|
|
1
|
+
import { f as AppliedResource } from "../../../index-Cbb9pLt6.mjs";
|
|
2
2
|
import { c as IacError } from "../../../context-D5uelKLe.mjs";
|
|
3
3
|
import { t as BaseCommand } from "../../../base.command-BmddDbHa.mjs";
|
|
4
4
|
import * as _$_oclif_core_interfaces0 from "@oclif/core/interfaces";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as getConfig, _ as buildIacRegistry, b as createApiClient, m as apply, v as discoverProject, y as projectRoot } from "../../../core-
|
|
2
|
-
import { t as BaseCommand } from "../../../base.command-
|
|
1
|
+
import { E as getConfig, _ as buildIacRegistry, b as createApiClient, m as apply, v as discoverProject, y as projectRoot } from "../../../core-CY9pC37x.mjs";
|
|
2
|
+
import { t as BaseCommand } from "../../../base.command-CnVb4RG6.mjs";
|
|
3
3
|
import { n as renderIacErrors, t as APPLY_ACTION_LABELS } from "../../../iac-render-BSZZEP0n.mjs";
|
|
4
4
|
import chalk from "chalk";
|
|
5
5
|
import { Args, Flags } from "@oclif/core";
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as BaseCommand } from "../../../../base.command-
|
|
1
|
+
import { D as resolveApiUrl, I as setAuthConfig, L as setAuthEnv, O as performOAuthLogin, V as getCredentialsPath, W as saveCredentials, b as createApiClient, k as AUTH_ENVS, l as resolveProjectContext, n as selectOrganization, x as unwrap } from "../../../../core-CY9pC37x.mjs";
|
|
2
|
+
import { t as BaseCommand } from "../../../../base.command-CnVb4RG6.mjs";
|
|
3
3
|
import chalk from "chalk";
|
|
4
4
|
import { Flags } from "@oclif/core";
|
|
5
|
-
import open from "open";
|
|
6
5
|
//#region src/adapters/oclif/commands/auth/login.ts
|
|
7
6
|
var AuthLogin = class extends BaseCommand {
|
|
8
7
|
static projectContextMode = "relaxed";
|
|
@@ -24,37 +23,23 @@ var AuthLogin = class extends BaseCommand {
|
|
|
24
23
|
authClientId: flags["auth-client-id"]
|
|
25
24
|
});
|
|
26
25
|
if (!this.jsonEnabled()) this.log("Starting authentication...\n");
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
this.
|
|
33
|
-
|
|
34
|
-
this.log(` ${authorizationUrl}\n`);
|
|
35
|
-
this.log("Waiting for authentication... (Press Ctrl+C to cancel)\n");
|
|
36
|
-
}
|
|
37
|
-
await open(authorizationUrl);
|
|
38
|
-
const callbackResult = await server.waitForCallback();
|
|
39
|
-
if (callbackResult.state !== pkce.state) throw new Error("Invalid state parameter. Authentication may have been tampered with.");
|
|
40
|
-
if (!this.jsonEnabled()) this.log("Received authorization code, exchanging for tokens...\n");
|
|
41
|
-
const tokenResponse = await exchangeCodeForTokens(callbackResult.code, redirectUri, pkce.codeVerifier);
|
|
42
|
-
const userInfo = await getUserInfo(tokenResponse.access_token);
|
|
43
|
-
const credentials = tokenResponseToCredentials(tokenResponse, userInfo);
|
|
44
|
-
const apiUrl = apiUrlOverride ?? process.env.REVOS_API_URL ?? "https://api.revos.ai";
|
|
45
|
-
const activeAuth = getActiveAuthConfig();
|
|
46
|
-
credentials.apiUrl = apiUrl;
|
|
47
|
-
credentials.authUrl = activeAuth.authUrl;
|
|
48
|
-
credentials.authClientId = activeAuth.authClientId;
|
|
49
|
-
saveCredentials(credentials);
|
|
26
|
+
const apiUrl = apiUrlOverride ?? resolveApiUrl();
|
|
27
|
+
const projectCtx = resolveProjectContext();
|
|
28
|
+
const { credentials, userInfo } = await performOAuthLogin({
|
|
29
|
+
apiUrl,
|
|
30
|
+
organizationId: projectCtx?.orgId,
|
|
31
|
+
log: this.jsonEnabled() ? void 0 : (msg) => this.log(msg)
|
|
32
|
+
});
|
|
50
33
|
if (!this.jsonEnabled()) {
|
|
51
34
|
this.log(chalk.green(`\nAuthenticated as ${userInfo.email || userInfo.sub}`));
|
|
52
35
|
this.log(`\nCredentials saved to ${getCredentialsPath()}`);
|
|
53
36
|
}
|
|
54
|
-
|
|
37
|
+
if (projectCtx) {
|
|
38
|
+
if (!this.jsonEnabled()) this.log(chalk.green(`\nUsing organization from revos.yaml: ${projectCtx.orgId}`));
|
|
39
|
+
} else try {
|
|
55
40
|
const orgs = unwrap(await createApiClient({
|
|
56
41
|
apiUrl,
|
|
57
|
-
token:
|
|
42
|
+
token: credentials.accessToken
|
|
58
43
|
}).organizations.list());
|
|
59
44
|
if (orgs.length === 1) {
|
|
60
45
|
credentials.organizationId = orgs[0].id;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as BaseCommand } from "../../../../base.command-
|
|
1
|
+
import { B as deleteCredentials } from "../../../../core-CY9pC37x.mjs";
|
|
2
|
+
import { t as BaseCommand } from "../../../../base.command-CnVb4RG6.mjs";
|
|
3
3
|
import * as os from "os";
|
|
4
4
|
//#region src/adapters/oclif/commands/auth/logout.ts
|
|
5
5
|
var AuthLogout = class extends BaseCommand {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as BaseCommand } from "../../../../base.command-
|
|
1
|
+
import { H as isTokenExpired, U as loadCredentials, V as getCredentialsPath, l as resolveProjectContext } from "../../../../core-CY9pC37x.mjs";
|
|
2
|
+
import { t as BaseCommand } from "../../../../base.command-CnVb4RG6.mjs";
|
|
3
3
|
import chalk from "chalk";
|
|
4
4
|
//#region src/adapters/oclif/commands/auth/status.ts
|
|
5
5
|
var AuthStatus = class extends BaseCommand {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { x as unwrap } from "../../../../core-CY9pC37x.mjs";
|
|
2
|
+
import { r as defineApiCommand } from "../../../../factory-DTqayaCF.mjs";
|
|
3
|
+
import chalk from "chalk";
|
|
4
|
+
//#region src/adapters/oclif/commands/cubes/meta.ts
|
|
5
|
+
var meta_default = defineApiCommand({
|
|
6
|
+
description: "List cubes and views in the semantic model with their measures, dimensions, and segments.",
|
|
7
|
+
examples: ["<%= config.bin %> <%= command.id %>", "<%= config.bin %> <%= command.id %> --json"],
|
|
8
|
+
call: async ({ api }) => {
|
|
9
|
+
return unwrap(await api.cubes.meta());
|
|
10
|
+
},
|
|
11
|
+
render: (data, command) => {
|
|
12
|
+
const cubes = data?.cubes ?? [];
|
|
13
|
+
if (cubes.length === 0) {
|
|
14
|
+
command.log("(no cubes)");
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
for (const cube of cubes) {
|
|
18
|
+
const heading = cube.title ? `${cube.name} — ${cube.title}` : cube.name;
|
|
19
|
+
command.log(chalk.bold(heading));
|
|
20
|
+
const members = [
|
|
21
|
+
...(cube.measures ?? []).map((m) => ({
|
|
22
|
+
kind: "measure",
|
|
23
|
+
...m
|
|
24
|
+
})),
|
|
25
|
+
...(cube.dimensions ?? []).map((m) => ({
|
|
26
|
+
kind: "dimension",
|
|
27
|
+
...m
|
|
28
|
+
})),
|
|
29
|
+
...(cube.segments ?? []).map((m) => ({
|
|
30
|
+
kind: "segment",
|
|
31
|
+
...m
|
|
32
|
+
}))
|
|
33
|
+
];
|
|
34
|
+
if (members.length === 0) command.log(" (no members)");
|
|
35
|
+
else for (const m of members) {
|
|
36
|
+
const suffix = m.type ? ` :${m.type}` : "";
|
|
37
|
+
const title = m.title ? ` ${chalk.dim(m.title)}` : "";
|
|
38
|
+
command.log(` ${chalk.gray(m.kind.padEnd(9))} ${m.name}${suffix}${title}`);
|
|
39
|
+
}
|
|
40
|
+
command.log("");
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
//#endregion
|
|
45
|
+
export { meta_default as default };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { x as unwrap } from "../../../../core-CY9pC37x.mjs";
|
|
2
|
+
import { i as renderList, r as defineApiCommand } from "../../../../factory-DTqayaCF.mjs";
|
|
3
|
+
import * as fs from "fs";
|
|
4
|
+
import * as path from "path";
|
|
5
|
+
import { Flags } from "@oclif/core";
|
|
6
|
+
//#region src/adapters/oclif/commands/cubes/query.ts
|
|
7
|
+
var query_default = defineApiCommand({
|
|
8
|
+
description: "Run a Cube.js query against the semantic model and print the resulting rows.",
|
|
9
|
+
examples: [
|
|
10
|
+
"<%= config.bin %> <%= command.id %> --query '{\"measures\":[\"Orders.count\"]}'",
|
|
11
|
+
"<%= config.bin %> <%= command.id %> --query @./query.json --json",
|
|
12
|
+
"echo '{\"measures\":[\"Orders.count\"]}' | <%= config.bin %> <%= command.id %>"
|
|
13
|
+
],
|
|
14
|
+
flags: { query: Flags.string({
|
|
15
|
+
description: "Cube.js query. Inline JSON, '@path' to read from a file, or '-' / omitted to read from stdin.",
|
|
16
|
+
helpValue: "JSON|@file|-"
|
|
17
|
+
}) },
|
|
18
|
+
call: async ({ api, flags }) => {
|
|
19
|
+
const parsed = parseQueryJson(await readQueryInput(flags.query));
|
|
20
|
+
const query = typeof parsed === "object" && parsed !== null && "query" in parsed ? parsed.query : parsed;
|
|
21
|
+
return unwrap(await api.cubes.query({ body: { query } }));
|
|
22
|
+
},
|
|
23
|
+
render: (data, command) => {
|
|
24
|
+
renderList(command, data ?? []);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
async function readQueryInput(flagValue) {
|
|
28
|
+
if (flagValue === void 0 || flagValue === "-") {
|
|
29
|
+
if (process.stdin.isTTY && flagValue !== "-") throw new Error("--query is required (inline JSON, '@path' for file, or '-' for stdin)");
|
|
30
|
+
return readStdin();
|
|
31
|
+
}
|
|
32
|
+
if (flagValue.startsWith("@")) {
|
|
33
|
+
const filePath = path.resolve(process.cwd(), flagValue.slice(1));
|
|
34
|
+
return fs.readFileSync(filePath, "utf8");
|
|
35
|
+
}
|
|
36
|
+
return flagValue;
|
|
37
|
+
}
|
|
38
|
+
function parseQueryJson(raw) {
|
|
39
|
+
try {
|
|
40
|
+
return JSON.parse(raw);
|
|
41
|
+
} catch (err) {
|
|
42
|
+
throw new Error(`--query is not valid JSON: ${err.message}`, { cause: err });
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
async function readStdin() {
|
|
46
|
+
const chunks = [];
|
|
47
|
+
for await (const chunk of process.stdin) chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
48
|
+
return Buffer.concat(chunks).toString("utf8");
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
export { query_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as AppliedResource } from "../../../index-
|
|
1
|
+
import { f as AppliedResource } from "../../../index-Cbb9pLt6.mjs";
|
|
2
2
|
import { c as IacError } from "../../../context-D5uelKLe.mjs";
|
|
3
3
|
import { t as BaseCommand } from "../../../base.command-BmddDbHa.mjs";
|
|
4
4
|
import * as _$_oclif_core_interfaces0 from "@oclif/core/interfaces";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as getConfig, _ as buildIacRegistry, b as createApiClient, h as formatDiffLine, m as apply, v as discoverProject, y as projectRoot } from "../../../core-
|
|
2
|
-
import { t as BaseCommand } from "../../../base.command-
|
|
1
|
+
import { E as getConfig, _ as buildIacRegistry, b as createApiClient, h as formatDiffLine, m as apply, v as discoverProject, y as projectRoot } from "../../../core-CY9pC37x.mjs";
|
|
2
|
+
import { t as BaseCommand } from "../../../base.command-CnVb4RG6.mjs";
|
|
3
3
|
import { n as renderIacErrors, t as APPLY_ACTION_LABELS } from "../../../iac-render-BSZZEP0n.mjs";
|
|
4
4
|
import chalk from "chalk";
|
|
5
5
|
import { Args, Flags } from "@oclif/core";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as getCommand } from "../../../../presets-
|
|
1
|
+
import { r as getCommand } from "../../../../presets-mJzFGMhG.mjs";
|
|
2
2
|
//#region src/adapters/oclif/commands/gservice-account-keys/get.ts
|
|
3
3
|
var get_default = getCommand({
|
|
4
4
|
resource: "gserviceAccountKeys",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { x as unwrap } from "../../../../core-
|
|
2
|
-
import { r as defineApiCommand } from "../../../../factory-
|
|
1
|
+
import { x as unwrap } from "../../../../core-CY9pC37x.mjs";
|
|
2
|
+
import { r as defineApiCommand } from "../../../../factory-DTqayaCF.mjs";
|
|
3
3
|
import { Args } from "@oclif/core";
|
|
4
4
|
//#region src/adapters/oclif/commands/gservice-account-keys/reveal.ts
|
|
5
5
|
var reveal_default = defineApiCommand({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createCommand } from "../../../../presets-
|
|
1
|
+
import { t as createCommand } from "../../../../presets-mJzFGMhG.mjs";
|
|
2
2
|
//#region src/adapters/oclif/commands/gservice-accounts/create.ts
|
|
3
3
|
var create_default = createCommand({
|
|
4
4
|
resource: "gserviceAccounts",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as deleteCommand } from "../../../../presets-
|
|
1
|
+
import { n as deleteCommand } from "../../../../presets-mJzFGMhG.mjs";
|
|
2
2
|
//#region src/adapters/oclif/commands/gservice-accounts/delete.ts
|
|
3
3
|
var delete_default = deleteCommand({
|
|
4
4
|
resource: "gserviceAccounts",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as listCommand } from "../../../../presets-
|
|
1
|
+
import { i as listCommand } from "../../../../presets-mJzFGMhG.mjs";
|
|
2
2
|
//#region src/adapters/oclif/commands/gservice-accounts/list.ts
|
|
3
3
|
var list_default = listCommand({
|
|
4
4
|
resource: "gserviceAccounts",
|
|
@@ -14,6 +14,8 @@ declare class Init extends BaseCommand<typeof Init> {
|
|
|
14
14
|
"no-pull": _$_oclif_core_interfaces0.BooleanFlag<boolean>;
|
|
15
15
|
};
|
|
16
16
|
run(): Promise<void>;
|
|
17
|
+
private runInProject;
|
|
18
|
+
private activateGcloudInContainer;
|
|
17
19
|
}
|
|
18
20
|
//#endregion
|
|
19
21
|
export { Init as default };
|