@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.
Files changed (102) hide show
  1. package/README.md +19 -7
  2. package/dist/adapters/oclif/commands/action-runs/get.mjs +1 -1
  3. package/dist/adapters/oclif/commands/action-runs/list.mjs +1 -1
  4. package/dist/adapters/oclif/commands/actions/get-input-schema.mjs +2 -2
  5. package/dist/adapters/oclif/commands/actions/get-params-schema.mjs +2 -2
  6. package/dist/adapters/oclif/commands/actions/get.mjs +1 -1
  7. package/dist/adapters/oclif/commands/actions/list.mjs +2 -2
  8. package/dist/adapters/oclif/commands/ai-instructions/create.mjs +1 -1
  9. package/dist/adapters/oclif/commands/ai-instructions/delete.mjs +1 -1
  10. package/dist/adapters/oclif/commands/ai-instructions/get.mjs +1 -1
  11. package/dist/adapters/oclif/commands/ai-instructions/list.mjs +1 -1
  12. package/dist/adapters/oclif/commands/ai-instructions/update.mjs +1 -1
  13. package/dist/adapters/oclif/commands/api.mjs +2 -2
  14. package/dist/adapters/oclif/commands/apply.d.mts +3 -2
  15. package/dist/adapters/oclif/commands/apply.mjs +2 -2
  16. package/dist/adapters/oclif/commands/auth/login.d.mts +3 -2
  17. package/dist/adapters/oclif/commands/auth/login.mjs +3 -2
  18. package/dist/adapters/oclif/commands/auth/logout.d.mts +2 -1
  19. package/dist/adapters/oclif/commands/auth/logout.mjs +3 -2
  20. package/dist/adapters/oclif/commands/auth/status.d.mts +4 -2
  21. package/dist/adapters/oclif/commands/auth/status.mjs +23 -3
  22. package/dist/adapters/oclif/commands/connections/create.mjs +1 -1
  23. package/dist/adapters/oclif/commands/connections/delete.mjs +1 -1
  24. package/dist/adapters/oclif/commands/connections/get.mjs +1 -1
  25. package/dist/adapters/oclif/commands/connections/list.mjs +1 -1
  26. package/dist/adapters/oclif/commands/connections/update.mjs +1 -1
  27. package/dist/adapters/oclif/commands/cubes/create.mjs +1 -1
  28. package/dist/adapters/oclif/commands/cubes/delete.mjs +1 -1
  29. package/dist/adapters/oclif/commands/cubes/get.mjs +1 -1
  30. package/dist/adapters/oclif/commands/cubes/list.mjs +1 -1
  31. package/dist/adapters/oclif/commands/cubes/update.mjs +1 -1
  32. package/dist/adapters/oclif/commands/diff.d.mts +3 -2
  33. package/dist/adapters/oclif/commands/diff.mjs +2 -2
  34. package/dist/adapters/oclif/commands/gservice-account-keys/get.mjs +1 -1
  35. package/dist/adapters/oclif/commands/gservice-account-keys/reveal.mjs +2 -2
  36. package/dist/adapters/oclif/commands/gservice-accounts/create.mjs +1 -1
  37. package/dist/adapters/oclif/commands/gservice-accounts/delete.mjs +1 -1
  38. package/dist/adapters/oclif/commands/gservice-accounts/get.mjs +1 -1
  39. package/dist/adapters/oclif/commands/gservice-accounts/list.mjs +1 -1
  40. package/dist/adapters/oclif/commands/init.d.mts +2 -1
  41. package/dist/adapters/oclif/commands/init.mjs +3 -2
  42. package/dist/adapters/oclif/commands/org/create.mjs +3 -2
  43. package/dist/adapters/oclif/commands/org/current.d.mts +12 -3
  44. package/dist/adapters/oclif/commands/org/current.mjs +27 -2
  45. package/dist/adapters/oclif/commands/org/get.mjs +3 -2
  46. package/dist/adapters/oclif/commands/org/list.mjs +15 -6
  47. package/dist/adapters/oclif/commands/org/switch.d.mts +3 -2
  48. package/dist/adapters/oclif/commands/org/switch.mjs +8 -2
  49. package/dist/adapters/oclif/commands/pull.d.mts +3 -2
  50. package/dist/adapters/oclif/commands/pull.mjs +2 -2
  51. package/dist/adapters/oclif/commands/score-groups/create.mjs +1 -1
  52. package/dist/adapters/oclif/commands/score-groups/delete.mjs +1 -1
  53. package/dist/adapters/oclif/commands/score-groups/get.mjs +1 -1
  54. package/dist/adapters/oclif/commands/score-groups/list.mjs +1 -1
  55. package/dist/adapters/oclif/commands/score-groups/update.mjs +1 -1
  56. package/dist/adapters/oclif/commands/scores/create.mjs +1 -1
  57. package/dist/adapters/oclif/commands/scores/delete.mjs +1 -1
  58. package/dist/adapters/oclif/commands/scores/list.mjs +1 -1
  59. package/dist/adapters/oclif/commands/scores/update.mjs +1 -1
  60. package/dist/adapters/oclif/commands/segments/create.mjs +1 -1
  61. package/dist/adapters/oclif/commands/segments/delete.mjs +1 -1
  62. package/dist/adapters/oclif/commands/segments/evaluate.mjs +2 -2
  63. package/dist/adapters/oclif/commands/segments/get-evaluation-history.mjs +2 -2
  64. package/dist/adapters/oclif/commands/segments/get-version.mjs +2 -2
  65. package/dist/adapters/oclif/commands/segments/get.mjs +1 -1
  66. package/dist/adapters/oclif/commands/segments/list-versions.mjs +2 -2
  67. package/dist/adapters/oclif/commands/segments/list.mjs +1 -1
  68. package/dist/adapters/oclif/commands/segments/restore-version.mjs +2 -2
  69. package/dist/adapters/oclif/commands/segments/update.mjs +1 -1
  70. package/dist/adapters/oclif/commands/sources/create.d.mts +1 -1
  71. package/dist/adapters/oclif/commands/sources/create.mjs +2 -2
  72. package/dist/adapters/oclif/commands/sources/delete.mjs +1 -1
  73. package/dist/adapters/oclif/commands/sources/get.mjs +1 -1
  74. package/dist/adapters/oclif/commands/sources/list-streams.mjs +2 -2
  75. package/dist/adapters/oclif/commands/sources/list.mjs +1 -1
  76. package/dist/adapters/oclif/commands/sources/update.d.mts +1 -1
  77. package/dist/adapters/oclif/commands/sources/update.mjs +2 -2
  78. package/dist/adapters/oclif/commands/status.d.mts +3 -2
  79. package/dist/adapters/oclif/commands/status.mjs +3 -3
  80. package/dist/adapters/oclif/commands/table-views/create.mjs +1 -1
  81. package/dist/adapters/oclif/commands/table-views/delete.mjs +1 -1
  82. package/dist/adapters/oclif/commands/table-views/list.mjs +1 -1
  83. package/dist/adapters/oclif/commands/table-views/update.mjs +1 -1
  84. package/dist/adapters/oclif/commands/tables/create.mjs +1 -1
  85. package/dist/adapters/oclif/commands/tables/delete.mjs +1 -1
  86. package/dist/adapters/oclif/commands/tables/get.mjs +1 -1
  87. package/dist/adapters/oclif/commands/tables/list.mjs +1 -1
  88. package/dist/adapters/oclif/commands/tables/update.mjs +1 -1
  89. package/dist/{base.command-D7X3ZNtY.d.mts → base.command-BmddDbHa.d.mts} +4 -0
  90. package/dist/{base.command-cV5d65r8.mjs → base.command-D8taHOFF.mjs} +20 -2
  91. package/dist/context-D5uelKLe.d.mts +62 -0
  92. package/dist/{core-CMrP5BQS.mjs → core-B-IdeRNl.mjs} +71 -1
  93. package/dist/{factory-C6XLqhT9.mjs → factory-CCcimDhl.mjs} +3 -2
  94. package/dist/{index-BqKwXXAo.d.mts → index-D0ax2I61.d.mts} +25 -42
  95. package/dist/index.d.mts +4 -3
  96. package/dist/index.mjs +2 -2
  97. package/dist/{presets-CJbFbHlw.mjs → presets-Bb9gwgeh.mjs} +7 -2
  98. package/dist/templates/.devcontainer/Dockerfile +9 -0
  99. package/dist/templates/.devcontainer/devcontainer.json +4 -1
  100. package/dist/templates/gitignore +3 -1
  101. package/dist/{types-CGjxcj4L.d.mts → types-Bk2Cb5yt.d.mts} +6 -0
  102. package/package.json +1 -1
