@revos/cli 0.2.2 → 0.2.3
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 +19 -7
- 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 +3 -2
- package/dist/adapters/oclif/commands/apply.mjs +2 -2
- package/dist/adapters/oclif/commands/auth/login.d.mts +3 -2
- package/dist/adapters/oclif/commands/auth/login.mjs +3 -2
- package/dist/adapters/oclif/commands/auth/logout.d.mts +2 -1
- package/dist/adapters/oclif/commands/auth/logout.mjs +3 -2
- package/dist/adapters/oclif/commands/auth/status.d.mts +4 -2
- package/dist/adapters/oclif/commands/auth/status.mjs +23 -3
- 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/update.mjs +1 -1
- package/dist/adapters/oclif/commands/diff.d.mts +3 -2
- 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 -1
- package/dist/adapters/oclif/commands/init.mjs +3 -2
- package/dist/adapters/oclif/commands/org/create.mjs +3 -2
- package/dist/adapters/oclif/commands/org/current.d.mts +12 -3
- package/dist/adapters/oclif/commands/org/current.mjs +27 -2
- package/dist/adapters/oclif/commands/org/get.mjs +3 -2
- package/dist/adapters/oclif/commands/org/list.mjs +15 -6
- package/dist/adapters/oclif/commands/org/switch.d.mts +3 -2
- package/dist/adapters/oclif/commands/org/switch.mjs +8 -2
- package/dist/adapters/oclif/commands/pull.d.mts +3 -2
- 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.d.mts +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.d.mts +1 -1
- package/dist/adapters/oclif/commands/sources/update.mjs +2 -2
- package/dist/adapters/oclif/commands/status.d.mts +3 -2
- 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-D7X3ZNtY.d.mts → base.command-BmddDbHa.d.mts} +4 -0
- package/dist/{base.command-cV5d65r8.mjs → base.command-D8taHOFF.mjs} +20 -2
- package/dist/context-D5uelKLe.d.mts +62 -0
- package/dist/{core-CMrP5BQS.mjs → core-B-IdeRNl.mjs} +71 -1
- package/dist/{factory-C6XLqhT9.mjs → factory-CCcimDhl.mjs} +3 -2
- package/dist/{index-BqKwXXAo.d.mts → index-D0ax2I61.d.mts} +25 -42
- package/dist/index.d.mts +4 -3
- package/dist/index.mjs +2 -2
- package/dist/{presets-CJbFbHlw.mjs → presets-Bb9gwgeh.mjs} +7 -2
- package/dist/templates/.devcontainer/Dockerfile +9 -0
- package/dist/templates/.devcontainer/devcontainer.json +4 -1
- package/dist/templates/gitignore +3 -1
- package/dist/{types-CGjxcj4L.d.mts → types-Bk2Cb5yt.d.mts} +6 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,10 +24,22 @@ revos [command] [options]
|
|
|
24
24
|
## Global Options
|
|
25
25
|
|
|
26
26
|
```
|
|
27
|
-
-o, --org <id> Override organization ID
|
|
27
|
+
-o, --org <id> Override organization ID. Only accepted OUTSIDE a project —
|
|
28
|
+
inside a project, the org is anchored in revos.yaml and
|
|
29
|
+
--org is rejected.
|
|
28
30
|
--json Format output as JSON
|
|
29
31
|
```
|
|
30
32
|
|
|
33
|
+
## Project context and the org
|
|
34
|
+
|
|
35
|
+
The CLI walks up from the current directory looking for `revos.yaml` on every command. When it finds one:
|
|
36
|
+
|
|
37
|
+
- `revos apply / pull / diff / status` and every resource command (`connections`, `cubes`, `tables`, …) target `metadata.orgId` from `revos.yaml`. This is authoritative.
|
|
38
|
+
- `--org` and `REVOS_ORG_ID` are validated against `revos.yaml`. A mismatch is a hard error — this prevents a Dev Container generated for org A from silently writing to org B when you switch contexts.
|
|
39
|
+
- Your stored global default (`revos org switch`) is informational only inside a project. The CLI warns if it differs from the project's org but uses the project's org for actual API calls.
|
|
40
|
+
|
|
41
|
+
Outside a project, the CLI uses `REVOS_ORG_ID` (env), then `--org`, then your stored global default (`revos org switch`). `revos init`, `revos auth *`, and `revos org *` skip the strict in-project enforcement so you can still log in, list, or switch orgs from inside a project tree.
|
|
42
|
+
|
|
31
43
|
## Commands
|
|
32
44
|
|
|
33
45
|
### Project Initialization
|
|
@@ -67,7 +79,7 @@ If the destination already exists and is not empty, you will be prompted to conf
|
|
|
67
79
|
2. Provisions a GCP service account for your org (idempotent) and writes the key to `~/.revos/{project-name}-gsa-creds.json`.
|
|
68
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.
|
|
69
81
|
4. Creates the project directory structure (medallion layout: bronze/silver/gold).
|
|
70
|
-
5. Generates `.devcontainer/devcontainer.json` with Python 3.11, Node.js, Google Cloud SDK (`bq`), and dbt pre-installed. The Dev Container mounts `~/.revos/{project-name}-gsa-creds.json` automatically.
|
|
82
|
+
5. Generates `.devcontainer/devcontainer.json` with Python 3.11, Node.js, Google Cloud SDK (`bq`), GitHub CLI (`gh`), and dbt pre-installed. The Dev Container mounts `~/.revos/{project-name}-gsa-creds.json` automatically.
|
|
71
83
|
6. Generates `dbt/profiles.yml` pre-configured for BigQuery.
|
|
72
84
|
7. Generates `.gitignore` and `README.md`.
|
|
73
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).
|
|
@@ -494,8 +506,8 @@ revos status --columns address,state,id
|
|
|
494
506
|
|
|
495
507
|
## Configuration
|
|
496
508
|
|
|
497
|
-
| Variable | Description
|
|
498
|
-
| --------------- |
|
|
499
|
-
| `REVOS_TOKEN` | Authentication token (alternative to `revos auth login`)
|
|
500
|
-
| `REVOS_API_URL` | API endpoint (default: `https://api.revos.ai`)
|
|
501
|
-
| `REVOS_ORG_ID` | Organization ID override
|
|
509
|
+
| Variable | Description |
|
|
510
|
+
| --------------- | ------------------------------------------------------------------------------------------------------------------ |
|
|
511
|
+
| `REVOS_TOKEN` | Authentication token (alternative to `revos auth login`) |
|
|
512
|
+
| `REVOS_API_URL` | API endpoint (default: `https://api.revos.ai`) |
|
|
513
|
+
| `REVOS_ORG_ID` | Organization ID override. Inside a project, must match `metadata.orgId` in `revos.yaml`; mismatch is a hard error. |
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as defineApiCommand } from "../../../../factory-
|
|
1
|
+
import { x as unwrap } from "../../../../core-B-IdeRNl.mjs";
|
|
2
|
+
import { r as defineApiCommand } from "../../../../factory-CCcimDhl.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 {
|
|
2
|
-
import { r as defineApiCommand } from "../../../../factory-
|
|
1
|
+
import { x as unwrap } from "../../../../core-B-IdeRNl.mjs";
|
|
2
|
+
import { r as defineApiCommand } from "../../../../factory-CCcimDhl.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 {
|
|
2
|
-
import { n as createListRender, r as defineApiCommand } from "../../../../factory-
|
|
1
|
+
import { x as unwrap } from "../../../../core-B-IdeRNl.mjs";
|
|
2
|
+
import { n as createListRender, r as defineApiCommand } from "../../../../factory-CCcimDhl.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-Bb9gwgeh.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-Bb9gwgeh.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-Bb9gwgeh.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 { U as ApiError } from "../../../core-B-IdeRNl.mjs";
|
|
2
|
+
import { r as defineApiCommand, t as bodyFlag } from "../../../factory-CCcimDhl.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,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { f as AppliedResource } from "../../../index-D0ax2I61.mjs";
|
|
2
|
+
import { c as IacError } from "../../../context-D5uelKLe.mjs";
|
|
3
|
+
import { t as BaseCommand } from "../../../base.command-BmddDbHa.mjs";
|
|
3
4
|
import * as _$_oclif_core_interfaces0 from "@oclif/core/interfaces";
|
|
4
5
|
|
|
5
6
|
//#region src/adapters/oclif/commands/apply.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
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-B-IdeRNl.mjs";
|
|
2
|
+
import { t as BaseCommand } from "../../../base.command-D8taHOFF.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,9 +1,10 @@
|
|
|
1
|
-
import { t as AuthResult } from "../../../../types-
|
|
2
|
-
import { t as BaseCommand } from "../../../../base.command-
|
|
1
|
+
import { t as AuthResult } from "../../../../types-Bk2Cb5yt.mjs";
|
|
2
|
+
import { t as BaseCommand } from "../../../../base.command-BmddDbHa.mjs";
|
|
3
3
|
import * as _$_oclif_core_interfaces0 from "@oclif/core/interfaces";
|
|
4
4
|
|
|
5
5
|
//#region src/adapters/oclif/commands/auth/login.d.ts
|
|
6
6
|
declare class AuthLogin extends BaseCommand<typeof AuthLogin> {
|
|
7
|
+
static projectContextMode: "relaxed";
|
|
7
8
|
static description: string;
|
|
8
9
|
static flags: {
|
|
9
10
|
dev: _$_oclif_core_interfaces0.BooleanFlag<boolean>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as BaseCommand } from "../../../../base.command-
|
|
1
|
+
import { A as generatePKCEChallenge, D as AUTH_ENVS, F as setAuthEnv, H as saveCredentials, I as tokenResponseToCredentials, L as startOAuthServer, M as getUserInfo, O as buildAuthorizationUrl, P as setAuthConfig, b as createApiClient, j as getActiveAuthConfig, k as exchangeCodeForTokens, n as selectOrganization, x as unwrap, z as getCredentialsPath } from "../../../../core-B-IdeRNl.mjs";
|
|
2
|
+
import { t as BaseCommand } from "../../../../base.command-D8taHOFF.mjs";
|
|
3
3
|
import chalk from "chalk";
|
|
4
4
|
import { Flags } from "@oclif/core";
|
|
5
5
|
import open from "open";
|
|
6
6
|
//#region src/adapters/oclif/commands/auth/login.ts
|
|
7
7
|
var AuthLogin = class extends BaseCommand {
|
|
8
|
+
static projectContextMode = "relaxed";
|
|
8
9
|
static description = "Authenticate with RevOS via browser";
|
|
9
10
|
static flags = {
|
|
10
11
|
dev: Flags.boolean({ description: "Authenticate against the development environment" }),
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { t as BaseCommand } from "../../../../base.command-
|
|
1
|
+
import { t as BaseCommand } from "../../../../base.command-BmddDbHa.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/adapters/oclif/commands/auth/logout.d.ts
|
|
4
4
|
declare class AuthLogout extends BaseCommand<typeof AuthLogout> {
|
|
5
5
|
static description: string;
|
|
6
|
+
static projectContextMode: "relaxed";
|
|
6
7
|
run(): Promise<{
|
|
7
8
|
deleted: boolean;
|
|
8
9
|
}>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as BaseCommand } from "../../../../base.command-
|
|
1
|
+
import { R as deleteCredentials } from "../../../../core-B-IdeRNl.mjs";
|
|
2
|
+
import { t as BaseCommand } from "../../../../base.command-D8taHOFF.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 {
|
|
6
6
|
static description = "Remove stored authentication credentials";
|
|
7
|
+
static projectContextMode = "relaxed";
|
|
7
8
|
async run() {
|
|
8
9
|
const deleted = deleteCredentials();
|
|
9
10
|
if (!this.jsonEnabled()) {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { n as AuthStatusInfo } from "../../../../types-
|
|
2
|
-
import { t as BaseCommand } from "../../../../base.command-
|
|
1
|
+
import { n as AuthStatusInfo } from "../../../../types-Bk2Cb5yt.mjs";
|
|
2
|
+
import { t as BaseCommand } from "../../../../base.command-BmddDbHa.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/adapters/oclif/commands/auth/status.d.ts
|
|
5
5
|
declare class AuthStatus extends BaseCommand<typeof AuthStatus> {
|
|
6
6
|
static description: string;
|
|
7
|
+
static projectContextMode: "relaxed";
|
|
7
8
|
run(): Promise<AuthStatusInfo>;
|
|
8
9
|
private renderStatus;
|
|
10
|
+
private renderProject;
|
|
9
11
|
}
|
|
10
12
|
//#endregion
|
|
11
13
|
export { AuthStatus as default };
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as BaseCommand } from "../../../../base.command-
|
|
1
|
+
import { B as isTokenExpired, V as loadCredentials, l as resolveProjectContext, z as getCredentialsPath } from "../../../../core-B-IdeRNl.mjs";
|
|
2
|
+
import { t as BaseCommand } from "../../../../base.command-D8taHOFF.mjs";
|
|
3
3
|
import chalk from "chalk";
|
|
4
4
|
//#region src/adapters/oclif/commands/auth/status.ts
|
|
5
5
|
var AuthStatus = class extends BaseCommand {
|
|
6
6
|
static description = "Show current authentication status";
|
|
7
|
+
static projectContextMode = "relaxed";
|
|
7
8
|
async run() {
|
|
8
9
|
const envToken = process.env.REVOS_TOKEN;
|
|
9
10
|
const storedCredentials = loadCredentials();
|
|
11
|
+
const projectContext = resolveProjectContext();
|
|
10
12
|
let status;
|
|
11
13
|
if (envToken) status = {
|
|
12
14
|
authenticated: true,
|
|
@@ -25,6 +27,12 @@ var AuthStatus = class extends BaseCommand {
|
|
|
25
27
|
};
|
|
26
28
|
if (!this.jsonEnabled() && expired) this.warn("Token has expired. Please run 'revos auth login' to re-authenticate.");
|
|
27
29
|
} else status = { authenticated: false };
|
|
30
|
+
if (projectContext) status.project = {
|
|
31
|
+
name: projectContext.projectFile.metadata.name,
|
|
32
|
+
path: projectContext.projectFile.path,
|
|
33
|
+
orgId: projectContext.orgId,
|
|
34
|
+
inSyncWithGlobal: !storedCredentials?.organizationId || storedCredentials.organizationId === projectContext.orgId
|
|
35
|
+
};
|
|
28
36
|
if (!this.jsonEnabled()) this.renderStatus(status);
|
|
29
37
|
return status;
|
|
30
38
|
}
|
|
@@ -32,6 +40,7 @@ var AuthStatus = class extends BaseCommand {
|
|
|
32
40
|
if (!status.authenticated) {
|
|
33
41
|
this.log(chalk.yellow("Not authenticated"));
|
|
34
42
|
this.log(chalk.gray("\nRun 'revos auth login' to authenticate."));
|
|
43
|
+
this.renderProject(status);
|
|
35
44
|
return;
|
|
36
45
|
}
|
|
37
46
|
this.log(chalk.bold("Authentication Status:\n"));
|
|
@@ -49,9 +58,20 @@ var AuthStatus = class extends BaseCommand {
|
|
|
49
58
|
}
|
|
50
59
|
if (status.organizationId) {
|
|
51
60
|
const orgDisplay = status.organizationName ? `${status.organizationName} (${status.organizationId})` : status.organizationId;
|
|
52
|
-
|
|
61
|
+
const label = status.project ? "Global default" : "Organization";
|
|
62
|
+
this.log(` ${label}: ${orgDisplay}`);
|
|
53
63
|
}
|
|
54
64
|
if (status.credentialsPath) this.log(chalk.gray(`\n Credentials: ${status.credentialsPath}`));
|
|
65
|
+
this.renderProject(status);
|
|
66
|
+
}
|
|
67
|
+
renderProject(status) {
|
|
68
|
+
if (!status.project) return;
|
|
69
|
+
this.log("");
|
|
70
|
+
this.log(chalk.bold("Project:") + ` ${status.project.name ?? "(unnamed)"}`);
|
|
71
|
+
this.log(chalk.gray(` Path: ${status.project.path}`));
|
|
72
|
+
this.log(` Org: ${status.project.orgId}`);
|
|
73
|
+
if (!status.project.inSyncWithGlobal) this.log(chalk.yellow(` ⚠ Differs from your global default — apply/pull/diff use this project's org.`));
|
|
74
|
+
else this.log(chalk.gray(` ✓ In sync with global default`));
|
|
55
75
|
}
|
|
56
76
|
};
|
|
57
77
|
//#endregion
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { f as AppliedResource } from "../../../index-D0ax2I61.mjs";
|
|
2
|
+
import { c as IacError } from "../../../context-D5uelKLe.mjs";
|
|
3
|
+
import { t as BaseCommand } from "../../../base.command-BmddDbHa.mjs";
|
|
3
4
|
import * as _$_oclif_core_interfaces0 from "@oclif/core/interfaces";
|
|
4
5
|
|
|
5
6
|
//#region src/adapters/oclif/commands/diff.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
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-B-IdeRNl.mjs";
|
|
2
|
+
import { t as BaseCommand } from "../../../base.command-D8taHOFF.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-Bb9gwgeh.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 {
|
|
2
|
-
import { r as defineApiCommand } from "../../../../factory-
|
|
1
|
+
import { x as unwrap } from "../../../../core-B-IdeRNl.mjs";
|
|
2
|
+
import { r as defineApiCommand } from "../../../../factory-CCcimDhl.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-Bb9gwgeh.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-Bb9gwgeh.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-Bb9gwgeh.mjs";
|
|
2
2
|
//#region src/adapters/oclif/commands/gservice-accounts/list.ts
|
|
3
3
|
var list_default = listCommand({
|
|
4
4
|
resource: "gserviceAccounts",
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { t as BaseCommand } from "../../../base.command-
|
|
1
|
+
import { t as BaseCommand } from "../../../base.command-BmddDbHa.mjs";
|
|
2
2
|
import * as _$_oclif_core_interfaces0 from "@oclif/core/interfaces";
|
|
3
3
|
|
|
4
4
|
//#region src/adapters/oclif/commands/init.d.ts
|
|
5
5
|
declare class Init extends BaseCommand<typeof Init> {
|
|
6
6
|
static description: string;
|
|
7
|
+
static projectContextMode: "relaxed";
|
|
7
8
|
static args: {
|
|
8
9
|
destination: _$_oclif_core_interfaces0.Arg<string | undefined, Record<string, unknown>>;
|
|
9
10
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as getConfig, U as ApiError, t as InitService } from "../../../core-B-IdeRNl.mjs";
|
|
2
2
|
import { TEMPLATES_DIR } from "../../../templates/index.mjs";
|
|
3
|
-
import { t as BaseCommand } from "../../../base.command-
|
|
3
|
+
import { t as BaseCommand } from "../../../base.command-D8taHOFF.mjs";
|
|
4
4
|
import * as fs from "fs";
|
|
5
5
|
import * as path from "path";
|
|
6
6
|
import chalk from "chalk";
|
|
@@ -12,6 +12,7 @@ function isDirEmpty(dirPath) {
|
|
|
12
12
|
}
|
|
13
13
|
var Init = class extends BaseCommand {
|
|
14
14
|
static description = "Scaffold a new RevOS data engineering project";
|
|
15
|
+
static projectContextMode = "relaxed";
|
|
15
16
|
static args = { destination: Args.string({
|
|
16
17
|
description: "Path or project name (default: current directory name). Supports relative and absolute paths.",
|
|
17
18
|
required: false
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { t as createCommand } from "../../../../presets-
|
|
1
|
+
import { t as createCommand } from "../../../../presets-Bb9gwgeh.mjs";
|
|
2
2
|
//#region src/adapters/oclif/commands/org/create.ts
|
|
3
3
|
var create_default = createCommand({
|
|
4
4
|
resource: "organizations",
|
|
5
|
-
description: "Create a new organization"
|
|
5
|
+
description: "Create a new organization",
|
|
6
|
+
projectContextMode: "relaxed"
|
|
6
7
|
});
|
|
7
8
|
//#endregion
|
|
8
9
|
export { create_default as default };
|
|
@@ -1,14 +1,23 @@
|
|
|
1
|
-
import { s as OrganizationInfo } from "../../../../types-
|
|
2
|
-
import { t as BaseCommand } from "../../../../base.command-
|
|
1
|
+
import { s as OrganizationInfo } from "../../../../types-Bk2Cb5yt.mjs";
|
|
2
|
+
import { t as BaseCommand } from "../../../../base.command-BmddDbHa.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/adapters/oclif/commands/org/current.d.ts
|
|
5
5
|
interface CurrentOrgResult {
|
|
6
6
|
organizationId: string | null;
|
|
7
7
|
organization: OrganizationInfo | null;
|
|
8
|
-
source: "env" | "credentials" | null;
|
|
8
|
+
source: "env" | "credentials" | "project" | null;
|
|
9
|
+
project?: {
|
|
10
|
+
name?: string;
|
|
11
|
+
path: string;
|
|
12
|
+
orgId: string;
|
|
13
|
+
};
|
|
14
|
+
globalDefault?: {
|
|
15
|
+
organizationId: string | null;
|
|
16
|
+
};
|
|
9
17
|
}
|
|
10
18
|
declare class OrgCurrent extends BaseCommand<typeof OrgCurrent> {
|
|
11
19
|
static description: string;
|
|
20
|
+
static projectContextMode: "relaxed";
|
|
12
21
|
run(): Promise<CurrentOrgResult>;
|
|
13
22
|
}
|
|
14
23
|
//#endregion
|
|
@@ -1,11 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as BaseCommand } from "../../../../base.command-
|
|
1
|
+
import { E as getConfig, V as loadCredentials, b as createApiClient, l as resolveProjectContext, x as unwrap } from "../../../../core-B-IdeRNl.mjs";
|
|
2
|
+
import { t as BaseCommand } from "../../../../base.command-D8taHOFF.mjs";
|
|
3
|
+
import chalk from "chalk";
|
|
3
4
|
//#region src/adapters/oclif/commands/org/current.ts
|
|
4
5
|
var OrgCurrent = class extends BaseCommand {
|
|
5
6
|
static description = "Show currently selected organization";
|
|
7
|
+
static projectContextMode = "relaxed";
|
|
6
8
|
async run() {
|
|
7
9
|
const credentials = loadCredentials();
|
|
10
|
+
const projectContext = resolveProjectContext();
|
|
8
11
|
const envOrgId = process.env.REVOS_ORG_ID;
|
|
12
|
+
if (projectContext) {
|
|
13
|
+
let organization = null;
|
|
14
|
+
try {
|
|
15
|
+
organization = unwrap(await createApiClient(await getConfig()).organizations.list()).find((o) => o.id === projectContext.orgId) ?? null;
|
|
16
|
+
} catch {}
|
|
17
|
+
if (!this.jsonEnabled()) {
|
|
18
|
+
const orgDisplay = organization ? `${organization.name} (${projectContext.orgId})` : projectContext.orgId;
|
|
19
|
+
this.log(`Current organization (from ${chalk.cyan("revos.yaml")}): ${orgDisplay}`);
|
|
20
|
+
if (credentials?.organizationId && credentials.organizationId !== projectContext.orgId) this.log(chalk.gray(`Global default differs: ${credentials.organizationId}`));
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
organizationId: projectContext.orgId,
|
|
24
|
+
organization,
|
|
25
|
+
source: "project",
|
|
26
|
+
project: {
|
|
27
|
+
name: projectContext.projectFile.metadata.name,
|
|
28
|
+
path: projectContext.projectFile.path,
|
|
29
|
+
orgId: projectContext.orgId
|
|
30
|
+
},
|
|
31
|
+
globalDefault: { organizationId: credentials?.organizationId ?? null }
|
|
32
|
+
};
|
|
33
|
+
}
|
|
9
34
|
if (envOrgId) {
|
|
10
35
|
if (!this.jsonEnabled()) this.log(`Current organization (from REVOS_ORG_ID): ${envOrgId}`);
|
|
11
36
|
return {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { r as getCommand } from "../../../../presets-
|
|
1
|
+
import { r as getCommand } from "../../../../presets-Bb9gwgeh.mjs";
|
|
2
2
|
//#region src/adapters/oclif/commands/org/get.ts
|
|
3
3
|
var get_default = getCommand({
|
|
4
4
|
resource: "organizations",
|
|
5
|
-
description: "Get an organization by ID"
|
|
5
|
+
description: "Get an organization by ID",
|
|
6
|
+
projectContextMode: "relaxed"
|
|
6
7
|
});
|
|
7
8
|
//#endregion
|
|
8
9
|
export { get_default as default };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as resolveColumns, i as renderList, r as defineApiCommand } from "../../../../factory-
|
|
1
|
+
import { l as resolveProjectContext, x as unwrap } from "../../../../core-B-IdeRNl.mjs";
|
|
2
|
+
import { a as resolveColumns, i as renderList, r as defineApiCommand } from "../../../../factory-CCcimDhl.mjs";
|
|
3
3
|
import chalk from "chalk";
|
|
4
4
|
import { Flags } from "@oclif/core";
|
|
5
5
|
//#region src/adapters/oclif/commands/org/list.ts
|
|
6
6
|
const DEFAULT_COLUMNS = ["id", "name"];
|
|
7
7
|
var list_default = defineApiCommand({
|
|
8
8
|
description: "List organizations you belong to",
|
|
9
|
+
projectContextMode: "relaxed",
|
|
9
10
|
flags: { columns: Flags.string({
|
|
10
11
|
description: "Columns to display in table output (comma-separated). Overrides the resource default. Ignored with --json.",
|
|
11
12
|
helpValue: "a,b,c"
|
|
@@ -22,12 +23,20 @@ var list_default = defineApiCommand({
|
|
|
22
23
|
command.warn("You don't belong to any organizations.");
|
|
23
24
|
return;
|
|
24
25
|
}
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
const projectOrgId = resolveProjectContext()?.orgId;
|
|
27
|
+
const rows = organizations.map((org) => {
|
|
28
|
+
const annotations = [];
|
|
29
|
+
if (org.id === projectOrgId) annotations.push(chalk.cyan("project"));
|
|
30
|
+
if (org.id === currentOrgId && org.id !== projectOrgId) annotations.push(chalk.green("current"));
|
|
31
|
+
const suffix = annotations.length ? ` ${annotations.join(" ")}` : "";
|
|
32
|
+
return {
|
|
33
|
+
id: org.id,
|
|
34
|
+
name: `${org.name}${suffix}`
|
|
35
|
+
};
|
|
36
|
+
});
|
|
29
37
|
const flags = command.flags;
|
|
30
38
|
renderList(command, rows, { columns: resolveColumns(flags.columns, DEFAULT_COLUMNS) });
|
|
39
|
+
if (projectOrgId && projectOrgId !== currentOrgId) command.log(chalk.gray(`\nThis directory is anchored to the project org; the global default differs.`));
|
|
31
40
|
}
|
|
32
41
|
});
|
|
33
42
|
//#endregion
|