@@ -1,10 +1,11 @@
1
- import { o as OrgSwitchResult } from "../../../../types-CGjxcj4L.mjs";
2
- import { t as BaseCommand } from "../../../../base.command-D7X3ZNtY.mjs";
1
+ import { o as OrgSwitchResult } 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/org/switch.d.ts
6
6
  declare class OrgSwitch extends BaseCommand<typeof OrgSwitch> {
7
7
  static description: string;
8
+ static projectContextMode: "relaxed";
8
9
  static args: {
9
10
  id: _$_oclif_core_interfaces0.Arg<string | undefined, Record<string, unknown>>;
10
11
  };
@@ -1,11 +1,12 @@
1
- import { N as loadCredentials, P as saveCredentials, f as createApiClient, n as selectOrganization, p as unwrap, v as getConfig } from "../../../../core-CMrP5BQS.mjs";
2
- import { t as BaseCommand } from "../../../../base.command-cV5d65r8.mjs";
1
+ import { E as getConfig, H as saveCredentials, V as loadCredentials, a as formatInProjectSwitchWarning, b as createApiClient, l as resolveProjectContext, n as selectOrganization, x as unwrap } from "../../../../core-B-IdeRNl.mjs";
2
+ import { t as BaseCommand } from "../../../../base.command-D8taHOFF.mjs";
3
3
  import * as os from "os";
4
4
  import chalk from "chalk";
5
5
  import { Args } from "@oclif/core";
6
6
  //#region src/adapters/oclif/commands/org/switch.ts
7
7
  var OrgSwitch = class extends BaseCommand {
8
8
  static description = "Switch to a different organization";
9
+ static projectContextMode = "relaxed";
9
10
  static args = { id: Args.string({
10
11
  description: "Organization ID",
11
12
  required: false
@@ -29,6 +30,11 @@ var OrgSwitch = class extends BaseCommand {
29
30
  ...credentials,
30
31
  organizationId: selected.id
31
32
  });
33
+ const projectContext = resolveProjectContext();
34
+ if (projectContext && projectContext.orgId !== selected.id && !json) this.warn(formatInProjectSwitchWarning({
35
+ projectName: projectContext.projectFile.metadata.name,
36
+ projectOrgId: projectContext.orgId
37
+ }));
32
38
  if (!json) this.log(chalk.green(`Switched to organization: ${selected.name}`));
33
39
  return {
34
40
  success: true,
@@ -1,5 +1,6 @@
1
- import { c as IacError, o as PulledResource } from "../../../index-BqKwXXAo.mjs";
2
- import { t as BaseCommand } from "../../../base.command-D7X3ZNtY.mjs";
1
+ import { d as PulledResource } 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/pull.d.ts
@@ -1,5 +1,5 @@
1
- import { a as pull, d as projectRoot, f as createApiClient, l as buildIacRegistry, u as discoverProject, v as getConfig } from "../../../core-CMrP5BQS.mjs";
2
- import { t as BaseCommand } from "../../../base.command-cV5d65r8.mjs";
1
+ import { E as getConfig, _ as buildIacRegistry, b as createApiClient, p as pull, 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 } 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 { t as createCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { t as createCommand } from "../../../../presets-Bb9gwgeh.mjs";
2
2
  //#region src/adapters/oclif/commands/score-groups/create.ts
3
3
  var create_default = createCommand({
4
4
  resource: "scoreGroups",
@@ -1,4 +1,4 @@
1
- import { n as deleteCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { n as deleteCommand } from "../../../../presets-Bb9gwgeh.mjs";
2
2
  //#region src/adapters/oclif/commands/score-groups/delete.ts
3
3
  var delete_default = deleteCommand({
4
4
  resource: "scoreGroups",
@@ -1,4 +1,4 @@
1
- import { r as getCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { r as getCommand } from "../../../../presets-Bb9gwgeh.mjs";
2
2
  //#region src/adapters/oclif/commands/score-groups/get.ts
3
3
  var get_default = getCommand({
4
4
  resource: "scoreGroups",
@@ -1,4 +1,4 @@
1
- import { i as listCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { i as listCommand } from "../../../../presets-Bb9gwgeh.mjs";
2
2
  //#region src/adapters/oclif/commands/score-groups/list.ts
3
3
  var list_default = listCommand({
4
4
  resource: "scoreGroups",
@@ -1,4 +1,4 @@
1
- import { a as updateCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { a as updateCommand } from "../../../../presets-Bb9gwgeh.mjs";
2
2
  //#region src/adapters/oclif/commands/score-groups/update.ts
3
3
  var update_default = updateCommand({
4
4
  resource: "scoreGroups",
@@ -1,4 +1,4 @@
1
- import { t as createCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { t as createCommand } from "../../../../presets-Bb9gwgeh.mjs";
2
2
  //#region src/adapters/oclif/commands/scores/create.ts
3
3
  var create_default = createCommand({
4
4
  resource: "scores",
@@ -1,4 +1,4 @@
1
- import { n as deleteCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { n as deleteCommand } from "../../../../presets-Bb9gwgeh.mjs";
2
2
  //#region src/adapters/oclif/commands/scores/delete.ts
3
3
  var delete_default = deleteCommand({
4
4
  resource: "scores",
@@ -1,4 +1,4 @@
1
- import { i as listCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { i as listCommand } from "../../../../presets-Bb9gwgeh.mjs";
2
2
  //#region src/adapters/oclif/commands/scores/list.ts
3
3
  var list_default = listCommand({
4
4
  resource: "scores",
@@ -1,4 +1,4 @@
1
- import { a as updateCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { a as updateCommand } from "../../../../presets-Bb9gwgeh.mjs";
2
2
  //#region src/adapters/oclif/commands/scores/update.ts
3
3
  var update_default = updateCommand({
4
4
  resource: "scores",
@@ -1,4 +1,4 @@
1
- import { t as createCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { t as createCommand } from "../../../../presets-Bb9gwgeh.mjs";
2
2
  //#region src/adapters/oclif/commands/segments/create.ts
3
3
  var create_default = createCommand({
4
4
  resource: "segments",
@@ -1,4 +1,4 @@
1
- import { n as deleteCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { n as deleteCommand } from "../../../../presets-Bb9gwgeh.mjs";
2
2
  //#region src/adapters/oclif/commands/segments/delete.ts
3
3
  var delete_default = deleteCommand({
4
4
  resource: "segments",
@@ -1,5 +1,5 @@
1
- import { p as unwrap } from "../../../../core-CMrP5BQS.mjs";
2
- import { r as defineApiCommand } from "../../../../factory-C6XLqhT9.mjs";
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/segments/evaluate.ts
5
5
  var evaluate_default = defineApiCommand({
@@ -1,5 +1,5 @@
1
- import { p as unwrap } from "../../../../core-CMrP5BQS.mjs";
2
- import { r as defineApiCommand } from "../../../../factory-C6XLqhT9.mjs";
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/segments/get-evaluation-history.ts
5
5
  var get_evaluation_history_default = defineApiCommand({
@@ -1,5 +1,5 @@
1
- import { p as unwrap } from "../../../../core-CMrP5BQS.mjs";
2
- import { r as defineApiCommand } from "../../../../factory-C6XLqhT9.mjs";
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/segments/get-version.ts
5
5
  var get_version_default = defineApiCommand({
@@ -1,4 +1,4 @@
1
- import { r as getCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { r as getCommand } from "../../../../presets-Bb9gwgeh.mjs";
2
2
  //#region src/adapters/oclif/commands/segments/get.ts
3
3
  var get_default = getCommand({
4
4
  resource: "segments",
@@ -1,5 +1,5 @@
1
- import { p as unwrap } from "../../../../core-CMrP5BQS.mjs";
2
- import { n as createListRender, r as defineApiCommand } from "../../../../factory-C6XLqhT9.mjs";
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 { Args, Flags } from "@oclif/core";
4
4
  var list_versions_default = defineApiCommand({
5
5
  description: "List versions of a segment",
@@ -1,4 +1,4 @@
1
- import { i as listCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { i as listCommand } from "../../../../presets-Bb9gwgeh.mjs";
2
2
  //#region src/adapters/oclif/commands/segments/list.ts
3
3
  var list_default = listCommand({
4
4
  resource: "segments",
@@ -1,5 +1,5 @@
1
- import { p as unwrap } from "../../../../core-CMrP5BQS.mjs";
2
- import { r as defineApiCommand } from "../../../../factory-C6XLqhT9.mjs";
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/segments/restore-version.ts
5
5
  var restore_version_default = defineApiCommand({
@@ -1,4 +1,4 @@
1
- import { a as updateCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { a as updateCommand } from "../../../../presets-Bb9gwgeh.mjs";
2
2
  //#region src/adapters/oclif/commands/segments/update.ts
3
3
  var update_default = updateCommand({
4
4
  resource: "segments",
@@ -1,4 +1,4 @@
1
- import { t as BaseCommand } from "../../../../base.command-D7X3ZNtY.mjs";
1
+ import { t as BaseCommand } from "../../../../base.command-BmddDbHa.mjs";
2
2
 
3
3
  //#region src/adapters/oclif/commands/sources/create.d.ts
4
4
  declare class SourcesCreate extends BaseCommand<typeof SourcesCreate> {
@@ -1,5 +1,5 @@
1
- import { m as resolveAppUrl, v as getConfig } from "../../../../core-CMrP5BQS.mjs";
2
- import { t as BaseCommand } from "../../../../base.command-cV5d65r8.mjs";
1
+ import { E as getConfig, S as resolveAppUrl } from "../../../../core-B-IdeRNl.mjs";
2
+ import { t as BaseCommand } from "../../../../base.command-D8taHOFF.mjs";
3
3
  import chalk from "chalk";
4
4
  import open from "open";
5
5
  //#region src/adapters/oclif/commands/sources/create.ts
@@ -1,4 +1,4 @@
1
- import { n as deleteCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { n as deleteCommand } from "../../../../presets-Bb9gwgeh.mjs";
2
2
  //#region src/adapters/oclif/commands/sources/delete.ts
3
3
  var delete_default = deleteCommand({
4
4
  resource: "sources",
@@ -1,4 +1,4 @@
1
- import { r as getCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { r as getCommand } from "../../../../presets-Bb9gwgeh.mjs";
2
2
  //#region src/adapters/oclif/commands/sources/get.ts
3
3
  var get_default = getCommand({
4
4
  resource: "sources",
@@ -1,5 +1,5 @@
1
- import { p as unwrap } from "../../../../core-CMrP5BQS.mjs";
2
- import { n as createListRender, r as defineApiCommand } from "../../../../factory-C6XLqhT9.mjs";
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 { Args, Flags } from "@oclif/core";
4
4
  var list_streams_default = defineApiCommand({
5
5
  description: "List streams the source exposes (sync modes, cursor/PK candidates, field paths)",
@@ -1,4 +1,4 @@
1
- import { i as listCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { i as listCommand } from "../../../../presets-Bb9gwgeh.mjs";
2
2
  //#region src/adapters/oclif/commands/sources/list.ts
3
3
  var list_default = listCommand({
4
4
  resource: "sources",
@@ -1,4 +1,4 @@
1
- import { t as BaseCommand } from "../../../../base.command-D7X3ZNtY.mjs";
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/sources/update.d.ts
@@ -1,5 +1,5 @@
1
- import { m as resolveAppUrl, v as getConfig } from "../../../../core-CMrP5BQS.mjs";
2
- import { t as BaseCommand } from "../../../../base.command-cV5d65r8.mjs";
1
+ import { E as getConfig, S as resolveAppUrl } from "../../../../core-B-IdeRNl.mjs";
2
+ import { t as BaseCommand } from "../../../../base.command-D8taHOFF.mjs";
3
3
  import chalk from "chalk";
4
4
  import { Args } from "@oclif/core";
5
5
  import open from "open";
@@ -1,5 +1,6 @@
1
- import { a as ResourceStatus, c as IacError } from "../../../index-BqKwXXAo.mjs";
2
- import { t as BaseCommand } from "../../../base.command-D7X3ZNtY.mjs";
1
+ import { u as ResourceStatus } 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/status.d.ts
@@ -1,6 +1,6 @@
1
- import { c as loadResources, d as projectRoot, f as createApiClient, i as describeResources, l as buildIacRegistry, u as discoverProject } from "../../../core-CMrP5BQS.mjs";
2
- import { t as BaseCommand } from "../../../base.command-cV5d65r8.mjs";
3
- import { a as resolveColumns, i as renderList } from "../../../factory-C6XLqhT9.mjs";
1
+ import { _ as buildIacRegistry, b as createApiClient, f as describeResources, g as loadResources, v as discoverProject, y as projectRoot } from "../../../core-B-IdeRNl.mjs";
2
+ import { t as BaseCommand } from "../../../base.command-D8taHOFF.mjs";
3
+ import { a as resolveColumns, i as renderList } from "../../../factory-CCcimDhl.mjs";
4
4
  import { n as renderIacErrors } from "../../../iac-render-BSZZEP0n.mjs";
5
5
  import chalk from "chalk";
6
6
  import { Args, Flags } from "@oclif/core";
@@ -1,4 +1,4 @@
1
- import { t as createCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { t as createCommand } from "../../../../presets-Bb9gwgeh.mjs";
2
2
  //#region src/adapters/oclif/commands/table-views/create.ts
3
3
  var create_default = createCommand({
4
4
  resource: "tableViews",
@@ -1,4 +1,4 @@
1
- import { n as deleteCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { n as deleteCommand } from "../../../../presets-Bb9gwgeh.mjs";
2
2
  //#region src/adapters/oclif/commands/table-views/delete.ts
3
3
  var delete_default = deleteCommand({
4
4
  resource: "tableViews",
@@ -1,4 +1,4 @@
1
- import { i as listCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { i as listCommand } from "../../../../presets-Bb9gwgeh.mjs";
2
2
  //#region src/adapters/oclif/commands/table-views/list.ts
3
3
  var list_default = listCommand({
4
4
  resource: "tableViews",
@@ -1,4 +1,4 @@
1
- import { a as updateCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { a as updateCommand } from "../../../../presets-Bb9gwgeh.mjs";
2
2
  //#region src/adapters/oclif/commands/table-views/update.ts
3
3
  var update_default = updateCommand({
4
4
  resource: "tableViews",
@@ -1,4 +1,4 @@
1
- import { t as createCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { t as createCommand } from "../../../../presets-Bb9gwgeh.mjs";
2
2
  //#region src/adapters/oclif/commands/tables/create.ts
3
3
  var create_default = createCommand({
4
4
  resource: "tables",
@@ -1,4 +1,4 @@
1
- import { n as deleteCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { n as deleteCommand } from "../../../../presets-Bb9gwgeh.mjs";
2
2
  //#region src/adapters/oclif/commands/tables/delete.ts
3
3
  var delete_default = deleteCommand({
4
4
  resource: "tables",
@@ -1,4 +1,4 @@
1
- import { r as getCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { r as getCommand } from "../../../../presets-Bb9gwgeh.mjs";
2
2
  //#region src/adapters/oclif/commands/tables/get.ts
3
3
  var get_default = getCommand({
4
4
  resource: "tables",
@@ -1,4 +1,4 @@
1
- import { i as listCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { i as listCommand } from "../../../../presets-Bb9gwgeh.mjs";
2
2
  //#region src/adapters/oclif/commands/tables/list.ts
3
3
  var list_default = listCommand({
4
4
  resource: "tables",
@@ -1,4 +1,4 @@
1
- import { a as updateCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { a as updateCommand } from "../../../../presets-Bb9gwgeh.mjs";
2
2
  //#region src/adapters/oclif/commands/tables/update.ts
3
3
  var update_default = updateCommand({
4
4
  resource: "tables",
@@ -1,16 +1,20 @@
1
+ import { n as ProjectContext } from "./context-D5uelKLe.mjs";
1
2
  import { Command, Interfaces } from "@oclif/core";
2
3
  import { TableOptions } from "@oclif/table";
3
4
 
4
5
  //#region src/adapters/oclif/base.command.d.ts
5
6
  type Flags$1<T extends typeof Command> = Interfaces.InferredFlags<(typeof BaseCommand)["baseFlags"] & T["flags"]>;
6
7
  type Args$1<T extends typeof Command> = Interfaces.InferredArgs<T["args"]>;
8
+ type ProjectContextMode = "enforce" | "relaxed";
7
9
  declare abstract class BaseCommand<T extends typeof Command> extends Command {
8
10
  static enableJsonFlag: boolean;
11
+ static projectContextMode: ProjectContextMode;
9
12
  static baseFlags: {
10
13
  org: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
11
14
  };
12
15
  protected flags: Flags$1<T>;
13
16
  protected args: Args$1<T>;
17
+ protected projectContext: ProjectContext | null;
14
18
  init(): Promise<void>;
15
19
  protected table<R extends Record<string, unknown>>(data: R[], options?: Omit<TableOptions<R>, "data">): void;
16
20
  protected catch(err: Error & {
@@ -1,15 +1,17 @@
1
- import { E as setAuthConfig, F as ApiError, N as loadCredentials } from "./core-CMrP5BQS.mjs";
1
+ import { P as setAuthConfig, U as ApiError, V as loadCredentials, i as formatEnvMismatchError, l as resolveProjectContext, o as formatProjectOrgFlagError, r as formatCredentialsMismatchWarning, u as validateEnvAgainstProject } from "./core-B-IdeRNl.mjs";
2
2
  import { Command, Flags } from "@oclif/core";
3
3
  import { makeTable } from "@oclif/table";
4
4
  //#region src/adapters/oclif/base.command.ts
5
5
  var BaseCommand = class extends Command {
6
6
  static enableJsonFlag = true;
7
+ static projectContextMode = "enforce";
7
8
  static baseFlags = { org: Flags.string({
8
9
  char: "o",
9
10
  description: "Override organization ID for this command"
10
11
  }) };
11
12
  flags;
12
13
  args;
14
+ projectContext = null;
13
15
  async init() {
14
16
  await super.init();
15
17
  const { flags, args } = await this.parse({
@@ -22,7 +24,23 @@ var BaseCommand = class extends Command {
22
24
  this.flags = flags;
23
25
  this.args = args;
24
26
  applyStoredEnvironment();
25
- if (this.flags.org) process.env.REVOS_ORG_ID = this.flags.org;
27
+ this.projectContext = resolveProjectContext();
28
+ const mode = this.ctor.projectContextMode;
29
+ if (this.projectContext && mode === "enforce") {
30
+ if (this.flags.org && this.flags.org !== this.projectContext.orgId) this.error(formatProjectOrgFlagError({
31
+ projectOrgId: this.projectContext.orgId,
32
+ projectPath: this.projectContext.projectFile.path
33
+ }), { exit: 1 });
34
+ const mismatches = validateEnvAgainstProject(this.projectContext);
35
+ if (mismatches.length > 0) this.error(formatEnvMismatchError(mismatches, this.projectContext.projectFile.path), { exit: 1 });
36
+ process.env.REVOS_ORG_ID = this.projectContext.orgId;
37
+ const credentials = loadCredentials();
38
+ if (credentials?.organizationId && credentials.organizationId !== this.projectContext.orgId && !this.jsonEnabled()) this.warn(formatCredentialsMismatchWarning({
39
+ credentialsOrgId: credentials.organizationId,
40
+ projectOrgId: this.projectContext.orgId,
41
+ projectPath: this.projectContext.projectFile.path
42
+ }));
43
+ } else if (this.flags.org) process.env.REVOS_ORG_ID = this.flags.org;
26
44
  }
27
45
  table(data, options) {
28
46
  this.log(makeTable({
@@ -0,0 +1,62 @@
1
+ import { Document } from "yaml";
2
+
3
+ //#region src/core/iac/types.d.ts
4
+ declare const API_VERSION = "revos/v1";
5
+ interface SourceLocation {
6
+ file: string;
7
+ line?: number;
8
+ column?: number;
9
+ }
10
+ interface ProjectFile {
11
+ path: string;
12
+ metadata: {
13
+ name?: string;
14
+ orgId: string;
15
+ };
16
+ }
17
+ interface ResourceMetadata {
18
+ name: string;
19
+ id?: string;
20
+ }
21
+ type ResourceState = "ok" | "drifted" | "pending" | "tampered";
22
+ interface ResourceDoc<TSpec = unknown> {
23
+ kind: string;
24
+ metadata: ResourceMetadata;
25
+ spec: TSpec;
26
+ rawSpec: unknown;
27
+ source: SourceLocation;
28
+ docIndex: number;
29
+ document: Document;
30
+ }
31
+ type IacErrorCode = "apply" | "cycle" | "duplicate" | "env.missing" | "init.pull" | "invalid-name" | "pull" | "ref" | "schema" | "tampered" | "unknown-kind" | "yaml.parse";
32
+ interface IacError {
33
+ code: IacErrorCode;
34
+ message: string;
35
+ source?: SourceLocation;
36
+ hint?: string;
37
+ }
38
+ declare class IacAggregateError extends Error {
39
+ readonly errors: IacError[];
40
+ constructor(errors: IacError[]);
41
+ }
42
+ //#endregion
43
+ //#region src/core/context.d.ts
44
+ interface ProjectContext {
45
+ projectFile: ProjectFile;
46
+ projectPath: string;
47
+ orgId: string;
48
+ }
49
+ interface ResolveProjectContextOptions {
50
+ cwd?: string;
51
+ projectPath?: string;
52
+ }
53
+ declare function resolveProjectContext(opts?: ResolveProjectContextOptions): ProjectContext | null;
54
+ interface EnvMismatch {
55
+ variable: string;
56
+ envValue: string;
57
+ expected: string;
58
+ }
59
+ declare function validateEnvAgainstProject(ctx: ProjectContext, env?: NodeJS.ProcessEnv): EnvMismatch[];
60
+ declare function isInsideProject(cwd: string, projectContext: ProjectContext): boolean;
61
+ //#endregion
62
+ export { validateEnvAgainstProject as a, IacError as c, ResourceDoc as d, ResourceMetadata as f, resolveProjectContext as i, IacErrorCode as l, SourceLocation as m, ProjectContext as n, API_VERSION as o, ResourceState as p, isInsideProject as r, IacAggregateError as s, EnvMismatch as t, ProjectFile as u };
@@ -2120,6 +2120,76 @@ var iac_exports = /* @__PURE__ */ __exportAll({
2120
2120
  writeProjectFile: () => writeProjectFile
2121
2121
  });
2122
2122
  //#endregion
2123
+ //#region src/core/context.ts
2124
+ function resolveProjectContext(opts = {}) {
2125
+ try {
2126
+ const projectFile = discoverProject({
2127
+ cwd: opts.cwd,
2128
+ projectPath: opts.projectPath
2129
+ });
2130
+ return {
2131
+ projectFile,
2132
+ projectPath: projectRoot(projectFile),
2133
+ orgId: projectFile.metadata.orgId
2134
+ };
2135
+ } catch (err) {
2136
+ if (err instanceof ProjectNotFoundError) return null;
2137
+ throw err;
2138
+ }
2139
+ }
2140
+ function validateEnvAgainstProject(ctx, env = process.env) {
2141
+ const mismatches = [];
2142
+ const envOrgId = env.REVOS_ORG_ID;
2143
+ if (envOrgId && envOrgId !== ctx.orgId) mismatches.push({
2144
+ variable: "REVOS_ORG_ID",
2145
+ envValue: envOrgId,
2146
+ expected: ctx.orgId
2147
+ });
2148
+ return mismatches;
2149
+ }
2150
+ function isInsideProject(cwd, projectContext) {
2151
+ const rel = path.relative(projectContext.projectPath, path.resolve(cwd));
2152
+ return !rel.startsWith("..") && !path.isAbsolute(rel);
2153
+ }
2154
+ //#endregion
2155
+ //#region src/core/diagnostics.ts
2156
+ function formatEnvMismatchError(mismatches, projectPath) {
2157
+ if (mismatches.length === 0) throw new Error("formatEnvMismatchError called with no mismatches");
2158
+ const lines = [];
2159
+ lines.push("environment does not match this project.");
2160
+ lines.push("");
2161
+ for (const m of mismatches) {
2162
+ lines.push(` ${m.variable} is set to ${m.envValue}`);
2163
+ lines.push(` but this project is for ${m.expected} (from ${projectPath})`);
2164
+ lines.push("");
2165
+ }
2166
+ lines.push("This usually happens when:");
2167
+ lines.push(" • You opened a dev container generated for a different org");
2168
+ lines.push(" • You manually set REVOS_ORG_ID in your shell");
2169
+ lines.push("");
2170
+ lines.push("To fix:");
2171
+ lines.push(" • Open this project's own dev container, or");
2172
+ lines.push(" • `unset REVOS_ORG_ID GOOGLE_CLOUD_PROJECT REVOS_BQ_DATASET`");
2173
+ return lines.join("\n");
2174
+ }
2175
+ function formatCredentialsMismatchWarning(args) {
2176
+ return `Your stored credentials are for org ${args.credentialsOrgId}, but this project is anchored to ${args.projectOrgId} (from ${args.projectPath}). Project commands will use the project's org; if the token has no access there, re-run 'revos auth login'.`;
2177
+ }
2178
+ function formatProjectOrgFlagError(args) {
2179
+ return `--org is not allowed inside a revos project — this directory is anchored to ${args.projectOrgId} (from ${args.projectPath}). Remove --org, or run from outside the project to target a different org.`;
2180
+ }
2181
+ function formatInProjectSwitchWarning(args) {
2182
+ return `You are inside ${args.projectName ? `project "${args.projectName}"` : "this project"}, which is anchored to org ${args.projectOrgId}. 'revos org switch' only changes your global default org — it does NOT affect 'revos apply / pull / diff' for this project.`;
2183
+ }
2184
+ function renderProjectContextLine(args) {
2185
+ const lines = [];
2186
+ lines.push(chalk.bold("Project:") + ` ${args.projectName ?? "(unnamed)"}`);
2187
+ lines.push(chalk.gray(` Path: ${args.projectPath}`));
2188
+ lines.push(` Org: ${args.projectOrgId}`);
2189
+ if (args.globalOrgId && args.globalOrgId !== args.projectOrgId) lines.push(chalk.yellow(` ⚠ Global default (${args.globalOrgId}) differs from this project's org.`));
2190
+ return lines;
2191
+ }
2192
+ //#endregion
2123
2193
  //#region src/core/services/org-selector.ts
2124
2194
  async function selectOrganization(organizations) {
2125
2195
  const answer = await search({
@@ -2375,4 +2445,4 @@ var InitService = class InitService {
2375
2445
  }
2376
2446
  };
2377
2447
  //#endregion
2378
- export { deleteCredentials as A, getActiveAuthConfig as C, setAuthEnv as D, setAuthConfig as E, ApiError as F, isTokenExpired as M, loadCredentials as N, tokenResponseToCredentials as O, saveCredentials as P, generatePKCEChallenge as S, refreshAccessToken as T, DEFAULT_API_URL as _, pull as a, buildAuthorizationUrl as b, loadResources as c, projectRoot as d, createApiClient as f, sanitizeFileName as g, formatError as h, describeResources as i, getCredentialsPath as j, startOAuthServer as k, buildIacRegistry as l, resolveAppUrl as m, selectOrganization as n, apply as o, unwrap as p, iac_exports as r, formatDiffLine as s, InitService as t, discoverProject as u, getConfig as v, getUserInfo as w, exchangeCodeForTokens as x, AUTH_ENVS as y };
2448
+ export { generatePKCEChallenge as A, isTokenExpired as B, formatError as C, AUTH_ENVS as D, getConfig as E, setAuthEnv as F, saveCredentials as H, tokenResponseToCredentials as I, startOAuthServer as L, getUserInfo as M, refreshAccessToken as N, buildAuthorizationUrl as O, setAuthConfig as P, deleteCredentials as R, resolveAppUrl as S, DEFAULT_API_URL as T, ApiError as U, loadCredentials as V, buildIacRegistry as _, formatInProjectSwitchWarning as a, createApiClient as b, isInsideProject as c, iac_exports as d, describeResources as f, loadResources as g, formatDiffLine as h, formatEnvMismatchError as i, getActiveAuthConfig as j, exchangeCodeForTokens as k, resolveProjectContext as l, apply as m, selectOrganization as n, formatProjectOrgFlagError as o, pull as p, formatCredentialsMismatchWarning as r, renderProjectContextLine as s, InitService as t, validateEnvAgainstProject as u, discoverProject as v, sanitizeFileName as w, unwrap as x, projectRoot as y, getCredentialsPath as z };
@@ -1,5 +1,5 @@
1
- import { f as createApiClient, v as getConfig } from "./core-CMrP5BQS.mjs";
2
- import { t as BaseCommand } from "./base.command-cV5d65r8.mjs";
1
+ import { E as getConfig, b as createApiClient } from "./core-B-IdeRNl.mjs";
2
+ import { t as BaseCommand } from "./base.command-D8taHOFF.mjs";
3
3
  import * as fs from "fs";
4
4
  import * as path from "path";
5
5
  import chalk from "chalk";
@@ -15,6 +15,7 @@ function defineApiCommand(spec) {
15
15
  static examples = spec.examples ?? [];
16
16
  static args = spec.args ?? {};
17
17
  static flags = spec.flags ?? {};
18
+ static projectContextMode = spec.projectContextMode ?? "enforce";
18
19
  async run() {
19
20
  const config = await getConfig();
20
21
  const api = createApiClient(config);